Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

stack buffer overflow

Name: Anonymous 2012-07-26 13:33

I come to you for help with this assignment I have; smashing the stack. Implement a buffer overflow attack on the program, isThisGood.c, by exploiting the input, see gets(). If exploit successful, it should invoke the function oopsIGotToTheBadFunction!

a. What is the address of the function oopsIGotToTheBadFunction()?
How did you determine this?

b. What is the address on the stack that your input must overwrite
(address and content please)? How did you locate this address?

c. What is the address of buf?

d. What is the minimum length your input, the length you need to alter
the return address stored on the stack.

e. what is your input - show it in hexa characters since some of the
input is not likely to be printable.

#include <stdio.h>
#include <stdlib.h>

int oopsIGotToTheBadFunction(void)
{
printf("Gotcha!\n");
exit(0);
}

int goodFunctionUserInput(void)
{
char buf[12];
gets(buf);
return(1);
}

int main(void)
{
goodFunctionUserInput();
printf("Overflow failed\n");
return(1);
}

Name: Anonymous 2012-07-27 0:51

Right I know that buf will be different each time I compile it, but the printf() was the easiest way for me to find it because I'm not very good at reading the assembly dump. I've never dealt with something like this before and our professor never talked about it and then just tossed us an assignment. That's why I'm having such a difficult time with this.

Also I know about the "set dissassembly-flavor intel", but it doesn't help because it constantly says something about "no symbol table found" whenever i try to do anything. And I'm still getting "no registers" even after I have ran the program, I don't get it.

In case I haven't said it, I really do appreciate the help that you have been giving me.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List