From a8cf1fde5040f77d6159cf7a54d3ddf84b9590f0 Mon Sep 17 00:00:00 2001 From: Matthew Haigh Date: Fri, 7 Sep 2018 06:31:04 -0700 Subject: [PATCH 1/3] added log entry for new tcp connections at proxy --- fakenet/listeners/ProxyListener.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fakenet/listeners/ProxyListener.py b/fakenet/listeners/ProxyListener.py index 33b193d..84d94a3 100644 --- a/fakenet/listeners/ProxyListener.py +++ b/fakenet/listeners/ProxyListener.py @@ -154,11 +154,13 @@ def get_top_listener(config, data, listeners, diverter, orig_src_ip, return top_listener + class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): - def handle(self): + self.server.logger.info( + 'New connection: %s:%s' % self.request.getpeername()) remote_sock = self.request # queue for data received from the listener listener_q = Queue.Queue() From d715ea10a06ce836598960d9b236cac2d0e32d19 Mon Sep 17 00:00:00 2001 From: Matthew Haigh Date: Thu, 21 Mar 2019 05:50:20 -0700 Subject: [PATCH 2/3] added logging to HTTP listener --- fakenet/listeners/HTTPListener.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fakenet/listeners/HTTPListener.py b/fakenet/listeners/HTTPListener.py index 381cff5..55a5ea3 100644 --- a/fakenet/listeners/HTTPListener.py +++ b/fakenet/listeners/HTTPListener.py @@ -130,9 +130,11 @@ def __init__(self, *args): BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args) def version_string(self): - return self.server.config.get('version', "FakeNet/1.3") + return self.server.config.get('version', "FakeNet/1.3") def setup(self): + self.server.logger.info( + 'New HTTP connection: %s:%s' % self.client_address) self.request.settimeout(int(self.server.config.get('timeout', 5))) BaseHTTPServer.BaseHTTPRequestHandler.setup(self) From 6201a1a68e726ec33c87770284f11770d1267a05 Mon Sep 17 00:00:00 2001 From: Matthew Haigh Date: Thu, 21 Mar 2019 05:59:42 -0700 Subject: [PATCH 3/3] Added word proxy for clarity --- fakenet/listeners/ProxyListener.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fakenet/listeners/ProxyListener.py b/fakenet/listeners/ProxyListener.py index 84d94a3..9312e16 100644 --- a/fakenet/listeners/ProxyListener.py +++ b/fakenet/listeners/ProxyListener.py @@ -160,7 +160,7 @@ class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): def handle(self): self.server.logger.info( - 'New connection: %s:%s' % self.request.getpeername()) + 'New proxy connection: %s:%s' % self.request.getpeername()) remote_sock = self.request # queue for data received from the listener listener_q = Queue.Queue()