Skip to content
Pwnversity
FUND-LINUX-SISTEMAbasic · 9 min · upd. 2026-11

Linux: Processes, Services and Software

A Linux system isn’t just files: it’s what’s running. Which processes exist, under which user, which services start by themselves and what cron runs every minute is exactly what you look for when enumerating a compromised machine, because that’s where the privileged programs you can hijack show up. And on your own Kali, knowing how to control processes, services and installs saves you hours of “it doesn’t work and I don’t know why”.

  • A process is a running program. It has a PID, a PPID (the process that launched it) and runs with the user and permissions of whoever started it.
  • /proc/<pid>/ exposes its live information: cmdline (the arguments it was launched with), environ (its environment variables, if you have permission) and cwd (its directory).
Command What it shows
ps aux Snapshot of every process, with user, PID and command
ps -ef --forest Process tree: who launched whom
top · htop Live view of CPU and memory usage
pgrep -a name PID and command of matching processes
Signal Number How it’s sent Effect
SIGTERM 15 kill PID (default) Asks it to terminate cleanly
SIGKILL 9 kill -9 PID Immediate stop, no cleanup. Last resort
SIGINT 2 Ctrl+C Interrupt from the terminal
SIGTSTP 20 Ctrl+Z Pause and hand control back to the shell
SIGHUP 1 Closing the terminal The process usually dies; many daemons use it to reload config
Ventana de terminal
nmap -p- 10.10.10.5 -oN all.txt & # run in the background
jobs # this shell's jobs
fg %1 # bring job 1 to the foreground
# Ctrl+Z pauses the current one; bg keeps it running in the background
nohup ./script.sh > out.log 2>&1 & # survive closing the terminal

A daemon is a process without a terminal that waits to be needed (sshd, nginx, cron). systemd starts them, watches them and restarts them; each is defined in a unit (/etc/systemd/system/*.service or /lib/systemd/system/).

Command What it does
systemctl status ssh State, PID and the last log lines
systemctl start ssh · stop · restart Start, stop, restart now
systemctl enable ssh · disable Start it at boot (or not). Doesn’t start it now
systemctl enable --now ssh Both at once
systemctl list-units --type=service --state=running Running services
journalctl -u ssh -f The service’s full log, live

The classic logs are still in /var/log (auth.log or secure for authentication, syslog or messages for the system).

  • cron: /etc/crontab, /etc/cron.d/, /etc/cron.{hourly,daily,weekly}/ and each user’s crontab (crontab -l). Each line: minute, hour, day of month, month, day of week, (user) and command.
  • systemd timers: systemctl list-timers.

tmux keeps your sessions alive even if you close the terminal or the SSH or VPN connection drops; they only die if the machine they run on reboots. It also lets you split the screen to have a listener, a scan and your shell side by side.

Action Keys or command
New named session tmux new -s lab
Detach · reattach Ctrl+b d · tmux a -t lab
List sessions tmux ls
New window · next Ctrl+b c · Ctrl+b n
Split vertically · horizontally Ctrl+b % · Ctrl+b "
Move between panes · close Ctrl+b + arrow · Ctrl+b x

In order of preference: the package manager, the language’s package manager and, as a last resort, building or downloading by hand.

Route Command Where it ends up Notes
System packages sudo apt update && sudo apt install nmap /usr/bin Resolves dependencies. dpkg -i file.deb installs a standalone .deb without resolving them
Python tools pipx install tool ~/.local/bin Each tool in its own isolated environment
Python projects python3 -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt Inside .venv For code you clone and run
Go go install github.com/author/tool@latest ~/go/bin That directory isn’t in the PATH by default
Source code git clone https://… Wherever you clone it Cloning isn’t installing: the system doesn’t know it exists
By hand Downloaded binary /usr/local/bin or /opt Check where you download it from
Ventana de terminal
# What runs as root?
ps aux | awk '$1=="root"' | grep -vE '\[|ps aux'
# Which services listen, and with which process?
sudo ss -tlnp
# A service that won't start, in this order
systemctl status nginx
journalctl -u nginx -n 50 --no-pager
sudo ss -tlnp | grep ':80 ' # is another process already on the port?
# Visible scheduled tasks
cat /etc/crontab; ls -la /etc/cron.*; crontab -l 2>/dev/null
systemctl list-timers --all
Concept What to remember
Process PID, PPID and the permissions of whoever launched it.
/proc/<pid>/cmdline · environ Arguments and variables: sometimes with passwords.
kill · kill -9 Asks to terminate (15) · hard stop (9).
& · Ctrl+Z · bg · fg Background · pause · continue behind · bring forward.
nohup · tmux Survive closing the terminal · persistent sessions.
start · enable Now · at boot. Both: enable --now.
journalctl -u service The service’s log.
cron /etc/crontab, /etc/cron.*, crontab -l.
apt update Always before installing.
externally-managed-environment Use pipx or venv.
go install Ends up in ~/go/bin: add it to the PATH.
  1. What’s the difference between systemctl start and systemctl enable?

    Answer

    start starts the service now, but it won’t start on the next boot. enable configures it to start at boot, but doesn’t start it now. enable --now does both.

  2. A process doesn’t respond to kill PID. What do you do, and what’s the risk?

    Answer

    kill -9 PID, which sends SIGKILL and stops it without letting it clean up: it can leave temporary files, locks or half-written data behind.

  3. You start a long scan over SSH and the connection drops. How could you have avoided losing it?

    Answer

    By running it inside tmux (or with nohup in the background): the process stays alive on the machine even if the session closes, and with tmux you can reattach.

  4. On a compromised machine you see a root process running /opt/scripts/backup.sh every minute, and the file is writable by your user. What does that mean?

    Answer

    That you can add commands to the script and they’ll run as root on the next execution: it’s a privilege escalation.

  5. pip install tool fails with externally-managed-environment. What do you do?

    Answer

    Install it with pipx (if it’s a command-line tool) or inside a virtual environment created with python3 -m venv. Don’t force the install into the system Python.

  6. Why is /proc/<pid>/environ interesting when enumerating?

    Answer

    Because it holds the environment variables the process was launched with, and many applications receive credentials or keys there. You can only read it for your own user’s processes (or all of them if you’re root).