Debug for mitm

main
Bob Mottram 2022-10-03 12:20:44 +01:00
parent a9e300037d
commit 6e703f206c
2 changed files with 10 additions and 0 deletions

View File

@ -465,6 +465,7 @@ class PubServer(BaseHTTPRequestHandler):
for header_name in check_headers: for header_name in check_headers:
if self.headers.get(header_name): if self.headers.get(header_name):
if interloper in self.headers[header_name]: if interloper in self.headers[header_name]:
print('MITM: ' + self.headers[header_name])
return True return True
# The presence of these headers on their own indicates a MiTM # The presence of these headers on their own indicates a MiTM
mitm_headers = ( mitm_headers = (
@ -473,8 +474,10 @@ class PubServer(BaseHTTPRequestHandler):
) )
for header_name in mitm_headers: for header_name in mitm_headers:
if self.headers.get(header_name): if self.headers.get(header_name):
print('MITM: ' + self.headers[header_name])
return True return True
if self.headers.get(header_name.lower()): if self.headers.get(header_name.lower()):
print('MITM: ' + self.headers[header_name])
return True return True
return False return False

7
scripts/mitm 100755
View File

@ -0,0 +1,7 @@
#!/bin/bash
journalctl -u epicyon | grep 'MITM:' > .mitm_events.txt
if [ ! -f .mitm_events.txt ]; then
echo 'No MITM events'
else
cat .mitm_events.txt
fi