Sudo Tee Privilege Escalation
Sudo tee command is vulnerable to privilege escalation.
Investigation
If we can execute tee
command as root, we can escalate to privilege.
Exploitation
1. Create a New Password for New User
Assume the new username is "tester".
Copy the output password.
2. Write New Line with Tee
Paste the password in printf
and overwrite /etc/passwd
using tee
command.
3. Switch to New User
Now the new user was created. We can switch to the new user.
Last updated