Project Report
Project Report
Department of Computing
Prepared by
(Group 5)
Muhammed BAYKAL 41035127
Guillermo Alfonso Moreno Quijano 41729935
Table of contents
1. Introduction
2. Global Objectives
3. Global Objectives Summary
4. Attack Diagrams
4.1. Attack Flow Diagram (No Firewall Protects the Victim)
4.2. Attack Flow Diagram (Firewall Protects the Victim)
5. Procedure
5.1. Port Scanning to Determine Services Running on Target Machine
5.2. Running Fuzz Application against Ability FTP Server
5.3. Creating Pattern to Determine Exact Memory Crash Locations
5.4. Sending the Pattern to the FTP Server to Determine Where EIP
and ESP are overridden
5.5. Finding the Return Address
5.6. Generating the shell code
A- Bind TCP inline
B- Creating Reverse TCP Inline
6. Appendix
6.1. Fuzzer Code - to find at what point application throws buffer
overflow error.
6.2. Pattern Code to Determine EIP, ESP and EBP Pointers
6.3. ‘Bind TCP Inline’ Shell Code
6.4.’ Reverse TCP’ Shell Code
1. Introduction
The objective of the analysis was to simulate an attack to assess the buffer overflow
vulnerability of the Ability FTP server 2.34. This report contains all the steps which led to
gain control over the target machine.
2. Global Objectives
1. Use two machines to simulate one as the victim and another one as the attacker. Both
machines were virtual machines on VMware. The victim machine ran XP windows
operating system and Ability FTP server was installed on it. In addition, the attacker
machine ran Backtrack operating system.
2. Use the command STORE to assess the buffer overflow vulnerability of the Ability
FTP server. This goal is assessed without any firewall protecting the victim.
3. Use the reverse shell to gain control over our victim machine. This goal is assessed
with a firewall protecting the victim.
2.1 Achieved
2.2 Achieved
2.3 Achieved
4. Attack Diagrams
5. Procedure
Assuming that we do not know anything about victim PC so following steps need to be
completed in order to gain enough knowledge of the target environment.
The following screenshot shows the result of fuzz code execution with buffer size of 1000
characters on the victim machine.
From the picture above, it is detected that the Ability FTP server crashes with a buffer size of
between 900 and 1000 characters .
Now we need to replace our fuzz code and instead of sending incremental buffer we send the
pattern to the server at once with concatenating STOR command.
Please refer to Appendix 6.2 to see detail of the modified fuzz code. We have got the
following screenshot after execution of the modified fuzz code.
We can use pattern offset tool to determine length of buffer which ESP and EIP are
overridden.
Finally, it is known that EIP breaks at 965 and ESP breaks at 985. We need to build a buffer
as following structure;
Since we are using ESP break point we need to find memory address of Jump ESP command
from system modules in this assignment we have used SHELL32.dll.
Please refer to the following screenshot to see how we found address of the JMP command.
Return_Address=”\xf3\x30\x9d\x7c”
As it was mention before we want to create 2 shell code s to exploit the ftp server. The bind
TCP inline code will allow the attacker to take control over the victim without any firewall
protecting the victim. The reverse shell code will allow the attacker to take control over the
victim with a firewall protecting the victim
Using Metasploit we can generate the bind shell code. Please refer to the following screenshot
to see how to generate the shell code.
After execution of the bind shell code we connect to the victim machine through netcat. The
following screen was captured after getting access to the machine.
nc –nvvlp 80
To generate reverse TCP inline shell code we need to use msfweb application of Metasploit
framework please refer to the following screenshot to see details of the shell generation
process.
Please see the screenshot below to see the connection from the victim to the attacker using
port 80 in the attacker machine.