mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-05 12:09:57 +00:00
[MASTER] ADD Referrer False Positive Testing REF: #277
This commit is contained in:
parent
83e531a522
commit
484c06e59d
1 changed files with 47 additions and 0 deletions
|
@ -77,6 +77,23 @@ UAmustnotmatch[2]="SNutch"
|
||||||
UAmustnotmatch[3]="Bing"
|
UAmustnotmatch[3]="Bing"
|
||||||
UAmustnotmatch[4]="bing"
|
UAmustnotmatch[4]="bing"
|
||||||
|
|
||||||
|
# ---------------------------
|
||||||
|
# REFERRER ARRAY - MUST MATCH
|
||||||
|
# ---------------------------
|
||||||
|
|
||||||
|
REFmustmatch[0]="zx6.ru"
|
||||||
|
REFmustmatch[1]="100dollars-seo.com"
|
||||||
|
REFmustmatch[2]="googglet.com"
|
||||||
|
|
||||||
|
# ---------------------------------
|
||||||
|
# USER-AGENT ARRAY - MUST NOT MATCH
|
||||||
|
# ---------------------------------
|
||||||
|
|
||||||
|
REFmustnotmatch[0]="zx6.russia"
|
||||||
|
REFmustnotmatch[1]="100dollars-seo.community"
|
||||||
|
REFmustnotmatch[2]="googglet.co"
|
||||||
|
REFmustnotmatch[3]="google.com"
|
||||||
|
|
||||||
# ---------
|
# ---------
|
||||||
# FUNCTIONS
|
# FUNCTIONS
|
||||||
# ---------
|
# ---------
|
||||||
|
@ -127,6 +144,36 @@ do
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# REFERRER FALSE POSITIVE TESTS
|
||||||
|
# -----------------------------
|
||||||
|
|
||||||
|
REFtest_mustmatch () {
|
||||||
|
for mustmatch in "${REFmustmatch[@]}"
|
||||||
|
do
|
||||||
|
if
|
||||||
|
curl -I http://localhost:9000 -e "${mustmatch}" 2>&1 | grep -i '(52)'; then
|
||||||
|
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
|
||||||
|
else
|
||||||
|
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
REFtest_mustnotmatch () {
|
||||||
|
for mustnotmatch in "${REFmustnotmatch[@]}"
|
||||||
|
do
|
||||||
|
if
|
||||||
|
curl -I http://localhost:9000 -e "${mustnotmatch}" 2>&1 | grep -i '(52)'; then
|
||||||
|
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "${bold}${green}PASSED (FALSE POSITIVE NOT DETECTED) - ${bold}${red}${mustnotmatch}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Trigger Functions / Tests
|
# Trigger Functions / Tests
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
Loading…
Add table
Reference in a new issue