|
OpenVAS Scanner
7.0.1~git
|
#include "../misc/plugutils.h"#include "../misc/vendorversion.h"#include "attack.h"#include "pluginlaunch.h"#include "processes.h"#include "sighand.h"#include "utils.h"#include <errno.h>#include <fcntl.h>#include <gcrypt.h>#include <glib.h>#include <grp.h>#include <gvm/base/logging.h>#include <gvm/base/nvti.h>#include <gvm/base/prefs.h>#include <gvm/base/proctitle.h>#include <gvm/base/version.h>#include <gvm/util/kb.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"
Go to the source code of this file.
Data Structures | |
| struct | openvas_option |
Macros | |
| #define | G_LOG_DOMAIN "sd main" |
| GLib log domain. More... | |
| #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_globals_from_preferences (void) |
| static void | reload_openvas (void) |
| static void | handle_reload_signal (int sig) |
| static void | handle_termination_signal (int sig) |
| static void | init_signal_handlers () |
| Initializes main scanner process' signal handlers. More... | |
| static int | load_scan_preferences (struct scan_globals *globals) |
| Read the scan preferences from redis @input scan_id Scan ID used as key to find the corresponding KB where to take the preferences from. More... | |
| static void | handle_client (struct scan_globals *globals) |
| static void | scanner_thread (struct scan_globals *globals) |
| static int | init_openvas (const char *config_file) |
| Initialize everything. More... | |
| static int | flush_all_kbs () |
| static void | gcrypt_init () |
| void | start_single_task_scan () |
| static void | stop_single_task_scan () |
| Search in redis the process ID of a running scan and sends it the kill signal SIGUSR2, which will stop the scan. To find the process ID, it uses the scan_id passed with the –scan-stop option. More... | |
| int | openvas (int argc, char *argv[]) |
| openvas. More... | |
Variables | |
| int | global_max_hosts = 15 |
| int | global_max_checks = 10 |
| GSList * | log_config = NULL |
| Logging parameters, as passed to setup_log_handlers. More... | |
| static volatile int | loading_stop_signal = 0 |
| static volatile int | termination_signal = 0 |
| static char * | global_scan_id = NULL |
| static openvas_option | openvas_defaults [] |
| Default values for scanner options. Must be NULL terminated. More... | |
OpenVAS main module, runs the scanner.
Definition in file openvas.c.
| #define PROCTITLE_WAITING "openvas: Waiting for incoming connections" |
|
static |
|
static |
|
static |
Definition at line 284 of file openvas.c.
References attack_network(), load_scan_preferences(), and scan_globals::scan_id.
Referenced by scanner_thread().


|
static |
Definition at line 156 of file openvas.c.
References reload_openvas().
Referenced by init_signal_handlers(), and reload_openvas().


|
static |
Definition at line 163 of file openvas.c.
References termination_signal.
Referenced by init_signal_handlers().

|
static |
Initialize everything.
| config_file | Path to config file for initialization |
Definition at line 321 of file openvas.c.
References log_config, openvas_defaults, openvas_option::option, option, and set_globals_from_preferences().
Referenced by openvas().


|
static |
Initializes main scanner process' signal handlers.
Definition at line 172 of file openvas.c.
References handle_reload_signal(), handle_termination_signal(), openvas_signal, and sighand_chld().
Referenced by start_single_task_scan().


|
static |
Read the scan preferences from redis @input scan_id Scan ID used as key to find the corresponding KB where to take the preferences from.
Definition at line 226 of file openvas.c.
References script_infos::key, scan_globals::scan_id, and store_file().
Referenced by handle_client().


| int openvas | ( | int | argc, |
| char * | argv[] | ||
| ) |
openvas.
| argc | Argument count. |
| argv | Argument vector. |
Definition at line 429 of file openvas.c.
References flush_all_kbs(), gcrypt_init(), global_scan_id, init_openvas(), openvas_signal, openvas_SSL_init(), plugins_init(), scan_globals::scan_id, start_single_task_scan(), stop_single_task_scan(), and vendor_version_set().
Referenced by main().


|
static |
Definition at line 183 of file openvas.c.
References handle_reload_signal(), log_config, openvas_defaults, openvas_signal, openvas_option::option, option, plugins_init(), PROCTITLE_RELOADING, PROCTITLE_WAITING, and set_globals_from_preferences().
Referenced by handle_reload_signal().


|
static |
Definition at line 304 of file openvas.c.
References global_scan_id, handle_client(), and scan_globals::scan_id.
Referenced by start_single_task_scan().


|
static |
Definition at line 133 of file openvas.c.
References global_max_checks, and global_max_hosts.
Referenced by init_openvas(), and reload_openvas().

| void start_single_task_scan | ( | ) |
Definition at line 368 of file openvas.c.
References init_signal_handlers(), openvas_SSL_init(), plugins_cache_init(), and scanner_thread().
Referenced by openvas().


|
static |
Search in redis the process ID of a running scan and sends it the kill signal SIGUSR2, which will stop the scan. To find the process ID, it uses the scan_id passed with the –scan-stop option.
Definition at line 403 of file openvas.c.
References global_scan_id, and pid.
Referenced by openvas().

| int global_max_checks = 10 |
Definition at line 90 of file openvas.c.
Referenced by get_max_checks_number(), and set_globals_from_preferences().
| int global_max_hosts = 15 |
Globals that should not be touched (used in utils module).
Definition at line 89 of file openvas.c.
Referenced by get_max_hosts_number(), and set_globals_from_preferences().
|
static |
Definition at line 99 of file openvas.c.
Referenced by openvas(), scanner_thread(), and stop_single_task_scan().
| GSList* log_config = NULL |
Logging parameters, as passed to setup_log_handlers.
Definition at line 95 of file openvas.c.
Referenced by init_openvas(), and reload_openvas().
|
static |
Default values for scanner options. Must be NULL terminated.
Definition at line 110 of file openvas.c.
Referenced by init_openvas(), and reload_openvas().
|
static |
Definition at line 98 of file openvas.c.
Referenced by handle_termination_signal().