From 6e703f206c214518d069471292a0524e68395a2f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 3 Oct 2022 12:20:44 +0100 Subject: [PATCH] Debug for mitm --- daemon.py | 3 +++ scripts/mitm | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100755 scripts/mitm diff --git a/daemon.py b/daemon.py index 548150781..4fa90866c 100644 --- a/daemon.py +++ b/daemon.py @@ -465,6 +465,7 @@ class PubServer(BaseHTTPRequestHandler): for header_name in check_headers: if self.headers.get(header_name): if interloper in self.headers[header_name]: + print('MITM: ' + self.headers[header_name]) return True # The presence of these headers on their own indicates a MiTM mitm_headers = ( @@ -473,8 +474,10 @@ class PubServer(BaseHTTPRequestHandler): ) for header_name in mitm_headers: if self.headers.get(header_name): + print('MITM: ' + self.headers[header_name]) return True if self.headers.get(header_name.lower()): + print('MITM: ' + self.headers[header_name]) return True return False diff --git a/scripts/mitm b/scripts/mitm new file mode 100755 index 000000000..09cb8cc9b --- /dev/null +++ b/scripts/mitm @@ -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