Skip to content

Commit 80d38c1

Browse files
committed
Change final display. More readable.
1 parent 84b4831 commit 80d38c1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

nxc/modules/maq.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def connect_smb(connection):
106106

107107
smb = connect_smb(connection)
108108

109+
109110
for guid in guids:
110111
# Accessing the GPO in the SYSVOL share to parse GptTmpl.inf
111112
path = ntpath.join(connection.targetDomain, "Policies", f"{{{guid}}}", "MACHINE", "Microsoft", "Windows NT", "SecEdit", "GptTmpl.inf",)
@@ -125,8 +126,8 @@ def connect_smb(connection):
125126
if "SeMachineAccountPrivilege" in line:
126127
found = True
127128
gpo_name = resolve_gpo(context, connection, guid)
128-
context.log.success(f'[GPO] "{gpo_name}"')
129-
context.log.highlight(f"{line}")
129+
context.log.success(f'(GPO) "{gpo_name}"')
130+
context.log.highlight(f"\t{line}")
130131
# extract all the sid concerns by the SeMachineAccountPrivilege
131132
sids = re.findall(r"\*?(S-\d+(?:-\d+)+)", line)
132133
break
@@ -176,7 +177,7 @@ def connect_smb(connection):
176177
if resp:
177178
for sid, item in zip(sessions.keys(), resp["TranslatedNames"]["Names"], strict=False):
178179
if item["DomainIndex"] >= 0:
179-
context.log.highlight(f"\t({sid}) \"{item['Name']}\"")
180+
context.log.highlight(f'\t\t - "{item["Name"]}" ({sid})')
180181

181182
else:
182183
context.log.fail("No SID(s) found in SeMachineAccountPrivilege")
@@ -186,7 +187,7 @@ def connect_smb(connection):
186187

187188

188189
def on_login(self, context, connection):
189-
context.log.display("Getting the MachineAccountQuota and SeMachineAccountPrivilege")
190+
context.log.display("Getting the MachineAccountQuota")
190191

191192
ldap_response = connection.search("(ms-DS-MachineAccountQuota=*)", ["ms-DS-MachineAccountQuota"])
192193
entries = parse_result_attributes(ldap_response)
@@ -197,4 +198,6 @@ def on_login(self, context, connection):
197198

198199
context.log.highlight(f"MachineAccountQuota: {entries[0]['ms-DS-MachineAccountQuota']}")
199200

201+
context.log.display("Getting SeMachineAccountPrivilege")
202+
200203
self.get_SeMachineAccountPrivilege(context, connection)

0 commit comments

Comments
 (0)