OpenVAS Scanner  21.4.1
Functions
nasl_packet_forgery_v6.h File Reference

Go to the source code of this file.

Functions

tree_cellforge_ip_v6_packet (lex_ctxt *)
 Forge an IPv6 packet. More...
 
tree_cellset_ip_v6_elements (lex_ctxt *)
 Set IPv6 header element. More...
 
tree_cellget_ip_v6_element (lex_ctxt *)
 Obtain IPv6 header element. More...
 
tree_celldump_ip_v6_packet (lex_ctxt *)
 Print IPv6 Header. More...
 
tree_cellinsert_ip_v6_options (lex_ctxt *)
 Adds an IPv6 option to the datagram. More...
 
tree_cellforge_tcp_v6_packet (lex_ctxt *)
 Forge TCP packet. More...
 
tree_cellget_tcp_v6_element (lex_ctxt *)
 Get TCP Header element. More...
 
tree_cellget_tcp_v6_option (lex_ctxt *)
 Get a TCP option from an IP datagram if present. Possible options are: TCPOPT_MAXSEG (2), values between 536 and 65535 TCPOPT_WINDOW (3), with values between 0 and 14 TCPOPT_SACK_PERMITTED (4), no value required. TCPOPT_TIMESTAMP (8), 8 bytes value for timestamp and echo timestamp, 4 bytes each one. More...
 
tree_cellset_tcp_v6_elements (lex_ctxt *)
 Set TCP Header element. More...
 
tree_cellinsert_tcp_v6_options (lex_ctxt *)
 Add options to a TCP segment header. Possible options are: TCPOPT_MAXSEG (2), values between 536 and 65535 TCPOPT_WINDOW (3), with values between 0 and 14 TCPOPT_SACK_PERMITTED (4), no value required. TCPOPT_TIMESTAMP (8), 8 bytes value for timestamp and echo timestamp, 4 bytes each one. More...
 
tree_celldump_tcp_v6_packet (lex_ctxt *)
 Dump TCP part of an IPv6 Datagram. More...
 
tree_cellforge_udp_v6_packet (lex_ctxt *)
 
tree_cellset_udp_v6_elements (lex_ctxt *)
 
tree_celldump_udp_v6_packet (lex_ctxt *)
 
tree_cellget_udp_v6_element (lex_ctxt *)
 
tree_cellforge_icmp_v6_packet (lex_ctxt *)
 
tree_cellget_icmp_v6_element (lex_ctxt *)
 
tree_celldump_icmp_v6_packet (lex_ctxt *)
 Dump the ICMP part of a IP Datagram. More...
 
tree_cellforge_igmp_v6_packet (lex_ctxt *)
 
tree_cellnasl_tcp_v6_ping (lex_ctxt *)
 Performs TCP Connect to test if host is alive. More...
 
tree_cellnasl_send_v6packet (lex_ctxt *)
 Send forged IPv6 Packets. More...
 

Function Documentation

◆ dump_icmp_v6_packet()

tree_cell* dump_icmp_v6_packet ( lex_ctxt lexic)

Dump the ICMP part of a IP Datagram.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]...IP datagrams to dump the ICMP part from.

◆ dump_ip_v6_packet()

tree_cell* dump_ip_v6_packet ( lex_ctxt lexic)

Print IPv6 Header.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]...IPv6 datagrams to dump.
Returns
Print and returns FAKE_CELL.

◆ dump_tcp_v6_packet()

tree_cell* dump_tcp_v6_packet ( lex_ctxt lexic)

Dump TCP part of an IPv6 Datagram.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]...IPv6 datagrams to dump.
Returns
Print and return FAKE_CELL.

◆ dump_udp_v6_packet()

tree_cell* dump_udp_v6_packet ( lex_ctxt lexic)

◆ forge_icmp_v6_packet()

tree_cell* forge_icmp_v6_packet ( lex_ctxt lexic)

◆ forge_igmp_v6_packet()

tree_cell* forge_igmp_v6_packet ( lex_ctxt lexic)

◆ forge_ip_v6_packet()

tree_cell* forge_ip_v6_packet ( lex_ctxt lexic)

Forge an IPv6 packet.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]dataData payload
[in]ip6_vVersion. 6 by default.
[in]ip6_tcTraffic class. 0 by default.
[in]ip6_flFlow label. 0 by default.
[in]ip6_pIP protocol. 0 by default.
[in]ip6_hlimHop limit. Max. 255. 64 by default.
[in]ip6_srcSource address.
[in]ip6_dstDestination address.
Returns
Forged IP packet.

◆ forge_tcp_v6_packet()

tree_cell* forge_tcp_v6_packet ( lex_ctxt lexic)

