Advertisement
Guest User

Untitled

a guest
Jun 16th, 2014
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. import nmap
  2.  
  3.  
  4. def findTgts(subNet):
  5.     nmScan= nmap.PortScanner()
  6.     nmScan.scan(subNet, '161')
  7.     tgtHosts = []
  8.     for host in nmScan.all_hosts():
  9.         if nmScan[host].has_udp(161):
  10.             state = nmScan[host]['udp'][161]['state']
  11.             if state == 'open':
  12.                 print '[+] Found Target Host: '+host
  13.                 tgtHosts.append(host)
  14. return tgtHosts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement