pspy is a command-line tool that observes Linux process execution without root. It uses procfs scans and inotify watchers to catch short-lived commands such as cron jobs.
Overview
pspy lets unprivileged users on a Linux host see commands as they run, including work by other users and scheduled jobs. It addresses the gap left by kernel notification tools that typically require root.
The tool combines periodic procfs scans with inotify watchers on directories such as /usr, /tmp, /etc, /home, /var, and /opt. File system activity triggers faster scans so brief processes are less likely to be missed.
Operators can enable colored command output, optional file-system event logging, configurable watch paths, and scan intervals. Static and smaller dynamically linked binaries are distributed for deployment onto a target system.
Common uses include CTF-style Linux enumeration and demonstrating risks when secrets appear on command lines. The documentation contrasts pspy with tools like forkstat that need elevated privileges.
Key features
- Procfs-based process scanning
- Inotify-triggered scans
- No root required
- Configurable directory watches
- Colored command output by UID
- Optional filesystem event logging
- Static and compact binaries
- Docker-based build option
Use cases
- Linux privilege enumeration in CTFs
- Observing cron and background jobs
- Demonstrating command-line secret exposure
- Monitoring short-lived processes