Go to the source code of this file.
◆ nasl_close_socket()
◆ nasl_get_sock_info()
Get info pertaining to a socket.
- NASL Function: get_sock_info\n
This function is used to retrieve various information about an active socket. It requires the NASL socket number and a string to select the information to retrieve.
Supported keywords are:
- dport Return the destination port. This is an integer. NOTE: Not yet implemented.
- sport Return the source port. This is an integer. NOTE: Not yet implemented.
- encaps Return the encapsulation of the socket. Example output: "TLScustom".
- tls-proto Return a string with the actual TLS protocol in use. n/a" is returned if no SSL/TLS session is active. Example
output: "TLSv1".
- @a tls-kx Return a string describing the key exchange algorithm.
Example output: "RSA".
- @a tls-certtype Return the type of the certificate in use by the
session. Example output: "X.509"
- @a tls-cipher Return the cipher algorithm in use by the session;
Example output: "AES-256-CBC".
- @a tls-mac Return the message authentication algorithms used by
the session. Example output: "SHA1".
- @a tls-auth Return the peer's authentication type. Example
output: "CERT".
- tls-cert Return the peer's certificates for an SSL or TLS connection. This is an array of binary strings or NULL if no certificate is known.
- NASL Unnamed Parameters:\n
- A NASL socket
- A string keyword; see above.
- NASL Named Parameters:\n
- asstring If true return a human readable string instead of an integer. Used only with these keywords: encaps.
- NASL Returns:\n An integer or a string or NULL on error.
- Parameters
-
[in] | lexic | Lexical context of the NASL interpreter. |
- Returns
- A tree cell.
◆ nasl_get_source_port()
◆ nasl_join_multicast_group()
◆ nasl_leave_multicast_group()
◆ nasl_open_priv_sock_tcp()
◆ nasl_open_priv_sock_udp()
◆ nasl_open_sock_tcp()
Open a TCP socket to the target host.
- NASL Function: open_sock_tcp\n
This function is used to create a TCP connection to the target host. It requires the port number as its argument and has various optional named arguments to control encapsulation, timeout and buffering.
- NASL Unnamed Parameters:\n
- A non-negative integer with the TCP port number.
- NASL Named Parameters:\n
- bufsz An integer with the the size buffer size. Note that by default, no buffering is used.
- timeout An integer with the timeout value in seconds. The default timeout is controlled by a global value.
- transport One of the ENCAPS_* constants to force a specific encapsulation mode or force trying of all modes (ENCAPS_AUTO). This is for example useful to select a specific TLS or SSL version or use specific TLS connection setup priorities. See get_port_transport for a description of the ENCAPS constants.
- priority A string value with priorities for an TLS encapsulation. For the syntax of the priority string see the GNUTLS manual. This argument is only used in ENCAPS_TLScustom encapsulation.
- NASL Returns:\n A positive integer as a NASL socket, 0 on connection error or
- NULL on other errors.
- Parameters
-
[in] | lexic | Lexical context of the NASL interpreter. |
- Returns
- A tree cell.
◆ nasl_open_sock_tcp_bufsz()
◆ nasl_open_sock_udp()
◆ nasl_recv()
◆ nasl_recv_line()
◆ nasl_send()
◆ nasl_socket_cert_verify()
Verify a certificate.
- NASL Function: socket_cert_verify\n
This function is used to retrieve and verify a certificate from an active socket. It requires the NASL socket number.
- NASL Unnamed Parameters:\n
- NASL Returns:\n 0 in case of successfully verification. A positive integer in
- case of verification error or NULL on other errors.
- Parameters
-
[in] | lexic | Lexical context of the NASL interpreter. |
- Returns
- A tree cell.
◆ nasl_socket_get_cert()
◆ nasl_socket_get_error()
◆ nasl_socket_get_ssl_ciphersuite()
◆ nasl_socket_get_ssl_session_id()
◆ nasl_socket_get_ssl_version()
◆ nasl_socket_negotiate_ssl()