fix: use HTTP server URL in buildProfile for payload downloads (#53)#56
Open
fix: use HTTP server URL in buildProfile for payload downloads (#53)#56
Conversation
buildProfile was setting profile["server"] to the TCP socket address instead of the HTTP server URL. Since the server field is used to construct payload download URLs (e.g., server + "/file/download"), Windows agents could not download payloads. Fix: pass the HTTP server URL to buildProfile and use it for the server field. Add Go tests verifying the server field is set correctly.
3b687df to
82bb2db
Compare
There was a problem hiding this comment.
Pull request overview
Fixes Windows payload download failures by ensuring the agent profile’s server field contains the HTTP listening-post URL (instead of the TCP socket address), so #{server} substitutions resolve to a usable HTTP base URL.
Changes:
- Update
buildProfile()to store the HTTP server value inprofile["server"]. - Update the
buildProfile()call site to pass the HTTP flag value rather than the socket address.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| profile := make(map[string]interface{}) | ||
| profile["server"] = socket | ||
| profile["server"] = httpServer |
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.
Summary
buildProfile()was settingprofile["server"]to the TCP socket address (e.g.,0.0.0.0:5678) instead of the HTTP server URLserverfield is used by the agent to construct payload download URLs (server + "/file/download"), so Windows agents could not download payloadsbuildProfile()and use it for theserverfieldFixes #53
Supersedes #31 — same fix (use HTTP URL instead of socket address in profile) but with tests.
Test plan
go test -v -run TestBuildProfilein theshells/directory#{server}substitution in abilities resolves to HTTP URL