update Cloudflare IUAM detection

again
This commit is contained in:
Mike Fährmann
2022-10-31 18:33:52 +01:00
parent c12a97bcde
commit 86790da2d5

View File

@@ -149,14 +149,13 @@ class Extractor():
msg = "'{} {}' for '{}'".format(code, response.reason, url) msg = "'{} {}' for '{}'".format(code, response.reason, url)
server = response.headers.get("Server") server = response.headers.get("Server")
if server and server.startswith("cloudflare"): if server and server.startswith("cloudflare") and \
if code == 503 and \ code in (403, 503):
(b"_cf_chl_opt" in response.content or content = response.content
b"jschl-answer" in response.content): if b"_cf_chl_opt" in content or b"jschl-answer" in content:
self.log.warning("Cloudflare IUAM challenge") self.log.warning("Cloudflare IUAM challenge")
break break
if code == 403 and \ if b'name="captcha-bypass"' in content:
b'name="captcha-bypass"' in response.content:
self.log.warning("Cloudflare CAPTCHA") self.log.warning("Cloudflare CAPTCHA")
break break
if code < 500 and code != 429 and code != 430: if code < 500 and code != 429 and code != 430: