Skip to content

Instantly share code, notes, and snippets.

@njsmith njsmith/get-flood.py Secret
Created Oct 20, 2016

Embed
What would you like to do?
import sys
import socket
host, port = sys.argv[1], int(sys.argv[2])
with socket.create_connection((host, port)) as sock:
get = b"GET / HTTP/1.1\r\nHost: " + host.encode("ascii") + b"\r\n\r\n"
count = 0
while True:
sock.sendall(get)
count += 1
if count % 10000 == 0:
sys.stdout.write("\rRequests sent: {}".format(count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.