Skip to content

Instantly share code, notes, and snippets.

@kjmkznr
Created May 24, 2018 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjmkznr/cd180d8dbc7fad7247be87a7257e2f18 to your computer and use it in GitHub Desktop.
Save kjmkznr/cd180d8dbc7fad7247be87a7257e2f18 to your computer and use it in GitHub Desktop.
#!/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