Skip to content

Commit 2ef108e

Browse files
committed
v2.3.30
fixing compilation for auto-run with dylib/so
1 parent a4265b0 commit 2ef108e

File tree

11 files changed

+149
-18
lines changed

11 files changed

+149
-18
lines changed

Payload_Type/poseidon/go.mod

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ go 1.19
55
//replace github.com/MythicMeta/MythicContainer => ../../../../MythicMeta/MythicContainer
66

77
require (
8-
github.com/MythicMeta/MythicContainer v1.3.7
8+
github.com/MythicMeta/MythicContainer v1.3.11
99
github.com/google/uuid v1.6.0
1010
github.com/mitchellh/mapstructure v1.5.0
11+
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81
1112
)
1213

1314
require (
1415
github.com/fsnotify/fsnotify v1.7.0 // indirect
1516
github.com/go-logr/logr v1.4.1 // indirect
1617
github.com/go-logr/zerologr v1.2.3 // indirect
17-
github.com/golang/protobuf v1.5.3 // indirect
18+
github.com/golang/protobuf v1.5.4 // indirect
1819
github.com/hashicorp/hcl v1.0.0 // indirect
1920
github.com/magiconair/properties v1.8.7 // indirect
2021
github.com/mattn/go-colorable v0.1.13 // indirect
@@ -31,13 +32,12 @@ require (
3132
github.com/spf13/viper v1.18.2 // indirect
3233
github.com/subosito/gotenv v1.6.0 // indirect
3334
go.uber.org/multierr v1.11.0 // indirect
34-
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
35-
golang.org/x/net v0.21.0 // indirect
36-
golang.org/x/sys v0.17.0 // indirect
35+
golang.org/x/net v0.22.0 // indirect
36+
golang.org/x/sys v0.18.0 // indirect
3737
golang.org/x/text v0.14.0 // indirect
38-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240228224816-df926f6c8641 // indirect
39-
google.golang.org/grpc v1.62.0 // indirect
40-
google.golang.org/protobuf v1.32.0 // indirect
38+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
39+
google.golang.org/grpc v1.62.1 // indirect
40+
google.golang.org/protobuf v1.33.0 // indirect
4141
gopkg.in/ini.v1 v1.67.0 // indirect
4242
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
4343
gopkg.in/yaml.v3 v3.0.1 // indirect

Payload_Type/poseidon/go.sum

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
github.com/MythicMeta/MythicContainer v1.3.7 h1:n5uIgSJKjEWvrvSzM7ab3CzCfFp7ovzGgr5Yf8p7ch4=
2-
github.com/MythicMeta/MythicContainer v1.3.7/go.mod h1:EZqZAa+ZdZhhfLICL4RhnlBydMxZC4wi5vr95WRgdbY=
1+
github.com/MythicMeta/MythicContainer v1.3.10 h1:XC1m5GToDOf3+evbnLVxZcwz/2k/t9wOQPtCbqDi4W4=
2+
github.com/MythicMeta/MythicContainer v1.3.10/go.mod h1:EZqZAa+ZdZhhfLICL4RhnlBydMxZC4wi5vr95WRgdbY=
3+
github.com/MythicMeta/MythicContainer v1.3.11 h1:K4ML3m9TUDXQ2X+/JUcCxI9RLfiVYCg1uwWwdiy4w0o=
4+
github.com/MythicMeta/MythicContainer v1.3.11/go.mod h1:EZqZAa+ZdZhhfLICL4RhnlBydMxZC4wi5vr95WRgdbY=
35
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
46
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
57
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -15,6 +17,8 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
1517
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
1618
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
1719
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
20+
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
21+
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
1822
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
1923
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
2024
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -76,24 +80,36 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
7680
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
7781
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ=
7882
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
83+
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc=
84+
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ=
7985
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
8086
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
87+
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
88+
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
8189
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8290
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8391
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8492
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
8593
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
94+
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
95+
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
8696
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
8797
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
8898
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
8999
google.golang.org/genproto/googleapis/rpc v0.0.0-20240228224816-df926f6c8641 h1:DKU1r6Tj5s1vlU/moGhuGz7E3xRfwjdAfDzbsaQJtEY=
90100
google.golang.org/genproto/googleapis/rpc v0.0.0-20240228224816-df926f6c8641/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs=
101+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
102+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
91103
google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk=
92104
google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
105+
google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
106+
google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
93107
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
94108
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
95109
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
96110
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
111+
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
112+
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
97113
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
98114
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
99115
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=

Payload_Type/poseidon/poseidon/agent_code/CHANGELOG.MD

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ 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.30 - 2024-03-19
8+
9+
### Changed
10+
11+
- Updated the dylib/so build process (c-shared mode) to not require additional compilation
12+
- This leverages a build flow from [merlin](https://github.com/MythicAgents/merlin/) to conditionally add in constructors to auto run on load instead of waiting for RunMain execution
13+
714
## 2.0.29 - 2024-03-14
815

916
### Changed

Payload_Type/poseidon/poseidon/agent_code/go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ require (
1010
github.com/kbinani/screenshot v0.0.0-20230812210009-b87d31814237
1111
github.com/tmc/scp v0.0.0-20170824174625-f7b48647feef
1212
github.com/xorrior/keyctl v1.0.1-0.20210425144957-8746c535bf58
13-
golang.org/x/crypto v0.20.0
13+
golang.org/x/crypto v0.21.0
1414
golang.org/x/sync v0.6.0
15-
golang.org/x/sys v0.17.0
15+
golang.org/x/sys v0.18.0
1616
howett.net/plist v1.0.1
1717
)
1818

@@ -21,5 +21,5 @@ require (
2121
github.com/jezek/xgb v1.1.1 // indirect
2222
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
2323
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
24-
golang.org/x/net v0.21.0 // indirect
24+
golang.org/x/net v0.22.0 // indirect
2525
)

Payload_Type/poseidon/poseidon/agent_code/go.sum

+7
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
2727
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
2828
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
2929
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
30+
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
31+
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
3032
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
3133
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
3234
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
3335
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
3436
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
37+
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
38+
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
3539
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
3640
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
3741
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -41,8 +45,11 @@ golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
4145
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
4246
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
4347
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
48+
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
49+
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
4450
golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=
4551
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
52+
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
4653
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
4754
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4855
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// This code is borrowed and slightly modified from https://github.com/MythicAgents/merlin/blob/efde48c42ed6dc364258698ef3a49009c684dd9f/Payload_Type/merlin/agent/merlin.c
2+
// Merlin is a post-exploitation command and control framework.
3+
// This file is part of Merlin.
4+
// Copyright (C) 2023 Russel Van Tuyl
5+
6+
// Merlin is free software: you can redistribute it and/or modify
7+
// it under the terms of the GNU General Public License as published by
8+
// the Free Software Foundation, either version 3 of the License, or
9+
// any later version.
10+
11+
// Merlin is distributed in the hope that it will be useful,
12+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
// GNU General Public License for more details.
15+
16+
// You should have received a copy of the GNU General Public License
17+
// along with Merlin. If not, see <http://www.gnu.org/licenses/>.
18+
19+
#ifdef __linux__
20+
21+
// Test SO execution
22+
// LD_PRELOAD=/home/itsafeature/Downloads/poseidon.so /usr/bin/whoami
23+
24+
#include <stdlib.h>
25+
26+
extern void* RunMain();
27+
28+
static void __attribute__ ((constructor)) init(void);
29+
30+
static void init(void) {
31+
// Thanks to the Sliver team for the unsetenv reminder
32+
unsetenv("LD_PRELOAD");
33+
unsetenv("LD_PARAMS");
34+
RunMain();
35+
return;
36+
}
37+
38+
#elif __APPLE__
39+
40+
// Test Dylib execution with python3
41+
// python3
42+
// import ctypes
43+
// ctypes.CDLL("./poseidon.dylib")
44+
45+
#include <stdio.h>
46+
#include <string.h>
47+
#include <stdlib.h>
48+
#include <wchar.h>
49+
#include <assert.h>
50+
#include <pthread.h>
51+
52+
extern void* RunMain();
53+
54+
__attribute__ ((constructor)) void initializer()
55+
{
56+
// Thanks to the Sliver team for the unsetenv reminder
57+
unsetenv("DYLD_INSERT_LIBRARIES");
58+
unsetenv("LD_PARAMS");
59+
60+
pthread_attr_t attr;
61+
pthread_t posixThreadID;
62+
int returnVal;
63+
64+
returnVal = pthread_attr_init(&attr);
65+
assert(!returnVal);
66+
returnVal = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
67+
assert(!returnVal);
68+
pthread_create(&posixThreadID, &attr, &RunMain, NULL);
69+
}
70+
71+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//go:build shared
2+
// +build shared
3+
4+
// This code is borrowed and slightly modified from https://github.com/MythicAgents/merlin/blob/efde48c42ed6dc364258698ef3a49009c684dd9f/Payload_Type/merlin/agent/shared.go
5+
// Merlin is a post-exploitation command and control framework.
6+
// This file is part of Merlin.
7+
// Copyright (C) 2023 Russel Van Tuyl
8+
9+
// Merlin is free software: you can redistribute it and/or modify
10+
// it under the terms of the GNU General Public License as published by
11+
// the Free Software Foundation, either version 3 of the License, or
12+
// any later version.
13+
14+
// Merlin is distributed in the hope that it will be useful,
15+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
// GNU General Public License for more details.
18+
19+
// You should have received a copy of the GNU General Public License
20+
// along with Merlin. If not, see <http://www.gnu.org/licenses/>.
21+
22+
package main
23+
24+
/*
25+
#include "poseidon.h"
26+
*/
27+
import "C"

Payload_Type/poseidon/poseidon/agent_code/sharedlib/sharedlib-darwin-linux.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <pthread.h>
77
#include "poseidon-darwin-10.12-amd64.h" //Change the header file if something different was used
88
// To build :
9-
// 1. Build a c-archive in golang: go build -buildmode=c-archive -o poseidon-darwin-10.12-amd64.a -tags=[profile] poseidon.go
9+
// 1. (this is done as part of building through mythic) Build a c-archive in golang: go build -buildmode=c-archive -o poseidon-darwin-10.12-amd64.a -tags=[profile] poseidon.go
1010
// 2. Execute: ranlib poseidon-darwin-10.12-amd64.a
11-
// 3. Build a shared lib (darwin): clang -shared -framework Foundation -framework CoreGraphics -framework Security -framework ApplicationServices -framework OSAKit -framework AppKit -fpic sharedlib-darwin-linux.c poseidon-darwin-10.12-amd64.a -o poseidon.dylib
11+
// 3. Build a shared lib (darwin): clang -shared -framework Foundation -framework CoreGraphics -framework Security -framework ApplicationServices -framework OSAKit -framework AppKit -framework OpenDirectory -fpic sharedlib-darwin-linux.c poseidon-darwin-10.12-amd64.a -o poseidon.dylib
1212

1313
// Test Dylib execution with python3
1414
// python3

Payload_Type/poseidon/poseidon/agent_code/xpc/xpc_wrapper_darwin.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern char *xpc_strerror (int);
5151
extern int csr_check (int what);
5252

5353
// This is undocumented, but sooooo useful :)
54-
extern mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, char *key);
54+
extern mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, const char *key);
5555

5656

5757
// Some of the routine #s launchd recognizes. There are quite a few subsystems

Payload_Type/poseidon/poseidon/agentfunctions/builder.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"strings"
1919
)
2020

21-
const version = "2.0.29"
21+
const version = "2.0.30"
2222

2323
var payloadDefinition = agentstructs.PayloadType{
2424
Name: "poseidon",
@@ -345,6 +345,9 @@ func build(payloadBuildMsg agentstructs.PayloadBuildMessage) agentstructs.Payloa
345345
for index, _ := range payloadBuildMsg.C2Profiles {
346346
tags = append(tags, payloadBuildMsg.C2Profiles[index].Name)
347347
}
348+
if mode == "c-shared" {
349+
tags = append(tags, "shared")
350+
}
348351
command := fmt.Sprintf("CGO_ENABLED=1 GOOS=%s GOARCH=%s ", targetOs, goarch)
349352
goCmd := fmt.Sprintf("-tags %s -buildmode %s -ldflags \"%s\"", strings.Join(tags, ","), mode, ldflags)
350353
if targetOs == "darwin" {

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.29",
13+
"agent_version": "2.0.30",
1414
"supported_wrappers": []
1515
}

0 commit comments

Comments
 (0)