Closed tiaotiaolong closed 5 years ago
Please give detailed error message or screenshot.
I have the same error, but it's not ok on mac. the detail error:
Traceback (most recent call last):
File "/Users/user/.local/share/virtualenvs/AssertSec-12yGsf5S/lib/python3.6/site-packages/masscan/masscan.py", line 371, in analyse_masscan_xml_scan
dom = ET.fromstring(self._masscan_last_output)
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/xml/etree/ElementTree.py", line 1315, 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 "test.py", line 14, in <module>
mas.scan('192.168.1.110')
File "/Users/user/.local/share/virtualenvs/AssertSec-12yGsf5S/lib/python3.6/site-packages/masscan/masscan.py", line 317, in scan
masscan_warn_keep_trace=masscan_warn_keep_trace
File "/Users/user/.local/share/virtualenvs/AssertSec-12yGsf5S/lib/python3.6/site-packages/masscan/masscan.py", line 375, in analyse_masscan_xml_scan
raise ET.ParseError
xml.etree.ElementTree.ParseError: None
The issue is the same as #8, so closed.
@chentdy hi, can you provide py
scripts or test commands written below?
As a notice for future readers of this I get this error when running the python code under WSL (Windows Subsystem Linux)
>>> import masscan
>>> mas = masscan.PortScanner()
>>> mas.scan("192.168.1.0/24")
[2018-09-05 16:59:18,317] [DEBUG] [masscan.py 10 line] Scan parameters: "masscan -oX - 192.168.1.0/24 -p <snipped for brevity>"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/masscan/masscan.py", line 317, in scan
masscan_warn_keep_trace=masscan_warn_keep_trace
File "/usr/local/lib/python2.7/dist-packages/masscan/masscan.py", line 375, in analyse_masscan_xml_scan
raise ET.ParseError
xml.etree.ElementTree.ParseError: None
>>> import sys
>>> sys.platform
'linux2'
>>>
This however is due to the limitations of WSL not having native device capability; running masscan
standalone throws the error
HINT: you must install libpcap or WinPcap
FAIL: libpcap not loaded
adapter[eth0].init: failed
See related WSL issue here https://github.com/Microsoft/WSL/issues/2150 as such the error thrown is missleading as this does not directly relate to xml processing it is related to the masscan process having thrown an error and attemtping to move directly onto the xml processing.
@Oneiroi
I built a WSL
environment and failed to run masscan.
$ masscan -p80 192.168.0.1/24
FAIL: socket for SIOCETHTOOL (ETHTOOL_GET_TS_INFO): Socket type not supported
Adapter[eth0].init: failed
Test environment:
Seeing Microsoft/WSL#2150, this question is about the problem of SOCK_PACKET
, but I checked the source of masscan, which is not using SOCK_PACKET
.
When I use ethool
to view the NIC information, I get the following error:
~$ ethtool -i eth0
Cannot get driver information: Invalid argument
Finally I fixed the error message for python-masscan
726b1a56.
Try and catch in this case.
mas = masscan.PortScanner()
mas.scan(ip_range,ports='443')
for host in mas.all_hosts:
subs_ssl.append(host)
except (xml.etree.ElementTree.ParseError,masscan.masscan.NetworkConnectionError) as e:
pass
You can't use pass
here, you should provide enough error tips for developers to handle problems.
@MyKings @arbazkiraak @tiaotiaolong @chentdy Hi, You should access to root permission for execute masscan
@arbazkiraak You can use sudo python example.py
to execute.
xml.etree.ElementTree.ParserError:None on Ubuntu where nothing with google
But it's Ok on Mac