OpenVAS Scanner
7.0.0~git
|
#include "nasl_packet_forgery.h"
#include "../misc/bpf_share.h"
#include "../misc/pcap_openvas.h"
#include "../misc/plugutils.h"
#include "capture_packet.h"
#include "exec.h"
#include "nasl_debug.h"
#include "nasl_func.h"
#include "nasl_global_ctxt.h"
#include "nasl_lex_ctxt.h"
#include "nasl_packet_forgery_v6.h"
#include "nasl_raw.h"
#include "nasl_socket.h"
#include "nasl_tree.h"
#include "nasl_var.h"
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <pcap.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.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 | |
static int | np_in_cksum (u_short *p, int n) |
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 51 of file nasl_packet_forgery.c.
#define rnd_tcp_port | ( | ) | (rand () % 65535 + 1024) |
#define UNFIX | ( | n | ) | ntohs (n) |
Definition at line 52 of file nasl_packet_forgery.c.
Definition at line 370 of file nasl_packet_forgery.c.
References FAKE_CELL, get_str_var_by_num(), and UNFIX.
Definition at line 688 of file nasl_packet_forgery.c.
References get_str_var_by_num(), get_var_size_by_num(), and UNFIX.
Definition at line 1033 of file nasl_packet_forgery.c.
References get_str_var_by_num(), and get_var_size_by_num().
Definition at line 1063 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, FIX, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), np_in_cksum(), TC::size, TC::str_val, UNFIX, and TC::x.
Definition at line 1194 of file nasl_packet_forgery.c.
References alloc_typed_cell(), igmp::cksum, igmp::code, CONST_DATA, FIX, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), igmp::group, np_in_cksum(), TC::size, TC::str_val, igmp::type, UNFIX, and TC::x.
Definition at line 90 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, FIX, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), np_in_cksum(), plug_get_host_ip(), struct_lex_ctxt::script_infos, TC::size, TC::str_val, and TC::x.
Definition at line 427 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, pseudohdr::daddr, FIX, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), pseudohdr::length, nasl_perror(), np_in_cksum(), pseudohdr::protocol, pseudohdr::saddr, TC::size, TC::str_val, pseudohdr::tcpheader, UNFIX, and TC::x.
Definition at line 784 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, pseudohdr::daddr, FIX, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), np_in_cksum(), pseudohdr::saddr, TC::size, TC::str_val, UNFIX, and TC::x.
Definition at line 1130 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, CONST_INT, get_str_var_by_name(), get_var_size_by_name(), TC::i_val, TC::size, TC::str_val, and TC::x.
Definition at line 156 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, CONST_INT, get_str_var_by_name(), TC::i_val, nasl_perror(), TC::size, TC::str_val, UNFIX, and TC::x.
Definition at line 515 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, CONST_INT, get_str_var_by_name(), get_var_size_by_name(), TC::i_val, nasl_perror(), TC::size, TC::str_val, UNFIX, and TC::x.
Definition at line 867 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, CONST_INT, get_str_var_by_name(), get_var_size_by_name(), TC::i_val, TC::size, TC::str_val, and TC::x.
Definition at line 299 of file nasl_packet_forgery.c.
References alloc_typed_cell(), code, CONST_DATA, FIX, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), np_in_cksum(), TC::size, TC::str_val, UNFIX, and TC::x.
Definition at line 1503 of file nasl_packet_forgery.c.
References alloc_typed_cell(), bpf_close(), bpf_datalink(), bpf_next(), bpf_open_live(), CONST_DATA, get_datalink_size(), get_int_var_by_name(), get_str_var_by_name(), nasl_perror(), plug_get_host_ip(), routethrough(), TC::size, TC::str_val, timeval(), UNFIX, v6_routethrough(), and TC::x.
Definition at line 1634 of file nasl_packet_forgery.c.
References alloc_typed_cell(), bpf_close(), bpf_datalink(), bpf_next(), bpf_open_live(), CONST_DATA, get_datalink_size(), get_int_var_by_name(), get_str_var_by_name(), nasl_perror(), nasl_send(), plug_get_host_ip(), routethrough(), TC::size, TC::str_val, timeval(), UNFIX, v6_routethrough(), and TC::x.
Definition at line 1393 of file nasl_packet_forgery.c.
References alloc_typed_cell(), bpf_close(), capture_next_packet(), CONST_DATA, FAKE_CELL, get_int_var_by_name(), get_str_var_by_name(), get_str_var_by_num(), get_var_size_by_num(), init_capture_device(), islocalhost(), nasl_perror(), np_in_cksum(), plug_get_host_ip(), struct_lex_ctxt::script_infos, TC::size, TC::str_val, and TC::x.
Definition at line 1254 of file nasl_packet_forgery.c.
References alloc_typed_cell(), bpf_close(), bpf_next_tv(), CONST_INT, pseudohdr::daddr, FIX, get_int_var_by_name(), TC::i_val, init_capture_device(), islocalhost(), pseudohdr::length, nasl_tcp_v6_ping(), np_in_cksum(), plug_get_host_ip(), plug_get_host_open_port(), pseudohdr::protocol, rnd_tcp_port, routethrough(), pseudohdr::saddr, struct_lex_ctxt::script_infos, pseudohdr::tcpheader, timeval(), and TC::x.
Referenced by nasl_end_denial(), and nasl_start_denial().
|
static |
Definition at line 61 of file nasl_packet_forgery.c.
Referenced by forge_icmp_packet(), forge_igmp_packet(), forge_ip_packet(), forge_tcp_packet(), forge_udp_packet(), insert_ip_options(), nasl_send_packet(), nasl_tcp_ping(), set_ip_elements(), set_tcp_elements(), and set_udp_elements().
Definition at line 255 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, FIX, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), np_in_cksum(), TC::size, TC::str_val, UNFIX, and TC::x.
Definition at line 592 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, pseudohdr::daddr, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), pseudohdr::length, nasl_perror(), np_in_cksum(), pseudohdr::protocol, pseudohdr::saddr, TC::size, TC::str_val, pseudohdr::tcpheader, UNFIX, and TC::x.
Definition at line 928 of file nasl_packet_forgery.c.
References alloc_typed_cell(), CONST_DATA, pseudohdr::daddr, FIX, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), np_in_cksum(), pseudohdr::saddr, TC::size, TC::str_val, and TC::x.