Skip to content

Commit

Permalink
Add: Auto-generated table of content for built-in nasl functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraemii authored and ArnoStiefvater committed Jan 9, 2023
1 parent e5e8293 commit 94b7754
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 68 deletions.
11 changes: 10 additions & 1 deletion doc/manual/nasl/built-in-functions/built-in-plugins/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
\n\n\n\n\n\n










4 changes: 4 additions & 0 deletions doc/manual/nasl/built-in-functions/cert-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
Implementation of an API for X.509 certificates.

## TABLE OF CONTENT

**[cert_close](cert_close.md)** - release a certificate object
**[cert_open](cert_open.md)** - create a certificate object
**[cert_query](cert_query.md)** - query a certificate object
36 changes: 18 additions & 18 deletions doc/manual/nasl/built-in-functions/description-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ All those functions but script_get_preference are only used in the "description

## TABLE OF CONTENT

**script_add_preference** - Adds an option to the plugin.
**script_bugtraq_id** - Removed. Sets the SecurityFocus “bid”.
**script_category sets** - The “category” of the plugin.
**script_copyright** - Deprecated. Kept for backward compatibility. Sets the copyright string of the plugin.
**script_cve_id** - sets the CVE IDs of the flaws tested by the script.
**script_dependencies** - Sets the lists of scripts that should be run before this one (if “optimize mode” is on).
**script_exclude_keys** - sets the list of “KB items” that must not be set to run this script in “optimize mode”.
**script_mandatory_keys** - sets the list of “KB items” that must be set to run this script.
**script_family** - sets the “family” of the plugin. It takes an unnamed string argument.
**script_oid** - sets the script number.
**script_name** - sets the “name” of the plugin.
**script_require_keys** - sets the list of “KB items” that must be set to run this script.
**script_require_ports** - sets the list of TCP ports that must be open to run this script in “optimize mode”.
**script_require_udp_ports** - sets the list of UDP ports that must be open to run this script in “optimize mode”.
**script_timeout** - sets the default timeout of the plugin.
**script_version** - Deprecated. sets the “version” of the plugin.
**script_xref** - URLs related to the script.
**script_tag** - sets additional information.
**[script_add_preference](script_add_preference.md)** - adds an option to the plugin.

**[script_category](script_category.md)** - sets the plugin's category.

**[script_cve_id](script_cve_id.md)** - sets the CVE IDs of the flaws tested by the script.
**[script_dependencies](script_dependencies.md)** - sets the lists of scripts that should be run before this one (if “optimize mode” is on).
**[script_exclude_keys](script_exclude_keys.md)** - sets the list of “KB items” that must not be set to run this script in “optimize mode”.
**[script_family](script_family.md)** - sets the plugin's family.
**[script_mandatory_keys](script_mandatory_keys.md)** - sets the list of “KB items” that must be set to run this script.
**[script_name](script_name.md)** - sets the plugin's name.
**[script_oid](script_oid.md)** - sets the plugin's oid.
**[script_require_keys](script_require_keys.md)** - sets the list of “KB items” that must be set to run this script.
**[script_require_ports](script_require_ports.md)** - sets the list of TCP ports that must be open to run this script in “optimize mode”.
**[script_require_udp_ports](script_require_udp_ports.md)** - sets the list of UDP ports that must be open to run this script in “optimize mode”.
**[script_tag](script_tag.md)** - sets additional information. Takes a named string argument:
**[script_timeout](script_timeout.md)** - sets the default timeout of the plugin.
**[script_version](script_version.md)** - sets the plugin's version.
**[script_xref](script_xref.md)** - Add a cross reference to the meta data.
8 changes: 8 additions & 0 deletions doc/manual/nasl/built-in-functions/host-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@
Host functions are used to get, resolve, compare and add hosts to the vhosts list

## TABLE OF CONTENT

