Remote Linux privilege escalation
In this recipe, we will use Metasploit against the Metasploitable VM to raise the privileges of the user.
Getting ready
Let's ensure the following prerequisites:
- Your Kali VM is up and running
- Your Metasploitable VM is up and running and on the host-only network
How to do it...
In this recipe we will remotely elevate privilege on a Linux device:
- First, let's log in to the Metasploitable VM and add a standard user.
Note
Metasploitable's default username is msfadmin
and password msfadmin
.
- From the console, enter the following commands to add a user and validate the IP address of the Metasploitable host:
cd <enter> ifconfig <enter> sudo useradd -m user7 <enter> msfadmin <enter>ex sudo passwd user7 <enter> password <enter> password <enter> exit <enter>

Metasploitable console
- From Kali, let's start Armitage.
Note
Refer to Chapter 4, Finding Exploits in the Target, for information on starting Armitage.
- From Armitage, add the...