OpenVAS Libraries
7.0.4
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
#include <time.h>
#include <glib.h>
#include "arglists.h"
#include "kb.h"
#include "network.h"
#include "plugutils.h"
#include "internal_com.h"
#include "system.h"
#include "scanners_utils.h"
#include "../base/nvticache.h"
Macros | |
#define | MAX_CANDIDATES 16 |
Functions | |
char * | addslashes (char *in) |
Escapes \n and \r and \ in <in> properly. The. More... | |
char * | rmslashes (char *in) |
Replaces escape codes (\n, \r) by the real value. More... | |
void | plug_set_xref (struct arglist *desc, char *name, char *value) |
void | plug_set_tag (struct arglist *desc, char *name, char *value) |
void | plug_set_dep (struct arglist *desc, const char *depname) |
void | plug_set_launch (struct arglist *desc, int launch) |
int | plug_get_launch (struct arglist *desc) |
void | _add_plugin_preference (struct arglist *prefs, const char *p_name, const char *name, const char *type, const char *defaul) |
struct arglist * | plug_create_from_nvti_and_prefs (nvti_t *nvti, struct arglist *prefs) |
Returns a (plugin) arglist assembled from the nvti. More... | |
void | host_add_port_proto (struct arglist *args, int portnum, int state, char *proto) |
int | kb_get_port_state_proto (kb_t kb, struct arglist *prefs, int portnum, char *proto) |
int | host_get_port_state_proto (struct arglist *plugdata, int portnum, char *proto) |
int | host_get_port_state (struct arglist *plugdata, int portnum) |
int | host_get_port_state_udp (struct arglist *plugdata, int portnum) |
const char * | plug_get_hostname (struct arglist *desc) |
const char * | plug_get_host_fqdn (struct arglist *desc) |
struct in6_addr * | plug_get_host_ip (struct arglist *desc) |
void | proto_post_wrapped (struct arglist *desc, int port, const char *proto, const char *action, const char *what) |
Post a security message (e.g. LOG, NOTE, WARNING ...). More... | |
void | proto_post_alarm (struct arglist *desc, int port, const char *proto, const char *action) |
void | post_alarm (struct arglist *desc, int port, const char *action) |
void | proto_post_log (struct arglist *desc, int port, const char *proto, const char *action) |
Post a log message. More... | |
void | post_log (struct arglist *desc, int port, const char *action) |
Post a log message about a tcp port. More... | |
void | proto_post_error (struct arglist *desc, int port, const char *proto, const char *action) |
void | post_error (struct arglist *desc, int port, const char *action) |
char * | get_preference (struct arglist *desc, const char *name) |
void | add_plugin_preference (struct arglist *desc, const char *name, const char *type, const char *defaul) |
char * | get_plugin_preference (struct arglist *desc, const char *name) |
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". More... | |
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". More... | |
const 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". More... | |
void * | plug_get_fresh_key (struct arglist *args, char *name, int *type) |
void | plug_set_key (struct arglist *args, char *name, int type, void *value) |
void | plug_replace_key (struct arglist *args, char *name, int type, void *value) |
void | scanner_add_port (struct arglist *args, int port, char *proto) |
kb_t | plug_get_kb (struct arglist *args) |
void * | plug_get_key (struct arglist *args, char *name, int *type) |
unsigned int | plug_get_host_open_port (struct arglist *desc) |
void | plug_set_port_transport (struct arglist *args, int port, int tr) |
int | plug_get_port_transport (struct arglist *args, int port) |
const char * | plug_get_port_transport_name (struct arglist *args, int port) |
void | plug_set_ssl_cert (struct arglist *args, char *cert) |
void | plug_set_ssl_key (struct arglist *args, char *key) |
void | plug_set_ssl_pem_password (struct arglist *args, char *key) |
void | plug_set_ssl_CA_file (struct arglist *args, char *key) |
char * | find_in_path (char *name, int safe) |
Variables | |
int | global_nasl_debug = 0 |
#define MAX_CANDIDATES 16 |
void _add_plugin_preference | ( | struct arglist * | prefs, |
const char * | p_name, | ||
const char * | name, | ||
const char * | type, | ||
const char * | defaul | ||
) |
void add_plugin_preference | ( | struct arglist * | desc, |
const char * | name, | ||
const char * | type, | ||
const char * | defaul | ||
) |
char* addslashes | ( | char * | in | ) |
Escapes \n and \r and \ in <in> properly. The.
resulting string is copied and returned.
in | String in which to escape \n, \r and |
char* find_in_path | ( | char * | name, |
int | safe | ||
) |
char* get_plugin_preference | ( | struct arglist * | desc, |
const char * | name | ||
) |
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. |
const 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. |
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.
char* get_preference | ( | struct arglist * | desc, |
const char * | name | ||
) |
void host_add_port_proto | ( | struct arglist * | args, |
int | portnum, | ||
int | state, | ||
char * | proto | ||
) |
int host_get_port_state | ( | struct arglist * | plugdata, |
int | portnum | ||
) |
int host_get_port_state_proto | ( | struct arglist * | plugdata, |
int | portnum, | ||
char * | proto | ||
) |
int host_get_port_state_udp | ( | struct arglist * | plugdata, |
int | portnum | ||
) |
proto | Protocol (udp/tcp). If NULL, "tcp" will be used. |
Returns a (plugin) arglist assembled from the nvti.
nvti | NVT Information to be used for the creation. |
prefs | Plugin preference arglist that is added to new arglist and where all preferences of the NVTI are copied to as single entries. |
void* plug_get_fresh_key | ( | struct arglist * | args, |
char * | name, | ||
int * | type | ||
) |
const char* plug_get_host_fqdn | ( | struct arglist * | desc | ) |
struct in6_addr* plug_get_host_ip | ( | struct arglist * | desc | ) |
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...
const char* plug_get_hostname | ( | struct arglist * | desc | ) |
void* plug_get_key | ( | struct arglist * | args, |
char * | name, | ||
int * | type | ||
) |
int plug_get_launch | ( | struct arglist * | desc | ) |
int plug_get_port_transport | ( | struct arglist * | args, |
int | port | ||
) |
const char* plug_get_port_transport_name | ( | struct arglist * | args, |
int | port | ||
) |
void plug_replace_key | ( | struct arglist * | args, |
char * | name, | ||
int | type, | ||
void * | value | ||
) |
void plug_set_dep | ( | struct arglist * | desc, |
const char * | depname | ||
) |
void plug_set_key | ( | struct arglist * | args, |
char * | name, | ||
int | type, | ||
void * | value | ||
) |
void plug_set_launch | ( | struct arglist * | desc, |
int | launch | ||
) |
void plug_set_port_transport | ( | struct arglist * | args, |
int | port, | ||
int | tr | ||
) |
void plug_set_ssl_CA_file | ( | struct arglist * | args, |
char * | key | ||
) |
void plug_set_ssl_cert | ( | struct arglist * | args, |
char * | cert | ||
) |
void plug_set_ssl_key | ( | struct arglist * | args, |
char * | key | ||
) |
void plug_set_ssl_pem_password | ( | struct arglist * | args, |
char * | key | ||
) |
void plug_set_tag | ( | struct arglist * | desc, |
char * | name, | ||
char * | value | ||
) |
void plug_set_xref | ( | struct arglist * | desc, |
char * | name, | ||
char * | value | ||
) |
void post_alarm | ( | struct arglist * | desc, |
int | port, | ||
const char * | action | ||
) |
void post_error | ( | struct arglist * | desc, |
int | port, | ||
const char * | action | ||
) |
void post_log | ( | struct arglist * | desc, |
int | port, | ||
const char * | action | ||
) |
Post a log message about a tcp port.
void proto_post_alarm | ( | struct arglist * | desc, |
int | port, | ||
const char * | proto, | ||
const char * | action | ||
) |
void proto_post_error | ( | struct arglist * | desc, |
int | port, | ||
const char * | proto, | ||
const char * | action | ||
) |
void proto_post_log | ( | struct arglist * | desc, |
int | port, | ||
const char * | proto, | ||
const char * | action | ||
) |
Post a log message.
void proto_post_wrapped | ( | struct arglist * | desc, |
int | port, | ||
const char * | proto, | ||
const char * | action, | ||
const char * | what | ||
) |
Post a security message (e.g. LOG, NOTE, WARNING ...).
desc | The arglist where to get the nvtichache from and some other settings and it is used to send the messages |
port | Port number related to the issue. |
proto | Protocol related to the issue (tcp or udp). |
action | The actual result text |
what | The type, like "LOG". |
char* rmslashes | ( | char * | in | ) |
Replaces escape codes (\n, \r) by the real value.
The resulting string is stored in another buffer.
void scanner_add_port | ( | struct arglist * | args, |
int | port, | ||
char * | proto | ||
) |
int global_nasl_debug = 0 |