**[add_host_name](add_host_name.md)** - add a host name to the vhost list
**[get_host_names](get_host_names.md)** - get a list with found hostnames
**[get_host_name_source](get_host_name_source.md)** - get the hostname source
**[resolve_host_name](resolve_host_name.md)** - get an IP address corresponding to the host name
**[resolve_hostname_to_multiple_ips](resolve_hostname_to_multiple_ips.md)** - resolve a hostname to all found addresses
**[same_host](same_host.md)** - compare two hosts
**[TARGET_IS_IPV6](TARGET_IS_IPV6.md)** -
17 changes: 8 additions & 9 deletions doc/manual/nasl/built-in-functions/http-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ These functions are mainly used for formating HTTP request, and for opening and

## TABLE OF CONTENT

**cgibin** - Get the cgi-bin path elements.
**http_delete** - formats an HTTP DELETE request for the server on the port.
**http_get** - formats an HTTP GET request for the server on the port.
**http_close_socket** - closes an HTTP socket.
**http_head** - formats an HTTP HEAD request for the server on the port.
**http_open_socket** - opens a socket to the given port.
**http_post** - formats an HTTP POST request for the server on the port.
**http_put** - formats an HTTP PUT request for the server on the port.

**[cgibin](cgibin.md)** - Get the cgi-bin path elements.
**[http_close_socket](http_close_socket.md)** - closes a socket.
**[http_delete](http_delete.md)** - formats an HTTP DELETE request for the server on the port.
**[http_get](http_get.md)** - formats an HTTP DELETE request for the server on the port.
**[http_head](http_head.md)** - formats an HTTP HEAD request for the server on the port.
**[http_open_socket](http_open_socket.md)** - opens a socket.
**[http_post](http_post.md)** - formats an HTTP POST request for the server on the port.
**[http_put](http_put.md)** - formats an HTTP PUT request for the server on the port.
11 changes: 5 additions & 6 deletions doc/manual/nasl/built-in-functions/knowledge-base/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ Knowledge-Base Functions are primarily used for inter-plugin communication.

## TABLE OF CONTENT

**get_host_kb_index** - Get the KB index of the host running the current script
**get_kb_item** - retrieves an entry from the KB
**get_kb_list** - retrieves multiple entries from the KB
**replace_kb_item** - creates a new entry in the KB or replace the old value
**set_kb_item** - creates a new entry in the KB

**[get_host_kb_index](get_host_kb_index.md)** - Get the KB index of the host running the current script
**[get_kb_item](get_kb_item.md)** - retrieves an entry from the KB
**[get_kb_list](get_kb_list.md)** - retrieves multiple entries from the KB
**[replace_kb_item](replace_kb_item.md)** - creates a new entry in the KB or replace the old value
**[set_kb_item](set_kb_item.md)** - creates a new entry in the KB
58 changes: 28 additions & 30 deletions doc/manual/nasl/built-in-functions/network-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,31 @@ In case of error, all those functions returns a value that can be interpreted as

## TABLE OF CONTENT

