diff --git a/Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD b/Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD index eaa86f6..17095c9 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.29 - 2024-03-14 + +### Changed + +- Fixed the build process that had a bad type used + ## 2.0.28 - 2024-03-13 ### Changed diff --git a/Payload_Type/poseidon/poseidon/agentfunctions/builder.go b/Payload_Type/poseidon/poseidon/agentfunctions/builder.go index 0354014..d249077 100644 --- a/Payload_Type/poseidon/poseidon/agentfunctions/builder.go +++ b/Payload_Type/poseidon/poseidon/agentfunctions/builder.go @@ -9,14 +9,16 @@ import ( agentstructs "github.com/MythicMeta/MythicContainer/agent_structs" "github.com/MythicMeta/MythicContainer/mythicrpc" "github.com/google/uuid" + "golang.org/x/exp/slices" "io" "os" "os/exec" "path/filepath" + "strconv" "strings" ) -const version = "2.0.28" +const version = "2.0.29" var payloadDefinition = agentstructs.PayloadType{ Name: "poseidon", @@ -252,15 +254,47 @@ func build(payloadBuildMsg agentstructs.PayloadBuildMessage) agentstructs.Payloa agentConfigString = strings.ReplaceAll(agentConfigString, "\n", "") ldflags += fmt.Sprintf(" -X '%s.%s_%s=%s'", poseidon_repo_profile, payloadBuildMsg.C2Profiles[index].Name, key, agentConfigString) */ - } else { - val, err := payloadBuildMsg.C2Profiles[index].GetArg(key) + } else if slices.Contains([]string{"callback_jitter", "callback_interval", "callback_port", "port"}, key) { + + val, err := payloadBuildMsg.C2Profiles[index].GetNumberArg(key) if err != nil { payloadBuildResponse.Success = false payloadBuildResponse.BuildStdErr = err.Error() return payloadBuildResponse } - initialConfig[key] = val + initialConfig[key] = int(val) //ldflags += fmt.Sprintf(" -X '%s.%s_%s=%v'", poseidon_repo_profile, payloadBuildMsg.C2Profiles[index].Name, key, val) + } else if slices.Contains([]string{"encrypted_exchange_check"}, key) { + val, err := payloadBuildMsg.C2Profiles[index].GetBooleanArg(key) + if err != nil { + payloadBuildResponse.Success = false + payloadBuildResponse.BuildStdErr = err.Error() + return payloadBuildResponse + } + initialConfig[key] = val + } else { + val, err := payloadBuildMsg.C2Profiles[index].GetStringArg(key) + if err != nil { + payloadBuildResponse.Success = false + payloadBuildResponse.BuildStdErr = err.Error() + return payloadBuildResponse + } + if key == "proxy_port" { + if val == "" { + initialConfig[key] = 0 + } else { + intval, err := strconv.Atoi(val) + if err != nil { + payloadBuildResponse.Success = false + payloadBuildResponse.BuildStdErr = err.Error() + return payloadBuildResponse + } + initialConfig[key] = intval + } + } else { + initialConfig[key] = val + } + } } initialConfigBytes, err := json.Marshal(initialConfig) @@ -270,7 +304,7 @@ func build(payloadBuildMsg agentstructs.PayloadBuildMessage) agentstructs.Payloa return payloadBuildResponse } initialConfigBase64 := base64.StdEncoding.EncodeToString(initialConfigBytes) - payloadBuildResponse.BuildStdOut += fmt.Sprintf("%s's config: \n%v\n", payloadBuildMsg.C2Profiles[index].Name, initialConfig) + payloadBuildResponse.BuildStdOut += fmt.Sprintf("%s's config: \n%v\n", payloadBuildMsg.C2Profiles[index].Name, string(initialConfigBytes)) ldflags += fmt.Sprintf(" -X '%s.%s_%s=%v'", poseidon_repo_profile, payloadBuildMsg.C2Profiles[index].Name, "initial_config", initialConfigBase64) } diff --git a/agent_capabilities.json b/agent_capabilities.json index d4a7e96..ed3b228 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", - "agent_version": "2.0.28", + "agent_version": "2.0.29", "supported_wrappers": [] } \ No newline at end of file