2

Have a bit of a noob question with NMAP, I've been trying to debug for hours to no avail.

Trying to scan a range of IP's with Nmap, yet every time I run the scan command with a range I get this error:

  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/nmap/nmap.py", line 266, in scan
    nmap_warn_keep_trace=nmap_warn_keep_trace
  File "/usr/local/lib/python3.7/site-packages/nmap/nmap.py", line 325, in analyse_nmap_xml_scan
    raise PortScannerError(nmap_err)
nmap.nmap.PortScannerError: 'Assertion failed: (htn.toclock_running == true), function stopTimeOutClock, file Target.cc, line 503.\n'

Heres the code broken down, and the error still happens:

import nmap
nm = nmap.PortScanner()
nm.scan(hosts='10.91.0.1/16', arguments='-sP')

Am I calling the IP range wrong? Any ideas?

Thanks guys!

Ethan Marcus
  • 1,266
  • 2
  • 9
  • 12

2 Answers2

0

I got problems running nmap module. Have you read this post : why is my Nmap module not working in python 3.7 ? "The other nmap is a numerical package that doesn't appear to be maintained." python-nmap worked fine for me, passing IP range in a for loop:

import nmap
nm = nmap.PortScanner()
for ip in range(1,17):
    nm.scan(hosts='10.91.0.'+str(ip), arguments='-sP')
jufx
  • 154
  • 1
  • 7
0
import nmap
nmScan = nmap.PortScanner()
nmScan.scan('127.0.0.1', '21-443', arguments='-sP')