From 2f2cf4864cd313c59bc5aef2840d0156b37f2a96 Mon Sep 17 00:00:00 2001 From: Paul Axe Date: Mon, 7 Oct 2024 17:36:53 +0300 Subject: [PATCH] no switch cases anymore! --- .../poseidon/poseidon/agent_code/Makefile | 6 +- .../agent_code/caffeinate/caffeinate.go | 5 + .../poseidon/poseidon/agent_code/cat/cat.go | 5 + .../poseidon/poseidon/agent_code/cd/cd.go | 6 + .../agent_code/clipboard/clipboard.go | 5 + .../clipboard_monitor/clipboard_monitor.go | 5 + .../poseidon/agent_code/config/config.go | 5 + .../poseidon/poseidon/agent_code/cp/cp.go | 5 + .../poseidon/poseidon/agent_code/curl/curl.go | 5 + .../poseidon/agent_code/download/download.go | 5 + .../poseidon/agent_code/drives/drives.go | 5 + .../execute_library/execute_library.go | 5 + .../poseidon/agent_code/getenv/getenv.go | 5 + .../poseidon/agent_code/getuser/getuser.go | 5 + .../poseidon/poseidon/agent_code/head/head.go | 5 + .../poseidon/agent_code/ifconfig/ifconfig.go | 5 + .../poseidon/agent_code/jsimport/jsimport.go | 5 + .../agent_code/jsimport_call/jsimport_call.go | 5 + .../poseidon/poseidon/agent_code/jxa/jxa.go | 5 + .../poseidon/agent_code/keylog/keylog.go | 5 + .../poseidon/poseidon/agent_code/keys/keys.go | 5 + .../poseidon/poseidon/agent_code/kill/kill.go | 5 + .../agent_code/libinject/libinject.go | 5 + .../poseidon/agent_code/link_tcp/link_tcp.go | 5 + .../agent_code/link_webshell/link_webshell.go | 6 + .../list_entitlements/list_entitlements.go | 5 + .../agent_code/listtasks/listtasks.go | 5 + .../poseidon/poseidon/agent_code/ls/ls.go | 5 + .../poseidon/agent_code/mkdir/mkdir.go | 5 + .../poseidon/poseidon/agent_code/modules.go | 64 ++++++ .../poseidon/poseidon/agent_code/mv/mv.go | 5 + .../persist_launchd/persist_launchd.go | 5 + .../persist_loginitem/persist_loginitem.go | 5 + .../agent_code/pkg/tasks/library/library.go | 22 ++ .../agent_code/pkg/tasks/newTasking.go | 203 ++---------------- .../agent_code/pkg/tasks/taskManagement.go | 6 + .../poseidon/agent_code/portscan/portscan.go | 5 + .../poseidon/agent_code/print_c2/print_c2.go | 5 + .../agent_code/print_p2p/print_p2p.go | 5 + .../poseidon/agent_code/prompt/prompt.go | 11 + .../poseidon/poseidon/agent_code/ps/ps.go | 5 + .../poseidon/poseidon/agent_code/pty/pty.go | 5 + .../poseidon/poseidon/agent_code/pwd/pwd.go | 5 + .../poseidon/poseidon/agent_code/rm/rm.go | 5 + .../poseidon/agent_code/rpfwd/rpfwd.go | 5 + .../poseidon/poseidon/agent_code/run/run.go | 5 + .../agent_code/screencapture/screencapture.go | 5 + .../poseidon/agent_code/setenv/setenv.go | 5 + .../poseidon/agent_code/shell/shell.go | 6 + .../poseidon/agent_code/sleep/sleep.go | 5 + .../poseidon/agent_code/socks/socks.go | 5 + .../poseidon/poseidon/agent_code/ssh/ssh.go | 5 + .../poseidon/agent_code/sshauth/sshauth.go | 5 + .../poseidon/poseidon/agent_code/sudo/sudo.go | 5 + .../poseidon/poseidon/agent_code/tail/tail.go | 5 + .../agent_code/tcc_check/tcc_check.go | 5 + .../agent_code/test_agent_config_http.json | 33 +-- .../agent_code/test_password/test_password.go | 5 + .../triagedirectory/triagedirectory.go | 5 + .../agent_code/unlink_tcp/unlink_tcp.go | 5 + .../unlink_webshell/unlink_webshell.go | 5 + .../poseidon/agent_code/unsetenv/unsetenv.go | 5 + .../agent_code/update_c2/update_c2.go | 5 + .../poseidon/agent_code/upload/upload.go | 5 + .../poseidon/poseidon/agent_code/xpc/xpc.go | 5 + 65 files changed, 430 insertions(+), 208 deletions(-) create mode 100644 Payload_Type/poseidon/poseidon/agent_code/modules.go create mode 100644 Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/library/library.go diff --git a/Payload_Type/poseidon/poseidon/agent_code/Makefile b/Payload_Type/poseidon/poseidon/agent_code/Makefile index 7d2d26c..469ada0 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/Makefile +++ b/Payload_Type/poseidon/poseidon/agent_code/Makefile @@ -1,6 +1,6 @@ -HTTP_UUID=80844d19-9bfc-47f9-b9af-c6b9144c0fdc +HTTP_UUID=abd41870-7d6a-47ee-a11e-be026be4a005 HTTP_AGENT_CONFIG_FILE=test_agent_config_http.json -HTTP_CONFIG=$(shell base64 -i ${HTTP_AGENT_CONFIG_FILE}) +HTTP_CONFIG=$(shell base64 -w0 -i ${HTTP_AGENT_CONFIG_FILE}) WEBSOCKET_UUID=80844d19-9bfc-47f9-b9af-c6b9144c0fdc WEBSOCKET_AGENT_CONFIG_FILE=test_agent_config_websocket.json @@ -133,4 +133,4 @@ clean_http: go clean rm ${BINARY_NAME}_${C2_HTTP}.bin rm ${BINARY_NAME}_${C2_TCP}.bin - rm ${BINARY_NAME}_${C2_WEBSOCKET}.bin \ No newline at end of file + rm ${BINARY_NAME}_${C2_WEBSOCKET}.bin diff --git a/Payload_Type/poseidon/poseidon/agent_code/caffeinate/caffeinate.go b/Payload_Type/poseidon/poseidon/agent_code/caffeinate/caffeinate.go index ce9a3ac..ee44008 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/caffeinate/caffeinate.go +++ b/Payload_Type/poseidon/poseidon/agent_code/caffeinate/caffeinate.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("caffeinate", Run) +} + type CaffeinateRun interface { Success() bool Result() string diff --git a/Payload_Type/poseidon/poseidon/agent_code/cat/cat.go b/Payload_Type/poseidon/poseidon/agent_code/cat/cat.go index e1f8305..8806972 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/cat/cat.go +++ b/Payload_Type/poseidon/poseidon/agent_code/cat/cat.go @@ -10,8 +10,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("cat", Run) +} + // Run - package function to run cat func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/cd/cd.go b/Payload_Type/poseidon/poseidon/agent_code/cd/cd.go index 48a9b73..b7e714f 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/cd/cd.go +++ b/Payload_Type/poseidon/poseidon/agent_code/cd/cd.go @@ -7,8 +7,14 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) + +func init() { + library.RegisterTask("cd", Run) +} + // Run - package function to run cd func Run(task structs.Task) { err := os.Chdir(task.Params) diff --git a/Payload_Type/poseidon/poseidon/agent_code/clipboard/clipboard.go b/Payload_Type/poseidon/poseidon/agent_code/clipboard/clipboard.go index 30342c4..7af0f5b 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/clipboard/clipboard.go +++ b/Payload_Type/poseidon/poseidon/agent_code/clipboard/clipboard.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("clipboard", Run) +} + type Arguments struct { ReadTypes []string `json:"read"` } diff --git a/Payload_Type/poseidon/poseidon/agent_code/clipboard_monitor/clipboard_monitor.go b/Payload_Type/poseidon/poseidon/agent_code/clipboard_monitor/clipboard_monitor.go index a2ffbd0..92f5db4 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/clipboard_monitor/clipboard_monitor.go +++ b/Payload_Type/poseidon/poseidon/agent_code/clipboard_monitor/clipboard_monitor.go @@ -8,12 +8,17 @@ import ( "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/functions" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) type Arguments struct { Duration int `json:"duration"` } +func init() { + library.RegisterTask("clipboard_monitor", Run) +} + func Run(task structs.Task) { msg := task.NewResponse() params := Arguments{} diff --git a/Payload_Type/poseidon/poseidon/agent_code/config/config.go b/Payload_Type/poseidon/poseidon/agent_code/config/config.go index bde1505..38022c0 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/config/config.go +++ b/Payload_Type/poseidon/poseidon/agent_code/config/config.go @@ -6,8 +6,13 @@ import ( "encoding/json" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/functions" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("config", Run) +} + // Run - Function that executes the shell command func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/cp/cp.go b/Payload_Type/poseidon/poseidon/agent_code/cp/cp.go index 2f7dd5b..8985b0e 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/cp/cp.go +++ b/Payload_Type/poseidon/poseidon/agent_code/cp/cp.go @@ -12,8 +12,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("cp", Run) +} + type Arguments struct { SourceFile string `json:"source"` DestinationFile string `json:"destination"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/curl/curl.go b/Payload_Type/poseidon/poseidon/agent_code/curl/curl.go index c3c48d3..aa3a847 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/curl/curl.go +++ b/Payload_Type/poseidon/poseidon/agent_code/curl/curl.go @@ -16,8 +16,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("curl", Run) +} + type Arguments struct { Url string `json:"url"` Method string `json:"method"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/download/download.go b/Payload_Type/poseidon/poseidon/agent_code/download/download.go index 884c087..fea7a3b 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/download/download.go +++ b/Payload_Type/poseidon/poseidon/agent_code/download/download.go @@ -10,8 +10,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("curl", Run) +} + // Run - Function that executes the shell command func Run(task structs.Task) { //File download diff --git a/Payload_Type/poseidon/poseidon/agent_code/drives/drives.go b/Payload_Type/poseidon/poseidon/agent_code/drives/drives.go index 8746320..cb54452 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/drives/drives.go +++ b/Payload_Type/poseidon/poseidon/agent_code/drives/drives.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("drives", Run) +} + type Drive struct { Name string `json:"name"` Description string `json:"description"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/execute_library/execute_library.go b/Payload_Type/poseidon/poseidon/agent_code/execute_library/execute_library.go index 983fb73..9d1c5e8 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/execute_library/execute_library.go +++ b/Payload_Type/poseidon/poseidon/agent_code/execute_library/execute_library.go @@ -9,8 +9,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("execute_library", Run) +} + type executeLibraryArgs struct { FileID string `json:"file_id"` FilePath string `json:"file_path"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/getenv/getenv.go b/Payload_Type/poseidon/poseidon/agent_code/getenv/getenv.go index a8069c5..18e00d7 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/getenv/getenv.go +++ b/Payload_Type/poseidon/poseidon/agent_code/getenv/getenv.go @@ -9,8 +9,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("getenv", Run) +} + // Run - Function that executes the shell command func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/getuser/getuser.go b/Payload_Type/poseidon/poseidon/agent_code/getuser/getuser.go index 88b3e51..b11e2dd 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/getuser/getuser.go +++ b/Payload_Type/poseidon/poseidon/agent_code/getuser/getuser.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("getuser", Run) +} + type SerializableUser struct { // Uid is the user ID. // On POSIX systems, this is a decimal number representing the uid. diff --git a/Payload_Type/poseidon/poseidon/agent_code/head/head.go b/Payload_Type/poseidon/poseidon/agent_code/head/head.go index 2bf3f9d..cab78f0 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/head/head.go +++ b/Payload_Type/poseidon/poseidon/agent_code/head/head.go @@ -6,8 +6,13 @@ import ( "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" "io" "os" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("head", Run) +} + type headArgs struct { FilePath string `json:"path"` Lines int `json:"lines"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/ifconfig/ifconfig.go b/Payload_Type/poseidon/poseidon/agent_code/ifconfig/ifconfig.go index 5199e41..a6c0353 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/ifconfig/ifconfig.go +++ b/Payload_Type/poseidon/poseidon/agent_code/ifconfig/ifconfig.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("ifconfig", Run) +} + // Run - Function that executes func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/jsimport/jsimport.go b/Payload_Type/poseidon/poseidon/agent_code/jsimport/jsimport.go index 8417a3b..787a107 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/jsimport/jsimport.go +++ b/Payload_Type/poseidon/poseidon/agent_code/jsimport/jsimport.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("jsimport", Run) +} + // initial .m code pulled from https://github.com/its-a-feature/macos_execute_from_memory // and https://github.com/opensource-apple/dyld/tree/master/unit-tests/test-cases/bundle-memory-load diff --git a/Payload_Type/poseidon/poseidon/agent_code/jsimport_call/jsimport_call.go b/Payload_Type/poseidon/poseidon/agent_code/jsimport_call/jsimport_call.go index 0c6947a..c908dbe 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/jsimport_call/jsimport_call.go +++ b/Payload_Type/poseidon/poseidon/agent_code/jsimport_call/jsimport_call.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("jsimport_call", Run) +} + type JxaRun interface { Success() bool Result() string diff --git a/Payload_Type/poseidon/poseidon/agent_code/jxa/jxa.go b/Payload_Type/poseidon/poseidon/agent_code/jxa/jxa.go index 5361c69..82ff40a 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/jxa/jxa.go +++ b/Payload_Type/poseidon/poseidon/agent_code/jxa/jxa.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("jxa", Run) +} + type JxaRun interface { Success() bool Result() string diff --git a/Payload_Type/poseidon/poseidon/agent_code/keylog/keylog.go b/Payload_Type/poseidon/poseidon/agent_code/keylog/keylog.go index 0e3c74c..282604c 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/keylog/keylog.go +++ b/Payload_Type/poseidon/poseidon/agent_code/keylog/keylog.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/keylog/keystate" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("keylog", Run) +} + // Run - Function that executes the shell command func Run(task structs.Task) { diff --git a/Payload_Type/poseidon/poseidon/agent_code/keys/keys.go b/Payload_Type/poseidon/poseidon/agent_code/keys/keys.go index 78562e0..432f385 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/keys/keys.go +++ b/Payload_Type/poseidon/poseidon/agent_code/keys/keys.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("keys", Run) +} + // KeyInformation - interface for key data type KeyInformation interface { KeyType() string diff --git a/Payload_Type/poseidon/poseidon/agent_code/kill/kill.go b/Payload_Type/poseidon/poseidon/agent_code/kill/kill.go index e36b00a..6ec36b4 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/kill/kill.go +++ b/Payload_Type/poseidon/poseidon/agent_code/kill/kill.go @@ -11,8 +11,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("kill", Run) +} + // Run - Function that executes the shell command func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/libinject/libinject.go b/Payload_Type/poseidon/poseidon/agent_code/libinject/libinject.go index 052e6fb..dc9619d 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/libinject/libinject.go +++ b/Payload_Type/poseidon/poseidon/agent_code/libinject/libinject.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("libinject", Run) +} + // Inject C source taken from: http://www.newosxbook.com/src.jl?tree=listings&file=inject.c type Injection interface { TargetPid() int diff --git a/Payload_Type/poseidon/poseidon/agent_code/link_tcp/link_tcp.go b/Payload_Type/poseidon/poseidon/agent_code/link_tcp/link_tcp.go index d71721d..04de70a 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/link_tcp/link_tcp.go +++ b/Payload_Type/poseidon/poseidon/agent_code/link_tcp/link_tcp.go @@ -10,8 +10,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("link_tcp", Run) +} + type Arguments struct { Port int `json:"port"` Address string `json:"address"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/link_webshell/link_webshell.go b/Payload_Type/poseidon/poseidon/agent_code/link_webshell/link_webshell.go index 4d329d7..7f8ac16 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/link_webshell/link_webshell.go +++ b/Payload_Type/poseidon/poseidon/agent_code/link_webshell/link_webshell.go @@ -11,8 +11,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("link_webshell", Run) +} + type Arguments struct { CookieValue string `json:"cookie_value"` CookieName string `json:"cookie_name"` @@ -22,6 +27,7 @@ type Arguments struct { TargetUUID string `json:"target_uuid"` } + // Run - package function to run link_tcp func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/list_entitlements/list_entitlements.go b/Payload_Type/poseidon/poseidon/agent_code/list_entitlements/list_entitlements.go index 733f362..20b7c3c 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/list_entitlements/list_entitlements.go +++ b/Payload_Type/poseidon/poseidon/agent_code/list_entitlements/list_entitlements.go @@ -7,8 +7,13 @@ import ( "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ps" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("list_entitlements", Run) +} + type Arguments struct { PID int `json:"pid"` } diff --git a/Payload_Type/poseidon/poseidon/agent_code/listtasks/listtasks.go b/Payload_Type/poseidon/poseidon/agent_code/listtasks/listtasks.go index cceff72..2fc4489 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/listtasks/listtasks.go +++ b/Payload_Type/poseidon/poseidon/agent_code/listtasks/listtasks.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("listtasks", Run) +} + type Listtasks interface { Result() map[string]interface{} } diff --git a/Payload_Type/poseidon/poseidon/agent_code/ls/ls.go b/Payload_Type/poseidon/poseidon/agent_code/ls/ls.go index 3b2e606..9c864e9 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/ls/ls.go +++ b/Payload_Type/poseidon/poseidon/agent_code/ls/ls.go @@ -16,8 +16,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("ls", Run) +} + func GetPermission(finfo os.FileInfo) structs.FilePermission { perms := structs.FilePermission{} perms.Permissions = finfo.Mode().Perm().String() diff --git a/Payload_Type/poseidon/poseidon/agent_code/mkdir/mkdir.go b/Payload_Type/poseidon/poseidon/agent_code/mkdir/mkdir.go index 395d41f..166d7ba 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/mkdir/mkdir.go +++ b/Payload_Type/poseidon/poseidon/agent_code/mkdir/mkdir.go @@ -9,8 +9,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("mkdir", Run) +} + func Run(task structs.Task) { msg := task.NewResponse() err := os.Mkdir(task.Params, 0777) diff --git a/Payload_Type/poseidon/poseidon/agent_code/modules.go b/Payload_Type/poseidon/poseidon/agent_code/modules.go new file mode 100644 index 0000000..d637eb0 --- /dev/null +++ b/Payload_Type/poseidon/poseidon/agent_code/modules.go @@ -0,0 +1,64 @@ +package main + + +import ( + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/cat" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/shell" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/caffeinate" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/cd" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/clipboard" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/clipboard_monitor" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/config" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/cp" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/curl" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/download" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/drives" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/execute_library" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/getenv" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/getuser" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/head" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ifconfig" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/jsimport" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/jsimport_call" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/jxa" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/keylog" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/keys" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/kill" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/libinject" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/link_tcp" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/link_webshell" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/list_entitlements" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/listtasks" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ls" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/mkdir" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/mv" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/persist_launchd" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/persist_loginitem" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/portscan" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/print_c2" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/print_p2p" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/prompt" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ps" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pty" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pwd" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/rm" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/rpfwd" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/run" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/screencapture" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/setenv" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/sleep" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/socks" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ssh" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/sshauth" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/sudo" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/tail" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/tcc_check" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/test_password" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/triagedirectory" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/unlink_tcp" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/unlink_webshell" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/unsetenv" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/update_c2" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/upload" + _ "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/xpc" +) diff --git a/Payload_Type/poseidon/poseidon/agent_code/mv/mv.go b/Payload_Type/poseidon/poseidon/agent_code/mv/mv.go index 9727a40..dd8c0bb 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/mv/mv.go +++ b/Payload_Type/poseidon/poseidon/agent_code/mv/mv.go @@ -11,8 +11,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("mv", Run) +} + type Arguments struct { SourceFile string `json:"source"` DestinationFile string `json:"destination"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/persist_launchd/persist_launchd.go b/Payload_Type/poseidon/poseidon/agent_code/persist_launchd/persist_launchd.go index 604e45b..da96a3f 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/persist_launchd/persist_launchd.go +++ b/Payload_Type/poseidon/poseidon/agent_code/persist_launchd/persist_launchd.go @@ -5,8 +5,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("persist_launchd", Run) +} + type Arguments struct { Label string `json:"Label"` ProgramArgs []string `json:"args"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/persist_loginitem/persist_loginitem.go b/Payload_Type/poseidon/poseidon/agent_code/persist_loginitem/persist_loginitem.go index f7cfacd..b0ecc43 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/persist_loginitem/persist_loginitem.go +++ b/Payload_Type/poseidon/poseidon/agent_code/persist_loginitem/persist_loginitem.go @@ -6,9 +6,14 @@ import ( // Poseidon + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" ) +func init() { + library.RegisterTask("persist_loginitem", Run) +} + type Arguments struct { Path string `json:"path"` Name string `json:"name"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/library/library.go b/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/library/library.go new file mode 100644 index 0000000..58f4da0 --- /dev/null +++ b/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/library/library.go @@ -0,0 +1,22 @@ +package library + +import ( + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" +) + +var commands map[string]func(structs.Task) + +func init() { + commands = make(map[string]func(structs.Task)) +} + + +func RegisterTask(name string, fn func(structs.Task)){ + commands[name] = fn +} + + +func FindTask(name string) (func(structs.Task), bool) { + fn, ok := commands[name] + return fn, ok +} diff --git a/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/newTasking.go b/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/newTasking.go index 49f780a..1e4fde8 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/newTasking.go +++ b/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/newTasking.go @@ -1,206 +1,29 @@ package tasks import ( - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/caffeinate" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/cat" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/cd" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/clipboard" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/clipboard_monitor" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/config" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/cp" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/curl" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/download" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/drives" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/execute_library" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/getenv" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/getuser" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/head" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ifconfig" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/jsimport" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/jsimport_call" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/jxa" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/keylog" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/keys" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/kill" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/libinject" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/link_tcp" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/link_webshell" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/list_entitlements" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/listtasks" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ls" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/mkdir" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/mv" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/persist_launchd" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/persist_loginitem" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/runtimeMainThread" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/portscan" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/print_c2" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/print_p2p" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/prompt" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ps" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pty" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pwd" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/rm" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/rpfwd" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/run" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/screencapture" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/setenv" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/shell" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/sleep" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/socks" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/ssh" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/sshauth" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/sudo" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/tail" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/tcc_check" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/test_password" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/triagedirectory" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/unlink_tcp" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/unlink_webshell" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/unsetenv" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/update_c2" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/upload" - "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/xpc" "os" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) var newTaskChannel = make(chan structs.Task, 10) + +func init() { + library.RegisterTask("exit", func(_ structs.Task) { + os.Exit(0) + }) +} + + // listenForNewTask uses NewTaskChannel to spawn goroutine based on task's Run method func listenForNewTask() { for { task := <-newTaskChannel - switch task.Command { - case "exit": - os.Exit(0) - case "shell": - go shell.Run(task) - case "screencapture": - go screencapture.Run(task) - case "keylog": - go keylog.Run(task) - case "download": - go download.Run(task) - case "upload": - go upload.Run(task) - case "libinject": - go libinject.Run(task) - case "ps": - go ps.Run(task) - case "sleep": - go sleep.Run(task) - case "cat": - go cat.Run(task) - case "cd": - go cd.Run(task) - case "ls": - go ls.Run(task) - case "jxa": - go jxa.Run(task) - case "keys": - go keys.Run(task) - case "triagedirectory": - go triagedirectory.Run(task) - case "sshauth": - go sshauth.Run(task) - case "portscan": - go portscan.Run(task) - case "jobs": - go getJobListing(task) - case "jobkill": - go killJob(task) - case "cp": - go cp.Run(task) - case "drives": - go drives.Run(task) - case "getuser": - go getuser.Run(task) - case "mkdir": - go mkdir.Run(task) - case "mv": - go mv.Run(task) - case "pwd": - go pwd.Run(task) - case "rm": - go rm.Run(task) - case "getenv": - go getenv.Run(task) - case "setenv": - go setenv.Run(task) - case "unsetenv": - go unsetenv.Run(task) - case "kill": - go kill.Run(task) - case "curl": - go curl.Run(task) - case "xpc": - go xpc.Run(task) - case "socks": - go socks.Run(task) - case "listtasks": - go listtasks.Run(task) - case "list_entitlements": - go list_entitlements.Run(task) - case "jsimport": - go jsimport.Run(task) - case "jsimport_call": - go jsimport_call.Run(task) - case "persist_launchd": - go persist_launchd.Run(task) - case "persist_loginitem": - go persist_loginitem.Run(task) - case "link_tcp": - go link_tcp.Run(task) - case "unlink_tcp": - go unlink_tcp.Run(task) - case "run": - go run.Run(task) - case "clipboard_monitor": - go clipboard_monitor.Run(task) - case "execute_library": - go execute_library.Run(task) - case "rpfwd": - go rpfwd.Run(task) - case "print_p2p": - go print_p2p.Run(task) - case "print_c2": - go print_c2.Run(task) - case "update_c2": - go update_c2.Run(task) - case "pty": - go pty.Run(task) - case "tcc_check": - go tcc_check.Run(task) - case "test_password": - go test_password.Run(task) - case "tail": - go tail.Run(task) - case "head": - go head.Run(task) - case "prompt": - go runtimeMainThread.DoOnMainThread(prompt.Run, task) - case "clipboard": - go clipboard.Run(task) - case "sudo": - go sudo.Run(task) - case "link_webshell": - go link_webshell.Run(task) - case "unlink_webshell": - go unlink_webshell.Run(task) - case "shell_config": - go shell.RunConfig(task) - case "config": - go config.Run(task) - case "ssh": - go ssh.Run(task) - case "ifconfig": - go ifconfig.Run(task) - case "caffeinate": - go caffeinate.Run(task) - default: - // No tasks, do nothing - break + + if f, ok := library.FindTask(task.Command); ok { + go f(task) } + } } diff --git a/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/taskManagement.go b/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/taskManagement.go index 1907b2d..de07570 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/taskManagement.go +++ b/Payload_Type/poseidon/poseidon/agent_code/pkg/tasks/taskManagement.go @@ -4,8 +4,14 @@ import ( "encoding/json" "fmt" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("jobs", getJobListing) + library.RegisterTask("jobkill", killJob) +} + // listenForRemoveRunningTask uses removeRunningTasksChannel to identify tasks to remove from runningTasks func listenForRemoveRunningTask() { for { diff --git a/Payload_Type/poseidon/poseidon/agent_code/portscan/portscan.go b/Payload_Type/poseidon/poseidon/agent_code/portscan/portscan.go index 0695a74..159d893 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/portscan/portscan.go +++ b/Payload_Type/poseidon/poseidon/agent_code/portscan/portscan.go @@ -10,8 +10,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("portscan", Run) +} + type PortScanParams struct { Hosts []string `json:"hosts"` // Can also be a cidr Ports []string `json:"ports"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/print_c2/print_c2.go b/Payload_Type/poseidon/poseidon/agent_code/print_c2/print_c2.go index f28a1a6..8cd7068 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/print_c2/print_c2.go +++ b/Payload_Type/poseidon/poseidon/agent_code/print_c2/print_c2.go @@ -7,8 +7,13 @@ import ( "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/profiles" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("print_c2", Run) +} + // Run - package function to run print_c2 func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/print_p2p/print_p2p.go b/Payload_Type/poseidon/poseidon/agent_code/print_p2p/print_p2p.go index 93af4a7..552699b 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/print_p2p/print_p2p.go +++ b/Payload_Type/poseidon/poseidon/agent_code/print_p2p/print_p2p.go @@ -7,8 +7,13 @@ import ( "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/p2p" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("print_p2p", Run) +} + // Run - package function to run print_tcp func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/prompt/prompt.go b/Payload_Type/poseidon/poseidon/agent_code/prompt/prompt.go index f186061..c7b95c6 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/prompt/prompt.go +++ b/Payload_Type/poseidon/poseidon/agent_code/prompt/prompt.go @@ -3,8 +3,19 @@ package prompt import ( "encoding/json" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/runtimeMainThread" ) + +func runWrapper(task structs.Task) { + runtimeMainThread.DoOnMainThread(Run, task) +} + +func init() { + library.RegisterTask("prompt", runWrapper) +} + type Arguments struct { Icon string `json:"icon"` TitleText string `json:"title"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/ps/ps.go b/Payload_Type/poseidon/poseidon/agent_code/ps/ps.go index fb67eed..efb197d 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/ps/ps.go +++ b/Payload_Type/poseidon/poseidon/agent_code/ps/ps.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("ps", Run) +} + type Arguments struct { RegexFilter string `json:"regex_filter"` } diff --git a/Payload_Type/poseidon/poseidon/agent_code/pty/pty.go b/Payload_Type/poseidon/poseidon/agent_code/pty/pty.go index df53704..8781f29 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/pty/pty.go +++ b/Payload_Type/poseidon/poseidon/agent_code/pty/pty.go @@ -15,8 +15,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("pty", Run) +} + type Args struct { ProgramPath string `json:"program_path"` } diff --git a/Payload_Type/poseidon/poseidon/agent_code/pwd/pwd.go b/Payload_Type/poseidon/poseidon/agent_code/pwd/pwd.go index 755edc1..d2ba8cb 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/pwd/pwd.go +++ b/Payload_Type/poseidon/poseidon/agent_code/pwd/pwd.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("pwd", Run) +} + // Run - interface method that retrieves a process list func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/rm/rm.go b/Payload_Type/poseidon/poseidon/agent_code/rm/rm.go index aec5cfc..fa6299a 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/rm/rm.go +++ b/Payload_Type/poseidon/poseidon/agent_code/rm/rm.go @@ -12,8 +12,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("rm", Run) +} + // Run - interface method that retrieves a process list func Run(task structs.Task) { args := structs.FileBrowserArguments{} diff --git a/Payload_Type/poseidon/poseidon/agent_code/rpfwd/rpfwd.go b/Payload_Type/poseidon/poseidon/agent_code/rpfwd/rpfwd.go index 813fbf2..8379687 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/rpfwd/rpfwd.go +++ b/Payload_Type/poseidon/poseidon/agent_code/rpfwd/rpfwd.go @@ -13,8 +13,13 @@ import ( "time" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("rpfwd", Run) +} + type rpfwdTracker struct { Channel chan structs.SocksMsg Connection net.Conn diff --git a/Payload_Type/poseidon/poseidon/agent_code/run/run.go b/Payload_Type/poseidon/poseidon/agent_code/run/run.go index b8c941e..3fe0d8f 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/run/run.go +++ b/Payload_Type/poseidon/poseidon/agent_code/run/run.go @@ -11,8 +11,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("run", Run) +} + type runArgs struct { Path string `json:"path"` Args []string `json:"args"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/screencapture/screencapture.go b/Payload_Type/poseidon/poseidon/agent_code/screencapture/screencapture.go index a6f2bea..065c931 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/screencapture/screencapture.go +++ b/Payload_Type/poseidon/poseidon/agent_code/screencapture/screencapture.go @@ -8,8 +8,13 @@ import ( "strconv" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("screencapture", Run) +} + // ScreenShot - interface for holding screenshot data type ScreenShot interface { Monitor() int diff --git a/Payload_Type/poseidon/poseidon/agent_code/setenv/setenv.go b/Payload_Type/poseidon/poseidon/agent_code/setenv/setenv.go index 39768d0..d36b58c 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/setenv/setenv.go +++ b/Payload_Type/poseidon/poseidon/agent_code/setenv/setenv.go @@ -10,8 +10,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("setenv", Run) +} + // Run - Function that executes the shell command func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/shell/shell.go b/Payload_Type/poseidon/poseidon/agent_code/shell/shell.go index 69ffb6e..836235c 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/shell/shell.go +++ b/Payload_Type/poseidon/poseidon/agent_code/shell/shell.go @@ -12,10 +12,16 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) var shellBin = "/bin/bash" +func init() { + library.RegisterTask("shell", Run) + library.RegisterTask("shell_config", RunConfig) +} + // Run - Function that executes the shell command func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/sleep/sleep.go b/Payload_Type/poseidon/poseidon/agent_code/sleep/sleep.go index ac0e6fb..6052d36 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/sleep/sleep.go +++ b/Payload_Type/poseidon/poseidon/agent_code/sleep/sleep.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("sleep", Run) +} + type Args struct { Interval int `json:"interval"` Jitter int `json:"jitter"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/socks/socks.go b/Payload_Type/poseidon/poseidon/agent_code/socks/socks.go index 619d04f..327a5bd 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/socks/socks.go +++ b/Payload_Type/poseidon/poseidon/agent_code/socks/socks.go @@ -9,12 +9,17 @@ import ( "fmt" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/responses" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" "io" "net" "strconv" "strings" ) +func init() { + library.RegisterTask("socks", Run) +} + // ****** The following is from https://github.com/armon/go-socks5 ***** const ( ConnectCommand = uint8(1) diff --git a/Payload_Type/poseidon/poseidon/agent_code/ssh/ssh.go b/Payload_Type/poseidon/poseidon/agent_code/ssh/ssh.go index 9ebe9bf..83aff60 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/ssh/ssh.go +++ b/Payload_Type/poseidon/poseidon/agent_code/ssh/ssh.go @@ -18,8 +18,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("ssh", Run) +} + // Credential Manages credential objects for authentication type Credential struct { Username string diff --git a/Payload_Type/poseidon/poseidon/agent_code/sshauth/sshauth.go b/Payload_Type/poseidon/poseidon/agent_code/sshauth/sshauth.go index 4d1e724..f3f5c82 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/sshauth/sshauth.go +++ b/Payload_Type/poseidon/poseidon/agent_code/sshauth/sshauth.go @@ -18,9 +18,14 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/portscan" ) +func init() { + library.RegisterTask("sshauth", Run) +} + var ( sshResultChan = make(chan SSHResult) ) diff --git a/Payload_Type/poseidon/poseidon/agent_code/sudo/sudo.go b/Payload_Type/poseidon/poseidon/agent_code/sudo/sudo.go index 68ffc84..517b369 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/sudo/sudo.go +++ b/Payload_Type/poseidon/poseidon/agent_code/sudo/sudo.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("sudo", Run) +} + type Arguments struct { Username string `json:"username"` Password string `json:"password"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/tail/tail.go b/Payload_Type/poseidon/poseidon/agent_code/tail/tail.go index 92f2788..15a04aa 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/tail/tail.go +++ b/Payload_Type/poseidon/poseidon/agent_code/tail/tail.go @@ -4,10 +4,15 @@ import ( "encoding/json" "fmt" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" "io" "os" ) +func init() { + library.RegisterTask("tail", Run) +} + type tailArgs struct { FilePath string `json:"path"` Lines int `json:"lines"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/tcc_check/tcc_check.go b/Payload_Type/poseidon/poseidon/agent_code/tcc_check/tcc_check.go index 5cce6cb..9b04050 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/tcc_check/tcc_check.go +++ b/Payload_Type/poseidon/poseidon/agent_code/tcc_check/tcc_check.go @@ -3,8 +3,13 @@ package tcc_check import ( "encoding/json" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("tcc_check", Run) +} + var args Arguments type Arguments struct { diff --git a/Payload_Type/poseidon/poseidon/agent_code/test_agent_config_http.json b/Payload_Type/poseidon/poseidon/agent_code/test_agent_config_http.json index f5733a7..cc8fb94 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/test_agent_config_http.json +++ b/Payload_Type/poseidon/poseidon/agent_code/test_agent_config_http.json @@ -1,16 +1,19 @@ { - "callback_host": "http://127.0.0.1", - "callback_port": 80, - "killdate": "2024-12-31", - "callback_interval": 2, - "callback_jitter": 0, - "post_uri": "data", - "encrypted_exchange_check": true, - "headers": {}, - "AESPSK": "hfN9Nk29S8LsjrE9ffbT9KONue4uozk+/TVMyrxDvvM=", - "proxy_port": 0, - "proxy_user": "", - "proxy_pass": "", - "proxy_host": "", - "proxy_bypass": false -} \ No newline at end of file + "AESPSK": "1aELoVWIIJURvhIPyk6g+e5aVp4jdj5YBejAN6TGcHc=", + "callback_host": "http://192.168.66.213", + "callback_interval": 10, + "callback_jitter": 23, + "callback_port": 19999, + "encrypted_exchange_check": true, + "get_uri": "index", + "headers": { + "User-Agent": "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko" + }, + "killdate": "2025-10-07", + "post_uri": "data", + "proxy_host": "", + "proxy_pass": "", + "proxy_port": 0, + "proxy_user": "", + "query_path_name": "q" +} diff --git a/Payload_Type/poseidon/poseidon/agent_code/test_password/test_password.go b/Payload_Type/poseidon/poseidon/agent_code/test_password/test_password.go index 46b1713..4985279 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/test_password/test_password.go +++ b/Payload_Type/poseidon/poseidon/agent_code/test_password/test_password.go @@ -3,8 +3,13 @@ package test_password import ( "encoding/json" "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("test_password", Run) +} + var args Arguments type Arguments struct { diff --git a/Payload_Type/poseidon/poseidon/agent_code/triagedirectory/triagedirectory.go b/Payload_Type/poseidon/poseidon/agent_code/triagedirectory/triagedirectory.go index 6b9e3a8..ab00b56 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/triagedirectory/triagedirectory.go +++ b/Payload_Type/poseidon/poseidon/agent_code/triagedirectory/triagedirectory.go @@ -12,8 +12,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("triagedirectory", Run) +} + type OSFile struct { Path string `json:"path"` Name string `json:"name"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/unlink_tcp/unlink_tcp.go b/Payload_Type/poseidon/poseidon/agent_code/unlink_tcp/unlink_tcp.go index e6d037d..4416326 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/unlink_tcp/unlink_tcp.go +++ b/Payload_Type/poseidon/poseidon/agent_code/unlink_tcp/unlink_tcp.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("unlink_tcp", Run) +} + type Arguments struct { RemoteUUID string `json:"connection"` } diff --git a/Payload_Type/poseidon/poseidon/agent_code/unlink_webshell/unlink_webshell.go b/Payload_Type/poseidon/poseidon/agent_code/unlink_webshell/unlink_webshell.go index 0d3a6e4..f550098 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/unlink_webshell/unlink_webshell.go +++ b/Payload_Type/poseidon/poseidon/agent_code/unlink_webshell/unlink_webshell.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("unlink_webshell", Run) +} + type Arguments struct { RemoteUUID string `json:"connection"` } diff --git a/Payload_Type/poseidon/poseidon/agent_code/unsetenv/unsetenv.go b/Payload_Type/poseidon/poseidon/agent_code/unsetenv/unsetenv.go index 4fba4a3..fb6d413 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/unsetenv/unsetenv.go +++ b/Payload_Type/poseidon/poseidon/agent_code/unsetenv/unsetenv.go @@ -10,8 +10,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("unsetenv", Run) +} + // Run - interface method that retrieves a process list func Run(task structs.Task) { msg := task.NewResponse() diff --git a/Payload_Type/poseidon/poseidon/agent_code/update_c2/update_c2.go b/Payload_Type/poseidon/poseidon/agent_code/update_c2/update_c2.go index c321b1e..447d465 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/update_c2/update_c2.go +++ b/Payload_Type/poseidon/poseidon/agent_code/update_c2/update_c2.go @@ -8,8 +8,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("update_c2", Run) +} + type updateC2Args struct { C2Name string `json:"c2_name"` Action string `json:"action"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/upload/upload.go b/Payload_Type/poseidon/poseidon/agent_code/upload/upload.go index e276b59..ad7d30b 100644 --- a/Payload_Type/poseidon/poseidon/agent_code/upload/upload.go +++ b/Payload_Type/poseidon/poseidon/agent_code/upload/upload.go @@ -10,8 +10,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("upload", Run) +} + type uploadArgs struct { FileID string `json:"file_id"` RemotePath string `json:"remote_path"` diff --git a/Payload_Type/poseidon/poseidon/agent_code/xpc/xpc.go b/Payload_Type/poseidon/poseidon/agent_code/xpc/xpc.go index cfac48d..4c57a68 100755 --- a/Payload_Type/poseidon/poseidon/agent_code/xpc/xpc.go +++ b/Payload_Type/poseidon/poseidon/agent_code/xpc/xpc.go @@ -7,8 +7,13 @@ import ( // Poseidon "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs" + "github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/tasks/library" ) +func init() { + library.RegisterTask("xpc", Run) +} + var args Arguments type Arguments struct {