From e839e64db2cc3fe68e30a9aa26c6ada13852a597 Mon Sep 17 00:00:00 2001 From: mb Date: Mon, 14 Jan 2019 06:39:26 -0500 Subject: [PATCH] Added more headers --- .../py-collaborator-mitmproxy-addon.py | 12 +++++++++++- web/py-collaborator/py-collaborator-proxy2-plugin.py | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/web/py-collaborator/py-collaborator-mitmproxy-addon.py b/web/py-collaborator/py-collaborator-mitmproxy-addon.py index 189cbf3..9fda6c0 100644 --- a/web/py-collaborator/py-collaborator-mitmproxy-addon.py +++ b/web/py-collaborator/py-collaborator-mitmproxy-addon.py @@ -42,6 +42,13 @@ append_headers = ( 'X-Forwarded-For', 'Referer', 'True-Client-IP', + 'X-Originating-IP', + 'X-Client-IP', + 'Client-IP', + 'X-Real-IP', + 'Contact', + 'Forwarded', + 'CF-Connecting_IP', 'X-WAP-Profile' ) @@ -301,6 +308,9 @@ class PyCollaboratorMitmproxyAddon: for header in append_headers: (pingback, uuid) = PyCollaboratorMitmproxyAddon.getPingbackUrl(self.request) self.request.headers[header] = pingback + if 'IP' in header: + self.request.headers[header] = '{}.{}'.format(uuid, config['pingback-host']) + self.saveRequestForCorrelation(pingback, header, uuid, 'Header: {}'.format(header)) self.sendMisroutedRequests() @@ -353,4 +363,4 @@ def request(flow: http.HTTPFlow) -> None: globalPyCollaborator.requestForMitmproxy(flow) globalPyCollaborator = PyCollaboratorMitmproxyAddon() -addons = [request] \ No newline at end of file +addons = [request] diff --git a/web/py-collaborator/py-collaborator-proxy2-plugin.py b/web/py-collaborator/py-collaborator-proxy2-plugin.py index 8bbbb6f..2712ea4 100644 --- a/web/py-collaborator/py-collaborator-proxy2-plugin.py +++ b/web/py-collaborator/py-collaborator-proxy2-plugin.py @@ -38,6 +38,13 @@ append_headers = ( 'X-Forwarded-For', 'Referer', 'True-Client-IP', + 'X-Originating-IP', + 'X-Client-IP', + 'Client-IP', + 'X-Real-IP', + 'Contact', + 'Forwarded', + 'CF-Connecting_IP', 'X-WAP-Profile' ) @@ -301,6 +308,8 @@ class ProxyHandler: for header in append_headers: (pingback, uuid) = ProxyHandler.getPingbackUrl(self.request) self.request.headers[header] = pingback + if 'IP' in header: + self.request.headers[header] = '{}.{}'.format(uuid, config['pingback-host']) self.saveRequestForCorrelation(pingback, header, uuid, 'Header: {}'.format(header)) self.sendMisroutedRequests() @@ -311,4 +320,4 @@ class ProxyHandler: def response_handler(self, req, req_body, res, res_body): pass - \ No newline at end of file +