OpenVAS Libraries
8.0.3
|
CVSS utility functions. More...
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
Data Structures | |
struct | impact_item |
Describe a CVSS impact element. More... | |
struct | cvss |
Describe a CVSS metrics. More... | |
Macros | |
#define | AV_NETWORK 1.0 |
#define | AV_ADJACENT_NETWORK 0.646 |
#define | AV_LOCAL 0.395 |
#define | AC_LOW 0.71 |
#define | AC_MEDIUM 0.61 |
#define | AC_HIGH 0.35 |
#define | Au_MULTIPLE_INSTANCES 0.45 |
#define | Au_SINGLE_INSTANCE 0.56 |
#define | Au_NONE 0.704 |
#define | C_NONE 0.0 |
#define | C_PARTIAL 0.275 |
#define | C_COMPLETE 0.660 |
#define | I_NONE 0.0 |
#define | I_PARTIAL 0.275 |
#define | I_COMPLETE 0.660 |
#define | A_NONE 0.0 |
#define | A_PARTIAL 0.275 |
#define | A_COMPLETE 0.660 |
Enumerations | |
enum | base_metrics { A, I, C, Au, AC, AV } |
Functions | |
double | get_cvss_score_from_base_metrics (const char *cvss_str) |
Calculate CVSS Score. More... | |
CVSS utility functions.
This file contains utility functions for handling CVSS. Namels a calculator for the CVSS base score from a CVSS base vector.
The base equation is the foundation of CVSS scoring. The base equation is: BaseScore6 = round_to_1_decimal(((0.6*Impact)+(0.4*Exploitability)–1.5)*f(Impact)) Impact = 10.41*(1-(1-ConfImpact)*(1-IntegImpact)*(1-AvailImpact)) Exploitability = 20* AccessVector*AccessComplexity*Authentication
f(impact)= 0 if Impact=0, 1.176 otherwise AccessVector = case AccessVector of requires local access: 0.395 adjacent network accessible: 0.646 network accessible: 1.0 AccessComplexity = case AccessComplexity of high: 0.35 medium: 0.61 low: 0.71 Authentication = case Authentication of requires multiple instances of authentication: 0.45 requires single instance of authentication: 0.56 requires no authentication: 0.704 ConfImpact = case ConfidentialityImpact of none: 0.0 partial: 0.275 complete: 0.660 IntegImpact = case IntegrityImpact of none: 0.0 partial: 0.275 complete: 0.660 AvailImpact = case AvailabilityImpact of none: 0.0 partial: 0.275 complete: 0.660
#define A_COMPLETE 0.660 |
#define A_NONE 0.0 |
#define A_PARTIAL 0.275 |
#define AC_HIGH 0.35 |
#define AC_LOW 0.71 |
#define AC_MEDIUM 0.61 |
#define Au_MULTIPLE_INSTANCES 0.45 |
#define Au_NONE 0.704 |
#define Au_SINGLE_INSTANCE 0.56 |
#define AV_ADJACENT_NETWORK 0.646 |
#define AV_LOCAL 0.395 |
#define AV_NETWORK 1.0 |
#define C_COMPLETE 0.660 |
#define C_NONE 0.0 |
#define C_PARTIAL 0.275 |
#define I_COMPLETE 0.660 |
#define I_NONE 0.0 |
#define I_PARTIAL 0.275 |
enum base_metrics |
double get_cvss_score_from_base_metrics | ( | const char * | cvss_str | ) |
Calculate CVSS Score.
base_metrics | Base vector string from which to compute score. |