Add proxy authentication support to the Python Meterpreter #13978
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support to the Python Meterpreter for using HTTP Proxies that require authentication by honoring the
HttpProxyUser
andHttpProxyPass
options (at least one of the two must be set to a non-empty string). This also deregisters theHttpProxyType
option because HTTP is the only one that is supported.I also updated the meterpreter stage description to note that it's compatible with versions 2.5-2.7 and 3.1+ to imply that it does in fact work with Python 3.7, 3.8 etc.
This addresses rapid7/metasploit-payloads#386 and requires the changes in rapid7/metasploit-payloads#427.
Verification
I used proxy.py as my proxy for testing and I highly recommend for the following reasons:
pip install proxy.py
--basic-auth
flagpip install proxy.py
proxy --hostname 0.0.0.0 --basic-auth user:pass
msfconsole
use payload/python/meterpreter/reverse_https
LHOST
andLPORT
options per usualHttpProxyHost
andHttpProxyPort
options to whatever system is running your proxy instanceHttpProxyUser
andHttpProxyPass
options to "user" and "pass" respectivelyto_handler