-
Notifications
You must be signed in to change notification settings - Fork 31
Add SOCKS5H Support #76
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
Changes from all commits
4be1a6a
48e6218
2bf32af
5a4c868
e647ece
e1d4b3a
9de00d8
a19f90f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -312,6 +312,7 @@ def peerport | |
| # The local host. Equivalent to the LocalHost parameter hash key. | ||
| # @return [String] | ||
| attr_writer :localhost | ||
|
|
||
| def localhost | ||
| return @localhost if @localhost | ||
|
|
||
|
|
@@ -354,7 +355,9 @@ def comm | |
| best_comm = nil | ||
| # If no comm was explicitly specified, try to use the comm that is best fit | ||
| # to handle the provided host based on the current routing table. | ||
| if server and localhost | ||
| if proxies? | ||
| best_comm = Rex::Socket::Comm::Local | ||
| elsif server && localhost | ||
|
Comment on lines
+358
to
+360
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now, only the local comm supports proxied connections. If a comm is specified, the proxy options are silently ignored. This seems like a problem. Solutions are probably to:
Kind of related is the fact that proxies are ignored for non-TCP socket types. Also seems like a problem, but supporting proxies in comms won't change that. SOCKS4 and HTTP simply don't support UDP and they never will. |
||
| best_comm = Rex::Socket::SwitchBoard.best_comm(localhost) | ||
| elsif peerhost | ||
| best_comm = Rex::Socket::SwitchBoard.best_comm(peerhost) | ||
|
|
@@ -472,6 +475,10 @@ def v6 | |
| # @return [Array] | ||
| attr_accessor :proxies | ||
|
|
||
| def proxies? | ||
| proxies && !proxies.empty? | ||
| end | ||
|
|
||
| alias peeraddr peerhost | ||
| alias localaddr localhost | ||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
This fixed a bug where an exception would be raised if Rex::Socket was used out side the context of Metasploit because
Rex::Proto::Http::Responseis unavailable. The other proxies just do the bare minimum parsing necessary to ensure the connection was established, so that pattern was copied here as well. Removing this dependency also means the HTTP proxy can be tested in the specs.