**close** - closes the socket given in its only unnamed argument.
**end_denial** - takes no argument and returns TRUE if the target host is still alive and FALSE if it is dead. You must have called start_denial before your test.
**ftp_get_pasv_port** - sends the “PASV” command on the open socket, parses the returned data and returns the chosen “passive” port. It takes one named argument: socket.
**get_host_name** - takes no argument and returns the target host name. Forks for every vhost. Although it is internally based on forking execution of a script is NOT parallel.
**get_host_ip** - takes no arguments and returns the target IP address.
**get_host_open_port** - takes no argument and returns an open TCP port on the target host. This function is used by tests that need to speak to the TCP/IP stack but not to a specific service.
**get_port_transport** - takes an unnamed integer (socket) argument and returns its “encapsulation” (see page 23).
**get_port_state** - takes an unnamed integer (TCP port number) and returns TRUE if it is open and FALSE otherwise. As some TCP ports may be in an unknown state because they were not scanned, the behavior of this function may be modified by the “consider unscanned ports as closed” global option. When this option is reset (the default), get_port_state will return TRUE on unknown ports; when it is set, get_port_state will return FALSE.
**get_source_port** - takes an unnamed integer (opn TCP socket) and returns the source port (i.e. on the openvas-scanner host side).
**get_tcp_port_state** - is a synonym for get_port_state.
**get_udp_port_state** - returns TRUE if the UDP port is open, FALSE otherwise (see get_port_state for comments). Note that UDP port scanning may be unreliable.
**islocalhost** - takes no argument and returns TRUE if the target host is the same as the attacking host, FALSE otherwise.
**islocalnet** - takes no argument and returns TRUE if the target host is on the same network as the attacking host, FALSE otherwise.
**join_multicast_group** - takes an string argument (an IP multicast address) and returns TRUE if it could join the multicast group. If the group was already joined, the function joins increments an internal counter
**leave_multicast_group** - takes an string argument (an IP multicast address). Note that if join_multicast_group was called several times, each call to leave_multicast_cast only decrements a counter; the group is left when it reaches 0.
**open_priv_sock_tcp** - opens a “privileged” TCP socket to the target host.
**open_priv_sock_udp** - opens a “privileged” UDP socket to the target host.
**open_sock_tcp** - opens a TCP socket to the target host 22.
**open_sock_udp** - opens a UDP socket to the target host. It takes an unnamed integer argument, the port number.
**recv** - receives data from a TCP or UDP socket.
**recv_line** - receives data from socket and stops as soon as a line feed character has been read, length bytes have been read or the default timeout has been triggered.
**send** - sends data on a socket
**scanner_add_port** - declares an open port to openvas-scanner.
**scanner_get_port** - walks through the list of open ports.
**tcp_ping** - launches a “TCP ping” against the target host.
**telnet_init** - performs a telnet negotiation on an open socket.
**this_host** - takes no argument and returns the IP address of the current (attacking) machine.
**this_host_name** - takes no argument and returns the host name of the current (attacking) machine.
**ftp_log_in** - performs a FTP identification / authentication on an open socket.
**start_denial** - initializes some internal data structure for end_denial. It takes no argument and returns no value.
**[close](close.md)** - [close](close.md)s the given socket.
**[end_denial](end_denial.md)** -
**[ftp_get_pasv_port](ftp_get_pasv_port.md)** - sends the “PASV” command on the open socket, parses the returned data and returns the chosen “passive” port.


**[get_host_name](get_host_name.md)** - [get_host_name](get_host_name.md)s the given socket.
**[get_host_open_port](get_host_open_port.md)** - Get an open TCP port on the target host.
**[get_port_state](get_port_state.md)** - Get a port state.
**[get_port_transport](get_port_transport.md)** - Get the encapsulation used for the given port, if it was previously stored in the kb.
**[get_udp_port_state](get_udp_port_state.md)** - Get a port state.
**[islocalhost](islocalhost.md)** - Check if the target host is the same as the attacking host
**[islocalnet](islocalnet.md)** - Check if the target host is on the same network as the attacking host
**[join_multicast_group](join_multicast_group.md)** - join a multicast group.
**[leave_multicast_group](leave_multicast_group.md)** - leaves a multicast group.




**[recv_line](recv_line.md)** - receives data from a TCP or UDP socket.
**[recv](recv.md)** - receives data from a TCP or UDP socket.
**[scanner_add_port](scanner_add_port.md)** - declares an open port to openvas-scanner.
**[scanner_get_port](scanner_get_port.md)** - walks through the list of open ports

**[start_denial](start_denial.md)** - Initializes some internal data structure for end_denial.
**[tcp_ping](tcp_ping.md)** - Launches a “TCP ping” against the target host.
**[telnet_init](telnet_init.md)** - performs a telnet negotiation on an open socket.
**[this_host](this_host.md)** - get the IP address of the current (attacking) machine.
**[this_host_name](this_host_name.md)** - get the host name of the current (attacking) machine.
8 changes: 4 additions & 4 deletions doc/manual/nasl/built-in-functions/report-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Those functions are used for reporting (send data back to daemon).

## TABLE OF CONTENT

