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-26 23:49

To be honest I understand what you are saying. I know what I have to do, it's just how to find the information in the dump and using gdb is what I'm having trouble with. I am taking a software security class online and my instructor gave us some information on memory allocations and then dumped this assignment on us and made it due in a relatively short time. He had never once explained anything about how to read the dump or use gdb so that is why I am having trouble. I need to finish this assignment because I am hoping to graduate next saturday and this is the last class I am taking haha.

I realized I was goofing whenever it says "no registers" because I was trying to view the registers before I even ran the program to fill the buf.

Name: Anonymous 2012-07-26 23:55

Okay so I put printf("buf variable is located at 0x%p\n", buf); line in and it prints out "buf variable is located at 0x0xbf89c2ec". If that is correct then I now know the location of the buf buffer

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