Documentation Index
Fetch the complete documentation index at: https://hackbook.dudji.com/llms.txt
Use this file to discover all available pages before exploring further.
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:
| Column | Meaning |
|---|---|
USER | Who owns the process — root-owned processes are high value |
PID | Process ID |
%CPU / %MEM | Resource usage |
VSZ | Virtual memory size — total memory the process could use |
RSS | Resident Set Size — physical memory currently used by the process |
STAT | Process state — S sleeping (waiting for input), R running (actively using CPU), Z zombie (finished but not cleaned up by parent) |
START | Time the process was started |
TIME | Total CPU time the process has consumed since it started |
COMMAND | The full command — passwords often appear here |
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
| Field | Values | Description |
|---|---|---|
| MIN | 0-59 | Minute |
| HOUR | 0-23 | Hour |
| DOM | 1-31 | Day of month |
| MON | 1-12 | Month |
| DOW | 0-7 | Day of week (0 and 7 = Sunday) |
* | any | Run every interval |
*/6 | any | Every 6 units |
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.| Signal | Number | Shortcut | Description |
|---|---|---|---|
SIGHUP | 1 | — | Reload config / restart |
SIGINT | 2 | Ctrl+C | Interrupt process |
SIGQUIT | 3 | Ctrl+D | Quit |
SIGKILL | 9 | — | Force kill — no cleanup |
SIGTERM | 15 | — | Graceful termination |
SIGSTOP | 19 | — | Pause process |
SIGTSTP | 20 | Ctrl+Z | Suspend to background |
Background & Foreground
Process & Service Enumeration Checklist
Quick Reference
| Command | Purpose |
|---|---|
ps aux | All running processes |
ps auxf | Process tree |
systemctl list-units --type=service | All services |
systemctl status <service> | Service status and logs |
journalctl -u <service> | Full service logs |
ss -tulnp | Listening ports with process names |
cat /etc/crontab | Scheduled tasks |
crontab -l | Current user’s cron jobs |
systemctl list-timers | Systemd timers |
kill -9 <PID> | Force kill a process |
Next: Network Configuration & Enumeration — mapping the internal network, active connections, and pivoting opportunities.