# Open a raw socket. Special permissions are usually required. s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP) s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) seq_id = 0 while cnt >= 1: # Calculate its checksum. seq_id = seq_id + 1 tcp.set_th_seq(seq_id) tcp.calculate_checksum()
# Send it to the target host. s.sendto(ip.get_packet(), (dst,80)) cnt= cnt -1