-
-
Save MJGTwo/8d039f2c0e417faf9d64 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
import logging | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)#Surpress's small errors from Scapy | |
from scapy.all import * | |
def arp_display(pkt): | |
if pkt.haslayer(ARP): #makes sure it is ARP | |
if pkt[ARP].op == 1: #who-has (request) | |
if pkt[ARP].psrc == '0.0.0.0': # ARP Probe | |
print "ARP Probe from: " + pkt[ARP].hwsrc | |
print sniff(prn=arp_display, filter="arp", store=0, count=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed a few errors in while running a version of this on my
Raspberry Pi. One of them is that Scapy likes to through low level
errors that cause the program to crash. Another is when Scapy receives
a packet that isn’t ARP and tries to use ARP features on it and
crashes, so I made it check for that. Lastly I changed the count to 0
so that it runs until you tell it to stop with a Ctrl+C command.