Created
May 24, 2018 23:24
-
-
Save kjmkznr/cd180d8dbc7fad7247be87a7257e2f18 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
#!/usr/bin/env python3 | |
from scapy.all import * | |
def decap_and_send(packet): | |
if packet[IP][0].proto == 4: | |
decap = (Ether() / packet[IP][1]) | |
sendp(decap, iface='dummy0') | |
print(decap) | |
if __name__ == '__main__': | |
while True: | |
sniff(iface='virbr0', filter="proto 4" , prn=decap_and_send, count=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment