0% found this document useful (0 votes)
34 views

Lab Manual - Metasploitable - V1.0

Uploaded by

Kamalesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Lab Manual - Metasploitable - V1.0

Uploaded by

Kamalesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Lab Manual

Metasploitable 2

Prerequisite: Metasploitable 2 (Target machine), Kali Linux (Attacker machine)

Steps to follow:

Step 1. Let us start with finding the IP address of our gateway. In order to do that, type route into the
terminal and press Enter as shown in the image below.

As you can see in the image above, here the gateway IP is 192.168.23.2.

Step 2. Now, to find out the IP address of the metasploitable2, we shall use netdiscover tool. Type
netdiscover -r Gateway IP, as shown in the image below, and press Enter.

Step 3. As can be seen in the image below, netdiscover has found 4 IP addresses in the network.

1|Page
Copyright ©Skill Cube Pvt. Ltd. All rights reserved
Step 4. Now, we need to find out which IP belongs to our target machine (metasploitable2). This can
be done by either giving the range in nmap or IP addresses can be manually provided. Here, we
have given all the IP addresses manually. Type nmap -sV 192.168.23.1,2,138,254 in the terminal
and press Enter. Here, -sV indicates service scan.
Step 5. Now, you will be able to see the nmap output, as shown in the images. Here, IP address
192.168.23.138 has most number of services running and in Hosts field, nmap shows that this IP
address is metasploitable.

So, IP address 192.168.23.138 is out target, and we shall exploit service UnrealIRCd.

Step 6. To exploit the service, we shall start postgresql service (optional) and then start Metasploit
framework. Type service postgresql start and press Enter. After that, type msfconsole and press
Enter.

2|Page
Copyright ©Skill Cube Pvt. Ltd. All rights reserved
Step 7. Now, in Metasploit terminal, type search UnrealIRCd and press Enter, to search for
UnrealIRCd exploit.

Step 8. Copy that exploit and type use exploit_name, as shown in the image below and press Enter.

Step 9. Now, type options and press Enter to figure out what kind of information this exploit needs
in order to execute.

Here, in the above image, it can be seen that we only have to give the RHOSTS information. RHOSTS
means the IP address of the target machine. Therefore, we need to give IP address of metasploitable
2.

Step 10. To set the RHOSTS, type set RHOSTS target IP and press Enter, as shown in the image below.

Step 11. Now, type run and press Enter.

3|Page
Copyright ©Skill Cube Pvt. Ltd. All rights reserved
Step 12. Following above step, the exploit will execute, and a command shell will open.

Step 13. If the session opens, it means we have successfully exploited metasploitable 2. Now, we can
run any command in the shell like ‘ls’, ‘whoami’ and it will be executed inside the metasploitable
2, as shown in the image below.

Note: There are other services inside the metasploitable 2 which can be exploited and get the reverse
connection.

4|Page
Copyright ©Skill Cube Pvt. Ltd. All rights reserved

You might also like