mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 18:50:13 +00:00
Fix curl testing of test list
This commit is contained in:
parent
e7fb35ae48
commit
f7dc3a85fe
1 changed files with 10 additions and 10 deletions
|
@ -40,7 +40,7 @@ run_curltest1 () {
|
|||
truncate -s 0 ${_curltest1}
|
||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest1}"
|
||||
curl -A "80legs" http://localhost:9000/index.php 2>> ${_curltest1}
|
||||
curl -A "80legs" http://localhost:9000/index.html 2>> ${_curltest1}
|
||||
if grep -i '(52)' ${_curltest1}; then
|
||||
echo 'BAD BOT DETECTED - TEST PASSED'
|
||||
else
|
||||
|
@ -57,7 +57,7 @@ run_curltest2 () {
|
|||
truncate -s 0 ${_curltest2}
|
||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest2}"
|
||||
curl -A "Nutch" http://localhost:9000/index.php 2>> ${_curltest2}
|
||||
curl -A "Nutch" http://localhost:9000/index.html 2>> ${_curltest2}
|
||||
if grep -i '(52)' ${_curltest2}; then
|
||||
echo 'BAD BOT DETECTED - TEST PASSED'
|
||||
else
|
||||
|
@ -74,7 +74,7 @@ run_curltest3 () {
|
|||
truncate -s 0 ${_curltest3}
|
||||
printf '\n%s\n%s\n%s\n\n' "##############################" "TESTING BAD REFERRER IS DENIED" "##############################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest3}"
|
||||
curl -I http://localhost:9000/index.php -e http://100dollars-seo.com 2>> ${_curltest3}
|
||||
curl -I http://localhost:9000/index.html -e http://100dollars-seo.com 2>> ${_curltest3}
|
||||
if grep -i '(52)' ${_curltest3}; then
|
||||
echo 'BAD REFERRER DETECTED - TEST PASSED'
|
||||
else
|
||||
|
@ -91,7 +91,7 @@ run_curltest4 () {
|
|||
truncate -s 0 ${_curltest4}
|
||||
printf '\n%s\n%s\n%s\n\n' "##############################" "TESTING BAD REFERRER IS DENIED" "##############################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest4}"
|
||||
curl -I http://localhost:9000/index.php -e http://zx6.ru 2>> ${_curltest4}
|
||||
curl -I http://localhost:9000/index.html -e http://zx6.ru 2>> ${_curltest4}
|
||||
if grep -i '(52)' ${_curltest4}; then
|
||||
echo 'BAD REFERRER DETECTED - TEST PASSED'
|
||||
else
|
||||
|
@ -108,7 +108,7 @@ run_curltest5 () {
|
|||
truncate -s 0 ${_curltest5}
|
||||
printf '\n%s\n%s\n%s\n\n' "###########################" "TESTING GOOD BOT IS ALLOWED" "###########################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest5}"
|
||||
curl -v -A "GoogleBot" http://localhost:9000/index.php 2>&1 >> ${_curltest5}
|
||||
curl -v -A "GoogleBot" http://localhost:9000/index.html 2>&1 >> ${_curltest5}
|
||||
if grep -i 'Welcome' ${_curltest5}; then
|
||||
echo 'GOOD BOT ALLOWED THROUGH - TEST PASSED'
|
||||
else
|
||||
|
@ -125,7 +125,7 @@ run_curltest6 () {
|
|||
truncate -s 0 ${_curltest6}
|
||||
printf '\n%s\n%s\n%s\n\n' "###########################" "TESTING GOOD BOT IS ALLOWED" "###########################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest6}"
|
||||
curl -v -A "BingBot" http://localhost:9000/index.php 2>&1 >> ${_curltest6}
|
||||
curl -v -A "BingBot" http://localhost:9000/index.html 2>&1 >> ${_curltest6}
|
||||
if grep -i 'Welcome' ${_curltest6}; then
|
||||
echo 'GOOD BOT ALLOWED THROUGH - TEST PASSED'
|
||||
else
|
||||
|
@ -142,7 +142,7 @@ run_curltest7 () {
|
|||
truncate -s 0 ${_curltest7}
|
||||
printf '\n%s\n%s\n%s\n\n' "################################" "TESTING GOOD REFERRER IS ALLOWED" "################################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest7}"
|
||||
curl http://localhost:9000/index.php -e http://google.com 2>&1 >> ${_curltest7}
|
||||
curl http://localhost:9000/index.html -e http://google.com 2>&1 >> ${_curltest7}
|
||||
if grep -i 'Welcome' ${_curltest7}; then
|
||||
echo 'GOOD REFERRER DETECTED - TEST PASSED'
|
||||
else
|
||||
|
@ -159,7 +159,7 @@ run_curltest8 () {
|
|||
truncate -s 0 ${_curltest8}
|
||||
printf '\n%s\n%s\n%s\n\n' "################################" "TESTING GOOD REFERRER IS ALLOWED" "################################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest8}"
|
||||
curl http://localhost:9000/index.php -e http://bing.com 2>&1 >> ${_curltest8}
|
||||
curl http://localhost:9000/index.html -e http://bing.com 2>&1 >> ${_curltest8}
|
||||
if grep -i 'Welcome' ${_curltest8}; then
|
||||
echo 'GOOD REFERRER DETECTED - TEST PASSED'
|
||||
exit 0
|
||||
|
@ -177,7 +177,7 @@ run_curltest9 () {
|
|||
truncate -s 0 ${_curltest9}
|
||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest9}"
|
||||
curl -A "Googlebot/Nutch-1.7" http://localhost:9000/index.php 2>> ${_curltest9}
|
||||
curl -A "Googlebot/Nutch-1.7" http://localhost:9000/index.html 2>> ${_curltest9}
|
||||
if grep -i '(52)' ${_curltest9}; then
|
||||
echo 'BAD BOT DETECTED - TEST PASSED'
|
||||
else
|
||||
|
@ -194,7 +194,7 @@ run_curltest10 () {
|
|||
truncate -s 0 ${_curltest10}
|
||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest10}"
|
||||
curl -A "Mozilla/5.0 (compatible; Googlebot/Nutch2.1; +http://www.google.com/bot.html)" http://localhost:9000/index.php 2>> ${_curltest10}
|
||||
curl -A "Mozilla/5.0 (compatible; Googlebot/Nutch2.1; +http://www.google.com/bot.html)" http://localhost:9000/index.html 2>> ${_curltest10}
|
||||
if grep -i '(52)' ${_curltest10}; then
|
||||
echo 'BAD BOT DETECTED - TEST PASSED'
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue