Python - nmap scan without looking for specific ports -
is possible start nmap scan using python script doesn't focus on available ports?
>>> import nmap >>> nm = nmap.portscanner() >>> nm.scan('127.0.0.1', '22-443') >>> nm.command_line() 'nmap -ox - -p 22-443 -sv 127.0.0.1' this example requires port, or range of ports, scan. in normal nmap scan linux terminal, simple as;
nmap -o -v <ip address/range> is possible?
pass whatever arguments want:
nm.scan(hosts='<ip address/range>',arguments="-o -v") bear in mind fingerprinting need root privileges.
if scanning range of ip's portscannerasync might useful:
import nmap nm = nmap.portscannerasync() def callback_result(host, scan_result): print '------------------' print host, scan_result nm.scan('192.168.1.0/24', arguments="-o -v", callback=callback_result) while nm.still_scanning(): print("waiting >>>") nm.wait(2)
Comments
Post a Comment