Added more headers

This commit is contained in:
mb 2019-01-14 06:39:26 -05:00
parent 8c359f5f7f
commit e839e64db2
2 changed files with 21 additions and 2 deletions

View File

@ -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]
addons = [request]

View File

@ -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