Anti ARP Poisoning

Iniciado por ProcessKill, Febrero 24, 2010, 04:10:54 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Febrero 24, 2010, 04:10:54 PM Ultima modificación: Mayo 03, 2014, 02:52:07 AM por Flemon
Código: python
#!/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"