dns/udp_sender.py

13 lines
253 B
Python
Raw Normal View History

2022-03-13 21:56:17 +01:00
#!/usr/bin/env python3
import socket
import sys
UDP_SIZE = int(sys.argv[1])
UDP_IP = "127.0.0.1"
UDP_PORT = 13337
MESSAGE = "A"
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.sendto(bytes(MESSAGE*UDP_SIZE, "utf-8"), (UDP_IP, UDP_PORT))