Skip to content

Instantly share code, notes, and snippets.

@NimishMishra
Last active June 30, 2020 05:49
Show Gist options
  • Save NimishMishra/e8bfb6da1f1e86cfc249fd998cdef13b to your computer and use it in GitHub Desktop.
Save NimishMishra/e8bfb6da1f1e86cfc249fd998cdef13b to your computer and use it in GitHub Desktop.
def restore_arp_tables(gateway_ip, gateway_mac, target_ip, target_mac):
# print("Restoring...")
arp_layer = ARP(op=2, hwsrc= gateway_mac, psrc= gateway_ip, pdst= target_ip, hwdst="ff:ff:ff:ff:ff:ff")
gateway_to_target = Ether()/arp_layer
arp_layer = ARP(op=2, hwsrc= target_mac, psrc= target_ip, pdst= gateway_ip, hwdst="ff:ff:ff:ff:ff:ff")
target_to_gateway = Ether()/arp_layer
send(gateway_to_target, count=10, verbose= 0)
send(target_to_gateway, count=10, verbose= 0)
# print("Restoring done...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment