Skip to content

Commit

Permalink
fixing build processes
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Mar 14, 2024
1 parent 915a4be commit 073b1d4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 39 additions & 5 deletions Payload_Type/poseidon/poseidon/agentfunctions/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand All @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion agent_capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}

0 comments on commit 073b1d4

Please sign in to comment.