Archiv der Kategorie: network

ARP-request logging in python

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

#!/usr/bin/python2

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)

sniff(prn=arp_monitor_callback,filter="arp",store=0)

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