Skip to content

--stats-every 1s can cause errors on very small scans #69

@Deedasmi

Description

@Deedasmi

nmap_proc = NmapProcess(targets="127.0.0.1", options="-sU -p 18000 -A") nmap_proc.sudo_run_background() parsed = NmapParser.parse(nmap_proc.stdout)

Traceback

(most recent call last):
File "/usr/local/lib/python3.5/dist-packages/libnmap/parser.py", line 90, in _parse_xml
root = ET.fromstring(nmap_data)
File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1334, in XML
return parser.close()
xml.etree.ElementTree.ParseError: no element found: line 33, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/$USER/PycharmProjects/hmap/test.py", line 15, in
parsed = NmapParser.parse(nmap_proc.stdout)
File "/usr/local/lib/python3.5/dist-packages/libnmap/parser.py", line 41, in parse
nmapobj = cls._parse_xml(nmap_data, incomplete)
File "/usr/local/lib/python3.5/dist-packages/libnmap/parser.py", line 92, in _parse_xml
raise NmapParserException("Wrong XML structure: cannot parse data")
libnmap.parser.NmapParserException: Wrong XML structure: cannot parse data

Nmap command:
sudo nmap -oX - -vvv -stats-every 1s -sU -p 18000 -A

nmap: timing.cc:710 bool ScanProgressMeter::printstats(double, const timeval*): Assertion 'ltime' failed.

Turns out it's an issue with nmap, not the lib. It would be nice if stats-every was an option we could control though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions