WUSTL CSE 361S - Lab Assignment #4 (7 pages)

Previewing pages 1, 2 of 7 page document View the full content.
View Full Document

Lab Assignment #4



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

Lab Assignment #4

42 views

Other


Pages:
7
School:
Washington University in St. Louis
Course:
Cse 361s - Introduction to Systems Software
Introduction to Systems Software Documents

Unformatted text preview:

CSE 361S Intro to Systems Software Lab Assignment 4 Due Thursday October 23 2008 In this lab you will mount a buffer overflow attack on your own program As stated in class we do not condone using this or any other form of attack to gain unauthorized access to a system Rather by doing this exercise I hope you will learn a lot about how to defend against such attacks You may work in a group of up to two people in solving the problems in this lab Download the file bufbomb c from the class web site and compile it to create an executable program In bufbomb c you will find the following functions int getbuf char buf 16 getxs buf return 1 void test int val printf Type Hex String val getbuf printf getbuf returned 0x x n val The function getxs also in bufbomb c is similar to the library gets except that it reads characters encoded as pairs of hex digits For example to give it a string 0123 the user would type in the string 30 31 32 33 The function ignores blank characters Recall that decimal digit x has ASCII representation 0x3x A typical execution of the program is as follows prompt bufbomb Type Hex String 30 31 32 33 getbuf returned 0x1 Looking at the code for the getbuf function it seems quite apparent that it will return value 1 whenever it is called It appears as if the call to getxs has no effect Your task is to make getbuf return 0xdeadbeef to test simply by typing an appropriate hexadecimal string to the prompt 1 You will get there in several stages Stage 1 If the string typed by the user to getbuf is no more than 15 characters long it is clear that getbuf will return 1 Typically an error occurs if we type a longer string prompt bufbomb Type Hex String 30 31 32 33 30 31 32 33 30 31 32 33 30 31 Ouch You caused a segmentation fault Better luck next time As the error indicates overrunning the buffer typically causes the program state to be corrupted leading to a memory access error Your task is to be more clever with the strings you feed bufbomb so that it does more



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Lab Assignment #4 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab Assignment #4 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?