self.dst = dst
self.payload = payload
self.checksum = 0
self.length = 8 # UDP...Header length
def pack(self, src, dst, proto=socket.IPPROTO_UDP):
length = self.length...fake packet test"
# packobj = UDP(fakesrc, dst, payload)
# packet = packobj.pack(fakesrc, dst)
# s.sendto...(packet, (dst, dstport))
udp = UDP(randint(1, 65535), dstport, payload).pack(fakesrc, dst)
ip = IP(fakesrc..., dst, udp, proto=socket.IPPROTO_UDP).pack()
s.sendto(ip + udp + payload, (dst, dstport))