Archiv der Kategorie: Python

ARP-request logging in python

A simple script which displays all ARP-requests in your network written in python:


from scapy.all import sniff

print '\n[*] Starting ARP monitoring\n'
print 'Ether.src'.ljust(20) + 'ARP.psrc'.ljust(16) + 'ARP.pdst'.ljust(16)

def arp_monitor_callback(pkt):

    print pkt.sprintf("%Ether.src%").ljust(20) + pkt.sprintf("%ARP.psrc%").ljust(16) + pkt.sprintf("%ARP.pdst%").ljust(16)


It requires only the module Scapy, which can be installed with the command pip install Scapy.