Detect Unsecured Credentials in Sumo Logic CSE
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/
Sumo Detection Query
// Branch 1: Credential Harvesting Tool Execution
(_sourceCategory="windows/sysmon" OR _sourceCategory="endpoints/sysmon")
| parse xml field=_raw "<EventID>*</EventID>" as EventID
| parse xml field=_raw "<Data Name='Image'>*</Data>" as Image nodrop
| parse xml field=_raw "<Data Name='CommandLine'>*</Data>" as CommandLine nodrop
| parse xml field=_raw "<Data Name='ParentImage'>*</Data>" as ParentImage nodrop
| parse xml field=_raw "<Data Name='User'>*</Data>" as User nodrop
| parse xml field=_raw "<Data Name='Computer'>*</Data>" as Computer nodrop
| parse xml field=_raw "<Data Name='TargetObject'>*</Data>" as TargetObject nodrop
| parse xml field=_raw "<Data Name='TargetFilename'>*</Data>" as TargetFilename nodrop
| where EventID in ("1", "11", "13")
| where
(
EventID == "1" and (
matches(Image, "(?i).*(lazagne|netpass|passwordfox|webbrowserpassview|vaultpassview|credentialfileview|mailpassview|mimikatz|wce\.exe|pwdump|fgdump|gsecdump).*")
or matches(CommandLine, "(?i).*(lazagne|nirsoft|netpass|mimikatz).*")
)
)
or
(
EventID == "13" and
matches(TargetObject, "(?i).*(WinVNC3.*Password|TightVNC.*Server|RealVNC|Winlogon.*DefaultPassword|PuTTY.*Sessions|SNMP.*ValidCommunities|OpenSSH).*")
and !matches(Image, "(?i).*(svchost|lsass|services)\.exe.*")
)
or
(
EventID == "11" and
matches(TargetFilename, "(?i).*(\.pem|\.pfx|\.p12|id_rsa|id_dsa|id_ecdsa|unattend\.xml|credentials|vnc\.ini|winscp\.ini|\.bash_history|\.aws).*")
and !matches(Image, "(?i).*(svchost|SearchIndexer|MsMpEng|OneDrive)\.exe.*")
)
or
(
EventID == "1" and
matches(Image, "(?i).*(powershell|pwsh|cmd|bash|sh).*") and
matches(CommandLine, "(?i).*(Get-Content|findstr|Select-String|grep|\btype\b|cat ).*") and
matches(CommandLine, "(?i).*(password|passwd|credentials|secret|apikey|api_key|connectionstring|passw).*")
)
| eval DetectionBranch = if(EventID == "1" and matches(Image, "(?i).*(lazagne|mimikatz|pwdump|netpass).*"), "CredentialHarvestingTool",
if(EventID == "13", "RegistryCredentialAccess",
if(EventID == "11", "CredentialFileAccess", "ScriptedCredentialSearch")))
| eval RiskScore = if(DetectionBranch == "CredentialHarvestingTool", 75,
if(DetectionBranch == "RegistryCredentialAccess", 50,
if(DetectionBranch == "CredentialFileAccess", 40, 25)))
| eval Severity = if(RiskScore >= 75, "Critical",
if(RiskScore >= 50, "High",
if(RiskScore >= 25, "Medium", "Low")))
| fields _messageTime, Computer, User, Image, CommandLine, ParentImage, TargetObject, TargetFilename, DetectionBranch, RiskScore, Severity
| sort by RiskScore desc, _messageTime desc Detects T1552 Unsecured Credentials access by parsing Sysmon XML event data ingested into Sumo Logic. Covers four detection branches: credential harvesting tool execution (EventID 1), registry credential path access (EventID 13), sensitive credential file creation or access (EventID 11), and scripted searches using PowerShell or shell commands. Dynamic risk scoring and severity classification aid analyst triage.
Data Sources
Required Tables
False Positives & Tuning
- Enterprise password managers (1Password, Bitwarden, KeePass) accessing their encrypted vault files may match credential file path patterns if stored in user home directories
- CI/CD pipeline agents (Jenkins, GitHub Actions runner) reading application configuration files such as web.config or environment files containing connection strings during build processes
- IT infrastructure management tools (Puppet, Chef, Ansible) using PowerShell modules to read or validate configuration files that contain service account credentials
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.