|
OpenVAS Scanner 23.40.3
|
#include "nasl_lex_ctxt.h"

Go to the source code of this file.
Definition at line 1179 of file nasl_scanner_glue.c.
References post_error(), proto_post_error(), and security_something().

Get the kb index of the host running the current script.
| [in] | lexic | NASL lexer. |
Definition at line 766 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_INT, TC::i_val, script_infos::key, struct_lex_ctxt::script_infos, val, and TC::x.

Definition at line 714 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_DATA, CONST_INT, get_int_var_by_num(), get_str_var_by_num(), TC::i_val, len, plug_get_key(), struct_lex_ctxt::script_infos, TC::size, TC::str_val, TC::type, val, and TC::x.

Definition at line 653 of file nasl_scanner_glue.c.
References add_var_to_array(), alloc_typed_cell(), deref_cell(), DYN_ARRAY, FAKE_CELL, get_str_var_by_num(), nasl_perror(), plug_get_kb(), TC::ref_val, st_nasl_string::s_siz, st_nasl_string::s_val, struct_lex_ctxt::script_infos, st_a_nasl_var::v, st_a_nasl_var::v_int, st_a_nasl_var::v_str, VAR2_DATA, VAR2_INT, st_a_nasl_var::var_type, and TC::x.

Return the OID of the current script.
| [in] | lexic | NASL lexer. |
Definition at line 635 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_DATA, oid, struct_lex_ctxt::oid, TC::size, TC::str_val, and TC::x.

Definition at line 1171 of file nasl_scanner_glue.c.
References post_log_with_uri(), proto_post_log(), and security_something().

Definition at line 1185 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_num(), name, nasl_perror(), TC::size, TC::str_val, and TC::x.

Directly runs a LSC with the given package list and OS release.
This function runs a Notus scan using the provided package list and OS release. As there are currently 2 types of LSC scanner, with different result formats, the result depends on the used scanner type. In case of Notus it returns a list of results in a JSON-like format. If an error occurs, it returns NULL and sets the notus_err variable to the appropriate error code. The error can be gathered using the notus_error function. In case of Skiron, it returns a dictionary with the OIDs and corresponding result messages.
| [in] | lexic | Lexical context of the NASL interpreter. |
Definition at line 1444 of file nasl_scanner_glue.c.
References get_str_var_by_name(), lsc_get_response(), lsc_process_response(), NOTUS, notus_err, notus_type, parse_notus(), parse_skiron(), and advisories::type.

Get the last Notus error as string.
| [in] | lexic | Lexical context of the NASL interpreter. |
Definition at line 1523 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_STR, notus_err, TC::size, TC::str_val, and TC::x.

Get the Notus scan type.
0 for Notus, 1 for Skiron.
| [in] | lexic | Lexical context of the NASL interpreter. |
Definition at line 1502 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_INT, TC::i_val, notus_type, and TC::x.

Definition at line 1601 of file nasl_scanner_glue.c.
References FAKE_CELL, get_int_var_by_name(), get_str_var_by_name(), scanner_add_port(), and struct_lex_ctxt::script_infos.

If the plugin is a port scanner, it needs to report the list of open ports back to openvas scanner, and it also needs to know which ports are to be scanned.
Definition at line 1561 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_INT, get_int_var_by_num(), getpts(), TC::i_val, nasl_perror(), and TC::x.

Definition at line 1617 of file nasl_scanner_glue.c.
References FAKE_CELL.
Communicate to the parent process that LSC data is ready for use in the host kb.
| [in] | lexic | Lexical context of the NASL interpreter. |
Definition at line 1236 of file nasl_scanner_glue.c.
References ARG_STRING, get_str_var_by_name(), script_infos::ipc_context, ipc_data_destroy(), ipc_data_to_json(), ipc_data_type_from_lsc(), IPC_MAIN, ipc_send(), plug_set_key(), and struct_lex_ctxt::script_infos.

Definition at line 1208 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_DATA, TC::size, TC::str_val, vendor_version_get(), and TC::x.

Definition at line 785 of file nasl_scanner_glue.c.
References ARG_INT, ARG_STRING, FAKE_CELL, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), get_var_type_by_name(), len, name, nasl_perror(), plug_replace_key(), plug_replace_key_len(), struct_lex_ctxt::script_infos, and VAR2_INT.

Definition at line 617 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_INT, TC::i_val, and TC::x.
Referenced by plugin_run_openvas_tcp_scanner().


