mirror of https://gitlab.com/bashrc2/epicyon
Show full header when using debug scripts
parent
34e9353cb1
commit
58d5fa7ed0
|
|
@ -286,7 +286,8 @@ def daemon_http_get(self) -> None:
|
||||||
if is_image_file(self.path):
|
if is_image_file(self.path):
|
||||||
http_404(self, 720)
|
http_404(self, 720)
|
||||||
return
|
return
|
||||||
print('GET HTTP LLM scraper poisoned: ' + str(self.headers))
|
print('GET HTTP LLM scraper poisoned: ' +
|
||||||
|
str(self.headers).replace('\n', ' '))
|
||||||
msg = html_poisoned(self.server.dictionary,
|
msg = html_poisoned(self.server.dictionary,
|
||||||
self.server.twograms)
|
self.server.twograms)
|
||||||
msg = msg.encode('utf-8')
|
msg = msg.encode('utf-8')
|
||||||
|
|
@ -302,7 +303,8 @@ def daemon_http_get(self) -> None:
|
||||||
|
|
||||||
# suspicious headers
|
# suspicious headers
|
||||||
if contains_suspicious_headers(self.headers):
|
if contains_suspicious_headers(self.headers):
|
||||||
print('GET HTTP suspicious headers 1 ' + str(self.headers))
|
print('GET HTTP suspicious headers 1 ' +
|
||||||
|
str(self.headers).replace('\n', ' '))
|
||||||
http_403(self)
|
http_403(self)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -340,7 +342,7 @@ def daemon_http_get(self) -> None:
|
||||||
|
|
||||||
if contains_invalid_chars(str(self.headers)):
|
if contains_invalid_chars(str(self.headers)):
|
||||||
print('GET HTTP headers contain invalid characters ' +
|
print('GET HTTP headers contain invalid characters ' +
|
||||||
str(self.headers))
|
str(self.headers).replace('\n', ' '))
|
||||||
http_403(self)
|
http_403(self)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -405,7 +407,8 @@ def daemon_http_get(self) -> None:
|
||||||
http_402(self)
|
http_402(self)
|
||||||
return
|
return
|
||||||
# if this is an LLM crawler then feed it some trash
|
# if this is an LLM crawler then feed it some trash
|
||||||
print('GET HTTP LLM scraper poisoned: ' + str(self.headers))
|
print('GET HTTP LLM scraper poisoned: ' +
|
||||||
|
str(self.headers).replace('\n', ' '))
|
||||||
msg = html_poisoned(self.server.dictionary,
|
msg = html_poisoned(self.server.dictionary,
|
||||||
self.server.twograms)
|
self.server.twograms)
|
||||||
msg = msg.encode('utf-8')
|
msg = msg.encode('utf-8')
|
||||||
|
|
@ -649,7 +652,7 @@ def daemon_http_get(self) -> None:
|
||||||
str(self.server.getreq_busy))
|
str(self.server.getreq_busy))
|
||||||
|
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print(str(self.headers))
|
print(str(self.headers).replace('\n', ' '))
|
||||||
|
|
||||||
cookie = None
|
cookie = None
|
||||||
if self.headers.get('Cookie'):
|
if self.headers.get('Cookie'):
|
||||||
|
|
@ -708,7 +711,7 @@ def daemon_http_get(self) -> None:
|
||||||
print('GET Authorization granted ' + self.path)
|
print('GET Authorization granted ' + self.path)
|
||||||
else:
|
else:
|
||||||
print('GET Not authorized ' + self.path + ' ' +
|
print('GET Not authorized ' + self.path + ' ' +
|
||||||
str(self.headers))
|
str(self.headers).replace('\n', ' '))
|
||||||
|
|
||||||
fitness_performance(getreq_start_time, self.server.fitness,
|
fitness_performance(getreq_start_time, self.server.fitness,
|
||||||
'_GET', 'isAuthorized',
|
'_GET', 'isAuthorized',
|
||||||
|
|
@ -1484,7 +1487,8 @@ def daemon_http_get(self) -> None:
|
||||||
self.headers['Connection'])
|
self.headers['Connection'])
|
||||||
http_200(self)
|
http_200(self)
|
||||||
else:
|
else:
|
||||||
print('WARN: No Accept header ' + str(self.headers))
|
print('WARN: No Accept header ' +
|
||||||
|
str(self.headers).replace('\n', ' '))
|
||||||
http_400(self)
|
http_400(self)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -178,17 +178,20 @@ def daemon_http_post(self) -> None:
|
||||||
|
|
||||||
mitm = detect_mitm(self)
|
mitm = detect_mitm(self)
|
||||||
if mitm:
|
if mitm:
|
||||||
print('DEBUG: MITM on HTTP POST, ' + str(self.headers))
|
print('DEBUG: MITM on HTTP POST, ' +
|
||||||
|
str(self.headers).replace('\n', ' '))
|
||||||
|
|
||||||
# headers used by LLM scrapers
|
# headers used by LLM scrapers
|
||||||
if 'oai-host-hash' in self.headers:
|
if 'oai-host-hash' in self.headers:
|
||||||
print('POST HTTP LLM scraper bounced: ' + str(self.headers))
|
print('POST HTTP LLM scraper bounced: ' +
|
||||||
|
str(self.headers).replace('\n', ' '))
|
||||||
http_402(self)
|
http_402(self)
|
||||||
return
|
return
|
||||||
|
|
||||||
# suspicious headers
|
# suspicious headers
|
||||||
if contains_suspicious_headers(self.headers):
|
if contains_suspicious_headers(self.headers):
|
||||||
print('POST HTTP suspicious headers 2 ' + str(self.headers))
|
print('POST HTTP suspicious headers 2 ' +
|
||||||
|
str(self.headers).replace('\n', ' '))
|
||||||
http_403(self)
|
http_403(self)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -261,7 +264,7 @@ def daemon_http_post(self) -> None:
|
||||||
|
|
||||||
if contains_invalid_chars(str(self.headers)):
|
if contains_invalid_chars(str(self.headers)):
|
||||||
print('POST HTTP headers contain invalid characters ' +
|
print('POST HTTP headers contain invalid characters ' +
|
||||||
str(self.headers))
|
str(self.headers).replace('\n', ' '))
|
||||||
http_403(self)
|
http_403(self)
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
@ -342,7 +345,7 @@ def daemon_http_post(self) -> None:
|
||||||
authorized = is_authorized(self)
|
authorized = is_authorized(self)
|
||||||
if not authorized and self.server.debug:
|
if not authorized and self.server.debug:
|
||||||
print('POST Not authorized')
|
print('POST Not authorized')
|
||||||
print(str(self.headers))
|
print(str(self.headers).replace('\n', ' '))
|
||||||
|
|
||||||
# if this is a POST to the outbox then check authentication
|
# if this is a POST to the outbox then check authentication
|
||||||
self.outbox_authenticated = False
|
self.outbox_authenticated = False
|
||||||
|
|
@ -1140,7 +1143,7 @@ def daemon_http_post(self) -> None:
|
||||||
not content_type_str.startswith('application/ld+json'):
|
not content_type_str.startswith('application/ld+json'):
|
||||||
print("POST is not json: " + self.headers['Content-type'])
|
print("POST is not json: " + self.headers['Content-type'])
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print(str(self.headers))
|
print(str(self.headers).replace('\n', ' '))
|
||||||
length = int(self.headers['Content-length'])
|
length = int(self.headers['Content-length'])
|
||||||
if length < self.server.max_post_length:
|
if length < self.server.max_post_length:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue