POC: Returning the http server location instead of the C2 connection string in the agent profile#31
Draft
mrengstrom wants to merge 1 commit intomasterfrom
Draft
POC: Returning the http server location instead of the C2 connection string in the agent profile#31mrengstrom wants to merge 1 commit intomasterfrom
mrengstrom wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes agent profile construction by returning the HTTP server location instead of the C2 connection string. The change addresses an issue where abilities expecting #{server} replacement were receiving the C2 connection string rather than the HTTP server URL they require.
- Modified
buildProfilefunction to accept and use HTTP server parameter - Updated profile creation to set "server" field to HTTP location instead of socket
- Fixed function call to pass both socket and HTTP parameters
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Description
A fix for the behavior seen in mitre/caldera#2165
The way things currently run, the C2 connection string is what gets returned in the agent profile to the server, which is used to construct the agent object. The C2 string is nice to have, but places of replacement of
#{server}in abilities are expecting the http server, so that seems the more appropriate value to send back.Ideally we would send back both the http server and the connection strings, so that we could send payloads back and initialize agents with the same C2 channels. This all is more involved as P2P agents beacon in as upstream agents will have to implement web servers for file uploads and C2 channels for communications (all this work is done already for sandcat and it works in this specific way)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tested the same scenario as the issue, and was able to reproduce it, then implement a fix that populates out the ability values correctly.
Checklist: