Skip to content

fix: use HTTP server URL in buildProfile for payload downloads (#53)#56

Open
deacon-mp wants to merge 1 commit intomasterfrom
fix/issue-53-windows-payload-download
Open

fix: use HTTP server URL in buildProfile for payload downloads (#53)#56
deacon-mp wants to merge 1 commit intomasterfrom
fix/issue-53-windows-payload-download

Conversation

@deacon-mp
Copy link
Copy Markdown
Contributor

@deacon-mp deacon-mp commented Mar 16, 2026

Summary

  • buildProfile() was setting profile["server"] to the TCP socket address (e.g., 0.0.0.0:5678) instead of the HTTP server URL
  • The server field is used by the agent to construct payload download URLs (server + "/file/download"), so Windows agents could not download payloads
  • Fix: pass the HTTP server URL into buildProfile() and use it for the server field
  • Added Go tests verifying the server field is set to the HTTP URL, not the socket address

Fixes #53

Supersedes #31 — same fix (use HTTP URL instead of socket address in profile) but with tests.

Test plan

  • Run go test -v -run TestBuildProfile in the shells/ directory
  • Deploy Manx agent on Windows and verify payload downloads work
  • Verify #{server} substitution in abilities resolves to HTTP URL

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in profile["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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Manx on a Windows doesn't download the payloads

2 participants