OpenVAS Scanner 21.4.1
|
#include "nasl_lex_ctxt.h"
Go to the source code of this file.
Functions | |
tree_cell * | forge_ip_packet (lex_ctxt *) |
Forge an IP datagram. More... | |
tree_cell * | set_ip_elements (lex_ctxt *) |
Modify the fields of a datagram. More... | |
tree_cell * | get_ip_element (lex_ctxt *) |
Extracts a field from an IP datagram. More... | |
tree_cell * | dump_ip_packet (lex_ctxt *) |
Dump IP datagrams. More... | |
tree_cell * | insert_ip_options (lex_ctxt *) |
Add option datagram. More... | |
tree_cell * | forge_tcp_packet (lex_ctxt *) |
Fills an IP datagram with TCP data. Note that the ip_p field is not updated. It returns the modified IP datagram. Its arguments are: More... | |
tree_cell * | get_tcp_element (lex_ctxt *) |
Extracts TCP field from an IP datagram. More... | |
tree_cell * | get_tcp_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_cell * | set_tcp_elements (lex_ctxt *) |
Modify the TCP fields of a datagram. More... | |
tree_cell * | insert_tcp_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_cell * | dump_tcp_packet (lex_ctxt *) |
Dump the TCP part of a IP Datagram. More... | |
tree_cell * | forge_udp_packet (lex_ctxt *) |
Fills an IP datagram with UDP data. Note that the ip_p field is not updated. It returns the modified IP datagram. Its arguments are: More... | |
tree_cell * | set_udp_elements (lex_ctxt *) |
Modify UDP fields of an IP datagram. More... | |
tree_cell * | dump_udp_packet (lex_ctxt *) |
Dump the UDP part of a IP Datagram. More... | |
tree_cell * | get_udp_element (lex_ctxt *) |
Get an UDP element from a IP datagram. More... | |
tree_cell * | forge_icmp_packet (lex_ctxt *) |
Fill an IP datagram with ICMP data. More... | |
tree_cell * | get_icmp_element (lex_ctxt *) |
Get an ICMP element from a IP datagram. More... | |
tree_cell * | dump_icmp_packet (lex_ctxt *) |
Dump the ICMP part of a IP Datagram. More... | |
tree_cell * | forge_igmp_packet (lex_ctxt *) |
Fills an IP datagram with IGMP data. More... | |
tree_cell * | nasl_tcp_ping (lex_ctxt *) |
Lunches a âTCP pingâ against the target host. More... | |
tree_cell * | nasl_send_packet (lex_ctxt *) |
Send a list of packets (passed as unnamed arguments) and listens to the answers. It returns a block made of all the sniffed âanswersâ. More... | |
tree_cell * | nasl_pcap_next (lex_ctxt *) |
Listen to one packet and return it. More... | |
tree_cell * | nasl_send_capture (lex_ctxt *) |
Send a capture. More... | |
Dump the ICMP part of a IP Datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ... | IP datagrams to dump the ICMP part from. |
Dump IP datagrams.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ... | IP datagrams to dump. |
Dump the TCP part of a IP Datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ... | IP datagrams to dump the TCP part from. |
Dump the UDP part of a IP Datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ... | IP datagrams to dump the UDP part from. |
Fill an IP datagram with ICMP data.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ip | IP datagram that is updated. |
[in] | data | Payload. |
[in] | icmp_cksum | Checksum, computed by default. |
[in] | icmp_code | ICMP code. 0 by default. |
[in] | icmp_id | ICMP ID. 0 by default. |
[in] | icmp_seq | ICMP sequence number. |
[in] | icmp_type | ICMP type. 0 by default. |
[in] | update_ip_len | Flag (TRUE by default). If set, NASL will recompute the size field of the IP datagram. |
Fills an IP datagram with IGMP data.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ip | IP datagram that is updated. |
[in] | code | 0 by default. |
[in] | data | |
[in] | group | |
[in] | type | 0 by default. |
[in] | update_ip_len | Flag (TRUE by default). If set, NASL will recompute the size field of the IP datagram. |
Forge an IP datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | data | Payload. |
[in] | ip_hl | IP header length in 32 bits words. 5 by default. |
[in] | ip_id | Datagram ID. Random by default. |
[in] | ip_len | Length of the datagram. 20 plus the length of the data field by default. |
[in] | ip_off | Fragment offset in 64 bits words. 0 by default. |
[in] | ip_p | IP protocol. 0 by default. |
[in] | ip_src | Source address in ASCII. NASL will convert it into an integer in network order. |
[in] | ip_dst | Destination address in ASCII. NASL will convert it into an integer in network order. Uses the target ip of the current plugin by default. |
[in] | ip_sum | Packet header checksum. It will be computed by default. |
[in] | ip_tos | Type of service field. 0 by default |
[in] | ip_ttl | Time To Live field. 64 by default. |
[in] | ip_v | IP version. 4 by default. |
Fills an IP datagram with TCP data. Note that the ip_p field is not updated. It returns the modified IP datagram. Its arguments are:
[in] | ip | IP datagram to be filled. |
[in] | data | TCP data payload. |
[in] | th_ack | Acknowledge number. NASL will convert it into network order if necessary. 0 by default. |
[in] | th_dport | Destination port. NASL will convert it into network order if necessary. 0 by default. |
[in] | th_flags | TCP flags. 0 by default. |
[in] | th_off | Size of the TCP header in 32 bits words. By default, 5. |
[in] | th_seq | TCP sequence number. NASL will convert it into network order if necessary. Random by default. |
[in] | th_sport | Source port. NASL will convert it into network order if necessary. 0 by default. |
[in] | th_sum | TCP checksum. Right value is computed by default. |
[in] | th_urp | Urgent pointer. 0 by default. |
[in] | th_win | TCP window size. NASL will convert it into network order if necessary. 0 by default. |
[in] | th_x2 | Is a reserved field and should probably be left unchanged. 0 by default. |
[in] | update_ip_len | Flag (TRUE by default). If set, NASL will recompute the size field of the IP datagram. |
Fills an IP datagram with UDP data. Note that the ip_p field is not updated. It returns the modified IP datagram. Its arguments are:
[in] | ip | IP datagram to be filled. |
[in] | data | Payload. |
[in] | uh_dport | Destination port. NASL will convert it into network order if necessary. 0 by default. |
[in] | uh_sport | Source port. NASL will convert it into network order if necessary. 0 by default. |
[in] | uh_sum | UDP checksum. Although it is not compulsory, the right value is computed by default. |
[in] | uh_ulen | Data length. By default it is set to the length of the data argument plus the size of the UDP header. |
[in] | update_ip_len | Flag (TRUE by default). If set, NASL will recompute the size field of the IP datagram. |
Get an ICMP element from a IP datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | icmp | Full IP datagram (IP + ICMP). |
[in] | element | Name of the TCP field (see forge_tcp_packet()). |
Extracts a field from an IP datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | element | Name of the field, e.g. "ip_len" or "ip_src". |
[in] | ip | IP datagram or fragment. |
Extracts TCP field from an IP datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | element | Name of the the TCP field. See forge_tcp_packet(). |
[in] | tcp | The full IP datagram (IP + TCP). |
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.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | tcp | The full IP datagram (IP + TCP). |
[in] | option | Option to get. |
Get an UDP element from a IP datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | udp | The full IP datagram (IP + UDP). |
[in] | element | Name of the UDP field (see forge_udp_packet()). |
Add option datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ip | IP datagram to add the option to. |
[in] | code | Number of the option. |
[in] | length | Length of the option data. |
[in] | value | Option data. |
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.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | tcp | IP datagram. |
[in] | data | (optional) TCP data payload. |
[in] | unnamed | option. |
[in] | Value | for unnamed option if required. |
Listen to one packet and return it.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | interface | Network interface name. By default, NASL will try to find the best one. |
[in] | pcap_filter | BPF filter. By default, it listens to everything. |
[in] | timeout | 5 seconds by default. |
Send a capture.
[in] | interface | string |
[in] | pcap | filter string |
[in] | timeout | integer |
Send a list of packets (passed as unnamed arguments) and listens to the answers. It returns a block made of all the sniffed âanswersâ.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ... | Packets to send. |
[in] | length | Length of each packet by default. |
[in] | pcap_active | TRUE by default. Otherwise, NASL does not listen for the answers. |
[in] | pcap_filter | BPF filter. |
[in] | pcap_timeout | Capture timeout. 5 by default. |
[in] | allow_broadcast | Default 0. |
Lunches a âTCP pingâ against the target host.
Tries to open a TCP connection and sees if anything comes back (SYN/ACK or RST).
[in] | lexic | Lexical context of NASL interpreter. |
[in] | port | Port to ping. Internal list of common ports is used as default. |
Modify the fields of a datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | ip | IP datagram to set fields on. |
[in] | ip_hl | IP header length in 32 bits words. 5 by default. |
[in] | ip_id | Datagram ID. Random by default. |
[in] | ip_len | Length of the datagram. 20 plus the length of the data field by default. |
[in] | ip_off | Fragment offset in 64 bits words. 0 by default. |
[in] | ip_p | IP protocol. 0 by default. |
[in] | ip_src | Source address in ASCII. NASL will convert it into an integer in network order. |
[in] | ip_sum | Packet header checksum. It will be computed by default. |
[in] | ip_tos | Type of service field. 0 by default |
[in] | ip_ttl | Time To Live field. 64 by default. |
[in] | ip_v | IP version. 4 by default. |
Modify the TCP fields of a datagram.
[in] | lexic | Lexical context of NASL interpreter. |
[in] | tcp | IP datagram. |
[in] | data | TCP data payload. |
[in] | th_ack | Acknowledge number. NASL will convert it into network order if necessary. |
[in] | th_dport | Destination port. NASL will convert it into network order if necessary. |
[in] | th_flags | TCP flags. |
[in] | th_off | Size of the TCP header in 32 bits words. |
[in] | th_seq | TCP sequence number. NASL will convert it into network order if necessary. |
[in] | th_sport | Source port. NASL will convert it into network order if necessary. |
[in] | th_sum | TCP checksum. |
[in] | th_urp | Urgent pointer. |
[in] | th_win | TCP window size. NASL will convert it into network order if necessary. |
[in] | th_x2 | Is a reserved field and should probably be left unchanged. |
[in] | update_ip_len | Flag (TRUE by default). If set, NASL will recompute the size field of the IP datagram. |
Modify UDP fields of an IP datagram.
[in] | udp | IP datagram to modify. |
[in] | data | Payload. |
[in] | uh_dport | Destination port. NASL will convert it into network order if necessary. |
[in] | uh_sport | Source port. NASL will convert it into network order if necessary. |
[in] | uh_sum | UDP checksum. |
[in] | uh_ulen | Data length. |