Proc Filesystem
Adversaries on Linux systems read process memory directly via the /proc filesystem to extract credentials from running processes. By accessing /proc/<PID>/maps to identify memory regions and /proc/<PID>/mem to read those regions, attackers dump credentials from processes like sshd, su, sudo, gnome-keyring, and KWallet without injecting code or using ptrace. Tools include MimiPenguin (specifically targeting sshd and gnome-keyring), LaZagne (Linux edition), and PACEMAKER. This technique requires root privileges or the same UID as the target process. Used by threat actors targeting Linux servers where traditional Windows credential tools don't apply.
let ProcMemAccess = DeviceFileEvents
| where Timestamp > ago(24h)
| where FolderPath matches regex @"/proc/\d+/mem"
or FolderPath matches regex @"/proc/\d+/maps"
or FolderPath matches regex @"/proc/\d+/environ"
| where InitiatingProcessFileName !in~ ("gdb", "strace", "ltrace", "python3", "python")
or InitiatingProcessCommandLine has_any ("sshd", "gnome-keyring", "kwallet", "su", "sudo")
| project Timestamp, DeviceName, AccountName, FolderPath, FileName,
InitiatingProcessFileName, InitiatingProcessCommandLine;
let MimiPenguinPattern = DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (
"mimipenguin", "MimiPenguin",
"/proc/", "gnome-keyring",
"sshd", "kwallet-daemon"
)
and ProcessCommandLine has "/proc/"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine;
let LaZagneLinux = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "python3" or FileName =~ "python"
| where ProcessCommandLine has "lazagne" and ProcessCommandLine has_any ("memory", "all")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine;
union ProcMemAccess, MimiPenguinPattern, LaZagneLinux
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- GDB debugger sessions legitimately accessing /proc/<PID>/mem when debugging application crashes or memory issues
- Security tools like Valgrind, Sanitizers, or custom profilers reading process memory maps for performance analysis
- Legitimate Python debugging frameworks (pdb, pydevd) accessing /proc for process introspection
- System monitoring tools (htop, systemd-coredump) reading /proc/<PID>/maps for process information display
- Container orchestration tools like containerd or Docker reading /proc entries for container lifecycle management
References (6)
- https://attack.mitre.org/techniques/T1003/007/
- https://github.com/huntergregal/mimipenguin
- https://github.com/AlessandroZ/LaZagne
- https://security.stackexchange.com/questions/91040/what-is-proc-pid-mem
- https://www.slideshare.net/roottoor1/linux-credential-access-techniques
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1003.007/T1003.007.md
Unlock Pro Content
Get the full detection package for T1003.007 including response playbook, investigation guide, and atomic red team tests.