Skip to content

Instantly share code, notes, and snippets.

@noslin005
Created May 25, 2020 05:11
Show Gist options
  • Save noslin005/7b15e6d75ce005c5449d76622f894d6e to your computer and use it in GitHub Desktop.
Save noslin005/7b15e6d75ce005c5449d76622f894d6e to your computer and use it in GitHub Desktop.
scan network using nmap
#!/usr/bin/python
import nmap
target_mac = '<Enter MAC Adress>'
nm = nmap.PortScanner()
nm.scan(hosts='10.0.0.0/24', arguments='-n -sP')
host_list = nm.all_hosts()
for host in host_list:
if 'mac' in nm[host]['addresses']:
print(host+' : '+nm[host]['addresses']['mac'])
if target_mac == nm[host]['addresses']['mac']:
print('Target Found')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment