Skip to content

Commit 073b1d4

Browse files
committed
fixing build processes
1 parent 915a4be commit 073b1d4

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## 2.0.29 - 2024-03-14
8+
9+
### Changed
10+
11+
- Fixed the build process that had a bad type used
12+
713
## 2.0.28 - 2024-03-13
814

915
### Changed

Payload_Type/poseidon/poseidon/agentfunctions/builder.go

+39-5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ import (
99
agentstructs "github.com/MythicMeta/MythicContainer/agent_structs"
1010
"github.com/MythicMeta/MythicContainer/mythicrpc"
1111
"github.com/google/uuid"
12+
"golang.org/x/exp/slices"
1213
"io"
1314
"os"
1415
"os/exec"
1516
"path/filepath"
17+
"strconv"
1618
"strings"
1719
)
1820

19-
const version = "2.0.28"
21+
const version = "2.0.29"
2022

2123
var payloadDefinition = agentstructs.PayloadType{
2224
Name: "poseidon",
@@ -252,15 +254,47 @@ func build(payloadBuildMsg agentstructs.PayloadBuildMessage) agentstructs.Payloa
252254
agentConfigString = strings.ReplaceAll(agentConfigString, "\n", "")
253255
ldflags += fmt.Sprintf(" -X '%s.%s_%s=%s'", poseidon_repo_profile, payloadBuildMsg.C2Profiles[index].Name, key, agentConfigString)
254256
*/
255-
} else {
256-
val, err := payloadBuildMsg.C2Profiles[index].GetArg(key)
257+
} else if slices.Contains([]string{"callback_jitter", "callback_interval", "callback_port", "port"}, key) {
258+
259+
val, err := payloadBuildMsg.C2Profiles[index].GetNumberArg(key)
257260
if err != nil {
258261
payloadBuildResponse.Success = false
259262
payloadBuildResponse.BuildStdErr = err.Error()
260263
return payloadBuildResponse
261264
}
262-
initialConfig[key] = val
265+
initialConfig[key] = int(val)
263266
//ldflags += fmt.Sprintf(" -X '%s.%s_%s=%v'", poseidon_repo_profile, payloadBuildMsg.C2Profiles[index].Name, key, val)
267+
} else if slices.Contains([]string{"encrypted_exchange_check"}, key) {
268+
val, err := payloadBuildMsg.C2Profiles[index].GetBooleanArg(key)
269+
if err != nil {
270+
payloadBuildResponse.Success = false
271+
payloadBuildResponse.BuildStdErr = err.Error()
272+
return payloadBuildResponse
273+
}
274+
initialConfig[key] = val
275+
} else {
276+
val, err := payloadBuildMsg.C2Profiles[index].GetStringArg(key)
277+
if err != nil {
278+
payloadBuildResponse.Success = false
279+
payloadBuildResponse.BuildStdErr = err.Error()
280+
return payloadBuildResponse
281+
}
282+
if key == "proxy_port" {
283+
if val == "" {
284+
initialConfig[key] = 0
285+
} else {
286+
intval, err := strconv.Atoi(val)
287+
if err != nil {
288+
payloadBuildResponse.Success = false
289+
payloadBuildResponse.BuildStdErr = err.Error()
290+
return payloadBuildResponse
291+
}
292+
initialConfig[key] = intval
293+
}
294+
} else {
295+
initialConfig[key] = val
296+
}
297+
264298
}
265299
}
266300
initialConfigBytes, err := json.Marshal(initialConfig)
@@ -270,7 +304,7 @@ func build(payloadBuildMsg agentstructs.PayloadBuildMessage) agentstructs.Payloa
270304
return payloadBuildResponse
271305
}
272306
initialConfigBase64 := base64.StdEncoding.EncodeToString(initialConfigBytes)
273-
payloadBuildResponse.BuildStdOut += fmt.Sprintf("%s's config: \n%v\n", payloadBuildMsg.C2Profiles[index].Name, initialConfig)
307+
payloadBuildResponse.BuildStdOut += fmt.Sprintf("%s's config: \n%v\n", payloadBuildMsg.C2Profiles[index].Name, string(initialConfigBytes))
274308
ldflags += fmt.Sprintf(" -X '%s.%s_%s=%v'", poseidon_repo_profile, payloadBuildMsg.C2Profiles[index].Name, "initial_config", initialConfigBase64)
275309
}
276310

agent_capabilities.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"architectures": ["x86_64", "arm_64"],
1111
"c2": ["http", "websocket", "dynamichttp", "poseidon_tcp"],
1212
"mythic_version": "3.2",
13-
"agent_version": "2.0.28",
13+
"agent_version": "2.0.29",
1414
"supported_wrappers": []
1515
}

0 commit comments

Comments
 (0)