Detect /etc/passwd and /etc/shadow in CrowdStrike LogScale
Adversaries read /etc/passwd and /etc/shadow on Linux and Unix systems to extract password hashes for offline cracking. /etc/passwd contains usernames and user information (world-readable), while /etc/shadow contains the actual password hashes (root-readable only). Together they can be combined with `unshadow` and cracked with John the Ripper or Hashcat. Tools include LaZagne (shadow.py module), direct cat commands, and Python one-liners. Also includes reading from backup copies (/etc/shadow-, /etc/shadow.bak) and cloud instance metadata for default credentials. Used by multiple threat actors as a standard post-exploitation step on Linux systems.
MITRE ATT&CK
- Tactic
- Credential Access
- Technique
- T1003 OS Credential Dumping
- Sub-technique
- T1003.008 /etc/passwd and /etc/shadow
- Canonical reference
- https://attack.mitre.org/techniques/T1003/008/
LogScale Detection Query
// Shadow file access and credential cracking tool detection — T1003.008
#repo=base_sensor
(
(
#event_simpleName = "ProcessRollup2"
| CommandLine = /\/etc\/(shadow|shadow-|shadow\.bak|master\.passwd|security\/passwd)/
| ImageFileName != /\/(usr\/)?(s?bin|sbin)\/(passwd|chpasswd|useradd|usermod|chage|login|newusers)$/
)
or
(
#event_simpleName = "ProcessRollup2"
| CommandLine = /unshadow|lazagne.*(shadow|linux|all)|(john|hashcat).*shadow/i
)
or
(
#event_simpleName = "ProcessRollup2"
| CommandLine = /\/etc\/shadow/ AND CommandLine = /\/etc\/passwd/
)
)
| case {
CommandLine = /unshadow|lazagne|john|hashcat/i | risk_level := "CRITICAL" ;
CommandLine = /python[0-9.]?|perl|ruby/ AND CommandLine = /\/etc\/shadow/ | risk_level := "HIGH" ;
* | risk_level := "MEDIUM"
}
| groupBy(
[ComputerName, UserName, FileName, CommandLine, risk_level],
function=[
count(aid, as=event_count),
min(@timestamp, as=first_seen),
max(@timestamp, as=last_seen)
]
)
| sort(last_seen, order=desc) CrowdStrike LogScale (Falcon) detection for unauthorized /etc/shadow access and password cracking tool execution on Linux endpoints. Queries ProcessRollup2 events from the Falcon sensor base repository for command lines accessing shadow credential files or invoking unshadow, john, hashcat, or lazagne. Results are risk-tiered and grouped by host/user/command for analyst triage.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate privileged automation using Python or shell scripts to manage Linux users in CI/CD pipelines — Falcon agents on build servers may generate high-volume hits requiring suppression by ComputerName tag
- CrowdStrike RTR (Real Time Response) sessions where analysts run cat /etc/shadow for live forensic triage — these appear as ProcessRollup2 events with Falcon's own RTR process ancestry and can be distinguished by ParentImageFileName
- Custom PAM modules compiled with debug logging that fork child processes reading /etc/shadow during authentication testing in QA environments
- Docker or Podman container build steps on monitored Linux hosts where Dockerfile RUN layers copy or transform /etc/shadow for hardened base image construction
Other platforms for T1003.008
Testing Methodology
Validate this detection against 3 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 1Direct /etc/shadow Read with cat
Expected signal: Auditd file watch event (type=SYSCALL, syscall=openat) for /etc/shadow with exe=/bin/cat. DeviceFileEvents (if MDE Linux agent) for /etc/shadow read by cat. Process creation event for cat command with /etc/shadow argument.
- Test 2Unshadow and Password Hash Preparation
Expected signal: Auditd SYSCALL events for openat on both /etc/passwd and /etc/shadow with exe=/usr/bin/unshadow. File creation event for /tmp/atomic_hashes.txt. DeviceProcessEvents for unshadow execution. DeviceFileEvents for shadow and passwd access.
- Test 3LaZagne Linux Shadow Module
Expected signal: DeviceNetworkEvents for GitHub download connection. DeviceProcessEvents for lazagne execution with 'linux -shadow' arguments. Auditd openat events for /etc/shadow with exe=/tmp/lazagne. DeviceFileEvents for /etc/shadow access.
References (6)
- https://attack.mitre.org/techniques/T1003/008/
- https://github.com/AlessandroZ/LaZagne
- https://linux.die.net/man/8/unshadow
- https://www.openwall.com/john/
- https://linux-audit.com/monitoring-of-etc-shadow-using-linux-audit/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1003.008/T1003.008.md
Unlock Pro Content
Get the full detection package for T1003.008 including response playbook, investigation guide, and atomic red team tests.