Vertical escalation
In this recipe, we will look at some examples using which we can gain access to a root account on a comprised box. The key to a successful escalation is to gather as much information as possible about the system.
How to do it...
The first step of rooting any box would be to check whether there are any publically available local root exploits:
- We can use scripts such as Linux Exploit Suggester. It is a script built in Perl where we can specify the kernel version and it will show us the possible publicly-available exploits we can use to gain root privileges. The script can be downloaded from https://github.com/PenturaLabs/Linux_Exploit_Suggester:
git clone https://github.com/PenturaLabs/Linux_Exploit_Suggester.git
- Now we go to the directory using the
cd
command:
cd Linux_Exploit_Suggester/
- It is simple to use, and we can find the kernel version by command:
uname –a
- We can also use the enumeration scripts that we saw in the previous recipe. Once we have the version...