-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: document Networking function in the NASL manual
- Loading branch information
1 parent
e916780
commit 4e4439f
Showing
29 changed files
with
1,036 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
doc/manual/nasl/built-in-functions/network-functions/close.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# close | ||
|
||
## NAME | ||
|
||
**close** - closes the given socket. | ||
|
||
## SYNOPSIS | ||
|
||
*any* **close**(*FD*); | ||
|
||
**close** takes single unnamed argument, the socket file descriptor to be close. | ||
|
||
## DESCRIPTION | ||
|
||
|
||
|
||
## RETURN VALUE | ||
|
||
Return FAKE_CELL, or Null on error | ||
|
||
## ERRORS | ||
- Invalid socket value | ||
|
||
## EXAMPLES | ||
|
||
**1**: Open and close a socket | ||
```cpp | ||
soc = open_sock_tcp(port); | ||
close(soc); | ||
|
||
``` | ||
## SEE ALSO | ||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
33 changes: 33 additions & 0 deletions
33
doc/manual/nasl/built-in-functions/network-functions/end_denial.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# end_denial | ||
|
||
## NAME | ||
|
||
**end_denial** - | ||
|
||
## SYNOPSIS | ||
|
||
*any* **end_denial**(); | ||
|
||
**end_denial** takes no arguments. | ||
|
||
## DESCRIPTION | ||
|
||
After calling start_denial before your test, it returns TRUE if the target host is still alive and FALSE if it is dead. | ||
|
||
## RETURN VALUE | ||
|
||
Returns TRUE if the target host is still alive and FALSE if it is dead. | ||
|
||
## ERRORS | ||
|
||
## EXAMPLES | ||
|
||
**1**: | ||
```cpp | ||
end_denial(); | ||
|
||
``` | ||
|
||
## SEE ALSO | ||
|
||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
33 changes: 33 additions & 0 deletions
33
doc/manual/nasl/built-in-functions/network-functions/ftp_get_pasv_port.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# ftp_get_pasv_port | ||
|
||
## NAME | ||
|
||
**ftp_get_pasv_port** - sends the “PASV” command on the open socket, parses the returned data and returns the chosen “passive” port. | ||
|
||
## SYNOPSIS | ||
|
||
*any* **ftp_get_pasv_port**(socket:*socket*); | ||
|
||
**ftp_get_pasv_port** It takes one named argument: socket. | ||
|
||
## DESCRIPTION | ||
|
||
|
||
|
||
## RETURN VALUE | ||
|
||
Return the passive port or Null | ||
|
||
## ERRORS | ||
|
||
|
||
## EXAMPLES | ||
|
||
**1**: Get the passive port | ||
```cpp | ||
ret = ftp_get_pasv_port(socket: soc); | ||
``` | ||
|
||
## SEE ALSO | ||
|
||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
37 changes: 37 additions & 0 deletions
37
doc/manual/nasl/built-in-functions/network-functions/ftp_log_in.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# ftp_log_in | ||
|
||
## NAME | ||
|
||
**ftp_log_in** performs a FTP identification / authentication on an open socket. | ||
|
||
## SYNOPSIS | ||
|
||
*any* **ftp_log_in**(user: *string*, pass: *string*, socket: *int*); | ||
|
||
**ftp_log_in** takes three named arguments: | ||
- user: is the user name (it has no default value like “anonymous” or “ftp”) | ||
- pass: is the password (again, no default value like the user e-mail address) | ||
- socket: an open socket. | ||
|
||
## DESCRIPTION | ||
|
||
Performs a FTP identification / authentication on an open socket. | ||
|
||
## RETURN VALUE | ||
|
||
Returns TRUE if it could login successfully, FALSE otherwise (e.g. wrong password, or any network problem). | ||
|
||
## ERRORS | ||
- Invalid socket value | ||
|
||
## EXAMPLES | ||
|
||
**1**: Performs an ftp login. | ||
```cpp | ||
soc = open_sock_tcp(23); | ||
ftp_log_in(socket: soc, user: "foo", pass: "bar"); | ||
``` | ||
## SEE ALSO | ||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
35 changes: 35 additions & 0 deletions
35
doc/manual/nasl/built-in-functions/network-functions/get_host_ip.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# get_host_ip | ||
|
||
## NAME | ||
|
||
**get_host_ip** | ||
|
||
## SYNOPSIS | ||
|
||
*any* **get_host_ip**(); | ||
|
||
**get_host_ip** takes no argument. | ||
|
||
## DESCRIPTION | ||
|
||
Get the current host's ip | ||
|
||
|
||
## RETURN VALUE | ||
|
||
Return a string containing the host ip, FAKE_CELL on failure. | ||
|
||
## ERRORS | ||
|
||
## EXAMPLES | ||
|
||
**1** Print the targets host ip: | ||
```cpp | ||
hip = get_host_ip(); | ||
display(hip); | ||
|
||
``` | ||
## SEE ALSO | ||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
35 changes: 35 additions & 0 deletions
35
doc/manual/nasl/built-in-functions/network-functions/get_host_name.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# get_host_name | ||
|
||
## NAME | ||
|
||
**get_host_name** - get_host_names the given socket. | ||
|
||
## SYNOPSIS | ||
|
||
*any* **get_host_name**(*FD*); | ||
|
||
**get_host_name** takes single unnamed argument, the socket file descriptor to be get_host_name. | ||
|
||
## DESCRIPTION | ||
|
||
|
||
|
||
## RETURN VALUE | ||
|
||
Return FAKE_CELL, or Null on error | ||
|
||
## ERRORS | ||
- Invalid socket value | ||
|
||
## EXAMPLES | ||
|
||
**1** Print the targets host name: | ||
```cpp | ||
hn = get_host_name() | ||
display(hn); | ||
|
||
``` | ||
## SEE ALSO | ||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
37 changes: 37 additions & 0 deletions
37
doc/manual/nasl/built-in-functions/network-functions/get_host_open_port.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# get_host_open_port | ||
|
||
## NAME | ||
|
||
**get_host_open_port** - Get an open TCP port on the target host. | ||
|
||
## SYNOPSIS | ||
|
||
*any* **get_host_open_port**(); | ||
|
||
**get_host_open_port** takes no arguments. | ||
|
||
## DESCRIPTION | ||
|
||
This function is used by tests that need to speak to the TCP/IP stack but not to a specific service. | ||
Don't always return the first open port, otherwise it might get bitten by OSes doing active SYN flood countermeasures. Also, avoid returning 80 and 21 as open ports, as many transparent proxies are acting for these. | ||
|
||
## RETURN VALUE | ||
|
||
Return a random open port from a list (if there is many open ports), the port 21 or the port 80 are the last choices. Returns 0 if there is no open port. | ||
|
||
|
||
## ERRORS | ||
|
||
|
||
## EXAMPLES | ||
|
||
**1**: Get and display an open port in the host target. | ||
```cpp | ||
port = get_host_open_port(); | ||
display(port); | ||
|
||
``` | ||
## SEE ALSO | ||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
34 changes: 34 additions & 0 deletions
34
doc/manual/nasl/built-in-functions/network-functions/get_port_state.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# get_port_state | ||
|
||
## NAME | ||
|
||
**get_port_state** - Get a port state. | ||
|
||
## SYNOPSIS | ||
|
||
*any* **get_port_state**(*int*); | ||
|
||
**get_port_state** takes one single unnamed argument, the port. | ||
|
||
## DESCRIPTION | ||
|
||
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. | ||
|
||
|
||
## RETURN VALUE | ||
Returns TRUE if it is open and FALSE otherwise. | ||
|
||
## ERRORS | ||
|
||
## EXAMPLES | ||
|
||
**1**: Get and display the state of the given port. | ||
```cpp | ||
st = get_port_state(port); | ||
display(st); | ||
|
||
``` | ||
## SEE ALSO | ||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
48 changes: 48 additions & 0 deletions
48
doc/manual/nasl/built-in-functions/network-functions/get_port_transport.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# get_port_transport | ||
|
||
## NAME | ||
|
||
**get_port_transport** - Get the encapsulation used for the given port, if it was previously stored in the kb. | ||
|
||
## SYNOPSIS | ||
|
||
*any* **get_port_transport**(*int*, asstring: *bool*); | ||
|
||
**get_port_transport** takes an unnamed argument, the port number, and a named parameter `asstring`. | ||
|
||
## DESCRIPTION | ||
|
||
Get the encapsulation used for the given port. | ||
|
||
Currently, there are the following encapsulation types: | ||
- ENCAPS_AUTO = 0, Request auto detection. | ||
- ENCAPS_IP = 1, this is the “transport” value for a pure TCP socket. | ||
- ENCAPS_SSLv23 = 2, this is the “transport” value for a SSL connection in compatibility mode. Note that the find_service plugin will never declare a port with this "encapsulation", but you may use it in a script. | ||
- ENCAPS_SSLv2 = 3, The old SSL version which only supports server side certificates. By the way, there is only one plugin that really tries to destroy data. This is http_methods.nasl | ||
- ENCAPS_SSLv3 = 4, The new SSL version: it supports server and client side certificates, more ciphers, and fixes a few security holes. | ||
- ENCAPS_TLSv1 = 5, TLSv1 is defined RFC 2246. Some people call it “SSL v3.1”. | ||
- ENCAPS_TLSv11 = 6 | ||
- ENCAPS_TLSv12 = 7 | ||
- ENCAPS_TLSv13 = 8 | ||
- ENCAPS_TLScustom = 9, SSL/TLS using custom priorities. | ||
- ENCAPS_MAX = 10 | ||
|
||
## RETURN VALUE | ||
|
||
Return the transport encapsulation mode (OPENVAS_ENCAPS_*) for the given PORT. If no such encapsulation mode has been stored in the knowledge base (or its value is < 0), OPENVAS_ENCAPS_IP is currently returned. | ||
The return value depends on the parameters. An integer or a string with the encapsulation mode or NULL on error. | ||
|
||
## ERRORS | ||
|
||
|
||
## EXAMPLES | ||
|
||
**1**: Get and display the encapsulation mode for the port | ||
```cpp | ||
encps = get_port_transport(443); | ||
display(encps); | ||
``` | ||
## SEE ALSO | ||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
35 changes: 35 additions & 0 deletions
35
doc/manual/nasl/built-in-functions/network-functions/get_udp_port_state.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# get_udp_port_state | ||
|
||
## NAME | ||
|
||
**get_udp_port_state** - Get a port state. | ||
|
||
## SYNOPSIS | ||
|
||
*any* **get_udp_port_state**(*int*); | ||
|
||
**get_udp_port_state** takes one single unnamed argument, the port. | ||
|
||
## DESCRIPTION | ||
|
||
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_udp_port_state will return TRUE on unknown ports; when it is set, get_udp_port_state will return FALSE. | ||
|
||
Note that UDP port scanning may be unreliable. | ||
|
||
## RETURN VALUE | ||
Returns TRUE if it is open and FALSE otherwise. | ||
|
||
## ERRORS | ||
|
||
## EXAMPLES | ||
|
||
**1**: Get and display the state of the given port. | ||
```cpp | ||
st = get_udp_port_state(port); | ||
display(st); | ||
|
||
``` | ||
## SEE ALSO | ||
**[close(3)](close.md)**, **[end_denial(3)](end_denial.md)**, **[ftp_get_pasv_port(3)](ftp_get_pasv_port.md)**, **[get_host_name(3)](get_host_name.md)**, **[get_host_ip(3)](get_host_ip.md)**, **[get_host_open_port(3)](get_host_open_port.md)**, **[get_port_transport(3)](get_port_transport.md)**, **[get_port_state(3)](get_port_state.md)**, **[get_source_port(3)](get_source_port.md)**, **[get_tcp_port_state(3)](get_tcp_port_state.md)**, **[get_udp_port_state(3)](get_udp_port_state.md)**, **[islocalhost(3)](islocalhost.md)**, **[islocalnet(3)](islocalnet.md)**, **[join_multicast_group(3)](join_multicast_group.md)**, **[leave_multicast_group(3)](leave_multicast_group.md)**, **[open_priv_sock_tcp(3)](open_priv_sock_tcp.md)**, **[open_priv_sock_udp(3)](open_priv_sock_udp.md)**, **[open_sock_tcp(3)](open_sock_tcp.md)**, **[open_sock_udp(3)](open_sock_udp.md)**, **[recv(3)](recv.md)**, **[recv_line(3)](recv_line.md)**, **[send(3)](send.md)**, **[scanner_add_port(3)](scanner_add_port.md)**, **[scanner_get_port(3)](scanner_get_port.md)**, **[tcp_ping(3)](tcp_ping.md)**, **[telnet_init(3)](telnet_init.md)**, **[this_host(3)](this_host.md)**, **[this_host_name(3)](this_host_name.md)**, **[ftp_log_in(3)](ftp_log_in.md)**, **[start_denial(3)](start_denial.md)** |
Oops, something went wrong.