GithubHelp home page GithubHelp logo

mykings / python-masscan Goto Github PK

View Code? Open in Web Editor NEW
281.0 281.0 60.0 92 KB

python-masscan is a python library which helps in using masscan port scanner.

Home Page: https://pypi.org/project/python-masscan/

License: GNU General Public License v3.0

Python 100.00%
masscan python

python-masscan's People

Contributors

blotz avatar emirati avatar fabaff avatar goncalor avatar kolanich avatar mykings avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-masscan's Issues

Exception string indices must be integers when scanning range

I am running Python 3.9.7 with python-masscan 0.1.6

I trying to scan a range of IP Addresses in the format: X.X.X.X-Y.Y.Y.Y

My command in the script is:

scan_rate = "1000"
ports = "nnn,ooo,ppp"
scan_ntwk = "X.X.X.X-Y.Y.Y.Y"
mas.scan("--range " + scan_ntwk, ports=scan_ports, arguments='--max-rate '+ scan_rate)

I get this exception: - string indices must be integers

It seems to work fine when in prefix format as scan_ntwk = "X.X.X.X/ZZ"

masscan not running

I'm getting this error when I try to execute masscan:

unknown masscan error occured: str('masscan program was not found in path. PATH is : /usr/local/sbin:/usr/local /bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin')

do you have idea how to fix ?

I'm using last version of masscan, python 3.8 on ubuntu 20.4

thanks

PyPi installation error

PyPI does not have "compressed" on the compressed package "README.md" and CHANGELOG.md cause the installation to fail
long_description=open('README.md').read() + "\n" + open('CHANGELOG.md').read(),

It's just my feeling or my delusion

Hello, I have a feeling that when I use this python-masscan library, I always feel that the scan result of masscan is less than the scan result of normal use of maascan. I don't know whether it is the problem of masscan version or my illusion

TypeError: 'encoding' is an invalid keyword while installing

Hi,

While installing python-masscan using the following command:

pip install python-masscan

I get the following error

Collecting python-masscan
  Using cached https://files.pythonhosted.org/packages/84/84/1ebf64158cd996958b3979984b731c675321fbca16b36009c6289914ae06/python-masscan-0.1.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/tf/g0srqs6n3ql4fd_5ml3xzrbh0000gn/T/pip-install-hi51vt/python-masscan/setup.py", line 15, in <module>
        with open(os.path.join(here, 'README.rst'), encoding='utf-8') as readme_file:
    TypeError: 'encoding' is an invalid keyword argument for this function

Python Version: 2.7

Apparently, the open() built-in function it is introduced in python2 as io.open() and for compatibility io.open() is an alias to open() in python3

Network unreachable, for no reason