Definition at line 440 of file nasl_scanner_glue.c.
References FAKE_CELL, get_int_var_by_name(), get_str_var_by_name(), name, nasl_perror(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 260 of file nasl_scanner_glue.c.
References FAKE_CELL, get_int_var_by_num(), nasl_perror(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 253 of file nasl_scanner_glue.c.
References FAKE_CELL.
Definition at line 117 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 284 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), nasl_perror(), plug_set_dep(), and struct_lex_ctxt::script_infos.

Definition at line 381 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), nasl_perror(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 277 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Get a preferences of the current script.
Search the preference by preference name or by preferences id.
| [in] | lexic | NASL lexer. |
Definition at line 497 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_DATA, CONST_INT, FAKE_CELL, get_int_var_by_name(), get_plugin_preference(), get_str_var_by_num(), TC::i_val, isalldigit(), nasl_perror(), struct_lex_ctxt::oid, TC::size, TC::str_val, TC::type, and TC::x.

Definition at line 534 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_DATA, FAKE_CELL, get_plugin_preference(), get_plugin_preference_file_content(), get_plugin_preference_file_size(), get_str_var_by_num(), nasl_perror(), struct_lex_ctxt::oid, struct_lex_ctxt::script_infos, TC::size, TC::str_val, and TC::x.

Definition at line 578 of file nasl_scanner_glue.c.
References alloc_typed_cell(), CONST_DATA, get_plugin_preference(), get_plugin_preference_fname(), get_str_var_by_num(), len, nasl_perror(), struct_lex_ctxt::oid, struct_lex_ctxt::script_infos, TC::size, TC::str_val, and TC::x.

Definition at line 334 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_name(), get_str_var_by_num(), nasl_perror(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 239 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), script_infos::nvti, and struct_lex_ctxt::script_infos.
Referenced by nasl_perror(), and nasl_trace().


Definition at line 110 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 310 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), nasl_perror(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 404 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 422 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_num(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 199 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_name(), name, nasl_perror(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Add timeout preference to VT preferences.
VT timeout is handled as normal VT preference. Because of backward compatibility issues the timeout preference is always located at the VT pref location with id NVTPREF_TIMEOUT_ID.
| [in] | lexic | lexic |
| [in] | to | script timeout |
Definition at line 92 of file nasl_scanner_glue.c.
References FAKE_CELL, get_int_var_by_num(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Definition at line 246 of file nasl_scanner_glue.c.
References FAKE_CELL.
Add a cross reference to the meta data.
The parameter "name" of the command defines actually the type, for example "URL" or "OSVDB". The parameter "value" is the actual reference. Alternative to "value", "csv" can be used with a list of comma-separated values.
In fact, if name is "cve", it is equivalent to call script_cve_id(), for example script_cve_id ("CVE-2019-12345"); is identical to script_xref (name: "cve", value: "CVE-2019-12345");
This even works with multiple comma-separated elements like script_xref (name: "cve", csv: "CVE-2019-12345,CVE-2019-54321");
| lexic | The parser context. |
Definition at line 155 of file nasl_scanner_glue.c.
References FAKE_CELL, get_str_var_by_name(), name, nasl_perror(), script_infos::nvti, and struct_lex_ctxt::script_infos.

Send a security message to the client.
| [in] | lexic | NASL lexer. |
Definition at line 1165 of file nasl_scanner_glue.c.
References post_alarm(), proto_post_alarm(), and security_something().

Definition at line 1092 of file nasl_scanner_glue.c.
References FAKE_CELL, get_main_kb(), get_notus_result_message(), get_var_by_name(), get_variable_by_name(), script_infos::ip, kb_item_push_str_with_main_kb_check(), nasl_perror(), NOTUS, notus_type, oid, TC::ref_val, st_nasl_string::s_val, struct_lex_ctxt::script_infos, st_n_nasl_var::u, st_a_nasl_var::v, st_a_nasl_var::v_arr, st_a_nasl_var::v_str, and TC::x.

Set a kb item.
If expire is set the key will be removed after it expired.
| [in] | lexic | NASL lexer. |
| [in] | name | Name of Item. |
| [in] | value | Value of Item. |
| [in] | expire | Optional expire for item in seconds. |
Definition at line 895 of file nasl_scanner_glue.c.
References ARG_INT, ARG_STRING, FAKE_CELL, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), get_var_type_by_name(), len, name, nasl_perror(), plug_set_key(), plug_set_key_len(), struct_lex_ctxt::script_infos, set_kb_item_volatile(), and VAR2_INT.
