🔬Linux Privilege Escalation
Last updated
Last updated
Direct access to the target machine via
student
unprivileged userFind specific Linux Privilege escalation vulnerabilities manually
Some files permissions are not set properly, use them to elevate privileges.
Look for world writable files
Find a file that could help to elevate privileges
❗
/etc/shadow
is writable by everyone!
/etc/shadow
stores the passwords in an encrypted format, so the root
password need to be replaced with a hashed password
Switch to the root
user
Direct access to the target machine via
student
unprivileged userFind misconfigured
sudo
privileges
Find setuid
programs
📌 Useful tool - FallOfSudo
Identify what commands the student
user can run
❗
/usr/bin/man
binary can be run withSUDO
privileges, without providing aroot
user password
This can happen on Linux systems for specific binaries that other users have to run with SUDO
privileges. It looks harmless, but it can allow users to spawn bash privileged sessions, since the specific binary can be utilized to execute specific commands. Those commands are executed with the binary root
privileges.
In the man
scrolling page, using the !
a bash
can be spawned
Retrieve the flag with the root
user