#!/usr/bin/python
import sys, os, time, this
def AntiArp(Argument):
print "Working ...nPress CTRL+C to Quit"
while 1:
f , a , b = open(Argument,'r') , 0 , 0
for lines in f:
a = a+1
f.seek(0)
while b < a :
mot = f.readline().rstrip()
d = mot.index(" ")
f , e = mot[:d] , mot[d+1:]
os.system("arp -d *")
print "deleting arp table"
cmd = "arp -s %s " %f + e
print cmd
os.system(cmd)
b+=1
time.sleep(10)
try:
if len(sys.argv) < 2:
print "nUsage : %s <cache-file>" % sys.argv[0]
print "<cache-file> where data is : x.x.x.x [MAC Address]"
else:
AntiArp(sys.argv[1])
except KeyboardInterrupt:
print "Stopped"