File: stresstest.py

package info (click to toggle)
python-libnmap 0.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,416 kB
  • sloc: xml: 5,572; python: 4,299; makefile: 149
file content (15 lines) | stat: -rw-r--r-- 409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python
from libnmap.parser import NmapParser, NmapParserException
from libnmap.process import NmapProcess

nm = NmapProcess("127.0.0.1", "-sP")
rc = nm.run()
if rc != 0:
    print("nmap scan failed: {0}".format(nm.stderr))

try:
    report = NmapParser.parse(nm.stdout)
except NmapParserException as e:
    print("Exception raised while parsing scan: {0}".format(e.msg))

print(len(nm.stdout))