Skip to content

Instantly share code, notes, and snippets.

@andrew-sipes
Created December 9, 2017 22:24
Show Gist options
  • Save andrew-sipes/5ab9088b97e76a4b4e2c49ebc6e3d670 to your computer and use it in GitHub Desktop.
Save andrew-sipes/5ab9088b97e76a4b4e2c49ebc6e3d670 to your computer and use it in GitHub Desktop.
from scapy.all import *
def reply(packet):
if(packet[2].type == 8):
src = packet[1].src
dst = packet[1].dst
id = packet[2].id
load = packet[3].load
seq = packet[2].seq
ip = IP(src=dst, dst=src)
icmp = ICMP(type=0, id=id, seq=seq)
reply = ip/icmp/load
send(reply)
if __name__="__main__":
sniff(iface="eth22", prn=reply, filter="icmp")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment