OpenVAS Scanner
21.4.1
|
Header file for module plugutils. More...
Go to the source code of this file.
Macros | |
#define | ARG_STRING 1 |
#define | ARG_INT 2 |
#define | post_alarm_tcp post_alarm |
#define | post_error_tcp post_error |
#define | post_log_tcp post_log |
Functions | |
void | scanner_add_port (struct script_infos *, int, char *) |
void | plug_set_dep (struct script_infos *, const char *) |
void | plug_set_ssl_cert (struct script_infos *, char *) |
void | plug_set_ssl_key (struct script_infos *, char *) |
void | plug_set_ssl_pem_password (struct script_infos *, char *) |
void | plug_set_ssl_CA_file (struct script_infos *, char *) |
const char * | plug_current_vhost (void) |
char * | plug_get_host_fqdn (struct script_infos *) |
int | plug_add_host_fqdn (struct script_infos *, const char *, const char *) |
GSList * | plug_get_host_fqdn_list (struct script_infos *) |
char * | plug_get_host_source (struct script_infos *, const char *) |
unsigned int | plug_get_host_open_port (struct script_infos *desc) |
void | plug_set_port_transport (struct script_infos *, int, int) |
int | plug_get_port_transport (struct script_infos *, int) |
struct script_infos * | plug_create_from_nvti_and_prefs (const nvti_t *) |
void | proto_post_alarm (const char *, struct script_infos *, int, const char *, const char *, const char *) |
void | post_alarm (const char *, struct script_infos *, int, const char *, const char *) |
void | post_alarm_udp (struct script_infos *, int, const char *, const char *) |
void | proto_post_error (const char *, struct script_infos *, int, const char *, const char *, const char *) |
void | post_error (const char *, struct script_infos *, int, const char *, const char *) |
void | proto_post_log (const char *, struct script_infos *, int, const char *, const char *, const char *) |
Post a log message. More... | |
void | post_log (const char *, struct script_infos *, int, const char *) |
Post a log message about a tcp port. More... | |
void | post_log_with_uri (const char *, struct script_infos *, int, const char *, const char *) |
Post a log message about a tcp port with a uri. More... | |
int | host_get_port_state (struct script_infos *, int) |
int | host_get_port_state_udp (struct script_infos *, int) |
void | plug_set_key (struct script_infos *, char *, int, const void *) |
void | plug_set_key_len (struct script_infos *, char *, int, const void *, size_t) |
void | plug_replace_key (struct script_infos *, char *, int, void *) |
void | plug_replace_key_len (struct script_infos *, char *, int, void *, size_t) |
kb_t | plug_get_kb (struct script_infos *) |
kb_t | plug_get_results_kb (struct script_infos *) |
void * | plug_get_key (struct script_infos *, char *, int *, size_t *, int) |
Get values from a kb under the given key name. More... | |
struct in6_addr * | plug_get_host_ip (struct script_infos *) |
char * | plug_get_host_ip_str (struct script_infos *) |
char * | get_plugin_preference (const char *, const char *, int) |
Get the a plugins preference. More... | |
const char * | get_plugin_preference_fname (struct script_infos *, const char *) |
Get the file name of a plugins preference that is of type "file". More... | |
char * | get_plugin_preference_file_content (struct script_infos *, const char *) |
Get the file contents of a plugins preference that is of type "file". More... | |
long | get_plugin_preference_file_size (struct script_infos *, const char *) |
Get the file size of a plugins preference that is of type "file". More... | |
Header file for module plugutils.
#define ARG_INT 2 |
#define ARG_STRING 1 |
#define post_alarm_tcp post_alarm |
#define post_error_tcp post_error |
#define post_log_tcp post_log |
char* get_plugin_preference | ( | const char * | oid, |
const char * | name, | ||
int | pref_id | ||
) |
Get the a plugins preference.
Search in the preferences set by the client. If it is not present, search in redis cache for the default.
[in] | oid | Script OID to get the preference from |
[in] | name | Name of the preference to get |
[in] | pref_id | Id of the preferences to get |
char* get_plugin_preference_file_content | ( | struct script_infos * | 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. |
identifier
, NULL if not found or setup broken. long get_plugin_preference_file_size | ( | struct script_infos * | 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. |
identifier
, -1 if not found or setup broken. const char* get_plugin_preference_fname | ( | struct script_infos * | 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.
filename
, NULL if not found or setup broken. int host_get_port_state | ( | struct script_infos * | plugdata, |
int | portnum | ||
) |
int host_get_port_state_udp | ( | struct script_infos * | plugdata, |
int | portnum | ||
) |
int plug_add_host_fqdn | ( | struct script_infos * | args, |
const char * | hostname, | ||
const char * | source | ||
) |
struct script_infos* plug_create_from_nvti_and_prefs | ( | const nvti_t * | ) |
const char* plug_current_vhost | ( | void | ) |
char* plug_get_host_fqdn | ( | struct script_infos * | args | ) |
GSList* plug_get_host_fqdn_list | ( | struct script_infos * | args | ) |
struct in6_addr* plug_get_host_ip | ( | struct script_infos * | args | ) |
char* plug_get_host_ip_str | ( | struct script_infos * | desc | ) |
unsigned int plug_get_host_open_port | ( | struct script_infos * | 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...
char* plug_get_host_source | ( | struct script_infos * | args, |
const char * | hostname | ||
) |
kb_t plug_get_kb | ( | struct script_infos * | args | ) |
void* plug_get_key | ( | struct script_infos * | args, |
char * | name, | ||
int * | type, | ||
size_t * | len, | ||
int | single | ||
) |
Get values from a kb under the given key name.
[in] | args | The script infos where to get the kb from. |
[in] | name | Key name to search in the kb. |
[in/out] | type If 1 is given, the answer is forced to be KB_TYPE_INT type. Otherwise it returns the fetched type. | |
[in] | len | Desired string length to be returned. |
[in] | single | In case of a list, fetch only the last element |
int plug_get_port_transport | ( | struct script_infos * | args, |
int | port | ||
) |
kb_t plug_get_results_kb | ( | struct script_infos * | args | ) |
void plug_replace_key | ( | struct script_infos * | args, |
char * | name, | ||
int | type, | ||
void * | value | ||
) |
void plug_replace_key_len | ( | struct script_infos * | args, |
char * | name, | ||
int | type, | ||
void * | value, | ||
size_t | len | ||
) |
void plug_set_dep | ( | struct script_infos * | args, |
const char * | depname | ||
) |
void plug_set_key | ( | struct script_infos * | args, |
char * | name, | ||
int | type, | ||
const void * | value | ||
) |
void plug_set_key_len | ( | struct script_infos * | args, |
char * | name, | ||
int | type, | ||
const void * | value, | ||
size_t | len | ||
) |
void plug_set_port_transport | ( | struct script_infos * | args, |
int | port, | ||
int | tr | ||
) |
void plug_set_ssl_CA_file | ( | struct script_infos * | args, |
char * | key | ||
) |
void plug_set_ssl_cert | ( | struct script_infos * | args, |
char * | cert | ||
) |
void plug_set_ssl_key | ( | struct script_infos * | args, |
char * | key | ||
) |
void plug_set_ssl_pem_password | ( | struct script_infos * | args, |
char * | key | ||
) |
void post_alarm | ( | const char * | oid, |
struct script_infos * | desc, | ||
int | port, | ||
const char * | action, | ||
const char * | uri | ||
) |
void post_alarm_udp | ( | struct script_infos * | , |
int | , | ||
const char * | , | ||
const char * | |||
) |
void post_error | ( | const char * | oid, |
struct script_infos * | desc, | ||
int | port, | ||
const char * | action, | ||
const char * | uri | ||
) |
void post_log | ( | const char * | oid, |
struct script_infos * | desc, | ||
int | port, | ||
const char * | action | ||
) |
Post a log message about a tcp port.
void post_log_with_uri | ( | const char * | oid, |
struct script_infos * | desc, | ||
int | port, | ||
const char * | action, | ||
const char * | uri | ||
) |
Post a log message about a tcp port with a uri.
void proto_post_alarm | ( | const char * | oid, |
struct script_infos * | desc, | ||
int | port, | ||
const char * | proto, | ||
const char * | action, | ||
const char * | uri | ||
) |
void proto_post_error | ( | const char * | oid, |
struct script_infos * | desc, | ||
int | port, | ||
const char * | proto, | ||
const char * | action, | ||
const char * | uri | ||
) |
void proto_post_log | ( | const char * | oid, |
struct script_infos * | desc, | ||
int | port, | ||
const char * | proto, | ||
const char * | action, | ||
const char * | uri | ||
) |
Post a log message.
void scanner_add_port | ( | struct script_infos * | args, |
int | port, | ||
char * | proto | ||
) |