Reuse Sudo Tokens
Theory
In the scenario where you have a shell as a user with sudo privileges but you don't know the password of the user, you can wait for him/her to execute some command using sudo. Then, you can access the token of the session where sudo was used and use it to execute anything as sudo (privilege escalation).
Practice
Requirements to escalate privileges:
The user have used sudo to execute something in the last 15mins (by default that's the duration of the sudo token that allows us to use sudo without introducing any password)
There is no restriction on ptrace
gdb is accessible (you can be able to upload it)
References
Last updated