OpenVAS Scanner
6.0.0~git
|
Launches the plugins, and manages multithreading. More...
#include "attack.h"
#include "../misc/network.h"
#include "../misc/nvt_categories.h"
#include "../misc/pcap_openvas.h"
#include "../nasl/nasl_debug.h"
#include "comm.h"
#include "hosts.h"
#include "pluginlaunch.h"
#include "pluginload.h"
#include "pluginscheduler.h"
#include "plugs_req.h"
#include "processes.h"
#include "sighand.h"
#include "utils.h"
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <glib.h>
#include <gvm/base/hosts.h>
#include <gvm/base/networking.h>
#include <gvm/base/prefs.h>
#include <gvm/base/proctitle.h>
#include <gvm/util/nvticache.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
Data Structures | |
struct | attack_start_args |
Macros | |
#define | ERR_HOST_DEAD -1 |
#define | ERR_CANT_FORK -2 |
#define | MAX_FORK_RETRIES 10 |
#define | PROGRESS_BAR_STYLE 1 |
#define | G_LOG_DOMAIN "sd main" |
GLib log domain. More... | |
Enumerations | |
enum | net_scan_status { NSS_NONE = 0, NSS_BUSY, NSS_DONE } |
Functions | |
static int | set_kb_readable (int host_kb_index) |
Add the Host KB index to the list of readable KBs used by ospd-openvas. More... | |
static int | comm_send_status (kb_t kb, char *hostname, int curr, int max) |
Sends the status of a host's scan. More... | |
static void | error_message_to_client (int soc, const char *msg, const char *hostname, const char *port) |
static void | error_message_to_client2 (kb_t kb, const char *msg, const char *port) |
static void | report_kb_failure (int soc, int errcode) |
static void | fork_sleep (int n) |
static enum net_scan_status | network_scan_status (struct scan_globals *globals) |
static int | scan_is_stopped () |
static int | all_scans_are_stopped () |
static int | nvti_category_is_safe (int category) |
Checks that an NVT category is safe. More... | |
static int | launch_plugin (struct scan_globals *globals, struct scheduler_plugin *plugin, struct in6_addr *ip, GSList *vhosts, kb_t kb) |
Launches a nvt. Respects safe check preference (i.e. does not try. More... | |
static int | kb_duplicate (kb_t dst, kb_t src, const gchar *filter) |
static kb_t | init_host_kb (struct scan_globals *globals, char *ip_str, kb_t *network_kb) |
Inits or loads the knowledge base for a single host. More... | |
static void | check_new_vhosts () |
Check if a plugin process pushed a new vhost value. More... | |
static void | attack_host (struct scan_globals *globals, struct in6_addr *ip, GSList *vhosts, plugins_scheduler_t sched, kb_t kb, kb_t *net_kb) |
Attack one host. More... | |
static int | host_authorized (const gvm_host_t *host, const struct in6_addr *addr, const gvm_hosts_t *hosts_allow, const gvm_hosts_t *hosts_deny) |
static char * | vhosts_to_str (GSList *list) |
static int | check_host_authorization (gvm_host_t *host, const struct in6_addr *addr, kb_t kb) |
static void | attack_start (struct attack_start_args *args) |
Set up some data and jump into attack_host() More... | |
static void | apply_hosts_preferences (gvm_hosts_t *hosts) |
static int | str_in_comma_list (const char *str, const char *comma_list) |
static int | iface_authorized (const char *iface) |
static int | apply_source_iface_preference (int soc) |
static int | check_kb_access (int soc) |
static void | handle_scan_stop_signal () |
static void | handle_stop_all_scans_signal () |
void | attack_network (struct scan_globals *globals, kb_t *network_kb) |
Attack a whole network. More... | |
Variables | |
int | global_scan_stop = 0 |
int | global_stop_all_scans = 0 |
static kb_t | host_kb = NULL |
static GSList * | host_vhosts = NULL |
Launches the plugins, and manages multithreading.
#define ERR_CANT_FORK -2 |
#define ERR_HOST_DEAD -1 |
#define G_LOG_DOMAIN "sd main" |
GLib log domain.
#define MAX_FORK_RETRIES 10 |
#define PROGRESS_BAR_STYLE 1 |
It switches progress bar styles. If set to 1, time oriented style and it take into account only alive host. If set to 0, it not reflect progress adequately in case of dead host, which will take into account with 0% processed, producing jumps in the process bar.
enum net_scan_status |
|
static |
|
static |
|
static |
|
static |
Attack one host.
void attack_network | ( | struct scan_globals * | globals, |
kb_t * | network_kb | ||
) |
Attack a whole network.
|
static |
Set up some data and jump into attack_host()
|
static |
|
static |
|
static |
Check if a plugin process pushed a new vhost value.
kb | Host scan KB. |
vhosts | List of vhosts to add new vhosts to. |
|
static |
Sends the status of a host's scan.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Inits or loads the knowledge base for a single host.
Fills the knowledge base with host-specific login information for local checks if defined.
globals | Global preference struct. |
ip_str | IP string of target host. |
|
static |
|
static |
Launches a nvt. Respects safe check preference (i.e. does not try.
destructive nvt if save_checks is yes).
Does not launch a plugin twice if !save_kb_replay.
|
static |
|
static |
Checks that an NVT category is safe.
category | Category to check. |
|
static |
|
static |
|
static |
Add the Host KB index to the list of readable KBs used by ospd-openvas.
|
static |
|
static |
int global_scan_stop = 0 |
int global_stop_all_scans = 0 |
|
static |
|
static |