Re: Overflowing Scripts fail to work

From: Bill Weiss (houdini+pen-test@clanspum.net)
Date: Mon Apr 24 2006 - 00:56:26 EDT


Paul Sebastian Ziegler(psz@observed.de)@Sat, Apr 22, 2006 at 10:30:43AM +0200:
> Hallo list!
>
> I've been on this for quite some time and after failing to find out
> anything on the Internet I've finally decided to propose this question
> here. Any help would be greatly appreciated!
>
> Due to interest I have started to try to understand
> buffer-overflow-attacks. The theory is fine with me. But now I'm getting
> quite some trouble when trying to write exploiting scripts.
>
> Let me show you what I mean:
(code and example runs cut)

Using your C code and the same python code:

(%:~/tmp)- ./a.out `python -c "print 'A' * 524"`
AAAAAAA (lots of As cut)
a.out: stack smashing attack in function main()
zsh: abort ./a.out `python -c "print 'A' * 524"`
(%:~/tmp)- python
Python 2.4.2 (#1, Oct 16 2005, 00:06:10)
[GCC 3.3.6 (Gentoo Hardened 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system("./a.out " + ("A" * 524))
AAAAAAA (again, lots of As)
a.out: stack smashing attack in function main()
6
>>>
(%:~/tmp)- python vuln.py
AAAAAAA (As galore)
a.out: stack smashing attack in function main()
(%:~/tmp)

Gentoo with kernel 2.6.12-gentoo-r10, GCC 3.3.6 (Gentoo Hardened 3.3.6,
ssp-3.3.6-1.0, pie-8.7.8), Python 2.4.2 built with this GCC.

The Hardened stuff is why I'm seeing "stack smashing attack", but I can't
imagine why this would be causing a failure where yours isn't (while
running from within python).

Unless the newer kernels added something here (which I doubt), it should
be working for you. We're on almost the same build.

-- 
Bill Weiss
------------------------------------------------------------------------------
This List Sponsored by: Cenzic
Concerned about Web Application Security? 
Why not go with the #1 solution - Cenzic, the only one to win the Analyst's 
Choice Award from eWeek. As attacks through web applications continue to rise, 
you need to proactively protect your applications from hackers. Cenzic has the 
most comprehensive solutions to meet your application security penetration 
testing and vulnerability management needs. You have an option to go with a 
managed service (Cenzic ClickToSecure) or an enterprise software 
(Cenzic Hailstorm). Download FREE whitepaper on how a managed service can 
help you: http://www.cenzic.com/news_events/wpappsec.php 
And, now for a limited time we can do a FREE audit for you to confirm your 
results from other product. Contact us at request@cenzic.com for details.
------------------------------------------------------------------------------


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:55:52 EDT