Created
June 30, 2020 05:36
-
-
Save NimishMishra/27d132696de626b4b466f7966604b7a4 to your computer and use it in GitHub Desktop.
This file contains 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
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