Detect Unsecured Credentials in CrowdStrike LogScale
Adversaries may search compromised systems to find and obtain insecurely stored credentials. These credentials can be stored and/or misplaced in many locations on a system, including plaintext files, operating system or application-specific repositories, shell history files, private key files, cloud instance metadata APIs, container environment variables, and group policy preference files. Tools like LaZagne, NirSoft utilities, and custom scripts are commonly used to automate credential harvesting across multiple storage locations simultaneously.
MITRE ATT&CK
- Tactic
- Credential Access
- Technique
- T1552 Unsecured Credentials
- Canonical reference
- https://attack.mitre.org/techniques/T1552/
LogScale Detection Query
// T1552 Unsecured Credentials Detection — CrowdStrike LogScale CQL
// Branch 1: Credential Harvesting Tool Execution
#event_simpleName=ProcessRollup2
| ImageFileName = /(?i)(lazagne|netpass\.exe|passwordfox|webbrowserpassview|vaultpassview|credentialfileview|mailpassview|mimikatz|wce\.exe|pwdump|fgdump\.exe|gsecdump)/
OR CommandLine = /(?i)(lazagne|nirsoft|netpass|mimikatz)/
| eval DetectionBranch="CredentialHarvestingTool"
| eval RiskScore=75
| union [
// Branch 2: Credential File Access
#event_simpleName=SuspiciousFilePath OR #event_simpleName=ManagedAssets
| TargetFileName = /(?i)(\.pem$|\.pfx$|\.p12$|id_rsa|id_dsa|id_ecdsa|id_ed25519|unattend\.xml|vnc\.ini|filezilla|winscp\.ini|\.bash_history|\.aws.credentials|web\.config|password|passwd|credentials|creds|secret|apikey|api_key)/
| ImageFileName != /(?i)(svchost\.exe|SearchIndexer\.exe|MsMpEng\.exe|OneDrive\.exe)/
| eval DetectionBranch="CredentialFileAccess"
| eval RiskScore=40
]
| union [
// Branch 3: Registry Credential Path Query
#event_simpleName=RegQueryValue OR #event_simpleName=RegOpenKey
| RegObjectName = /(?i)(WinVNC3.Password|TightVNC.Server|RealVNC.WinVNC4|SNMP.ValidCommunities|Winlogon.DefaultPassword|PuTTY.Sessions|OpenSSH)/
| ImageFileName != /(?i)(svchost\.exe|lsass\.exe|services\.exe)/
| eval DetectionBranch="RegistryCredentialAccess"
| eval RiskScore=50
]
| union [
// Branch 4: Scripted Credential Search via Shell
#event_simpleName=ProcessRollup2
| ImageFileName = /(?i)(powershell\.exe|pwsh\.exe|cmd\.exe|bash|\bsh\.exe)/
| CommandLine = /(?i)(Get-Content|findstr|Select-String|grep|\btype\b|\bcat\b)/
| CommandLine = /(?i)(password|passwd|credentials|secret|apikey|api_key|connectionstring|passw)/
| eval DetectionBranch="ScriptedCredentialSearch"
| eval RiskScore=25
]
| eval Severity=if(RiskScore >= 75, "Critical",
if(RiskScore >= 50, "High",
if(RiskScore >= 25, "Medium", "Low")))
| table([timestamp, ComputerName, UserName, ImageFileName, CommandLine, ParentBaseFileName, DetectionBranch, RiskScore, Severity])
| sort(RiskScore, order=desc) CrowdStrike LogScale (Falcon) CQL query detecting T1552 Unsecured Credentials access across four branches: execution of known credential harvesting tools (ProcessRollup2 image/command matching), sensitive credential file path access, registry credential storage path queries (RegQueryValue/RegOpenKey), and scripted shell credential searches. Uses Falcon event types and field names native to the CrowdStrike telemetry schema. Risk scoring and severity classification support analyst prioritization.
Data Sources
Required Tables
False Positives & Tuning
- CrowdStrike Falcon's own sensor processes or Real-Time Response (RTR) sessions accessing credential file paths during forensic investigations or threat hunting operations initiated by security teams
- Legitimate software deployment tools (SCCM, Intune) reading unattend.xml or sysprep.xml files during OS deployment or imaging workflows on endpoints
- Developers using Windows Subsystem for Linux (WSL) with bash to manage SSH keys or AWS CLI profiles will trigger scripted credential search detection when running key management commands
Other platforms for T1552
Testing Methodology
Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1LaZagne All-Sources Credential Harvest Simulation
Expected signal: Sysmon Event ID 1: Process Create for lazagne.exe with CommandLine 'all -oN'. Sysmon Event ID 11: Multiple file access events across browser profile directories, %APPDATA% credential stores, and credential files. Sysmon Event ID 13: Registry queries to PuTTY, VNC, and Winlogon password locations. File creation event for lazagne_test_output.txt.
- Test 2Scripted Credential File Search via PowerShell Select-String
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing both 'Select-String' and 'password'. PowerShell ScriptBlock Log Event ID 4104 capturing the full pipeline. Sysmon Event ID 11 for cred_search_results.txt creation. Multiple file access events as Select-String reads candidate files.
- Test 3Registry Credential Extraction — PuTTY and Winlogon
Expected signal: Sysmon Event ID 1: Process Create for reg.exe with CommandLine querying PuTTY sessions path. If Sysmon is configured to monitor registry access, Event ID 13 showing TargetObject paths. Security Event ID 4663 (if object access auditing enabled) for registry key read operations.
- Test 4Private Key Enumeration and Staging
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine referencing '.pem', '.pfx', 'id_rsa'. Sysmon Event ID 11: File creation for key_staging directory. Multiple file access events as Get-ChildItem reads candidate key files. PowerShell ScriptBlock Log Event ID 4104 with full enumeration script.
- Test 5NirSoft WebBrowserPassView Credential Extraction
Expected signal: Sysmon Event ID 1: Process Create for WebBrowserPassView.exe. Sysmon Event ID 11: File access to Chrome Login Data SQLite file at %LOCALAPPDATA%\Google\Chrome\User Data\Default\Login Data, Firefox logins.json, Edge Login Data. File creation event for browser_creds_test.html output. If DPAPI decryption is used, potential Event ID 4693 (DPAPI decryption) in Security log.
References (9)
- https://attack.mitre.org/techniques/T1552/
- https://github.com/AlessandroZ/LaZagne
- https://www.nirsoft.net/password_recovery_tools.html
- https://labs.portcullis.co.uk/download/eu-18-Wadhwa-Brown-Where-2-worlds-collide-Bringing-Mimikatz-et-al-to-UNIX.pdf
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicefileevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceregistryevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1552/T1552.md
- https://www.cybereason.com/blog/astaroth-malware-uses-legitimate-os-and-antivirus-processes-to-steal-passwords-and-personal-data
- https://www.huntress.com/blog/nppspy-how-unsecured-windows-credential-provider-allowed-adversaries-to-access-credentials
Unlock Pro Content
Get the full detection package for T1552 including response playbook, investigation guide, and atomic red team tests.