MyKings / python-masscan

python-masscan is a python library which helps in using masscan port scanner.
https://pypi.org/project/python-masscan/
GNU General Public License v3.0
281 stars 60 forks source link

Network unreachable, for no reason #44

Closed dobos90 closed 1 year ago

dobos90 commented 1 year ago

[2022-09-29 10:42:17,943] [DEBUG] [masscan.py 10 line] Scan parameters: "masscan -oX - 192.99.136.152/29 -p 25565 --max-rate 10000"
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/masscan/masscan.py", line 384, in analyse_masscan_xml_scan
    dom = ET.fromstring(self._masscan_last_output)
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 1343, in XML
    return parser.close()
xml.etree.ElementTree.ParseError: no element found: line 1, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/server/mcscanner/test.py", line 4, in <module>
    mas.scan('192.99.136.152/29', ports='25565', arguments='--max-rate 10000')
  File "/usr/local/lib/python3.10/dist-packages/masscan/masscan.py", line 325, in scan
    return self.analyse_masscan_xml_scan(
  File "/usr/local/lib/python3.10/dist-packages/masscan/masscan.py", line 387, in analyse_masscan_xml_scan
    raise NetworkConnectionError("network is unreachable.")
masscan.masscan.NetworkConnectionError: network is unreachable.```

Here is the whole command line. The server runs ubuntu 22.04.1 LTS
I want to scan that ip range, that I gave as an argument. It returns this error always
MyKings commented 1 year ago

I think masscan is not getting results and the xml exported using -oX is not parsing the results. Please upgrade to version v1.0.0 and test it, it supports json now :)