

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Delivery: Put your source code (exploit.c) and 1 page document explaining what you did in a zip file and send to our TA Juraj Obert at: [email protected]. Please put your email title as:
CAP6135: project 1 firstname.lastname
Problem: Stack overflow attack
In order to complete this assignment, you need write a program to obtain a shell by exploiting stack overflow vulnerability of a given target application.
This project is modified from the programming project 1 in Dr. Dawn Song’s course “CS161: computer security” in Fall 2008: http://inst.eecs.berkeley.edu/~cs161/fa08/
Target The target (target.c) is a simple application which copies the command-line parameter into its own internal buffer stored on the stack. The source code is provided for your reference. Of course you can build your own target while working on the assignment, but the submitted code MUST use the prebuilt version.
Exploit The exploit is the application (exploit.c) which calls the target (executable program) and passes in an artfully crafted character buffer which causes the target to give you a shell.
The compressed file: “assignment1.tgz” contains two directory: exploits and target. You will need to generate the executable “target” first. Then you will need to modify “exploit.c” to add your overflow code. Noted that you will need to modify: #define TARGET "/home/jobert/cap6135/1/proj1-fa08/targets/target" to use your own “target” directory.
You can download the compressed file “assignment1.tgz” from webcourse@UCF at the first assignment place.
The following are the suggested steps to complete this assignment:
Important notes: Olympus.eecs.ucf.edu (the server you’ll be working on) employs a technique called “Stack address randomization”, which randomizes the beginning of the stack for each new process. Therefore your SP register will always be different when you start a new process. This behavior is not desirable for this assignment, because we want the SP to be the same every time we execute the exploit/target (see the aforementioned tutorial for why this is so important).
The way around this is by using the wrapper setarch in the following way: jobert@olympus:~/cap6135/1/proj1-fa08/exploits$ setarch i686 -R ./exploit The –R parameter disables stack address randomization and creates a new process by executing ./exploit.
Grading: [+10%] if your program compiles and runs [+10%] if your program can successfully overflow the buffer [+10%] for correctly showing how you use gdb to obtain the stack information. [+10%] for correct drawing of the stack (in the document) with the addresses. [+60%] if execution of target gives the user a shell
[-20%] if you submitted your project late (no late submission will be accepted after Feb. 19 th).