mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
Improved html output with scoring information
This commit is contained in:
@@ -139,6 +139,14 @@ bsd_test_tcp_connectivity() {
|
||||
nc -z -G $TIMEOUT $HOST $PORT >/dev/null 2>&1 && echo "200" || echo "000"
|
||||
}
|
||||
|
||||
gnu_replace_sed(){
|
||||
sed -i $1 $2
|
||||
}
|
||||
|
||||
bsd_replace_sed(){
|
||||
sed -i '' $1 $2
|
||||
}
|
||||
|
||||
# Functions to manage dates depending on OS
|
||||
if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == "linux-musl" ]; then
|
||||
TEMP_REPORT_FILE=$(mktemp -t -p /tmp prowler.cred_report-XXXXXX)
|
||||
@@ -171,6 +179,10 @@ if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == "linux-musl" ]; then
|
||||
convert_date_to_timestamp() {
|
||||
gnu_convert_date_to_timestamp "$1"
|
||||
}
|
||||
replace_sed() {
|
||||
gnu_replace_sed $1 $2
|
||||
}
|
||||
|
||||
elif [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then
|
||||
# BSD/OSX commands compatibility
|
||||
TEMP_REPORT_FILE=$(mktemp -t prowler.cred_report-XXXXXX)
|
||||
@@ -244,6 +256,9 @@ elif [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then
|
||||
test_tcp_connectivity() {
|
||||
bsd_test_tcp_connectivity "$1" "$2" "$3"
|
||||
}
|
||||
replace_sed() {
|
||||
bsd_replace_sed $1 $2
|
||||
}
|
||||
elif [[ "$OSTYPE" == "cygwin" ]]; then
|
||||
# POSIX compatibility layer and Linux environment emulation for Windows
|
||||
TEMP_REPORT_FILE=$(mktemp -t -p /tmp prowler.cred_report-XXXXXX)
|
||||
@@ -274,6 +289,9 @@ elif [[ "$OSTYPE" == "cygwin" ]]; then
|
||||
convert_date_to_timestamp() {
|
||||
gnu_convert_date_to_timestamp "$1"
|
||||
}
|
||||
replace_sed() {
|
||||
gnu_replace_sed $1 $2
|
||||
}
|
||||
else
|
||||
echo "Unknown Operating System! Valid \$OSTYPE: linux-gnu, linux-musl, darwin* or cygwin"
|
||||
echo "Found: $OSTYPE"
|
||||
|
||||
Reference in New Issue
Block a user