A Debian-first guide to spotting signs that a low-privilege user or process gained elevated access, and reviewing the system changes that followed.
Privilege escalation is the process of gaining more access than was originally intended, often moving from a low-privilege account, web service, or application context into root-level or administrative control.
On Debian systems, this often shows up through sudo abuse, service manipulation, new administrative accounts, modified configs, or suspicious access to sensitive files and commands.
sudo grep -Ei "sudo|COMMAND" /var/log/auth.log
sudo grep -Ei "Accepted|session opened" /var/log/auth.log
getent group sudo
cut -d: -f1 /etc/passwd
ps -U root -u root u
sudo ufw status numbered
sudo systemctl list-unit-files --type=service
sudo find /etc/cron* -type f
sudo passwd -l <username>
sudo chage -E 0 <username>
sudo deluser <username> sudo
sudo kill -TERM <PID>
sudo systemctl stop <service_name>
sudo ufw status numbered
sudo systemctl list-unit-files --type=service
sudo find /etc/cron* -type f
sudo find /var/www -type f -mtime -2 2>/dev/null
sudo find /home /root -name authorized_keys -type f -exec ls -lah {} \; -exec cat {} \;
sudo grep -Ei "Accepted|sudo|useradd|adduser" /var/log/auth.log
file /path/to/binary
sha256sum /path/to/binary
strings /path/to/binary | less
Recovery means understanding not only how elevated access was gained, but what was changed afterward to preserve or expand that access.
sudo grep -Ei "sudo|COMMAND|Accepted" /var/log/auth.log
sudo ufw allow from <trusted_ip> to any port 22
sudo ufw deny 22
getent group sudo
sudo systemctl list-unit-files --type=service
sudo find /etc/cron* -type f
sudo apt update
sudo apt upgrade
Manual auth, process, and system review should come first. Future recommendations may include tooling that improves host visibility, but the core workflow remains tracing privilege gain to its source and reviewing what changed afterward.
All commands shown are based on Debian-based systems unless otherwise noted.