Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import nmap
- def findTgts(subNet):
- nmScan= nmap.PortScanner()
- nmScan.scan(subNet, '161')
- tgtHosts = []
- for host in nmScan.all_hosts():
- if nmScan[host].has_udp(161):
- state = nmScan[host]['udp'][161]['state']
- if state == 'open':
- print '[+] Found Target Host: '+host
- tgtHosts.append(host)
- return tgtHosts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement