import ip
import udp
import socket
udp_packet = udp.Packet()
udp_packet.sport = 1024
udp_packet.dport = 3024
udp_packet.data = '\xff\xff\xff\xffrcon "test" test\x00'
udp_data = udp.assemble(udp_packet, 0)
ip_packet = ip.Packet()
ip_packet.src = '1.1.1.1'
ip_packet.dst = '2.2.2.2'
ip_packet.ttl = 10
ip_packet.data = udp_data
packet = ip.assemble(ip_packet, 0)
Forging packet UDP with given TTL