Last active
July 1, 2024 04:51
-
-
Save DMcP89/22ac2d745e13cebe9be9 to your computer and use it in GitHub Desktop.
python script to scan network for mac address
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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') | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gracias.