mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
[MASTER][BETA] All Tests to Fail Builds
This commit is contained in:
parent
ef592237a8
commit
d4e562c760
16 changed files with 81 additions and 115 deletions
|
@ -88,7 +88,7 @@ if curl -I http://localhost:9000 -e "thisisabadword" 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - User bad-referrer-words.conf working"
|
||||
else
|
||||
echo "${bold}${red}FAILED - User bad-referrer-words.conf NOT working"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ if curl -I http://localhost:9000 -e "thisisanotherbadword" 2>&1 | grep -i '(52)'
|
|||
echo "${bold}${green}PASSED - User bad-referrer-words.conf working"
|
||||
else
|
||||
echo "${bold}${red}FAILED - User bad-referrer-words.conf NOT working"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ if grep -i 'Unavailable' < ${ratelimittestfile}; then
|
|||
echo "${bold}${green}PASSED - ${red}GoogleBot was ${bold}${red}RATE LIMITED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}GoogleBot was ${bold}${red}NOT RATE LIMITED"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ if curl http://localhost:9000 -e http://www.myowndomain.com 2>&1 | grep -i 'Welc
|
|||
echo "${bold}${green}PASSED - User whitelist-domains.conf working"
|
||||
else
|
||||
echo "${bold}${red}FAILED - User whitelist-domains.conf NOT working"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ if curl http://localhost:9000 -e http://www.myotherdomain.com 2>&1 | grep -i 'We
|
|||
echo "${bold}${green}PASSED - User whitelist-domains.conf working"
|
||||
else
|
||||
echo "${bold}${red}FAILED - User whitelist-domains.conf NOT working"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -81,6 +81,7 @@ if curl http://localhost:9000 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - ${bold}${red}blacklist own ip is WORKING"
|
||||
else
|
||||
echo "${bold}${red}FAILED - blacklist own ip is NOT working"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -90,6 +91,7 @@ if curl http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
|||
else
|
||||
echo "${bold}${red}FAILED - whitelist own ip is NOT working"
|
||||
curl http://localhost:9000
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -204,6 +204,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT ALLOWED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -228,6 +229,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT ALLOWED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
|
|
@ -154,7 +154,7 @@ if curl -A "Googlebot/Nutch-1.7" http://localhost:9000 2>&1 | grep -i '(52)'; th
|
|||
echo "${bold}${green}PASSED - ${red}Googlebot/Nutch-1.7 BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}Googlebot/Nutch-1.7 BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ if curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
|
|||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Mozilla/5.0"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ if curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/6
|
|||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Safari"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -194,6 +194,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -214,6 +215,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -234,6 +236,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -254,6 +257,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -275,6 +279,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -294,6 +299,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
|
|
@ -88,7 +88,7 @@ if curl -I http://localhost:9000 -e "thisisabadword" 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - User bad-referrer-words.conf working"
|
||||
else
|
||||
echo "${bold}${red}FAILED - User bad-referrer-words.conf NOT working"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ if curl -I http://localhost:9000 -e "thisisanotherbadword" 2>&1 | grep -i '(52)'
|
|||
echo "${bold}${green}PASSED - User bad-referrer-words.conf working"
|
||||
else
|
||||
echo "${bold}${red}FAILED - User bad-referrer-words.conf NOT working"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -200,6 +200,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -220,6 +221,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -240,6 +242,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -260,6 +263,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -281,6 +285,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -300,6 +305,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
|
|
@ -106,6 +106,7 @@ if grep -i 'Unavailable' < ${ratelimittestfile}; then
|
|||
echo "${bold}${green}PASSED - ${red}GoogleBot was ${bold}${red}RATE LIMITED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}GoogleBot was ${bold}${red}NOT RATE LIMITED"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ if curl http://localhost:9000 -e http://www.myowndomain.com 2>&1 | grep -i 'Welc
|
|||
echo "${bold}${green}PASSED - User whitelist-domains.conf working"
|
||||
else
|
||||
echo "${bold}${red}FAILED - User whitelist-domains.conf NOT working"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ if curl http://localhost:9000 -e http://www.myotherdomain.com 2>&1 | grep -i 'We
|
|||
echo "${bold}${green}PASSED - User whitelist-domains.conf working"
|
||||
else
|
||||
echo "${bold}${red}FAILED - User whitelist-domains.conf NOT working"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ if curl http://localhost:9000 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - ${bold}${red}blacklist own ip is WORKING"
|
||||
else
|
||||
echo "${bold}${red}FAILED - blacklist own ip is NOT working"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -89,6 +90,7 @@ if curl http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
|||
else
|
||||
echo "${bold}${red}FAILED - whitelist own ip is NOT working"
|
||||
curl http://localhost:9000
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -206,6 +206,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT ALLOWED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -229,6 +230,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT ALLOWED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
|
|
@ -200,6 +200,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -220,6 +221,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -240,6 +242,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -260,6 +263,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -281,6 +285,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -300,6 +305,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
|
|
@ -200,6 +200,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -220,6 +221,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -240,6 +242,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -260,6 +263,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -281,6 +285,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -300,6 +305,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
|
|
@ -88,7 +88,7 @@ if curl -A "80legs" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - ${red}80legs BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}80legs BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ if curl -A "Nutch" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - ${red}Nutch BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}Nutch BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ if curl -I http://localhost:9000 -e http://100dollars-seo.com 2>&1 | grep -i '(5
|
|||
echo "${bold}${green}PASSED - ${red}100dollars-seo.com BAD REFERRER DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}100dollars-seo.com BAD REFERRER NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ if curl -I http://localhost:9000 -e http://zx6.ru 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - ${red}zx6.ru BAD REFERRER DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}zx6.ru BAD REFERRER NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ if curl -A "GoogleBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
|||
echo "${bold}${green}PASSED - ${green}GoogleBot GOOD BOT ALLOWED THROUGH"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}GoogleBot GOOD BOT NOT ALLOWED THROUGH"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ if curl -A "BingBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
|||
echo "${bold}${green}PASSED - ${green}BingBot GOOD BOT ALLOWED THROUGH"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}BingBot GOOD BOT NOT ALLOWED THROUGH"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ if curl http://localhost:9000 -e http://google.com 2>&1 | grep -i 'Welcome'; the
|
|||
echo "${bold}${green}PASSED - ${green}google.com GOOD REFERRER DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}google.com GOOD REFERRER NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ if curl http://localhost:9000 -e http://bing.com 2>&1 | grep -i 'Welcome'; then
|
|||
echo "${bold}${green}PASSED - ${red}bing.com GOOD REFERRER DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}bing.com GOOD REFERRER NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -160,61 +160,25 @@ if curl -A "Googlebot/Nutch-1.7" http://localhost:9000 2>&1 | grep -i '(52)'; th
|
|||
echo "${bold}${green}PASSED - ${red}Googlebot/Nutch-1.7 BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}Googlebot/Nutch-1.7 BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest10 () {
|
||||
if curl -A "Mozilla/5.0 (compatible; Googlebot/Nutch2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
echo "${bold}${green}PASSED - ${red}Googlebot/Nutch2.1 BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}Googlebot/Nutch2.1 BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest11 () {
|
||||
if curl -A "Mozilla/5.0 (compatible; Googlebot/nutch/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
echo "${bold}${green}PASSED - ${red}Googlebot/nutch/-2.1 BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - Googlebot/nutch/-2.1 BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest12 () {
|
||||
if curl -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Googlebot-Image/Snutch\-/-2.1"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Googlebot-Image/Snutch\-/-2.1"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest13 () {
|
||||
if curl -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on SnutchMozilla/5.0"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on SnutchMozilla/5.0"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest14 () {
|
||||
if curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Mozilla/5.0"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest15 () {
|
||||
run_curltest11 () {
|
||||
if curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Safari"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -236,6 +200,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -256,6 +221,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -276,6 +242,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -296,6 +263,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -317,6 +285,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -336,6 +305,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -364,10 +334,6 @@ run_curltest8
|
|||
run_curltest9
|
||||
run_curltest10
|
||||
run_curltest11
|
||||
run_curltest12
|
||||
run_curltest13
|
||||
run_curltest14
|
||||
run_curltest15
|
||||
testBadUserAgents
|
||||
testGoodUserAgents
|
||||
testAllowedUserAgents
|
||||
|
|
|
@ -88,7 +88,7 @@ if curl -A "80legs" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - ${red}80legs BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}80legs BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ if curl -A "Nutch" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - ${red}Nutch BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}Nutch BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ if curl -I http://localhost:9000 -e http://100dollars-seo.com 2>&1 | grep -i '(5
|
|||
echo "${bold}${green}PASSED - ${red}100dollars-seo.com BAD REFERRER DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}100dollars-seo.com BAD REFERRER NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ if curl -I http://localhost:9000 -e http://zx6.ru 2>&1 | grep -i '(52)'; then
|
|||
echo "${bold}${green}PASSED - ${red}zx6.ru BAD REFERRER DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}zx6.ru BAD REFERRER NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ if curl -A "GoogleBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
|||
echo "${bold}${green}PASSED - ${green}GoogleBot GOOD BOT ALLOWED THROUGH"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}GoogleBot GOOD BOT NOT ALLOWED THROUGH"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ if curl -A "BingBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
|||
echo "${bold}${green}PASSED - ${green}BingBot GOOD BOT ALLOWED THROUGH"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}BingBot GOOD BOT NOT ALLOWED THROUGH"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ if curl http://localhost:9000 -e http://google.com 2>&1 | grep -i 'Welcome'; the
|
|||
echo "${bold}${green}PASSED - ${green}google.com GOOD REFERRER DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}google.com GOOD REFERRER NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ if curl http://localhost:9000 -e http://bing.com 2>&1 | grep -i 'Welcome'; then
|
|||
echo "${bold}${green}PASSED - ${red}bing.com GOOD REFERRER DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}bing.com GOOD REFERRER NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -160,61 +160,25 @@ if curl -A "Googlebot/Nutch-1.7" http://localhost:9000 2>&1 | grep -i '(52)'; th
|
|||
echo "${bold}${green}PASSED - ${red}Googlebot/Nutch-1.7 BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}Googlebot/Nutch-1.7 BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest10 () {
|
||||
if curl -A "Mozilla/5.0 (compatible; Googlebot/Nutch2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
echo "${bold}${green}PASSED - ${red}Googlebot/Nutch2.1 BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}Googlebot/Nutch2.1 BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest11 () {
|
||||
if curl -A "Mozilla/5.0 (compatible; Googlebot/nutch/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
echo "${bold}${green}PASSED - ${red}Googlebot/nutch/-2.1 BAD BOT DETECTED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - Googlebot/nutch/-2.1 BAD BOT NOT DETECTED"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest12 () {
|
||||
if curl -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Googlebot-Image/Snutch\-/-2.1"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Googlebot-Image/Snutch\-/-2.1"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest13 () {
|
||||
if curl -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on SnutchMozilla/5.0"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on SnutchMozilla/5.0"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest14 () {
|
||||
if curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Mozilla/5.0"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest15 () {
|
||||
run_curltest11 () {
|
||||
if curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari"
|
||||
else
|
||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Safari"
|
||||
#exit 1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -236,6 +200,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -256,6 +221,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -276,6 +242,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -296,6 +263,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -317,6 +285,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -336,6 +305,7 @@ for line in ${lines}; do
|
|||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -364,10 +334,6 @@ run_curltest8
|
|||
run_curltest9
|
||||
run_curltest10
|
||||
run_curltest11
|
||||
run_curltest12
|
||||
run_curltest13
|
||||
run_curltest14
|
||||
run_curltest15
|
||||
testBadUserAgents
|
||||
testGoodUserAgents
|
||||
testAllowedUserAgents
|
||||
|
|
Loading…
Add table
Reference in a new issue