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

hello,When I was using the python-masscan package, I encountered the following problems. My version is 3.7, and I think it's because I don't have administrator privileges to use it. But when I use it in the flask framework, I can't use the'sudo'command. I hope you can help me. #19

Closed Sunllnus closed 1 year ago

Sunllnus commented 5 years ago

This is my code: import masscan mas = masscan.PortScanner() mas.scan('47.99.62.36', ports='22,80,3306') print(mas.scan_result)

error: Traceback (most recent call last): File "/Users/xf/.virtualenvs/test/lib/python3.7/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.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/xml/etree/ElementTree.py", line 1316, 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 "/Users/xf/Desktop/test/demo.py", line 3, in mas.scan('47.99.62.36', ports='22,80,3306') File "/Users/xf/.virtualenvs/test/lib/python3.7/site-packages/masscan/masscan.py", line 317, in scan masscan_warn_keep_trace=masscan_warn_keep_trace File "/Users/xf/.virtualenvs/test/lib/python3.7/site-packages/masscan/masscan.py", line 375, in analyse_masscan_xml_scan raise ET.ParseError xml.etree.ElementTree.ParseError: None

MyKings commented 5 years ago

@Sunllnus
Please upgrade your python-masscan to v0.1.3 version and try it.

Sunllnus commented 5 years ago

Thank you for helping me upgrade to version 0.1.3 as you said. But the error still exists, and I have to use the sudo command to execute it.

Sunllnus commented 5 years ago

@MyKings

heychazza commented 2 years ago

Having the same issue, is there any fix for this?

MyKings commented 2 years ago

Having the same issue, is there any fix for this?

I don't understand what you mean, can you provide a detailed description of the environment and the error message?

heychazza commented 2 years ago

Having the same issue, is there any fix for this?

I don't understand what you mean, can you provide a detailed description of the environment and the error message?

That it requires sudo to run