Created
December 9, 2017 22:24
-
-
Save andrew-sipes/5ab9088b97e76a4b4e2c49ebc6e3d670 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
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