OpenVAS Libraries
9.0.3
|
#include <arpa/inet.h>
#include <ctype.h>
#include <pcap.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include "../misc/bpf_share.h"
#include "../misc/pcap_openvas.h"
#include "../misc/plugutils.h"
#include "nasl_raw.h"
#include "nasl_tree.h"
#include "nasl_global_ctxt.h"
#include "nasl_func.h"
#include "nasl_var.h"
#include "nasl_lex_ctxt.h"
#include "exec.h"
#include "nasl_socket.h"
#include "nasl_debug.h"
#include "capture_packet.h"
#include "nasl_packet_forgery.h"
#include "nasl_packet_forgery_v6.h"
Go to the source code of this file.
Data Structures | |
struct | pseudohdr |
struct | pseudo_udp_hdr |
struct | igmp |
Macros | |
#define | FIX(n) htons(n) |
#define | UNFIX(n) ntohs(n) |
#define | rnd_tcp_port() (rand() % 65535 + 1024) |
Functions | |
tree_cell * | forge_ip_packet (lex_ctxt *lexic) |
tree_cell * | get_ip_element (lex_ctxt *lexic) |
tree_cell * | set_ip_elements (lex_ctxt *lexic) |
tree_cell * | insert_ip_options (lex_ctxt *lexic) |
tree_cell * | dump_ip_packet (lex_ctxt *lexic) |
tree_cell * | forge_tcp_packet (lex_ctxt *lexic) |
tree_cell * | get_tcp_element (lex_ctxt *lexic) |
tree_cell * | set_tcp_elements (lex_ctxt *lexic) |
tree_cell * | dump_tcp_packet (lex_ctxt *lexic) |
tree_cell * | forge_udp_packet (lex_ctxt *lexic) |
tree_cell * | get_udp_element (lex_ctxt *lexic) |
tree_cell * | set_udp_elements (lex_ctxt *lexic) |
tree_cell * | dump_udp_packet (lex_ctxt *lexic) |
tree_cell * | forge_icmp_packet (lex_ctxt *lexic) |
tree_cell * | get_icmp_element (lex_ctxt *lexic) |
tree_cell * | forge_igmp_packet (lex_ctxt *lexic) |
tree_cell * | nasl_tcp_ping (lex_ctxt *lexic) |
tree_cell * | nasl_send_packet (lex_ctxt *lexic) |
tree_cell * | nasl_pcap_next (lex_ctxt *lexic) |
tree_cell * | nasl_send_capture (lex_ctxt *lexic) |
#define FIX | ( | n | ) | htons(n) |
Definition at line 54 of file nasl_packet_forgery.c.
#define rnd_tcp_port | ( | ) | (rand() % 65535 + 1024) |
#define UNFIX | ( | n | ) | ntohs(n) |
Definition at line 55 of file nasl_packet_forgery.c.
Definition at line 404 of file nasl_packet_forgery.c.
References FAKE_CELL, get_str_var_by_num(), and UNFIX.
Definition at line 742 of file nasl_packet_forgery.c.
References get_str_var_by_num(), get_var_size_by_num(), and UNFIX.
Definition at line 1115 of file nasl_packet_forgery.c.
References get_str_var_by_num(), and get_var_size_by_num().
Definition at line 1146 of file nasl_packet_forgery.c.
References FIX, get_int_local_var_by_name(), get_local_var_size_by_name(), get_str_local_var_by_name(), get_var_size_by_name(), and UNFIX.
Definition at line 1300 of file nasl_packet_forgery.c.
References FIX, get_int_local_var_by_name(), get_local_var_size_by_name(), get_str_local_var_by_name(), and UNFIX.
Definition at line 99 of file nasl_packet_forgery.c.
References alloc_tree_cell(), CONST_DATA, FIX, get_int_local_var_by_name(), get_local_var_size_by_name(), get_str_local_var_by_name(), plug_get_host_ip(), struct_lex_ctxt::script_infos, TC::size, TC::str_val, TC::type, and TC::x.
Definition at line 461 of file nasl_packet_forgery.c.
References alloc_tree_cell(), CONST_DATA, FIX, get_int_local_var_by_name(), get_local_var_size_by_name(), get_str_local_var_by_name(), get_var_size_by_name(), nasl_perror(), TC::str_val, TC::type, UNFIX, and TC::x.
Definition at line 840 of file nasl_packet_forgery.c.
References pseudohdr::daddr, get_int_local_var_by_name(), get_local_var_size_by_name(), get_str_local_var_by_name(), and pseudohdr::saddr.
Definition at line 1218 of file nasl_packet_forgery.c.
References alloc_tree_cell(), CONST_DATA, CONST_INT, get_str_local_var_by_name(), get_var_size_by_name(), TC::i_val, TC::size, TC::str_val, TC::type, and TC::x.
Definition at line 168 of file nasl_packet_forgery.c.
References alloc_tree_cell(), CONST_DATA, CONST_INT, get_str_local_var_by_name(), TC::i_val, nasl_perror(), TC::size, TC::str_val, TC::type, UNFIX, and TC::x.
Definition at line 557 of file nasl_packet_forgery.c.
References alloc_tree_cell(), CONST_DATA, CONST_INT, get_local_var_size_by_name(), get_str_local_var_by_name(), TC::i_val, nasl_perror(), TC::size, TC::str_val, TC::type, UNFIX, and TC::x.
Definition at line 930 of file nasl_packet_forgery.c.
References alloc_tree_cell(), CONST_DATA, CONST_INT, get_local_var_size_by_name(), get_str_local_var_by_name(), TC::i_val, TC::size, TC::str_val, TC::type, and TC::x.
Definition at line 321 of file nasl_packet_forgery.c.
References code, FIX, get_int_local_var_by_name(), get_str_local_var_by_name(), get_var_size_by_name(), nasl_perror(), and UNFIX.
Definition at line 1629 of file nasl_packet_forgery.c.
References alloc_tree_cell(), bpf_close(), bpf_datalink(), bpf_next(), bpf_open_live(), CONST_DATA, get_datalink_size(), get_int_local_var_by_name(), get_str_local_var_by_name(), nasl_perror(), plug_get_host_ip(), routethrough(), TC::size, TC::str_val, timeval(), TC::type, UNFIX, v6_routethrough(), and TC::x.
Definition at line 1765 of file nasl_packet_forgery.c.
References alloc_tree_cell(), bpf_close(), bpf_datalink(), bpf_next(), bpf_open_live(), CONST_DATA, get_datalink_size(), get_int_local_var_by_name(), get_str_local_var_by_name(), nasl_perror(), nasl_send(), plug_get_host_ip(), routethrough(), TC::size, TC::str_val, timeval(), TC::type, UNFIX, v6_routethrough(), and TC::x.
Definition at line 1512 of file nasl_packet_forgery.c.
References bpf_close(), FAKE_CELL, get_int_local_var_by_name(), get_str_local_var_by_name(), get_str_var_by_num(), get_var_size_by_num(), init_capture_device(), nasl_perror(), plug_get_host_ip(), and struct_lex_ctxt::script_infos.
Definition at line 1363 of file nasl_packet_forgery.c.
References FIX, get_int_local_var_by_name(), init_capture_device(), islocalhost(), nasl_tcp_v6_ping(), plug_get_host_ip(), plug_get_host_open_port(), rnd_tcp_port, routethrough(), struct_lex_ctxt::script_infos, and timeval().
Referenced by nasl_end_denial(), and nasl_start_denial().
Definition at line 273 of file nasl_packet_forgery.c.
References alloc_tree_cell(), FIX, get_int_local_var_by_name(), get_str_local_var_by_name(), get_var_size_by_name(), nasl_perror(), and UNFIX.
Definition at line 639 of file nasl_packet_forgery.c.
References get_int_local_var_by_name(), get_local_var_size_by_name(), get_str_local_var_by_name(), nasl_perror(), and UNFIX.
Definition at line 999 of file nasl_packet_forgery.c.
References FIX, get_local_var_size_by_name(), and get_str_local_var_by_name().