LinPEAS Showed No Cron Jobs. pspy Found One Running as Root.
The automated enumeration said there was nothing interesting in cron. There was — a root-owned job calling a world-writable script every five minutes. The scan just couldn't see it.
On a low-priv shell, a standard enumeration script's cron section came back essentially empty: no entries worth a second look. Dropping pspy64 and watching for a few minutes surfaced a root process spawning on a five-minute boundary, running a script that a low-priv user could write to. That one gap was the whole privesc path.
What the scripts checked
Typical enumeration tooling reads the cron sources it has permission to read:
cat /etc/crontab ls -la /etc/cron.d/ crontab -l
All three came back clean or empty. No suspicious lines, nothing flagged. The conclusion looked reasonable: cron isn't the way in here.
Why that conclusion was wrong
Each of those commands has a blind spot, and all three were in play at once:
/var/spool/cron/crontabs/*(per-user crontabs, including root's) is usually mode600and owned by the user it belongs to. A low-priv read of root's crontab just fails silently or returns nothing — it doesn't warn you that you were denied, and a script grepping for output sees the same empty result as "no job exists."crontab -lonly ever shows the crontab of the user running the command. It cannot show you root's jobs, or any other user's. Running it as a low-priv user answers a different question than the one you're asking.- The job wasn't in
/etc/crontabor/etc/cron.d/at all — it had been added straight into root's personal crontab file, which none of the three commands above has permission to read.
What pspy looked at instead
pspy doesn't read cron's configuration at all. It watches the kernel's process creation events directly — polling /proc for new PIDs, and using inotify to catch filesystem activity — and prints the command line of every process that gets forked and exec'd on the box, by any user:
./pspy64 -pf -i 1000
A few minutes in, the five-minute mark rolled over and a line appeared showing UID=0 executing a backup helper script in a directory with loose permissions. No cron file was read to get that line — it came from watching execution itself, which requires no special access to see.
That's the structural difference: configuration tells you what's declared, and only to whoever is allowed to read the declaration. Process monitoring tells you what actually runs, regardless of who declared it or whether you're allowed to read their config.
Other places the same gap shows up
- systemd timers –
systemctl list-timersshows timers you have permission to enumerate, but the unit it triggers can still run as another user and touch files a low-priv enumeration pass never thought to check. /etc/anacrontaband distro-specific periodic directories (/etc/cron.daily, etc.) are easy to forget to check manually, and an automated scanner that only parses standard crontab syntax can skip anacron's slightly different format entirely.- Application-level schedulers – a web app's own task queue or a monitoring agent's self-restart loop never touches cron at all, so no cron-focused check will ever flag it. Only watching what actually executes catches these.
Takeaway
A privesc script that reports no cron findings has told you "nothing in the cron files I could read looked interesting" — not "there is no scheduled task on this box." Those are different claims, and the gap between them is exactly where root-owned, low-priv-writable jobs live. Run the config-based check first since it's fast and free, but let something like pspy watch actual process creation for a few minutes — across at least one five-minute boundary, since that's cron's most common interval — before concluding cron is a dead end.
Related: Restricted shell escape techniques, Hashcat picked the wrong bcrypt mode.