fuzzy_attack.py 862 Bytes
import socket

def fuzzy_attack(method, targetIP, targetPORT):
    command = b"XXXX "

    if method == "udp":
        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        for x in range(4, 100000, 4):
            message = command + b"A" * x
            print(f"Sending command {command} with arg length {x}")
            sock.sendto(message, (targetIP, targetPORT))
            sock.recvfrom(1024)
        sock.close()

    elif method == "tcp":
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.connect((targetIP, targetPORT))
        for x in range(4, 100000, 4):
            message = command + b"A" * x
            print(f"Sending command {command} with arg length {x}")
            sock.sendall(message)
            resp = sock.recv(4096)
            print("Response Received:", resp)
        sock.close()