OpenVAS Libraries
9.0.3
|
#include "arglists.h"
#include "../base/nvti.h"
#include "../base/openvas_networking.h"
#include "../base/kb.h"
Go to the source code of this file.
Macros | |
#define | LEGACY_OID "1.3.6.1.4.1.25623.1.0." |
#define | post_alarm_tcp post_alarm |
#define | post_error_tcp post_error |
#define | post_log_tcp post_log |
Functions | |
void | scanner_add_port (struct arglist *, int, char *) |
void | plug_set_dep (struct arglist *, const char *) |
void | plug_set_xref (struct arglist *, char *, char *) |
void | plug_set_tag (struct arglist *, char *, char *) |
void | plug_set_ssl_cert (struct arglist *, char *) |
void | plug_set_ssl_key (struct arglist *, char *) |
void | plug_set_ssl_pem_password (struct arglist *, char *) |
void | plug_set_ssl_CA_file (struct arglist *, char *) |
const char * | plug_get_hostname (struct arglist *) |
char * | plug_get_host_fqdn (struct arglist *) |
unsigned int | plug_get_host_open_port (struct arglist *desc) |
void | plug_set_port_transport (struct arglist *, int, int) |
int | plug_get_port_transport (struct arglist *, int) |
struct arglist * | plug_create_from_nvti_and_prefs (const nvti_t *) |
void | proto_post_alarm (const char *, struct arglist *, int, const char *, const char *) |
void | post_alarm (const char *, struct arglist *, int, const char *) |
void | post_alarm_udp (struct arglist *, int, const char *) |
void | proto_post_error (const char *, struct arglist *, int, const char *, const char *) |
void | post_error (const char *, struct arglist *, int, const char *) |
void | proto_post_log (const char *, struct arglist *, int, const char *, const char *) |
Post a log message. More... | |
void | post_log (const char *, struct arglist *, int, const char *) |
Post a log message about a tcp port. More... | |
int | host_get_port_state (struct arglist *, int) |
int | host_get_port_state_udp (struct arglist *, int) |
void | plug_set_key (struct arglist *, char *, int, const void *) |
void | plug_replace_key (struct arglist *, char *, int, void *) |
kb_t | plug_get_kb (struct arglist *) |
void * | plug_get_key (struct arglist *, char *, int *, int) |
struct in6_addr * | plug_get_host_ip (struct arglist *) |
char * | plug_get_host_ip_str (struct arglist *) |
void | add_plugin_preference (struct arglist *, const char *, const char *, const char *) |
char * | get_plugin_preference (const char *, const char *) |
const char * | get_plugin_preference_fname (struct arglist *, const char *) |
Get the file name of a plugins preference that is of type "file". More... | |
char * | get_plugin_preference_file_content (struct arglist *, const char *) |
Get the file contents of a plugins preference that is of type "file". More... | |
long | get_plugin_preference_file_size (struct arglist *, const char *) |
Get the file size of a plugins preference that is of type "file". More... | |
char * | find_in_path (char *, int) |
#define LEGACY_OID "1.3.6.1.4.1.25623.1.0." |
Definition at line 35 of file plugutils.h.
Referenced by script_id().
#define post_alarm_tcp post_alarm |
Definition at line 73 of file plugutils.h.
#define post_error_tcp post_error |
Definition at line 77 of file plugutils.h.
#define post_log_tcp post_log |
Definition at line 81 of file plugutils.h.
void add_plugin_preference | ( | struct arglist * | , |
const char * | , | ||
const char * | , | ||
const char * | |||
) |
Definition at line 465 of file plugutils.c.
References arg_get_value(), name, nvti_add_pref(), and nvtpref_new().
Referenced by script_add_preference().
char* find_in_path | ( | char * | , |
int | |||
) |
Definition at line 1041 of file plugutils.c.
References name.
Referenced by nasl_find_in_path(), and plugin_run_openvas_tcp_scanner().
char* get_plugin_preference | ( | const char * | , |
const char * | |||
) |
Definition at line 476 of file plugutils.c.
References arglist::name, name, arglist::next, nvticache_get_name(), nvticache_get_prefs(), nvticache_initialized(), nvtpref_default(), nvtpref_free(), nvtpref_name(), oid, preferences_get(), and arglist::value.
Referenced by plugin_run_find_service(), script_get_preference(), script_get_preference_file_content(), and script_get_preference_file_location().
char* get_plugin_preference_file_content | ( | struct arglist * | desc, |
const char * | identifier | ||
) |
Get the file contents of a plugins preference that is of type "file".
As files sent to the scanner (e.g. as plugin preference) are stored in a hash table with an identifier supplied by the client as the key, the contents have to be looked up here.
identifier | Identifier that was supplied by the client when the file was uploaded. |
Definition at line 605 of file plugutils.c.
References arg_get_value().
Referenced by get_plugin_preference_fname(), and script_get_preference_file_content().
long get_plugin_preference_file_size | ( | struct arglist * | desc, |
const char * | identifier | ||
) |
Get the file size of a plugins preference that is of type "file".
Files sent to the scanner (e.g. as plugin preference) are stored in a hash table with an identifier supplied by the client as the key. The size of the file is stored in a separate hash table with the same identifier as key, which can be looked up here.
identifier | Identifier that was supplied by the client when the file was uploaded. |
Definition at line 637 of file plugutils.c.
References arg_get_value().
Referenced by get_plugin_preference_fname(), and script_get_preference_file_content().
const char* get_plugin_preference_fname | ( | struct arglist * | desc, |
const char * | filename | ||
) |
Get the file name of a plugins preference that is of type "file".
As files sent to the server (e.g. as plugin preference) are stored at pseudo-random locations with different names, the "real" file name has to be looked up in a hashtable.
Definition at line 551 of file plugutils.c.
References get_plugin_preference_file_content(), get_plugin_preference_file_size(), and log_legacy_write().
Referenced by plugin_run_find_service(), and script_get_preference_file_location().
int host_get_port_state | ( | struct arglist * | , |
int | |||
) |
Definition at line 177 of file plugutils.c.
References host_get_port_state_proto().
Referenced by get_port_state(), and open_sock_option().
int host_get_port_state_udp | ( | struct arglist * | , |
int | |||
) |
Definition at line 183 of file plugutils.c.
References host_get_port_state_proto().
Referenced by get_udp_port_state().
char* plug_get_host_fqdn | ( | struct arglist * | ) |
Definition at line 200 of file plugutils.c.
References arg_get_value(), host_info::fqdn, plug_get_key(), prefs_get(), and host_info::vhosts.
Referenced by get_hostname().
struct in6_addr* plug_get_host_ip | ( | struct arglist * | ) |
Definition at line 216 of file plugutils.c.
References arg_get_value(), and host_info::ip.
Referenced by forge_ip_packet(), forge_ipv6_packet(), get_host_ip(), ids_open_sock_tcp(), nasl_islocalhost(), nasl_islocalnet(), nasl_open_sock_udp(), nasl_pcap_next(), nasl_send_capture(), nasl_send_packet(), nasl_send_v6packet(), nasl_smb_connect(), nasl_target_is_ipv6(), nasl_tcp_ping(), nasl_tcp_v6_ping(), nasl_this_host(), nasl_win_cmd_exec(), nasl_wmi_connect(), nasl_wmi_connect_reg(), nasl_wmi_connect_rsop(), open_sock_option(), plug_get_host_ip_str(), and plugin_run_synscan().
char* plug_get_host_ip_str | ( | struct arglist * | ) |
Definition at line 225 of file plugutils.c.
References addr6_as_str(), and plug_get_host_ip().
Referenced by open_sock_tcp().
unsigned int plug_get_host_open_port | ( | struct arglist * | desc | ) |
Don't always return the first open port, otherwise we might get bitten by OSes doing active SYN flood countermeasures. Also, avoid returning 80 and 21 as open ports, as many transparent proxies are acting for these...
Definition at line 917 of file plugutils.c.
References MAX_CANDIDATES, and plug_get_kb().
Referenced by get_host_open_port(), nasl_start_denial(), nasl_tcp_ping(), and nasl_tcp_v6_ping().
const char* plug_get_hostname | ( | struct arglist * | ) |
Definition at line 190 of file plugutils.c.
References arg_get_value(), and host_info::name.
Referenced by proto_post_wrapped().
Definition at line 710 of file plugutils.c.
References arg_get_value().
Referenced by build_encode_URL(), exec_nasl_script(), get_kb_list(), host_get_port_state_proto(), open_sock_tcp(), plug_get_host_open_port(), plug_get_key(), plug_replace_key(), plug_set_key(), plugin_run_find_service(), and socket_negotiate_ssl().
void* plug_get_key | ( | struct arglist * | , |
char * | , | ||
int * | , | ||
int | |||
) |
Definition at line 767 of file plugutils.c.
References plug_get_kb(), and kb_item::type.
Referenced by get_kb_item(), nasl_open_sock_kdc(), and plug_get_host_fqdn().
int plug_get_port_transport | ( | struct arglist * | , |
int | |||
) |
Definition at line 990 of file plugutils.c.
Referenced by get_port_transport(), and open_stream_auto_encaps_ext().
void plug_replace_key | ( | struct arglist * | , |
char * | , | ||
int | , | ||
void * | |||
) |
Definition at line 681 of file plugutils.c.
References ARG_STRING, name, plug_get_kb(), arglist::type, and arglist::value.
Referenced by replace_kb_item().
void plug_set_dep | ( | struct arglist * | , |
const char * | |||
) |
Definition at line 87 of file plugutils.c.
References arg_get_value(), nvti_dependencies(), and nvti_set_dependencies().
Referenced by script_dependencies().
void plug_set_key | ( | struct arglist * | , |
char * | , | ||
int | , | ||
const void * | |||
) |
Definition at line 658 of file plugutils.c.
References ARG_STRING, name, plug_get_kb(), arglist::type, and arglist::value.
Referenced by host_add_port_proto(), plug_set_port_transport(), plugin_run_synscan(), scan(), and set_kb_item().
void plug_set_port_transport | ( | struct arglist * | args, |
int | port, | ||
int | tr | ||
) |
Definition at line 976 of file plugutils.c.
References ARG_INT, and plug_set_key().
Referenced by open_stream_auto_encaps_ext().
void plug_set_ssl_CA_file | ( | struct arglist * | args, |
char * | key | ||
) |
Definition at line 1035 of file plugutils.c.
Referenced by plugin_run_find_service().
void plug_set_ssl_cert | ( | struct arglist * | , |
char * | |||
) |
Definition at line 1013 of file plugutils.c.
Referenced by plugin_run_find_service().
void plug_set_ssl_key | ( | struct arglist * | , |
char * | |||
) |
Definition at line 1019 of file plugutils.c.
Referenced by plugin_run_find_service().
void plug_set_ssl_pem_password | ( | struct arglist * | , |
char * | |||
) |
Definition at line 1025 of file plugutils.c.
Referenced by plugin_run_find_service().
void plug_set_tag | ( | struct arglist * | , |
char * | , | ||
char * | |||
) |
Definition at line 72 of file plugutils.c.
References arg_get_value(), name, nvti_set_tag(), and nvti_tag().
Referenced by script_tag().
void plug_set_xref | ( | struct arglist * | , |
char * | , | ||
char * | |||
) |
Definition at line 57 of file plugutils.c.
References arg_get_value(), name, nvti_set_xref(), and nvti_xref().
Referenced by script_xref().
void post_alarm | ( | const char * | , |
struct arglist * | , | ||
int | , | ||
const char * | |||
) |
Definition at line 425 of file plugutils.c.
References oid, and proto_post_alarm().
void post_alarm_udp | ( | struct arglist * | , |
int | , | ||
const char * | |||
) |
void post_error | ( | const char * | , |
struct arglist * | , | ||
int | , | ||
const char * | |||
) |
Definition at line 459 of file plugutils.c.
References oid, and proto_post_error().
void post_log | ( | const char * | , |
struct arglist * | , | ||
int | , | ||
const char * | |||
) |
Post a log message about a tcp port.
Definition at line 445 of file plugutils.c.
References oid, and proto_post_log().
void proto_post_alarm | ( | const char * | , |
struct arglist * | , | ||
int | , | ||
const char * | , | ||
const char * | |||
) |
Definition at line 418 of file plugutils.c.
References oid, and proto_post_wrapped().
Referenced by post_alarm().
void proto_post_error | ( | const char * | , |
struct arglist * | , | ||
int | , | ||
const char * | , | ||
const char * | |||
) |
Definition at line 451 of file plugutils.c.
References oid, and proto_post_wrapped().
Referenced by post_error().
void proto_post_log | ( | const char * | , |
struct arglist * | , | ||
int | , | ||
const char * | , | ||
const char * | |||
) |
Post a log message.
Definition at line 435 of file plugutils.c.
References oid, and proto_post_wrapped().
Referenced by post_log().
void scanner_add_port | ( | struct arglist * | , |
int | , | ||
char * | |||
) |
Definition at line 703 of file plugutils.c.
References host_add_port_proto().
Referenced by nasl_scanner_add_port(), sendpacket(), and v6_sendpacket().