Code Monkey home page Code Monkey logo

nmapscanner's Introduction

G'Day Mate πŸ‡¦πŸ‡ΊπŸπŸ

Linkedin Badge Twitter Badge

nmapscanner's People

Contributors

cooperlees avatar dependabot[bot] avatar jpaussa avatar

Watchers

 avatar  avatar  avatar

Forkers

jpaussa

nmapscanner's Issues

Timeout Leads to XML Parsing Error

Repro with --nmap-timeout 1

This also breaks echo-back (can't see what I am typing) to my terminal until I reset. Need to check if this is a tmux thing or breaks stuff generically.

On timeout we won't have valid XML so we can skip parsing.

Full output of testing:

jdp@shelly:~/github/nmapscanner$ sudo /tmp/tn/bin/python3.9 nmapscanner.py 192.168.45.0/24 --nmap-timeout 1
[2022-03-21 17:16:33,052] INFO: Adding 192.168.45.0/24 scans to run queue (nmapscanner.py:164)
[2022-03-21 17:16:33,053] INFO: 192.168.45.0/24 - '/usr/bin/nmap -Pn -sS -oX /tmp/nmapscanner_run_20220321171633/192.168.45.0_24_TCP 192.168.45.0/24' starting (nmapscanner.py:133)
[2022-03-21 17:16:33,053] INFO: Running 1 nmap scans (nmapscanner.py:180)
[2022-03-21 17:16:34,120] ERROR: 192.168.45.0/24 - '['/usr/bin/nmap', '-Pn', '-sS', '-oX', '/tmp/nmapscanner_run_20220321171633/192.168.45.0_24_TCP', '192.168.45.0/24']' FAILED: Command '['/usr/bin/nmap', '-Pn', '-sS', '-oX', '/tmp/nmapscanner_run_20220321171633/192.168.45.0_24_TCP', '192.168.45.0/24']' timed out after 1 seconds (nmapscanner.py:137)
[2022-03-21 17:16:34,120] INFO: 192.168.45.0/24 - '/usr/bin/nmap -Pn -sU -oX /tmp/nmapscanner_run_20220321171633/192.168.45.0_24_UDP 192.168.45.0/24' starting (nmapscanner.py:133)
[2022-03-21 17:16:35,184] ERROR: 192.168.45.0/24 - '['/usr/bin/nmap', '-Pn', '-sU', '-oX', '/tmp/nmapscanner_run_20220321171633/192.168.45.0_24_UDP', '192.168.45.0/24']' FAILED: Command '['/usr/bin/nmap', '-Pn', '-sU', '-oX', '/tmp/nmapscanner_run_20220321171633/192.168.45.0_24_UDP', '192.168.45.0/24']' timed out after 1 seconds (nmapscanner.py:137)
[2022-03-21 17:16:35,185] INFO: 0 / 1 (0%) nmap scans succeeded (1 failed) (nmapscanner.py:191)
Traceback (most recent call last):
  File "/tmp/tn/lib/python3.9/site-packages/libnmap/parser.py", line 101, in _parse_xml
    root = ET.fromstring(nmap_data)
  File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 1350, in XML
    return parser.close()
xml.etree.ElementTree.ParseError: no element found: line 7, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jdp/github/nmapscanner/nmapscanner.py", line 304, in <module>
    main()
  File "/tmp/tn/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/tmp/tn/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/tmp/tn/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmp/tn/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/tmp/tn/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/jdp/github/nmapscanner/nmapscanner.py", line 300, in main
    ctx.exit(write_to_json_files(output_path))
  File "/home/jdp/github/nmapscanner/nmapscanner.py", line 206, in write_to_json_files
    json_results = get_nmap_result(afile)
  File "/home/jdp/github/nmapscanner/nmapscanner.py", line 46, in get_nmap_result
    nmap_report = NmapParser.parse_fromfile(str(nmap_xml_file))
  File "/tmp/tn/lib/python3.9/site-packages/libnmap/parser.py", line 213, in parse_fromfile
    rval = cls.parse(fdata, data_type, incomplete)
  File "/tmp/tn/lib/python3.9/site-packages/libnmap/parser.py", line 47, in parse
    nmapobj = cls._parse_xml(nmap_data, incomplete)
  File "/tmp/tn/lib/python3.9/site-packages/libnmap/parser.py", line 104, in _parse_xml
    raise NmapParserException(emsg)
libnmap.parser.NmapParserException: Wrong XML structure: cannot parse data: no element found: line 7, column 0

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.