Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@angeloped
Forked from nextrevision/udpflood_scapy.py
Created July 27, 2019 19:49
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 angeloped/0fb689573792b9c3aa7ba3bf522e6d78 to your computer and use it in GitHub Desktop.
Save angeloped/0fb689573792b9c3aa7ba3bf522e6d78 to your computer and use it in GitHub Desktop.
Send a flood of UDP packets to a specific UDP port
#!/usr/bin/env python
#
# Requires:
# - scapy
# - tcpreplay
import sys
from scapy.all import *
if len(sys.argv) != 6:
print "usage: %s dst_ip dst_port iface pps repeat" % sys.argv[0]
print "example: %s 1.2.3.4 5001 eth0 100000 300"
exit(1)
payload = 'a' * 100
pkt = IP(dst=sys.argv[1])/UDP(dport=[sys.argv[2]])/payload
sendpfast(pkt * sys.argv[4], pps=sys.argv[4], mbps=1000, loop=sys.argv[5], iface=sys.argv[3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment