forked from savon-noir/python-libnmap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnmap_task.py
More file actions
20 lines (16 loc) · 678 Bytes
/
nmap_task.py
File metadata and controls
20 lines (16 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from libnmap.process import NmapProcess
def mycallback(nmaptask):
nmaptask = nmap_proc.current_task
if nmaptask:
print("Task {0} ({1}): ETC: {2} DONE: {3}%".format(nmaptask.name,
nmaptask.status,
nmaptask.etc,
nmaptask.progress))
nmap_proc = NmapProcess(targets="scanme.nmap.org",
options="-sV",
event_callback=mycallback)
nmap_proc.run()
print(nmap_proc.stdout)
print(nmap_proc.stderr)