-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socks5h and socks5 support for python/meterpreter #735
base: master
Are you sure you want to change the base?
Conversation
Added support for socks5 and socks5h proxy
added socks5 and socks5h support
I don't have enough knowledge to apply it directly to msfvenom |
FIxed a small bug
fixed error for no module named
fixed an error for older Python versions
@@ -13,6 +13,8 @@ | |||
import threading | |||
import time | |||
import traceback | |||
import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could be wrong, but I believe the Python Meterpreter payload is meant to have zero dependencies to increase the likelhood that it works in all contexts. i.e. we couldn't have import requests
here in the payload and expect it to work 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. So I just have to make it an optional feature with try or if statement, so only if socks proxy is configured then it will import request library otherwise it will use UrlLib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add proxy support, it should really work consistently without any extra dependencies, ever.
A minimum version of Python maybe, but that shouldn't be necessary here, we've just had to use that in the past for ctypes. We would also need it added to the stagers. As it is right now, this looks like it has the following requirements, none of which are probably obvious to our users.
- The Python Meterpreter is selected
- A HTTP(S) transport is selected (this one is consistent IIRC with the wider proxy support)
- A stageless Meterpreter is selected
- The target has
requests
installed
We should also ensure that the functionality matches the other Meterpreter implementations which IIRC don't support SOCKS, they only support HTTP and I think it's only for HTTP transports.
Added requests library to properly use socks5 and socks5h for proxy also supports previous HTTP proxy
proxy format
socks5://ipadrress:port
socks5h://ipadrress:port ( added this to use DNS through proxy )
http://ipadrress:port
https://ipadrress:port
same thing goes for HttpProxyUser and Pass both HTTP and SOCKS uses same format