**scanner_status** Remove. Reports the port scan progress (if the plugin is a port scanner!).
**security_message** - reports a severe flaw.
**log_message** - reports a miscellaneous information.
**error_message** - reports an error information.
**[error_message](error_message.md)** - Reports an error information.
**[log_message](log_message.md)** - Reports a miscellaneous information.

**[security_message](security_message.md)** - Reports a severe flaw.
7 changes: 7 additions & 0 deletions doc/manual/nasl/built-in-functions/snmp-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ Simple Network Management Protocol (SNMP) is an Internet Standard protocol for c
SNMP functions are used to get available SNMP devices in the network.

## TABLE OF CONTENT

**[snmpv1_get](snmpv1_get.md)** - get a snmp v1 value query
**[snmpv1_getnext](snmpv1_getnext.md)** - get the next snmp v1 value query based on the last value
**[snmpv2c_get](snmpv2c_get.md)** - get a snmp v2c value query
**[snmpv2c_getnext](snmpv2c_getnext.md)** - get the next snmp v2c value query based on the last value
**[snmpv3_get](snmpv3_get.md)** - get a snmp v3 value query
**[snmpv3_getnext](snmpv3_getnext.md)** - get the next snmp v3 value query based on the last value
18 changes: 18 additions & 0 deletions doc/manual/nasl/built-in-functions/ssh-functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,21 @@ Used for SSH connections and interactions

## TABLE OF CONTENT


**[ssh_connect](ssh_connect.md)** - connect ot the target via TCP and setup an SSH connection
**[ssh_disconnect](ssh_disconnect.md)** - disconnect an open SSH connection
**[ssh_get_auth_methods](ssh_get_auth_methods.md)** - get list of supported authentication schemes
**[ssh_get_host_key](ssh_get_host_key.md)** - get the host key
**[ssh_get_issue_banner](ssh_get_issue_banner.md)** - get the issue banner
**[ssh_get_server_banner](ssh_get_server_banner.md)** - get the server banner
**[ssh_get_sock](ssh_get_sock.md)** - get the corresponding socket to a SSH session ID
**[ssh_login_interactive](ssh_login_interactive.md)** - starts an authentication process
**[ssh_login_interactive_pass](ssh_login_interactive_pass.md)** - finishes an authentication process
**[ssh_request_exec](ssh_request_exec.md)** - runs a command via SSH
**[ssh_session_id_from_sock](ssh_session_id_from_sock.md)** - get the SSH session ID from a socket
**[ssh_set_login](ssh_set_login.md)** - set the login name for authentication
**[ssh_shell_close](ssh_shell_close.md)** - close an SSH shell
**[ssh_shell_open](ssh_shell_open.md)** - requests an SSH shell
**[ssh_shell_read](ssh_shell_read.md)** - read the output of a SSH shell
**[ssh_shell_write](ssh_shell_write.md)** - write to a SSH shell
**[ssh_userauth](ssh_userauth.md)** - authenticate a user on a SSH connection
13 changes: 13 additions & 0 deletions doc/manual/nasl/built-in-functions/unsafe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@
"unsafe" functions are working with the scanner host file system. It is possible to open, read and write files as well as run commands.

## TABLE OF CONTENT

**[file_close](file_close.md)** - close a file descriptor
**[file_open](file_open.md)** - opens a file descriptor
**[file_read](file_read.md)** - read from a file
**[file_seek](file_seek.md)** - set offset for file operations
**[file_stat](file_stat.md)** - get size of a file
**[file_write](file_write.md)** - writes data to a file
**[find_in_path](find_in_path.md)** - searches a command in $PATH and returns TRUE if found, or FALSE if not. It takes one string argument (the command name)
**[fread](fread.md)** - read a whole file on the openvas-scanner host
**[fwrite](fwrite.md)** - write a file on the openvas-scanner host
**[get_tmp_dir](get_tmp_dir.md)** - get a path to temporary directory
**[pread](pread.md)** - runs a command on the host system
**[unlink](unlink.md)** - removes a file on the openvas scanner host

0 comments on commit 94b7754

Please sign in to comment.