|
OpenVAS Scanner 23.23.1
|
#include "openvas.h"#include "../misc/kb_cache.h"#include "../misc/plugutils.h"#include "../misc/scan_id.h"#include "../misc/vendorversion.h"#include "../nasl/nasl_krb5.h"#include "attack.h"#include "debug_utils.h"#include "pluginlaunch.h"#include "processes.h"#include "sighand.h"#include "utils.h"#include <bsd/unistd.h>#include <errno.h>#include <fcntl.h>#include <gcrypt.h>#include <glib.h>#include <gnutls/gnutls.h>#include <grp.h>#include <gvm/base/logging.h>#include <gvm/base/nvti.h>#include <gvm/base/prefs.h>#include <gvm/base/version.h>#include <gvm/util/kb.h>#include <gvm/util/mqtt.h>#include <gvm/util/nvticache.h>#include <gvm/util/uuidutils.h>#include <netdb.h>#include <pwd.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <sys/stat.h>#include <sys/un.h>#include <sys/wait.h>#include <unistd.h>#include "../misc/network.h"Data Structures | |
| struct | openvas_option |
Macros | |
| #define | G_LOG_DOMAIN "sd main" |
| GLib log domain. | |
| #define | PROCTITLE_WAITING "openvas: Waiting for incoming connections" |
| #define | PROCTITLE_LOADING "openvas: Loading Handler" |
| #define | PROCTITLE_RELOADING "openvas: Reloading" |
| #define | PROCTITLE_SERVING "openvas: Serving %s" |
Functions | |
| static void | set_default_openvas_prefs () |
| Set the prefs from the openvas_defaults array. | |
| static void | my_gnutls_log_func (int level, const char *text) |
| static void | set_globals_from_preferences (void) |
| static void | handle_termination_signal (int sig) |
| static void | init_signal_handlers (void) |
| Initializes main scanner process' signal handlers. | |
| static int | overwrite_openvas_prefs_with_prefs_from_client (struct scan_globals *globals) |
| Read the scan preferences from redis. | |
| static int | init_logging () |
| Init logging. | |
| static void | gcrypt_init (void) |
| static void | check_tls () |
| Check TLS. | |
| static void | openvas_print_start_msg () |
| Print start message. | |
| static int | stop_single_task_scan (void) |
| Search in redis the process ID of a running scan and sends it the kill signal SIGUSR1, which will stop the scan. To find the process ID, it uses the scan_id passed with the –scan-stop option. | |
| static void | send_message_to_client_and_finish_scan (const char *msg) |
| Send a failure message and set the scan as finished. | |
| static int | attack_network_init (struct scan_globals *globals, const gchar *config_file) |
| Set up data needed for attack_network(). | |
| int | openvas (int argc, char *argv[], char *env[]) |
| openvas. | |
Variables | |
| int | global_max_hosts = 15 |
| int | global_max_checks = 10 |
| int | global_min_memory = 0 |
| int | global_max_sysload = 0 |
| GSList * | log_config = NULL |
| Logging parameters, as passed to setup_log_handlers. | |
| static volatile int | termination_signal = 0 |
| static openvas_option | openvas_defaults [] |
| Default values for scanner options. Must be NULL terminated. | |
OpenVAS main module, runs the scanner.
| #define G_LOG_DOMAIN "sd main" |
GLib log domain.
| #define PROCTITLE_LOADING "openvas: Loading Handler" |
| #define PROCTITLE_RELOADING "openvas: Reloading" |
| #define PROCTITLE_SERVING "openvas: Serving %s" |
| #define PROCTITLE_WAITING "openvas: Waiting for incoming connections" |
|
static |
Set up data needed for attack_network().
| globals | scan_globals needed for client preference handling. |
| config_file | Used for config preference handling. |
|
static |
Check TLS.
|
static |
|
static |
|
static |
Init logging.
|
static |
Initializes main scanner process' signal handlers.
|
static |
| int openvas | ( | int | argc, |
| char * | argv[], | ||
| char * | env[] ) |
openvas.
| argc | Argument count. |
| argv | Argument vector. |
|
static |
Print start message.
|
static |
Read the scan preferences from redis.
Adds preferences to the global_prefs. If preference already exists in global_prefs they will be overwritten by prefs from client.
| globals | Scan ID of globals used as key to find the corresponding KB where to take the preferences from. Globals also used for file upload. |
|
static |
Send a failure message and set the scan as finished.
| msg | Message to send to the client. |
|
static |
Set the prefs from the openvas_defaults array.
|
static |
|
static |
Search in redis the process ID of a running scan and sends it the kill signal SIGUSR1, which will stop the scan. To find the process ID, it uses the scan_id passed with the –scan-stop option.
| int global_max_checks = 10 |
| int global_max_hosts = 15 |
Globals that should not be touched (used in utils module).
| int global_max_sysload = 0 |
| int global_min_memory = 0 |
| GSList* log_config = NULL |
Logging parameters, as passed to setup_log_handlers.
|
static |
Default values for scanner options. Must be NULL terminated.
Only include options which are dependent on CMake variables. Empty options must be "\0", not NULL, to match the behavior of prefs_init.
|
static |