Skip to content

Instantly share code, notes, and snippets.

@DMcP89
Last active May 27, 2024 23:54
Show Gist options
  • Save DMcP89/22ac2d745e13cebe9be9 to your computer and use it in GitHub Desktop.
Save DMcP89/22ac2d745e13cebe9be9 to your computer and use it in GitHub Desktop.
python script to scan network for mac address
#!/usr/bin/python
import nmap
target_mac = '<Enter MAC Adress>'
nm = nmap.PortScanner()
nm.scan(hosts='192.168.1.0/24', arguments='-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')
~
@arsyeed
Copy link

arsyeed commented Dec 7, 2022

Thanks

@xupurt
Copy link

xupurt commented May 30, 2023

Gracias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment