Nmap scan failing

(imported topic written by JesseR91)

Everytime I try and run an nmap scan, it fails. Below is the log of the task:

Completed delete __appendfile

Completed delete folder.bat

Completed appendfile @ECHO OFF

Completed appendfile mkdir “{pathname of windows folder & “\temp\nmap”}” > NUL 2>NUL

Completed appendfile del “{pathname of windows folder & “\temp\nmap\nmap*.xml”}” > NUL 2>NUL

Completed move __appendfile folder.bat

Completed wait “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” folder.bat

Completed regset "

HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\BESScanner-NMAP

" “LastScanStartTime”="{now}"

Completed delete nmapquiet.bat

Completed delete __appendfile

Completed appendfile @ECHO OFF

Completed appendfile “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” “{pathname of folder “BESScanner-NMAP\NMAP” of parent folder of regapp “BESClient.exe”}\nmap.exe” -sS -sU -p T:1,U:{value “ListenPort” of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions” of registry} --exclude “{concatenation “,” of (addresses whose (it as string != “0.0.0.0”) of ip interfaces whose (loopback of it = false) of network as string)}”{if (exists key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\BESScanner-NMAP” whose (value “NmapVersion” of it as string as version >= “4.20”) of registry) then " -O1 --osscan-guess" else " -O --osscan-guess"} -PE -PA80 -p 1-10000 -T 2 172.16.147.0/24 -oX “{pathname of windows folder}\temp\nmap\nmap-{computer name}-{(now - “01 Jan 1970 00:00:00” as local time)/second}.xml” >NUL 2>NUL

Completed move __appendfile nmapquiet.bat

Completed wait “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” nmapquiet.bat

Completed regset "

HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\BESScanner-NMAP

" “LastSubnetScanned”=“172.16.147.0/24”

Completed regset "

HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\BESScanner-NMAP

" “LastScanFinishTime”="{now}"

Completed regset "

HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\BESScanner-NMAP

" “NumberOfScansRun”="{value “NumberOfScansRun” of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\BESScanner-NMAP” of registry as integer + 1}"

Failed continue if {(exists file whose (name of it starts with “nmap-” AND exists line whose (it as lowercase contains “nmap run completed at”) of it) of folder (pathname of windows folder & “\temp\nmap”))}

setting “_BESClient_ArchiveManager_IntervalSeconds”=“604800” on “{parameter “action issue date” of action}” for client

setting “_BESClient_ArchiveManager_MaxArchiveSize”=“4194304” on “{parameter “action issue date” of action}” for client

continue if {(exists file whose (name of it starts with “nmap-” AND exists line whose (it as lowercase contains “nmap run completed at”) of it AND size of it <= ((value of setting “_BESClient_ArchiveManager_MaxArchiveSize” of client) as integer)) of folder (pathname of windows folder & “\temp\nmap”))}

setting “_BESClient_ArchiveManager_OperatingMode”=“1” on “{parameter “action issue date” of action}” for client

setting “_BESClient_ArchiveManager_FileSet-nmap”="{pathname of windows folder}\temp\nmap\nmap*.xml" on “{parameter “action issue date” of action}” for client

setting “__BESClient_ArchiveManager_LastIntervalNumber”=“0” on “{parameter “action issue date” of action}” for client

Any ideas? I cannot figure this out

(imported comment written by BenKus)

Hi JesseR,

The action is failing at the check:

continue if {(exists file whose (name of it starts with “nmap-” AND exists line whose (it as lowercase contains “nmap run completed at”) of it) of folder (pathname of windows folder & “\temp\nmap”))}

This is a test designed to see if the NMAP properly created an output file. In this case, it is failing to make an output file. You can look at the “nmap” folder in the Windows temp folder and see if there is any file there at all, which might help us understand what happened.

It is possible that this issue is a known NMAP bug when scanning the “.0” address on certain Windows computers. Instead of scanning “172.16.147.0/24”, you might instead scan “172.16.147.1-172.16.147.254” and see if that seems to help. If that doesn’t work try running NMAP manually on that computer and see if it generates an error.

Ben

(imported comment written by SystemAdmin)

I am having the same problem with an nmap scan. I checked the temp\nmap folder and there is a current .xml file dated the last time I tried to run the scan.

(imported comment written by rmnetops91)

I was in the same boat as j2johnson. Turned out I was trying to use a range like 10.x.1.1-10.x.10.254 when I should have been using this format: 10.x.1-10.1-254