harryhorton/node-nmap

Add ability to scan customer port range

tslytsly opened this issue · 4 comments

Hi,

I would like to be able to scan customer port ranges.
But if I include '-p 80,8080,8443' to my NmapScan object it fails with an error.

Can you please tell me how to include customer ports?

Thanks

To be more specific:
This works:
'-sT -n -Pn -p 80,5060'

This does not:
'-sT -n -Pn -p 80,5060,50800-50813'

I get this error:
TypeError: Cannot read property '0' of undefined at newHost.openPorts.openPorts.map (D:\Developing\nt-vuln-scanner\server\node_modules\node-nmap\index.js:75:41) at Array.map (<anonymous>) at xmlInput.map (D:\Developing\nt-vuln-scanner\server\node_modules\node-nmap\index.js:70:37) at Array.map (<anonymous>) at convertRawJsonToScanResults (D:\Developing\nt-vuln-scanner\server\node_modules\node-nmap\index.js:34:27) at xml2js.parseString (D:\Developing\nt-vuln-scanner\server\node_modules\node-nmap\index.js:226:19) at Parser.<anonymous> (D:\Developing\nt-vuln-scanner\server\node_modules\xml2js\lib\parser.js:303:18) at Parser.emit (events.js:189:13) at SAXParser.onclosetag (D:\Developing\nt-vuln-scanner\server\node_modules\xml2js\lib\parser.js:261:26) at emit (D:\Developing\nt-vuln-scanner\server\node_modules\sax\lib\sax.js:624:35)

Hmm, it seems to be linked to if the port is open.

So, for
'-sT -n -Pn -p 80,5060,50800-50813'

I get the error, but if I run directly in nmap, this is the output:

PORT      STATE    SERVICE
80/tcp    open     http
5060/tcp  open     sip
50800/tcp filtered unknown
50801/tcp filtered unknown
50802/tcp open     unknown
50803/tcp filtered unknown
50804/tcp filtered unknown
50805/tcp open     unknown
50806/tcp filtered unknown
50807/tcp filtered unknown
50808/tcp filtered unknown
50809/tcp open     unknown
50810/tcp filtered unknown
50811/tcp filtered unknown
50812/tcp filtered unknown
50813/tcp open     unknown

If I do:
-sT -n -Pn -p 80,5060,50812'
it's fine.

But if I do:
-sT -n -Pn -p 80,5060,50805'
it crashes.

same issue here :l

same issue here :(