Skip to main content

Module network

Module network 

Source
Expand description

Exposes the public network module. Network-interface selection, ARP packet exchange, and scan timing.

StructsΒ§

NetworkIterator
A network iterator for iterating over multiple network ranges in with a low-memory approach. This iterator was crafted to allow iteration over huge network ranges (192.168.0.0/16) without consuming excessive memory. Describes the public NetworkIterator type.
ResponseSummary
Gives high-level details about the scan response. This may include Ethernet details (packet count, size, …) and other technical network aspects. Describes the public ResponseSummary type.
ScanEstimation
Contains scan estimation records. This will be computed before the scan starts and should give insights about the scan. Describes the public ScanEstimation type.
TargetDetails
A target detail represents a single host on the local network with an IPv4 address and a linked MAC address. Hostnames are optional since some hosts does not respond to the resolve call (or the numeric mode may be enabled). Describes the public TargetDetails type.

ConstantsΒ§

ARP_PACKET_SIZE πŸ”’
DATALINK_RCV_TIMEOUT
Maximum receive wait between checks of the shared timeout flag, in ms.
ETHERNET_STD_PACKET_SIZE πŸ”’
ETHERNET_VLAN_PACKET_SIZE πŸ”’
VLAN_PACKET_SIZE πŸ”’
VLAN_QOS_DEFAULT πŸ”’

FunctionsΒ§

compute_network_configuration
Compute a network configuration based on the scan options and available interfaces. This configuration will be used in the scan process to target a specific network on a network interfaces. Performs the public compute_network_configuration operation.
compute_scan_estimation
Based on the network size and given scan options, this function performs an estimation of the scan impact (timing, bandwidth, …). Keep in mind that this is only an estimation, real results may vary based on the network. Performs the public compute_scan_estimation operation.
find_hostname πŸ”’
Find the local hostname linked to an IPv4 address. This will perform a reverse DNS request in the local network to find the IPv4 hostname.
find_interface_by_index πŸ”’
find_interface_by_name πŸ”’
find_source_ip
Find the most adequate IPv4 address on a given network interface for sending ARP requests. If the β€˜forced_source_ipv4’ parameter is set, it will take the priority over the network interface address. Performs the public find_source_ip operation.
receive_arp_responses
Wait at least N seconds and receive ARP network responses. The main downside of this function is the blocking nature of the datalink receiver: when the N seconds are elapsed, the receiver loop will therefore only stop on the next received frame. Therefore, the receiver should have been configured to stop at certain intervals (500ms for example). Performs the public receive_arp_responses operation.
send_arp_request
Send a single ARP request - using a datalink-layer sender, a given network interface and a target IPv4 address. The ARP request will be broadcasted to the whole local network with the first valid IPv4 address on the interface. Performs the public send_arp_request operation.