Global commands
-
crc32(str) — Computes the CRC-32 checksum for the input string and returns it as an unsigned integer.
-
key_gen(str_pass, str_salt, iter_num, len_num) — Creates an AES key for encrypt/decrypt data to use. Returns the generated key as a binary string.
-
aes_enc(t) — Encrypts the data using the previously-created AES key. Returns the encrypted data as a binary string.
-
aes_dec(t) — Decrypts the data using the previously-created AES key. Returns the decrypted data as a binary string.
-
EVP_Digest(alg, str) — Performs one-shot digest calculation using the specified algorithm.
-
HMAC(alg, str, key) — HMAC message authentication code.
-
HMAC_verify(alg, data, key, verify) — Compares the provided signature against the current digest value. Returns true for a match, false for a mismatch.
-
G2F(alg, key) — Returns a G2F random value.
-
class_match(input_string, operation, pattern_table) — Compares a string against a list of patterns or values using specified matching methods and returns detailed match information.
-
class_search(pattern_table, operation, input_string) — Searches through a list of strings to find elements that match the given pattern or criteria using specified matching methods.
-
cmp_addr(client_ip, addr_group) — Matches one IP address against a group of IP addresses. It can automatically detect IPv4 and IPv6 and can be used to compare IPv4 addresses with IPv6 addresses.
-
url_enc(str) — Converts the URL information into valid ASCII format.
-
url_dec(str) — Converts the encoding-URL into the original URL.
-
url_parser(str) — Parses a URL, returns a table containing host, port, path, query, fragment, the username, password, etc., from the URL.
-
url_compare(url1, url2) — Compares two URL strings, returns true if they are the same.
-
rand() — Generates a random number. Returns an integer number. After FortiADC reboots, the random number will be different.
-
srand(str) — Sets the random seed.
-
rand_hex(int) — Generates a random number in HEX. Returns a string, length is the <int>.
-
rand_alphanum(int) — Generates a random alphabet + number sequence. Returns a string, length is the <int>.
-
rand_seq(int) — Generates a random number sequence. Returns a string, length is the <int>.
-
time() — Returns the current time as a number in seconds. This is the time since the Epoch was measured.
-
ctime() — Returns the current time as a string, for example, “Tue Jun 25 14:11:01 2019”.
-
gmtime() — Returns the GMT time as a string, for example, “Thu 27 Jun 2019 18:27:42 GMT”.
-
md5(str) — Returns the MD5 calculated for the specified string.
-
md5_hex(str) — Returns the MD5 value in hex as a string.
-
md5_str(str) — Calculates the MD5 of a string input and stores the results in an intermediate variable, in some cases you need a version to deal with it.
-
md5_hex_str(str) — Calculates the MD5 of a string input of a string input and outputs the results in HEX format, in some cases you need a version to deal with it.
-
sha1(str) — Returns the SHA-1 calculated for the specified string.
-
sha1_hex(str) — Returns the SHA-1 calculated for the string in hex.
-
sha1_str(str) — Calculates the SHA-1 of a string input and stores the results in an intermediate variable, in some cases you need a version to deal with it.
-
sha1_hex_str(str) — Calculates the SHA-1 of a string input and output the results in HEX format, in some cases you need a version to deal with it.
-
sha256(str) — Calculates the SHA-256 of a string input and stores the result in an intermediate variable.
-
sha256_hex(str) — Calculates the SHA-256 of a string input and outputs the result in an intermediate variable. In some cases you need a version to deal with it.
-
sha256_str(str) — Calculates the SHA-256 of a string input and stores the result in an intermediate variable. In some cases you need a version to deal with it.
-
sha256_hex_str(str) — Calculates the SHA-256 of a string input and stores the result in an intermediate variable. In some case you need a version to deal with it.
-
sha384(str) — Calculates the SHA-384 of a string input and stores the result in an intermediate variable.
-
sha384_hex(str) — Calculates the SHA-384 of a string input and outputs the result in an intermediate variable. In some cases you need a version to deal with it.
-
sha384_str(str) — Calculates the SHA-384 of a string input and stores the result in an intermediate variable. In some cases you need a version to deal with it.
-
sha384_hex_str(str) — Calculates the SHA-384 of a string input and stores the result in an intermediate variable. In some case you need a version to deal with it.
-
sha512(str) — Calculates the SHA-512 of a string input and stores the result in an intermediate variable.
-
sha512_hex(str) — Calculates the SHA-512 of a string input and outputs the result in an intermediate variable. In some cases you need a version to deal with it.
-
sha512_str(str) — Calculates the SHA-512 of a string input and stores the result in an intermediate variable. In some cases you need a version to deal with it.
-
sha512_hex_str(str) — Calculates the SHA-512 of a string input and stores the result in an intermediate variable. In some case you need a version to deal with it.
-
b32_enc(str) — Encodes a string input in Base32 and outputs the result in string format.
-
b32_enc_str(str) — Encodes a string input in Base32 and outputs the result in string format. In some cases you need a version to deal with it.
-
b32_dec(str) — Decodes a Base32 encoded string input and outputs the result in string format.
-
b32_dec_str(str) — Decodes a Base32 encoded string input and outputs the result in string format. In some cases you need a version to deal with it.
-
b64_enc(str) — Encodes a string input in Base64 and outputs the result in string format.
-
b64_dec(str) — Decodes a Base64 encoded string input and outputs the result in string format.
-
get_pid() — Returns the PID value of the VS process.
-
table_to_string(t) — Returns the table in a string.
-
htonl(int) — Converts a 32 bit long integer from host byte order to network byte order.
-
ntohs(int) — Converts a 16 bit short integer from network byte order to host byte order.
-
htons(int) — Converts a 16 bit short integer from host byte order to network byte order.
-
ntohl(int) — When receiving long integers in HTTP response from the network, this command converts a 32 bit long integer from network byte order to host byte order.
-
to_HEX(str) — Returns the HEX calculate of the string.
-
debug(str) — Prints the debug information when the virtual server is using HTTP scripting.
-
log(str) — Prints the scripting running information in log format. When using this command, you should enable scripting log.
-
file_open(path, str) — Opens a file, returns a file object.
-
file_gets(file, size) — Returns the file content.
-
file_close(file) — Closes a file.