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

python-masscan won't return scan object #47

Closed zekiz774 closed 1 year ago

zekiz774 commented 1 year ago

Code:

mas = masscan.PortScanner()
mas.scan("0.0.0.0/24", ports="25565", arguments="--rate=1000", sudo=True)
print(mas.scan_result)

It should at least return the scanned IP address but it doesn't

Output: {"command_line": "masscan -oJ - 0.0.0.0/24 -p 25565 --rate=1000", "scan": {}}

This is the case with every IP address. I don't know what I'm doing wrong.

gsfish commented 1 year ago

I have encountered the same situation as you, and I found that is because masscan with low version (for me is 1.0.4) print invalid json output, so python-masscan just skip parsing it and return an empty dict.

Besix2 commented 1 year ago

how to fix that

BMlovePanda commented 1 year ago

how to fix that

update masscan from git