Skip to content

Instantly share code, notes, and snippets.

@NimishMishra
Created June 30, 2020 05:36
Show Gist options
  • Save NimishMishra/27d132696de626b4b466f7966604b7a4 to your computer and use it in GitHub Desktop.
Save NimishMishra/27d132696de626b4b466f7966604b7a4 to your computer and use it in GitHub Desktop.
def get_mac_address(ip_address):
packet = Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=ip_address)
answered, unanswered = srp(packet, timeout=2, verbose=0)
for sent,received in answered:
return received[ARP].hwsrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment