mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-06 12:40:17 +00:00
Introduce Random Bot Testing in Builds
This commit is contained in:
parent
3448d02162
commit
78e7c1098a
5 changed files with 132 additions and 8 deletions
|
@ -257,14 +257,23 @@ fi
|
||||||
}
|
}
|
||||||
run_curltest15
|
run_curltest15
|
||||||
|
|
||||||
#IFS=$'\n' read -d '' -r -a lines < ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list
|
#Test 50 Random User-Agents from Bad-User-Agents
|
||||||
#echo "${lines[@]}"
|
shuf -n 50 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test.tmp
|
||||||
#IFS=$'\n'
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test.list
|
||||||
#file=${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list
|
sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test.tmp
|
||||||
#lines=`cat $file`
|
|
||||||
#for line in $lines; do
|
echo "Testing 50 Random Bots"
|
||||||
# curl -v -A "$line" http://localhost:9000 2>&1
|
IFS=$'\n'
|
||||||
#done
|
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
|
||||||
|
echo "$(tput setaf 1)BAD BOT DETECTED - $(tput setaf 2)TEST PASSED"
|
||||||
|
else
|
||||||
|
echo "$(tput setaf 1)BAD REFERRER NOT DETECTED - TEST FAILED"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
echo "Tests Completed"
|
echo "Tests Completed"
|
||||||
|
|
50
.dev-tools/test_units/random-bots-for-test.list
Normal file
50
.dev-tools/test_units/random-bots-for-test.list
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
Steeler
|
||||||
|
SocialRankIOBot
|
||||||
|
PyCurl
|
||||||
|
Ecxi
|
||||||
|
eCatch
|
||||||
|
Indy Library
|
||||||
|
Twice
|
||||||
|
JetCar
|
||||||
|
Sqlworm
|
||||||
|
Craftbot
|
||||||
|
s1z.ru
|
||||||
|
UnisterBot
|
||||||
|
Gigablast
|
||||||
|
VidibleScraper
|
||||||
|
DIIbot
|
||||||
|
BDFetch
|
||||||
|
xpymep1.exe
|
||||||
|
seoscanners
|
||||||
|
MarkWatch
|
||||||
|
SuperBot
|
||||||
|
OrangeBot
|
||||||
|
page scorer
|
||||||
|
Nessus
|
||||||
|
Bolt
|
||||||
|
LeechFTP
|
||||||
|
RealDownload
|
||||||
|
NetSpider
|
||||||
|
HTMLparser
|
||||||
|
EMail Wolf
|
||||||
|
Pavuk
|
||||||
|
Likse
|
||||||
|
Spinn3r
|
||||||
|
Ltx71
|
||||||
|
Aboundexbot
|
||||||
|
Picsearch
|
||||||
|
Mata Hari
|
||||||
|
JOC Web Spider
|
||||||
|
FemtosearchBot
|
||||||
|
MegaIndex.ru
|
||||||
|
Probethenet
|
||||||
|
ZumBot
|
||||||
|
EroCrawler
|
||||||
|
Humanlinks
|
||||||
|
PeoplePal
|
||||||
|
LinqiaScrapeBot
|
||||||
|
zauba.io
|
||||||
|
WebAuto
|
||||||
|
Niki-bot
|
||||||
|
OutclicksBot
|
||||||
|
SurveyBot
|
50
.dev-tools/test_units/random-bots-for-test.tmp
Normal file
50
.dev-tools/test_units/random-bots-for-test.tmp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
Steeler
|
||||||
|
SocialRankIOBot
|
||||||
|
PyCurl
|
||||||
|
Ecxi
|
||||||
|
eCatch
|
||||||
|
Indy\ Library
|
||||||
|
Twice
|
||||||
|
JetCar
|
||||||
|
Sqlworm
|
||||||
|
Craftbot
|
||||||
|
s1z.ru
|
||||||
|
UnisterBot
|
||||||
|
Gigablast
|
||||||
|
VidibleScraper
|
||||||
|
DIIbot
|
||||||
|
BDFetch
|
||||||
|
xpymep1.exe
|
||||||
|
seoscanners
|
||||||
|
MarkWatch
|
||||||
|
SuperBot
|
||||||
|
OrangeBot
|
||||||
|
page\ scorer
|
||||||
|
Nessus
|
||||||
|
Bolt
|
||||||
|
LeechFTP
|
||||||
|
RealDownload
|
||||||
|
NetSpider
|
||||||
|
HTMLparser
|
||||||
|
EMail\ Wolf
|
||||||
|
Pavuk
|
||||||
|
Likse
|
||||||
|
Spinn3r
|
||||||
|
Ltx71
|
||||||
|
Aboundexbot
|
||||||
|
Picsearch
|
||||||
|
Mata\ Hari
|
||||||
|
JOC\ Web\ Spider
|
||||||
|
FemtosearchBot
|
||||||
|
MegaIndex.ru
|
||||||
|
Probethenet
|
||||||
|
ZumBot
|
||||||
|
EroCrawler
|
||||||
|
Humanlinks
|
||||||
|
PeoplePal
|
||||||
|
LinqiaScrapeBot
|
||||||
|
zauba.io
|
||||||
|
WebAuto
|
||||||
|
Niki-bot
|
||||||
|
OutclicksBot
|
||||||
|
SurveyBot
|
0
random-bots-for-test.list
Normal file
0
random-bots-for-test.list
Normal file
15
test.sh
Executable file
15
test.sh
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo "Testing 50 Random Bots"
|
||||||
|
IFS=$'\n'
|
||||||
|
file=/home/mitchellkrog/GIT/nginx-ultimate-bad-bot-blocker/.dev-tools/test_units/random-bots-for-test.list
|
||||||
|
lines=$(cat $file)
|
||||||
|
#echo ${lines}
|
||||||
|
for line in $lines; do
|
||||||
|
if
|
||||||
|
curl -v -A "${line}" http://localhost 2>&1 | grep -i '(52)'; then
|
||||||
|
echo "$(tput setaf 1)BAD BOT DETECTED - $(tput setaf 2)TEST PASSED"
|
||||||
|
else
|
||||||
|
echo "$(tput setaf 1)BAD REFERRER NOT DETECTED - TEST FAILED"
|
||||||
|
curl -v -A "${line}" http://localhost 2>&1
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue