Last active
April 10, 2018 11:32
-
-
Save maugern/f1be7d05f29313f585e2d92bc7f91377 to your computer and use it in GitHub Desktop.
Sniffing ARP response
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from scapy.all import * | |
# Sniffing ARP response | |
counter = 0 | |
def display_arp(packet): | |
global counter | |
if packet[ARP].op == 2: # is a response | |
counter += 1 | |
return ('Response n°{}: {} has address {}'.format(counter, | |
packet[ARP].hwsrc, | |
packet[ARP].psrc)) | |
sniff(prn=display_arp, filter="arp", store=0, count=10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment