mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-25 18:09:30 +01:00
Replace "--" with colorful descriptions to match JSON severity
This commit is contained in:
parent
107d2dd12e
commit
38aa90b41c
20
testssl.sh
20
testssl.sh
@ -1808,7 +1808,7 @@ run_hsts() {
|
|||||||
# https://chromium.googlesource.com/chromium/src/+/master/net/http/transport_security_state_static.json
|
# https://chromium.googlesource.com/chromium/src/+/master/net/http/transport_security_state_static.json
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
out "--"
|
pr_svrty_high "not offered"
|
||||||
fileout "HSTS" "HIGH" "not offered"
|
fileout "HSTS" "HIGH" "not offered"
|
||||||
fi
|
fi
|
||||||
outln
|
outln
|
||||||
@ -2055,7 +2055,7 @@ run_hpkp() {
|
|||||||
fileout "HPKP_backup" "HIGH" "No backup keys found. Loss/compromise of the currently pinned key(s) will lead to bricked site."
|
fileout "HPKP_backup" "HIGH" "No backup keys found. Loss/compromise of the currently pinned key(s) will lead to bricked site."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
outln "--"
|
prln_svrty_good "not supported"
|
||||||
fileout "HPKP" "INFO" "No support for HTTP Public Key Pinning"
|
fileout "HPKP" "INFO" "No support for HTTP Public Key Pinning"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -2209,7 +2209,7 @@ run_appl_banner() {
|
|||||||
pr_bold " Application banner "
|
pr_bold " Application banner "
|
||||||
egrep -ai '^X-Powered-By|^X-AspNet-Version|^X-Version|^Liferay-Portal|^X-OWA-Version^|^MicrosoftSharePointTeamServices' $HEADERFILE >$TMPFILE
|
egrep -ai '^X-Powered-By|^X-AspNet-Version|^X-Version|^Liferay-Portal|^X-OWA-Version^|^MicrosoftSharePointTeamServices' $HEADERFILE >$TMPFILE
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
outln "--"
|
prln_svrty_good "not found"
|
||||||
fileout "$jsonID" "INFO" "No application banner found"
|
fileout "$jsonID" "INFO" "No application banner found"
|
||||||
else
|
else
|
||||||
while IFS='' read -r line; do
|
while IFS='' read -r line; do
|
||||||
@ -2244,7 +2244,7 @@ run_rp_banner() {
|
|||||||
pr_bold " Reverse Proxy banner "
|
pr_bold " Reverse Proxy banner "
|
||||||
egrep -ai '^Via:|^X-Cache|^X-Squid|^X-Varnish:|^X-Server-Name:|^X-Server-Port:|^x-forwarded|^Forwarded' $HEADERFILE >$TMPFILE
|
egrep -ai '^Via:|^X-Cache|^X-Squid|^X-Varnish:|^X-Server-Name:|^X-Server-Port:|^x-forwarded|^Forwarded' $HEADERFILE >$TMPFILE
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
outln "--"
|
prln_svrty_good "not found"
|
||||||
fileout "$jsonID" "INFO" "--" "$cve" "$cwe"
|
fileout "$jsonID" "INFO" "--" "$cve" "$cwe"
|
||||||
else
|
else
|
||||||
while read line; do
|
while read line; do
|
||||||
@ -2431,7 +2431,7 @@ run_more_flags() {
|
|||||||
#TODO: I am not testing for the correctness or anything stupid yet, e.g. "X-Frame-Options: allowall" or Access-Control-Allow-Origin: *
|
#TODO: I am not testing for the correctness or anything stupid yet, e.g. "X-Frame-Options: allowall" or Access-Control-Allow-Origin: *
|
||||||
|
|
||||||
if "$first"; then
|
if "$first"; then
|
||||||
prln_svrty_medium "--"
|
prln_svrty_medium "none found"
|
||||||
fileout "security_headers" "MEDIUM" "--"
|
fileout "security_headers" "MEDIUM" "--"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -6413,7 +6413,7 @@ must_staple() {
|
|||||||
fileout "${jsonID}${json_postfix}" "HIGH" "extension detected but no OCSP stapling provided"
|
fileout "${jsonID}${json_postfix}" "HIGH" "extension detected but no OCSP stapling provided"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
outln "--"
|
prln_svrty_good "not supported"
|
||||||
fileout "${jsonID}${json_postfix}" "INFO" "--"
|
fileout "${jsonID}${json_postfix}" "INFO" "--"
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
@ -6761,7 +6761,7 @@ certificate_info() {
|
|||||||
outok=false
|
outok=false
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
outln "--"
|
prln_svrty_good "none"
|
||||||
fileout "${jsonID}${json_postfix}" "INFO" "No server key usage information"
|
fileout "${jsonID}${json_postfix}" "INFO" "No server key usage information"
|
||||||
outok=false
|
outok=false
|
||||||
fi
|
fi
|
||||||
@ -6781,7 +6781,7 @@ certificate_info() {
|
|||||||
outok=false
|
outok=false
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
outln "--"
|
prln_svrty_good "none"
|
||||||
fileout "${jsonID}${json_postfix}" "INFO" "No server extended key usage information"
|
fileout "${jsonID}${json_postfix}" "INFO" "No server extended key usage information"
|
||||||
outok=false
|
outok=false
|
||||||
fi
|
fi
|
||||||
@ -7137,8 +7137,8 @@ certificate_info() {
|
|||||||
# ~ get next 50 lines after pattern , strip until Signature Algorithm and retrieve URIs
|
# ~ get next 50 lines after pattern , strip until Signature Algorithm and retrieve URIs
|
||||||
crl="$(awk '/X509v3 CRL Distribution/{i=50} i&&i--' <<< "$cert_txt" | awk '/^$/,/^ [a-zA-Z0-9]+|^ Signature Algorithm:/' | awk -F'URI:' '/URI/ { print $2 }')"
|
crl="$(awk '/X509v3 CRL Distribution/{i=50} i&&i--' <<< "$cert_txt" | awk '/^$/,/^ [a-zA-Z0-9]+|^ Signature Algorithm:/' | awk -F'URI:' '/URI/ { print $2 }')"
|
||||||
if [[ -z "$crl" ]] ; then
|
if [[ -z "$crl" ]] ; then
|
||||||
|
prln_svrty_good "none"
|
||||||
fileout "${jsonID}${json_postfix}" "INFO" "--"
|
fileout "${jsonID}${json_postfix}" "INFO" "--"
|
||||||
outln "--"
|
|
||||||
else
|
else
|
||||||
if [[ $(count_lines "$crl") -eq 1 ]]; then
|
if [[ $(count_lines "$crl") -eq 1 ]]; then
|
||||||
outln "$crl"
|
outln "$crl"
|
||||||
@ -7152,7 +7152,7 @@ certificate_info() {
|
|||||||
jsonID="cert_ocspURL"
|
jsonID="cert_ocspURL"
|
||||||
ocsp_uri=$($OPENSSL x509 -in $HOSTCERT -noout -ocsp_uri 2>>$ERRFILE)
|
ocsp_uri=$($OPENSSL x509 -in $HOSTCERT -noout -ocsp_uri 2>>$ERRFILE)
|
||||||
if [[ -z "$ocsp_uri" ]]; then
|
if [[ -z "$ocsp_uri" ]]; then
|
||||||
outln "--"
|
prln_svrty_good "none"
|
||||||
fileout "${jsonID}${json_postfix}" "INFO" "--"
|
fileout "${jsonID}${json_postfix}" "INFO" "--"
|
||||||
else
|
else
|
||||||
if [[ $(count_lines "$ocsp_uri") -eq 1 ]]; then
|
if [[ $(count_lines "$ocsp_uri") -eq 1 ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user