Detect Unsecured Credentials in IBM QRadar
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/
QRadar Detection Query
SELECT
DATEFORMAT(starttime, 'yyyy-MM-dd HH:mm:ss') AS event_time,
LOGSOURCENAME(logsourceid) AS log_source,
username,
"sourceip",
QIDNAME(qid) AS event_name,
"EventID",
"CommandLine",
"Image" AS process_image,
"ParentImage" AS parent_image,
"TargetObject" AS registry_target,
"TargetFilename" AS target_filename,
CASE
WHEN "Image" IMATCHES '(?i).*(lazagne|netpass|passwordfox|webbrowserpassview|vaultpassview|credentialfileview|mailpassview|mimikatz|wce\.exe|pwdump|fgdump|gsecdump).*' THEN 'CredentialHarvestingTool'
WHEN "EventID" = '13' AND "TargetObject" IMATCHES '(?i).*(WinVNC3.Password|TightVNC.Server|RealVNC|Winlogon.DefaultPassword|PuTTY.Sessions|SNMP.ValidCommunities|OpenSSH).*' THEN 'RegistryCredentialAccess'
WHEN "EventID" = '11' AND "TargetFilename" IMATCHES '(?i).*(\.pem|\.pfx|\.p12|id_rsa|id_dsa|id_ecdsa|unattend\.xml|credentials|vnc\.ini|winscp\.ini|\.bash_history|\.aws).*' THEN 'CredentialFileAccess'
WHEN "EventID" = '1' AND "CommandLine" IMATCHES '(?i).*(Get-Content|findstr|Select-String|grep|\btype\b|\bcat\b).*(password|passwd|credentials|secret|apikey|api_key|connectionstring|passw).*' THEN 'ScriptedCredentialSearch'
ELSE 'Unknown'
END AS detection_branch,
CASE
WHEN "Image" IMATCHES '(?i).*(lazagne|mimikatz|pwdump|wce\.exe).*' THEN 75
WHEN "EventID" = '13' AND "TargetObject" IMATCHES '(?i).*(Winlogon.DefaultPassword|WinVNC3).*' THEN 60
WHEN "EventID" = '11' AND "TargetFilename" IMATCHES '(?i).*(id_rsa|\.pem|\.pfx).*' THEN 50
WHEN "EventID" = '1' AND "CommandLine" IMATCHES '(?i).*(password|passwd|secret).*' THEN 30
ELSE 20
END AS risk_score
FROM events
WHERE
LOGSOURCETYPEID(logsourceid) IN (12, 119, 143)
AND starttime > NOW() - 86400000
AND (
"Image" IMATCHES '(?i).*(lazagne|netpass|passwordfox|webbrowserpassview|vaultpassview|credentialfileview|mailpassview|mimikatz|wce\.exe|pwdump|fgdump|gsecdump).*'
OR "CommandLine" IMATCHES '(?i).*(lazagne|netpass|nirsoft|mimikatz).*'
OR (
"EventID" = '13'
AND "TargetObject" IMATCHES '(?i).*(WinVNC3|TightVNC|RealVNC|Winlogon.*DefaultPassword|PuTTY.*Sessions|SNMP.*ValidCommunities|OpenSSH).*'
AND "Image" NOT IMATCHES '(?i).*(svchost|lsass|services)\.exe.*'
)
OR (
"EventID" = '11'
AND "TargetFilename" IMATCHES '(?i).*(\.pem|\.pfx|\.p12|id_rsa|id_dsa|id_ecdsa|unattend\.xml|credentials|vnc\.ini|winscp\.ini|\.bash_history).*'
AND "Image" NOT IMATCHES '(?i).*(svchost|SearchIndexer|MsMpEng|OneDrive)\.exe.*'
)
OR (
"EventID" = '1'
AND "Image" IMATCHES '(?i).*(powershell|pwsh|cmd|bash|sh).*'
AND "CommandLine" IMATCHES '(?i).*(Get-Content|findstr|Select-String|grep|\btype\b|cat ).*'
AND "CommandLine" IMATCHES '(?i).*(password|passwd|credentials|secret|apikey|api_key|connectionstring|passw).*'
)
)
ORDER BY risk_score DESC, starttime DESC Detects T1552 Unsecured Credentials access by correlating Sysmon EventID 1 (process creation), 11 (file creation), and 13 (registry value set) events from QRadar-ingested Windows endpoint logs. Covers credential harvesting tool execution, sensitive file access, registry credential path queries, and scripted credential searches. Risk scoring differentiates severity across detection branches.
Data Sources
Required Tables
False Positives & Tuning
- Privileged access management (PAM) solutions such as BeyondTrust or CyberArk performing scheduled credential vault discovery may trigger registry and file-based detection branches
- System administrators using SysInternals tools or PowerShell remoting to audit SSH key presence and rotation compliance across managed hosts
- Antivirus or EDR agents (Carbon Black, Cortex XDR) scanning for credential files as part of on-access or scheduled threat hunting routines
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.