Penetration Testing mailing list archives
Controling the eip
From: wymerzp () sbu edu
Date: 15 May 2007 00:04:13 -0000
I am trying to learn about computer security. I picked up the book Shellcoder's Handbook (ISBN: 0-7645-4468-3)
I understand the concepts in the beginning but I keep on getting a funny result. Basically I wrote a program that had a
buffer overflow in it:
I run it and enter A's into the program (it recieves user input)-->hit enter and get a segmentation fault/core
dump-perfect. When I inspect the stack with gdb it over-writes the eip with 0x41414141.
I then look at the buffer size of the function as well as the address of said function (the purpose being to overflow
the buffer, control eip to make the function iterate again) and the buffer size is 0x24 (36) and the address is
0x08048405.
I then write a program to translate the hex into ASCII cleanly to insert into the buffer:
#include <stdio.h>
main()
{
int i=0;
char stuffing[44];
for (i=0; i<=44; i+=4)
{
*(long *) &stuffing[i] = 0x08048405;
puts(stuffing);
}
}
I then run the program and input the address as ASCII into the buffer as follows:
bash# (./addresstochar;cat) | ./overflow
which doesn't make the program iterate twice and doesn't change eip on inspection of the stack. What am I doing wrong
here? I tried to be as thorough as possible; please forgive my verbosity. Thanks, Zach
------------------------------------------------------------------------
This List Sponsored by: Cenzic
Are you using SPI, Watchfire or WhiteHat?
Consider getting clear vision with Cenzic
See HOW Now with our 20/20 program!
http://www.cenzic.com/c/2020
------------------------------------------------------------------------
Current thread:
- Controling the eip wymerzp (May 15)
- Re: Controling the eip Carl Livitt (May 15)
- <Possible follow-ups>
- Re: Re: Controling the eip wymerzp (May 15)
- Sneaking a peek on Wlan in airports jasper . o . waale (May 16)
- 答复: Sneaking a peek on Wlan in airports Cony.Zhou (May 16)
- RE: Sneaking a peek on Wlan in airports Ricardo Landrau (May 16)
- RE: Sneaking a peek on Wlan in airports Shenk, Jerry A (May 16)
- Re: Sneaking a peek on Wlan in airports Jason Chambers (May 17)
- Re: Sneaking a peek on Wlan in airports crazy frog crazy frog (May 17)
- Re: Sneaking a peek on Wlan in airports Morning Wood (May 17)
- Sneaking a peek on Wlan in airports jasper . o . waale (May 16)
- Re: Sneaking a peek on Wlan in airports Colin Copley (May 16)
