diff --git a/bin/.bin/webtest/analyse-headers b/bin/.bin/webtest/analyse-headers
index 5f6c5683..534e6364 100755
--- a/bin/.bin/webtest/analyse-headers
+++ b/bin/.bin/webtest/analyse-headers
@@ -26,6 +26,11 @@ trimWhitespace(){
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
}
+#wrapped echo
+wecho(){
+ builtin echo -e "$@" | fold -s -w 80
+}
+
drawInBox(){
innerWidth="45"
echo -en "${LBLUE}╭"
@@ -69,25 +74,25 @@ printKey(){
test_server(){
local value="$(echo "$1" | cut -d ':' -f 2 | trimWhitespace)"
echo "Server" | drawInBox
- echo -e "The server responds with ${ORANGE}$value${NC} in the Server header"
- echo -e "This is potentially un-necesary information disclosure\n\n"
+ wecho -e "The server responds with ${ORANGE}$value${NC} in the Server header"
+ wecho -e "This is potentially un-necesary information disclosure\n\n"
[ -n "$value" ] && return 1 || return 0
}
test_x-powered-by(){
local value="$(echo "$1" | cut -d ':' -f 2 | trimWhitespace)"
echo "X-Powered-By" | drawInBox
- echo -e "The server responds with ${ORANGE}$value${NC} in the X-Powered-By header"
- echo -e "This is potentially un-necesary information disclosure\n\n"
+ wecho -e "The server responds with ${ORANGE}$value${NC} in the X-Powered-By header" | wrap
+ wecho -e "This is potentially un-necesary information disclosure\n\n"
[ -n "$value" ] && return 1 || return 0
}
test_x-aspnet-version(){
local value="$(echo "$1" | cut -d ':' -f 2 | trimWhitespace)"
echo "X-Powered-By" | drawInBox
- echo -e "The server responds with ${ORANGE}$value${NC} in the \
+ wecho -e "The server responds with ${ORANGE}$value${NC} in the \
X-AspNet-Version header"
- echo -e "This is potentially un-necesary information disclosure\n\n"
+ wecho -e "This is potentially un-necesary information disclosure\n\n"
[ -n "$value" ] && return 1 || return 0
}
@@ -97,7 +102,7 @@ test_x-xss-protection(){
return 0
else
echo "X-XSS-Protection" | drawInBox
- echo -e "The X-XSS-Protection header asks browsers to try and prevent \
+ wecho -e "The X-XSS-Protection header asks browsers to try and prevent \
reflected cross site scripting attacks. It has been replaced in modern browsers \
by the content-security-policy although should still be included for the sake \
of old browsers\n\n"
@@ -111,15 +116,15 @@ test_x-frame-options(){
"SAMEORIGIN"|"DENY") return 0 ;;
"ALLOW-FROM"*)
echo "X-Frame-Opitons" | drawInBox
- echo "The ALLOW-FROM derivative is obsolete and no longer works \
+ wecho "The ALLOW-FROM derivative is obsolete and no longer works \
in modern browsers."
- echo "The Content-Security-Policy HTTP header has a \
+ wecho "The Content-Security-Policy HTTP header has a \
frame-ancestors directive which you can use instead."
return 1
;;
*)
echo "X-Frame-Opitons" | drawInBox
- echo "The X-Frame-Options HTTP response header can be used to \
+ wecho "The X-Frame-Options HTTP response header can be used to \
indicate whether or not a browser should be allowed to render a page in a \
,