Skip to content

Instantly share code, notes, and snippets.

@nextrevision
Created March 2, 2015 13:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nextrevision/8d340bc5ed95dbe41427 to your computer and use it in GitHub Desktop.
Save nextrevision/8d340bc5ed95dbe41427 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