Forge TCP packet.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]ip6IPv6 packet.
[in]dataData.
[in]th_sportSource port. 0 by default.
[in]th_dportDestination port. 0 by default.
[in]th_seqSequence number. Random by default.
[in]th_ackAcknowledgement number. 0 by default.
[in]th_x20 by default.
[in]th_offData offset. 5 by default.
[in]th_flagsFlags. 0 by default.
[in]th_winWindow. 0 by default.
[in]th_sumChecksum. Is filled in automatically by default
[in]th_urpUrgent pointer. 0 by default.
Returns
tree_cell with the forged TCP packet containing IPv6 header.

◆ forge_udp_v6_packet()

tree_cell* forge_udp_v6_packet ( lex_ctxt lexic)

◆ get_icmp_v6_element()

tree_cell* get_icmp_v6_element ( lex_ctxt lexic)

◆ get_ip_v6_element()

tree_cell* get_ip_v6_element ( lex_ctxt lexic)

Obtain IPv6 header element.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]ipv6IPv6 header. TODO: Once versions older than 20.08 are no longer in use the parameter name can be changed to 'ip6'.
[in]elementElement to extract from the header.
Returns
tree_cell with the IP header element.

◆ get_tcp_v6_element()

tree_cell* get_tcp_v6_element ( lex_ctxt lexic)

Get TCP Header element.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]tcpIPv6 packet
[in]elementElement to extract from the header (see forge_tcp_v6_packet()).
Returns
tree_cell with the forged IP packet.

◆ get_tcp_v6_option()

tree_cell* get_tcp_v6_option ( lex_ctxt lexic)

Get a TCP option from an IP datagram if present. Possible options are: TCPOPT_MAXSEG (2), values between 536 and 65535 TCPOPT_WINDOW (3), with values between 0 and 14 TCPOPT_SACK_PERMITTED (4), no value required. TCPOPT_TIMESTAMP (8), 8 bytes value for timestamp and echo timestamp, 4 bytes each one.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]tcpThe full IP datagram (IP + TCP).
[in]optionOption to get.
Returns
Integer or array given the case.

◆ get_udp_v6_element()

tree_cell* get_udp_v6_element ( lex_ctxt lexic)

◆ insert_ip_v6_options()

tree_cell* insert_ip_v6_options ( lex_ctxt lexic)

Adds an IPv6 option to the datagram.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]ip6IPv6 packet.
[in]dataData payload.
[in]codeCode of option.
[in]lengthLength of value.
[in]valueValue of the option.
Returns
the modified datagram.

◆ insert_tcp_v6_options()

tree_cell* insert_tcp_v6_options ( lex_ctxt lexic)

Add options to a TCP segment header. Possible options are: TCPOPT_MAXSEG (2), values between 536 and 65535 TCPOPT_WINDOW (3), with values between 0 and 14 TCPOPT_SACK_PERMITTED (4), no value required. TCPOPT_TIMESTAMP (8), 8 bytes value for timestamp and echo timestamp, 4 bytes each one.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]tcpIP datagram.
[in]data(optional) TCP data payload.
[in]unnamedoption.
[in]Valuefor unnamed option if required.
Returns
The modified IP datagram.

◆ nasl_send_v6packet()

tree_cell* nasl_send_v6packet ( lex_ctxt lexic)

Send forged IPv6 Packets.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]...IPv6 packets to send.
[in]lengthLength of each packet by default.
[in]pcap_activeTRUE by default. Otherwise, NASL does not listen for the answers.
[in]pcap_filterBPF filter.
[in]pcap_timeoutCapture timeout. 5 by default.
[in]allow_multicastDefault 0.
Returns
tree_cell with the response to the sent packet.

◆ nasl_tcp_v6_ping()

tree_cell* nasl_tcp_v6_ping ( lex_ctxt lexic)

Performs TCP Connect to test if host is alive.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]portPort to ping. Internal list of common ports is used as default.
Returns
tree_cell > 0 if host is alive, 0 otherwise.

◆ set_ip_v6_elements()

tree_cell* set_ip_v6_elements ( lex_ctxt lexic)

Set IPv6 header element.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]ip6IP v6 header.
[in]ip6_plenPayload length.
[in]ip6_hlimHop limit. Max. 255
[in]ip6_nxtNext packet.
[in]ip6_srcSource address
Returns
tree_cell with the forged IP packet.

◆ set_tcp_v6_elements()

tree_cell* set_tcp_v6_elements ( lex_ctxt lexic)

Set TCP Header element.

Parameters
[in]lexicLexical context of NASL interpreter.
[in]tcpIPv6 packet to modify.
[in]dataData.
[in]th_sportSource port.
[in]th_dportDestination port.
[in]th_seqSequence number.
[in]th_ackAcknowledgement number.
[in]th_x2
[in]th_offData offset.
[in]th_flagsFlags.
[in]th_winWindow.
[in]th_sumChecksum.
[in]th_urpUrgent pointer.
[in]update_ip_lenFlag (TRUE by default). If set, NASL will recompute the size field of the IP datagram.
Returns
tree_cell with the modified IPv6 datagram.

◆ set_udp_v6_elements()

tree_cell* set_udp_v6_elements ( lex_ctxt lexic)