MINISTRY OF EDUCATION
IMAM ABDULRAHMAN BIN
FAISAL UNIVERSITY
COLLEGE OF COMPUTER SCIENCE
& INFORMATION TECHNOLOGY
وزارة التعليم
جامعة اإلمام
عبدالرحمن بن فيصل
كلية علوم الحاسب
وتقنيةالمعلومات
Lab [3]: Exploiting Metasploitable2
Objectives:
• Understand the various vulnerabilities in Metasploitable2.
• Understand how to exploit Telnet and SMTP ports.
Tools/Software:
-
Virtual Box
Kali Linux
Tool: Metasploit
Metasploitable2
Wireshark
Description:
In this lab, we would exploit the Metasploitable2 machine through two
distinct ports which are port 23 and 25. Telnet is a text-based network protocol
that is used for remote access to computers over TCP/IP networks. This means
that Telnet is an unencrypted protocol where it sends sensitive data in clear
text. On other hand, SMTP is part of the application layer of the TCP / IP
protocol and is used to send and route messages to the specified receiver. This
protocol defects weak security and control properties, which leads to many
attacks to obtain usernames and email penetration. Smtp-User-Enum is one
of the Kali tools and we will use it in this lab to verify which SMTP usernames
exist in the victim machine.
MINISTRY OF EDUCATION
IMAM ABDULRAHMAN BIN
FAISAL UNIVERSITY
COLLEGE OF COMPUTER SCIENCE
& INFORMATION TECHNOLOGY
وزارة التعليم
جامعة اإلمام
عبدالرحمن بن فيصل
كلية علوم الحاسب
وتقنيةالمعلومات
Steps to exploit port 23 (Telnet) of Metasploitable2:
1- Make sure you turn on the Metaspolitable2 machine and know the IP address
of the machine.
2- To capture credential information ensure that your Wireshark is capturing
traffics.
3- Open your terminal on Kali and type the following command to connect to the
Metaspolitable2 through port 23 (Telnet).
Command: telnet [IP address of Metaspolitable2]
Figure 1: Connect to the Metaspolitable2 through port 23.
4- You can easily login to Metaspolitable2 machine as credential are easily
obtainable as seen in the figure 1.
MINISTRY OF EDUCATION
IMAM ABDULRAHMAN BIN
FAISAL UNIVERSITY
COLLEGE OF COMPUTER SCIENCE
& INFORMATION TECHNOLOGY
وزارة التعليم
جامعة اإلمام
عبدالرحمن بن فيصل
كلية علوم الحاسب
وتقنيةالمعلومات
5- Stop your Wireshark capture and filter your result using this filter to see
capture credentials.
Use one of these filters:
I. tcp.stream
II. telnet
Figure 2: TCP stream.
Steps to exploit port 25 (SMTP) of Metasploitable2:
MINISTRY OF EDUCATION
IMAM ABDULRAHMAN BIN
FAISAL UNIVERSITY
COLLEGE OF COMPUTER SCIENCE
& INFORMATION TECHNOLOGY
وزارة التعليم
جامعة اإلمام
عبدالرحمن بن فيصل
كلية علوم الحاسب
وتقنيةالمعلومات
In the previous labs, you learned how to use Metasploit tool. In this lab, we would
use Metasploit to perform our attack on port 25.
1- Open your Metasploit tool on Kali and search for smtp_enum.
Command: search smtp_enum
2- Access the enumeration exploit.
Command: use 0 or use [the file path]
Figure 3: enumeration exploit.
3- Set the target host and haunch the exploit.
Command: RHOST [IP address]
Command: run or exploit
best practuce is ti use commannd show
Figure 4: Rehost the target.
4- This exploit allows you to verify SMTP usernames in the target machine.
Figure 5: Verify usernames.
Tasks:
MINISTRY OF EDUCATION
IMAM ABDULRAHMAN BIN
FAISAL UNIVERSITY
COLLEGE OF COMPUTER SCIENCE
& INFORMATION TECHNOLOGY
وزارة التعليم
جامعة اإلمام
عبدالرحمن بن فيصل
كلية علوم الحاسب
وتقنيةالمعلومات
Task #1:
• Provide screen shots for performing the lab exploits.
• Write one paragraph about port 22 (SSH service) and how it can be exploited.
• Perform an exploit on port 22 for the Metasploitable2 machine (You can use
any tool and any exploit of your choice).
Task #2:
• Can you perform a reverse connection on the Metasploitable2? If so, briefly
explain what reverse connection and the tools used to perform it.
Deliverables:
Submit a report of performing the assigned tasks.