Local Linux system check for privilege escalation
In this recipe, we will use a Python script to check the system for vulnerabilities that could lead to privilege escalation.
Getting ready
Let's ensure the following prerequisites:
- Your Metasploitable machine is connected to the NAT network (remove it immediately after this lab)
- Your Metasploitable machine is powered up
How to do it...
In this recipe we will try and discover a vulnerability that will allow us to escalate privileges in linux:
- Log in to the Metasploitable machine with the username
msfadmin
and passwordmsfadmin
.
- From the terminal prompt of the Metasploitable machine, run the following commands:
cd <enter> wget http://www.securitysift.com/download/linuxprivchecker.py <enter> python ./linuxprivchecker.py >> vulns.txt <enter> tail --lines=50 vulns.txt |more <enter>
- You can now scroll through a list of vulnerabilities that can be used against this machine to provide privilege escalation:

Metasploitable console...