antibot - basic pow with javascript

This commit is contained in:
bunkerity
2021-05-19 17:36:29 +02:00
parent 16e5ede130
commit 6645632846
3 changed files with 19 additions and 8 deletions

View File

@@ -242,7 +242,7 @@ if use_crowdsec then
end
-- cookie check
if use_antibot_cookie then
if use_antibot_cookie and ngx.var.uri ~= "/favicon.ico" then
if not cookie.is_set("uri") then
if ngx.var.request_uri ~= antibot_uri then
cookie.set({uri = ngx.var.request_uri})
@@ -258,7 +258,7 @@ if use_antibot_cookie then
end
-- javascript check
if use_antibot_javascript then
if use_antibot_javascript and ngx.var.uri ~= "/favicon.ico" then
if not cookie.is_set("javascript") then
if ngx.var.request_uri ~= antibot_uri then
cookie.set({uri = ngx.var.request_uri, challenge = javascript.get_challenge()})
@@ -268,7 +268,7 @@ if use_antibot_javascript then
end
-- captcha check
if use_antibot_captcha then
if use_antibot_captcha and ngx.var.uri ~= "/favicon.ico" then
if not cookie.is_set("captcha") then
if ngx.var.request_uri ~= antibot_uri then
cookie.set({uri = ngx.var.request_uri})
@@ -278,7 +278,7 @@ if use_antibot_captcha then
end
-- recaptcha check
if use_antibot_recaptcha then
if use_antibot_recaptcha and ngx.var.uri ~= "/favicon.ico" then
if not cookie.is_set("recaptcha") then
if ngx.var.request_uri ~= antibot_uri then
cookie.set({uri = ngx.var.request_uri})