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', 'X-Forwarded-For',
'Referer', 'Referer',
'True-Client-IP', 'True-Client-IP',
'X-Originating-IP',
'X-Client-IP',
'Client-IP',
'X-Real-IP',
'Contact',
'Forwarded',
'CF-Connecting_IP',
'X-WAP-Profile' 'X-WAP-Profile'
) )
@ -301,6 +308,9 @@ class PyCollaboratorMitmproxyAddon:
for header in append_headers: for header in append_headers:
(pingback, uuid) = PyCollaboratorMitmproxyAddon.getPingbackUrl(self.request) (pingback, uuid) = PyCollaboratorMitmproxyAddon.getPingbackUrl(self.request)
self.request.headers[header] = pingback 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.saveRequestForCorrelation(pingback, header, uuid, 'Header: {}'.format(header))
self.sendMisroutedRequests() self.sendMisroutedRequests()

View File

@ -38,6 +38,13 @@ append_headers = (
'X-Forwarded-For', 'X-Forwarded-For',
'Referer', 'Referer',
'True-Client-IP', 'True-Client-IP',
'X-Originating-IP',
'X-Client-IP',
'Client-IP',
'X-Real-IP',
'Contact',
'Forwarded',
'CF-Connecting_IP',
'X-WAP-Profile' 'X-WAP-Profile'
) )
@ -301,6 +308,8 @@ class ProxyHandler:
for header in append_headers: for header in append_headers:
(pingback, uuid) = ProxyHandler.getPingbackUrl(self.request) (pingback, uuid) = ProxyHandler.getPingbackUrl(self.request)
self.request.headers[header] = pingback 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.saveRequestForCorrelation(pingback, header, uuid, 'Header: {}'.format(header))
self.sendMisroutedRequests() self.sendMisroutedRequests()