[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

Services?

Hello! Thanks for this super useful repo.

I noticed that the output includes a services field. I cant find a way for masscan to detect the running service. Am I missing something?

Thanks so much

masscan json output broken?

I get my portnumbers as integers and not strings which breaks parsing it as a JSON object.
any workaround for this

Exception on Ubuntu

xml.etree.ElementTree.ParserError:None on Ubuntu where nothing with google

But it's Ok on Mac

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.

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

No exception handling when there's no open port

Hey @MyKings,

This is a great python wrapper for masscan. But I found an issue when using this.
When I scan a host without any open port I get an exception. It would be better to handle it rather than raising an exception.

Code:

import masscan

mas = masscan.PortScanner()
mas.scan('127.0.0.1', ports='1-65535')

Exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/masscan/masscan.py", line 312, in scan
    masscan_warn_keep_trace=masscan_warn_keep_trace
  File "/usr/local/lib/python2.7/dist-packages/masscan/masscan.py", line 369, in analyse_masscan_xml_scan
    raise PortScannerError(masscan_err)
masscan.masscan.PortScannerError: u'\nStarting masscan 1.0.6 (http://bit.ly/14GZzcT) at 2018-05-27 13:57:06 GMT\n -- forced options: -sS -Pn -n --randomize-hosts -v --send-eth\nInitiating SYN Stealth Scan\nScanning 1 hosts [65535 ports/host]\nrate:  0.00-kpps,  0.00% done,   0:00:00 remaining, found=0       \rrate:  9.99-kpps, 10.76% done,   0:00:49 remaining, found=0       \rrate:  9.98-kpps, 22.69% done,   0:00:20 remaining, found=0       \rrate:  9.98-kpps, 34.41% done,   0:00:11 remaining, found=0       \rrate:  9.94-kpps, 45.85% done,   0:00:07 remaining, found=0       \rrate:  9.97-kpps, 56.86% done,   0:00:04 remaining, found=0       \rrate:  9.97-kpps, 68.61% done,   0:00:02 remaining, found=0       \rrate:  9.95-kpps, 80.49% done,   0:00:01 remaining, found=0       \rrate:  9.94-kpps, 91.36% done,   0:00:00 remaining, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 0-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 10-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 10-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 9-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 9-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 9-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 9-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 8-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 8-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 8-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 8-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 7-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 7-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 7-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 7-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 6-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 6-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 6-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 6-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 5-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 5-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 5-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 5-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 4-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 4-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 4-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 4-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 3-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 3-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 3-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 3-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 2-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 2-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 2-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 2-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 1-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 1-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 1-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 1-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 0-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 0-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 0-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting 0-secs, found=0       \rrate:  0.00-kpps, 100.00% done, waiting -1-secs, found=0       \r                                                                             \r'

(Note: My system doesn't have any open port)

Waiting for your response :)

Out of memory

Out of memory: Kill process 15506 (python3)

我在使用的时候发现,程序因为内存不足,然后被kill掉了

之前机器是1G内存,后续我增加到4G,还是因为内存不足被kill

我使用-iL 里面有几万行ip/ip段

猜测是不是communicate()的原因,导致内存泄漏?

:-(

masscan.masscan.NetworkConnectionError: network is unreachable.

[DEBUG] [masscan.py 10 line] Scan parameters: "masscan -oX - x.x.x.x/24 -p 22 --max-rate 1000"
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/masscan/masscan.py", line 384, in analyse_masscan_xml_scan
dom = ET.fromstring(self._masscan_last_output)
File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1334, 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 "ppp.py", line 6, in
mas.scan(i.rstrip(), ports='22', arguments='--max-rate 1000')
File "/usr/local/lib/python3.5/dist-packages/masscan/masscan.py", line 329, in scan
masscan_warn_keep_trace=masscan_warn_keep_trace
File "/usr/local/lib/python3.5/dist-packages/masscan/masscan.py", line 387, in analyse_masscan_xml_scan
raise NetworkConnectionError("network is unreachable.")
masscan.masscan.NetworkConnectionError: network is unreachable.

if i set two port,everything is normal

[DEBUG] [masscan.py 10 line] Scan parameters: "masscan -oX - x.x.x.x/24 -p 22,80 --max-rate 1000"
{'masscan': {'scanstats': {'..............

Broken Output

When I use the example script it only returns the cli command.

{"command_line": "masscan -oJ - 172.0.8.78/24 -p 22,80,8080 --max-rate 1000", "scan": {}}

Its not even starting scanning. It just skips the scanning process.

Incorrect json format

json must use " instead '
related to "def analyse_masscan_xml_scan"

scan_result['masscan'] = {
'command_line': self._args,
'scanstats': {
'timestr': dom.find("runstats/finished").get('timestr'),
'elapsed': dom.find("runstats/finished").get('elapsed'),
'uphosts': dom.find("runstats/hosts").get('up'),
'downhosts': dom.find("runstats/hosts").get('down'),
'totalhosts': dom.find("runstats/hosts").get('total')}
}

scan_result['masscan'] = {
"command_line": self._args,
"scanstats": {
..............
}

probleme running masscan

hello i run the following code
import masscan mas = masscan.PortScanner() mas.scan('172.0.8.78/24', ports='22,80,8080', arguments='--max-rate 1000') print(mas.scan_result)

i get the following error
` ```
"C:\Users\router-getway\PycharmProjects\untitled1\venv\Scripts\python.exe C:/Users/router-getway/PycharmProjects/untitled1/main.py
Traceback (most recent call last):
File "C:/Users/router-getway/PycharmProjects/untitled1/main.py", line 2, in
mas = masscan.PortScanner()
File "C:\Users\router-getway\PycharmProjects\untitled1\venv\lib\site-packages\masscan\masscan.py", line 128, in init
'masscan program was not found in path. PATH is : {0}'.format(os.getenv('PATH'))
masscan.masscan.PortScannerError: 'masscan program was not found in path. PATH is : C:\Users\router-getway\PycharmProjects\untitled1\venv\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\MATLAB\MATLAB Production Server\R2015a\bin;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Users\router-getway\AppData\Local\Programs\Python\Python37;C:\Users\router-getway\AppData\Local\Programs\Python\Python37\Scripts;C:\Program Files\Java\jre1.8.0_251\bin;C:\Program Files (x86)\Nmap;C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.2\bin;'

Process finished with exit code 1"

 `

python3, script works only if there is a port open apparently?

when I scan an IP that has open ports, the script works perfectly fine. when scanning an IP which returns nothing, I get 2 exceptions - is this expected??

root@scan-test:~# ./masscan.py
scanning $IP
[2018-11-13 20:13:27,364] [DEBUG] [masscan.py 10 line] Scan parameters: "masscan -oX - $IP -p 1-65535 --rate=8000"
Traceback (most recent call last):
File "/root/masscan/masscan.py", line 371, in analyse_masscan_xml_scan
dom = ET.fromstring(self._masscan_last_output)
File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1345, 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 "./masscan.py", line 17, in
mas.scan(target, ports='1-65535', arguments='--rate=8000')
File "/root/masscan/masscan.py", line 317, in scan
masscan_warn_keep_trace=masscan_warn_keep_trace
File "/root/masscan/masscan.py", line 374, in analyse_masscan_xml_scan
raise NetworkConnectionError("network is unreachable.")
masscan.masscan.NetworkConnectionError: network is unreachable.

how can I handle this? catching any exception will just end in "AssertionError: Do a scan before trying to get result !". This is on python 3.5.3.

thanks in advance

UDP ports ignored during scan

Hello, i run the command, but only TCP ports are scanning

host="192.168.0.1"
mas = masscan.PortScanner()
mas.scan(f'{host}', 'ports=U:1-65535,T:1-65535', 'arguments=-sS --max-rate 1000')

output:
{'command_line': 'masscan -oJ - 192.168.0.1 -p U:1-65535,T:1-65535 -sS --max-rate 1000', 'scan': {'192.168.0.1': [{'port': 443, 'proto': 'tcp', 'status': 'open', 'reason': 'syn-ack', 'ttl': 59}, {'port': 53, 'proto': 'tcp', 'status': 'open', 'reason': 'syn-ack', 'ttl': 62}, {'port': 80, 'proto': 'tcp', 'status': 'open', 'reason': 'syn-ack', 'ttl': 53}]}}

No UDP ports were found, but they are present

PortScanner() launch the scan() with an automatic "-oX -" arguments

Hello,

When executing a scan() the arguments "-oX" and a "-" are hardcoded and passed to the scan with also the "argumets=" I would think is better to not have this hardcoded since I do not want to have all my scans being exported also the "-" generates issues when passing custom arguments

I fixed this deleting the arguments in line 269 of masscan.py
Before:
image
After:
image

I don't know how to report this things (1st time in github) so sorry if this was no the proper way to report it

Edit: typo
Renato.

confusion caused by "logging.basicConfig(format=FORMAT)"

After importing masscan, it will cause my own logger to print multiple logs, which will cause some confusion.

>>> import logging
>>> logger = logging.getLogger("test")
>>> formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
>>> handler = logging.StreamHandler()
>>> handler.setFormatter(formatter)
>>> logger.addHandler(handler)
>>> logger.setLevel(level = logging.INFO)
>>> logger.info("fine")
2020-03-28 00:26:06,310 - test - INFO - fine
>>> import masscan
>>> logger.info("fine")
2020-03-28 00:26:11,949 - test - INFO - fine
[2020-03-28 00:26:11,949] [INFO] [<stdin> 20 line] fine

Although it can be solved in the following way

>>> import logging
>>> logger = logging.getLogger("test")
>>> formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
>>> handler = logging.StreamHandler()
>>> handler.setFormatter(formatter)
>>> logger.addHandler(handler)
>>> logger.setLevel(level = logging.INFO)
>>> logger.info("fine")
2020-03-28 00:26:06,310 - test - INFO - fine
>>> import masscan
>>> logger.info("fine")
2020-03-28 00:26:11,949 - test - INFO - fine
[2020-03-28 00:26:11,949] [INFO] [<stdin> 20 line] fine
>>> logger.parent.handlers=[]
>>> logger.info("fine")
2020-03-28 00:26:19,866 - test - INFO - fine

But in order not to cause unnecessary confusion for newbies, how about do not to use logging.basicConfig()

masscan.masscan.PortScannerError

import masscan

mas = masscan.PortScanner()
mas.scan('172.0.8.78/24', ports='22,80,8080')
print(mas.scan_result)

'masscan program was not found in path. PATH is : {0}'.format(os.getenv('PATH'))
masscan.masscan.PortScannerError: 'masscan program was not found in path. PATH is : /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'

what is the problem?!
im using python3.6

masscan.masscan.NetworkConnectionError: network is unreachable. part deux

When I add some output options to the scan to store the output into an XML file, the scan happens, and the file is created, but I get the output "masscan.masscan.NetworkConnectionError: network is unreachable."

Details:

Python 3.8.1 (default, Jan  3 2020, 22:44:00) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import masscan
>>> mas = masscan.PortScanner()
>>> mas.scan('192.168.1.111', ports='1-1000', arguments='--max-rate=1000 -oX testfile')
[2020-01-12 02:03:06,241] [DEBUG] [masscan.py 10 line] Scan parameters: "masscan -oX - 192.168.1.111 -p 1-1000 --max-rate=1000 -oX testfile"
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/masscan/masscan.py", line 384, in analyse_masscan_xml_scan
    dom = ET.fromstring(self._masscan_last_output)
  File "/usr/local/lib/python3.8/xml/etree/ElementTree.py", line 1321, 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 "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/masscan/masscan.py", line 325, in scan
    return self.analyse_masscan_xml_scan(
  File "/usr/local/lib/python3.8/site-packages/masscan/masscan.py", line 387, in analyse_masscan_xml_scan
    raise NetworkConnectionError("network is unreachable.")
masscan.masscan.NetworkConnectionError: network is unreachable.
>>> quit()
root@a23c6822251f:/opt/apps/src# cat testfile 
<?xml version="1.0"?>
<!-- masscan v1.0 scan -->
<nmaprun scanner="masscan" start="1578794586" version="1.0-BETA"  xmloutputversion="1.03">
<scaninfo type="syn" protocol="tcp" />
<host endtime="1578794586"><address addr="192.168.1.111" addrtype="ipv4"/><ports><port protocol="tcp" portid="445"><state state="open" reason="syn-ack" reason_ttl="62"/></port></ports></host>
<host endtime="1578794587"><address addr="192.168.1.111" addrtype="ipv4"/><ports><port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="61"/></port></ports></host>
<host endtime="1578794587"><address addr="192.168.1.111" addrtype="ipv4"/><ports><port protocol="tcp" portid="139"><state state="open" reason="syn-ack" reason_ttl="62"/></port></ports></host>
<host endtime="1578794587"><address addr="192.168.1.111" addrtype="ipv4"/><ports><port protocol="tcp" portid="111"><state state="open" reason="syn-ack" reason_ttl="62"/></port></ports></host>
<host endtime="1578794588"><address addr="192.168.1.111" addrtype="ipv4"/><ports><port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="62"/></port></ports></host>
<host endtime="1578794588"><address addr="192.168.1.111" addrtype="ipv4"/><ports><port protocol="tcp" portid="53"><state state="open" reason="syn-ack" reason_ttl="61"/></port></ports></host>
<runstats>
<finished time="1578794599" timestr="2020-01-12 02:03:19" elapsed="13" />
<hosts up="6" down="0" total="6" />
</runstats>
</nmaprun>

Additionally I see you pass the arguments '-oX -' which should output in XML format, but the format comes out in JSON. I don't understand why.

This doesn't work with /24 ranges or what?

I'm trying to scan some /24 ranges but it doesn't return any ports. I did the command from the command_line key and it returned +500 ports. What is up with this module?

Packaging for Fedora/CentOS

python-masscan is a dependency of a tool I'm packaging for the Fedora Package Collection. This means that a couple of changes are needed to get it through the review process, e.g., no shebangs, documentation in the tarball, etc.

how to pass masscan custom parameters?

Hello brother, python-masscan project is very cool, I have encountered some problems in the use, how to pass masscan custom parameters?
as:--max-rate 100000

python-masscan won't return scan object

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.

Error when install

` File "", line 17, in

File "/tmp/pip_build_root/python-masscan/setup.py", line 21, in

long_description = readme_file.read()

File "/usr/lib/python2.7/encodings/ascii.py", line 26, in decode

return codecs.ascii_decode(input, self.errors)[0]

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4267: ordinal not in range(128)`

masscan.masscan.PortScannerError

masscan.masscan.PortScannerError: 'masscan program was not found in path. PATH is : C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem

How can i fix this ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.