Security Basics mailing list archives

RE: Regarding Aleph's "Smashing the Stack for fun and Profit"


From: <ankush.kapoor () wipro com>
Date: Wed, 5 Oct 2005 09:29:33 +0530


What architecture do you have? I noticed something a couple of years
ago, and had to do some homework to understand the reason why Aleph's
examples don't seem to be working. One major reason is that on newer
machines and distro's (linux), if you do a sizeof(int), you often get 4,
instead of the traditionally assumed 2 (which is also what Aleph
assumed, since this is an ancient tutorial). Try fiddling with the
offsets, keeping this difference in the size of int etc. in mind. Works
fine once you learn that, and looking back, teaches you more than what
one learns if it just works in the first go!

All the best,

Ankush

-----Original Message-----
From: Miguel Dilaj [mailto:Miguel.Dilaj () nccgroup com]
Sent: Tuesday, October 04, 2005 2:11 PM
To: security-basics () securityfocus com
Subject: RE: Regarding Aleph's "Smashing the Stack for fun and Profit"


Hi!

Don't be surprise about assembler code being different, compilers
evolved over time, new internal optimizations and ways to generate
machine code (that you don't control) came on board, etc. Aleph One's
article is old, the older it gets, more different the code will be. I
haven't checked why you got the error (typo?, hardened OS?, improper
compiling?), but I would like to recommend a book that (IMHO) is one of
the best ones on the topic: The Shellcoder's Handbook, by several
authors (ISBN: 0764544683). Cheers,

Miguel


-----Original Message-----
From: ra_in_2003 () yahoo com [mailto:ra_in_2003 () yahoo com]
Sent: 03 October 2005 14:52
To: security-basics () securityfocus com
Subject: Regarding Aleph's "Smashing the Stack for fun and Profit"

Hi,

I was trying out examples given in Aleph One's Smashing the Stack
article. But somehow I am not getting the expected results. I am running
RedHat Linux Kernel 2.4-20 on an Intel Piii. GCC version is 3.2.2.

{snip}

The generated assembly is also different from the one given in the
article:

{snip}

I have tried turning on and off the optimizations right from -O0 to -O3.
Also have tried different offsets.

Shall be grateful if somebody can point out what is the problem and what
am I doing wrong. If there's an updated version of the tutorial,
pointers to it will also be great!

Thanks in Advance,
RA_IN





Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin () wipro com immediately
and destroy all copies of this message and any attachments.


Current thread: