Update the SOCKS proxy to use the new RelayManager#21048
Open
zeroSteiner wants to merge 3 commits intorapid7:masterfrom
Open
Update the SOCKS proxy to use the new RelayManager#21048zeroSteiner wants to merge 3 commits intorapid7:masterfrom
zeroSteiner wants to merge 3 commits intorapid7:masterfrom
Conversation
cbd1f60 to
ee24da5
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the SOCKS5 proxy implementation to use Rex::IO::RelayManager for TCP relaying instead of the local per-socket relay mixin, and updates the rex-core dependency to a git-based version that provides the needed relay manager behavior.
Changes:
- Replace the custom SOCKS5
TcpRelayimplementation withRex::IO::RelayManager-based relays. - Add a
relay_managerto the SOCKS5 server and use it fromServerClient. - Switch
rex-coredependency to a specific git branch/revision in Bundler.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/rex/proto/proxy/socks5/server.rb | Initializes and exposes a RelayManager instance for use by SOCKS5 clients. |
| lib/rex/proto/proxy/socks5/server_client.rb | Removes bespoke relay threading and wires sockets through the shared RelayManager; updates error logging and stop behavior. |
| Gemfile | Pins rex-core to a git branch to pick up RelayManager changes. |
| Gemfile.lock | Locks Bundler to the git-sourced rex-core revision. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 updates the SOCKS5 proxy module to use the newish RelayManager added in #20677 . The result is a net reduction in code and some performance improvements.
Requires rapid7/rex-core#45
Verification
List the steps needed to make sure this thing works
msfconsoleuse auxiliary/server/socks_proxySimple Benchmarking
This simple benchmark at least showed that when making repeated GET requests to a local server that is listening, the operation finished in about half the time.