get windir()Writing SMBclient-based WLSC NASL Scriptssmbgetdir(share, dir, typ)GetPEFileVersion (tmp_filename, orig_filename)

GetPEFileVersion (tmp_filename, orig_filename)

This function returns the version of Windows PE/32 executables like .exe or .dll. Together with smbgetfile, this can be used to check for Windows vulnerabilities.

Example:

  tmp_filename = get_tmp_dir() + "tmpfile" + rand();
  orig_filename = "C:\Windows\systems32\ntdll.dll";
  if(smbgetfile(share: "C$", filename: orig_filename,
                tmp_filename: tmp_filename))
  {
    v = GetPEFileVersion(tmp_filename:tmp_filename,
                        orig_filename:orig_filename);
    if(v = "1.2.3.4")
    {
      ...

get windir()Writing SMBclient-based WLSC NASL Scriptssmbgetdir(share, dir, typ)GetPEFileVersion (tmp_filename, orig_filename)