Last active
June 30, 2020 05:49
-
-
Save NimishMishra/e8bfb6da1f1e86cfc249fd998cdef13b to your computer and use it in GitHub Desktop.
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
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