def send_get_packet(destination_ip, destination_port): """Make TCP handshake by manually creating and sending SYN, SYN-ACK and ACK packets. Arguments: destination_ip -- the IP address of the target destination_port -- the targets port to which the packet will be sent request_line -- the request line of HTTP GET method (payload) """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((destination_ip, destination_port)) print(".") s.send(choice(request_lines).encode("utf-8")) print("Send 1 packets") s.close() sleep(packet_builder.generate_delay())
def send_syn_packet(destination_ip, destination_port): """Send TCP SYN packet""" send(build_syn_packet(destination_ip, destination_port), inter=packet_builder.generate_delay())
def send_fragmented_udp_packet(destination_ip, destination_port): """Send fragmented UDP packets""" for frag in build_fragemneted_udp_packet(destination_ip, destination_port): send(frag, inter=packet_builder.generate_delay())
def send_udp_packet(destination_ip, destination_port): """Send UDP packet""" send(build_udp_packet(destination_ip, destination_port), inter=packet_builder.generate_delay())
def send_fragmented_icmp_packet(destination_ip): """Send fragmented ICMP packets""" for frag in build_fragmented_icmp_packet(destination_ip): send(frag, inter=packet_builder.generate_delay())
def send_icmp_packet(destination_ip): """Send ICMP ECHO request""" send(build_icmp_packet(destination_ip), inter=packet_builder.generate_delay())
def send_ipsec_packet(destination_ip, destination_port): """Send IPSec packet""" send(build_ipsec_packet(destination_ip, destination_port), packet_builder.generate_delay())