mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-10 15:34:24 +00:00
Nginx Test BETA - Reduce Verbose Curls
This commit is contained in:
parent
246c1a39af
commit
7465ca0a14
1 changed files with 14 additions and 14 deletions
|
@ -77,17 +77,17 @@ sleep 10s
|
|||
}
|
||||
|
||||
run_curltest1 () {
|
||||
if curl -v -A "80legs" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
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"
|
||||
curl -v -A "80legs" http://localhost:9000 2>&1
|
||||
curl -A "80legs" http://localhost:9000 2>&1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_curltest2 () {
|
||||
if curl -v -A "Nutch" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
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"
|
||||
|
@ -114,7 +114,7 @@ fi
|
|||
}
|
||||
|
||||
run_curltest5 () {
|
||||
if curl -v -A "GoogleBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
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"
|
||||
|
@ -123,7 +123,7 @@ fi
|
|||
}
|
||||
|
||||
run_curltest6 () {
|
||||
if curl -v -A "BingBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
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"
|
||||
|
@ -177,7 +177,7 @@ fi
|
|||
}
|
||||
|
||||
run_curltest12 () {
|
||||
if curl -v -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
|
||||
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"
|
||||
|
@ -186,7 +186,7 @@ fi
|
|||
}
|
||||
|
||||
run_curltest13 () {
|
||||
if curl -v -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
|
||||
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"
|
||||
|
@ -195,7 +195,7 @@ fi
|
|||
}
|
||||
|
||||
run_curltest14 () {
|
||||
if curl -v -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
|
||||
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"
|
||||
|
@ -204,7 +204,7 @@ fi
|
|||
}
|
||||
|
||||
run_curltest15 () {
|
||||
if curl -v -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
|
||||
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"
|
||||
|
@ -226,7 +226,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test.list
|
|||
lines=$(cat ${file})
|
||||
for line in ${lines}; do
|
||||
if
|
||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
curl -A "${line}" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||
|
@ -246,7 +246,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
|||
lines=$(cat ${file})
|
||||
for line in ${lines}; do
|
||||
if
|
||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
|
@ -266,7 +266,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
|||
lines=$(cat ${file})
|
||||
for line in ${lines}; do
|
||||
if
|
||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
|
@ -286,7 +286,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
|||
lines=$(cat ${file})
|
||||
for line in ${lines}; do
|
||||
if
|
||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
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"
|
||||
|
@ -326,7 +326,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-referrers-for-test.list
|
|||
lines=$(cat ${file})
|
||||
for line in ${lines}; do
|
||||
if
|
||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue