Skip to content

Instantly share code, notes, and snippets.

@NimishMishra
Created June 30, 2020 05:13
Show Gist options
  • Save NimishMishra/18c25515ae0049005e8534b701701b31 to your computer and use it in GitHub Desktop.
Save NimishMishra/18c25515ae0049005e8534b701701b31 to your computer and use it in GitHub Desktop.
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