Created
June 30, 2020 05:13
-
-
Save NimishMishra/18c25515ae0049005e8534b701701b31 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
from scapy.all import * | |
response = "" | |
def discovery(dst, time): | |
global response | |
ethernet_layer = Ether(dst="ff:ff:ff:ff:ff:ff") | |
arp_layer = ARP(pdst= dst) | |
ans, unans = srp(ethernet_layer/arp_layer, timeout=int(time)) | |
for sent, received in ans: | |
response = response + received[ARP].psrc + " " | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment