nopasaran.utils

Functions

create_ICMP_packet()

create_TCP_packet()

create_UDP_packet()

deserialize_log_data(base64_data)

get_ICMP_code(packet)

get_ICMP_payload(packet)

get_ICMP_type(packet)

get_IP_dst(packet)

get_IP_src(packet)

get_TCP_ack(packet)

get_TCP_dport(packet)

get_TCP_flags(packet)

get_TCP_seq(packet)

get_TCP_sport(packet)

get_UDP_dport(packet)

get_UDP_payload_size(packet)

Return the size (in bytes) of the UDP payload.

get_UDP_sport(packet)

group_ports(ports)

Group consecutive ports into ranges.

handle_client_connection(client_socket)

remove_TCP_payload(packet)

send_echo_once_tcp(ip, port, message[, timeout])

Open a TCP connection to the echo server, send the message, receive any echoed data, then close the connection.

send_echo_once_udp(ip, port, message[, timeout])

Send a single UDP datagram to (ip, port), then wait for up to 'timeout' seconds for the echo response.

send_https_sni_request(ip, port, request_packet)

Send an HTTPS request with optional SNI and return the full response.

send_request(ip, port, request_packet)

send_tcp_dns_query(server_ip, server_port, ...)

send_udp_dns_query(server_ip, server_port, ...)

serialize_log_data(log_data)

set_ICMP_code(packet, icmp_code)

set_ICMP_payload(packet, payload_bytes)

set_ICMP_type(packet, icmp_type)

set_IP_df(packet)

Set the Don't Fragment (DF) flag on an IP packet.

set_IP_dst(packet, dst)

set_IP_src(packet, src)

set_TCP_ack(packet, ack)

set_TCP_automatic_packet_ack(ack_packet, ...)

set_TCP_automatic_packet_seq(packet)

set_TCP_dport(packet, dport)

set_TCP_flags(packet, flags)

set_TCP_payload(packet, payload)

set_TCP_seq(packet, seq)

set_TCP_sport(packet, sport)

set_UDP_dport(packet, dport)

set_UDP_packet_bytes(packet, size)

Set the UDP packet's payload to a sequence of 'A' characters of length size.

set_UDP_payload(packet, payload_bytes)

Replace the payload of a UDP packet with payload_bytes without recreating the entire packet.

set_UDP_sport(packet, sport)

set_random_float(min, max)

set_random_int(min, max)