The Mindset
Processes and services matter to a pentester for three reasons:- Attack surface — Services running as root with known vulnerabilities
- Credential exposure — Processes started with passwords as arguments (visible in
ps) - Scheduled execution — Cron jobs and timers running privileged scripts you might be able to modify
Processes
ps — Process Status
The primary tool for viewing running processes.
ps aux output explained:
Hunt for credentials in process arguments:
The first command searches
ps aux output for common patterns used when passwords are passed as arguments — password/passwd as full argument names, --pass as a CLI flag, or -p followed by a number (common with database CLIs like mysql).The second command reads directly from /proc instead of ps. Every running process has a cmdline file in /proc/[PID]/ containing its full command line, but arguments are separated by null bytes (\0) instead of spaces. tr '\0' ' ' converts those null bytes to spaces so the output is readable, then grep filters for anything that looks like a secret.Services (Daemons)
Services are background processes — identified by ad suffix in their name (sshd, httpd, mysqld). They’re managed by systemd on most modern Linux systems.
systemctl — Service Management
User=root in the unit file, any exploit against this service runs as root.
Check Service Unit Files for Misconfigs
journalctl — Service Logs
Listening Ports & Network Services
A service is only useful to you if it’s accessible. Map what’s listening and where.127.0.0.1 (localhost only) are not exposed externally — but once you’re on the box, you can access them. Internal services are often less hardened than externally-facing ones.
Cron Jobs — Scheduled Task Abuse
Cron runs scripts on a schedule — often as root. If a root-owned cron job calls a script you can modify, you can inject commands that run as root.Where Cron Jobs Live
Reading a Crontab
Exploiting Cron Jobs
Systemd Timers — The Modern Cron
Systemd timers are the modern replacement for cron. Check them too.Process Signals
Useful for controlling processes during a pentest — particularly for backgrounding tools or cleanly stopping them.Background & Foreground
Next: Network Configuration & Enumeration — mapping the internal network, active connections, and pivoting opportunities.