Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Vuln-Dev
[Top] [All Lists]

Re: iDEFENSE Security Advisory 03.28.05: Multiple Telnet Client slc_add_

Subject: Re: iDEFENSE Security Advisory 03.28.05: Multiple Telnet Client slc_add_reply() Buffer Overflow Vulnerability
Date: Tue, 29 Mar 2005 02:35:24 +0200
Hi Solar,

Your interesting tests show that there is a need to provide more
technical details about this overflow, to allow people to accurately
evaluate the risk.

You can find my initial analysis of the bug at this address:
http://www.cppsecurity.com/telnet_slc_overflow.txt


Main ideas:

Actual exploitation depends on what (static) variables are
stored just after the (static) buffer we overflow.

--> Sending an overflow string is usually not enough to make the client
crash or to rule out the possibility of arbitrary code execution,
because the variables we corrupted may be used later only in very
specific execution flows. Real-world exploitation is a _two_ stages
attack.

--> Thus, is your telnet client exploitable? It depends on the source
code AND on the compiler. So, the only way to check it is to debug the
binary, see what variables can be controlled, and try to understand
how these variables can be abused by an attacker (who is able to
drive the telnet client through many different, unusual, execution
paths).

--> I analyzed two Linux telnet clients binaries (MIT telnet and Debian
Woody) and found that it is possible to overflow pointers which allows
us to trigger heap corruption and other bugs later... straight road to
arbitrary code execution. See the URL for details and debug outputs
showing control of EIP.


Hope that helps.

Cheers,
--
Gaël Delalleau


On Tue, 29 Mar 2005 01:35:02 +0400
Solar Designer <solar@openwall.com> wrote:

On Mon, Mar 28, 2005 at 01:09:38PM -0500, iDEFENSE Labs wrote:
Multiple Telnet Client slc_add_reply() Buffer Overflow Vulnerability

FWIW, I've been using the following one-liner to trigger this
overflow:

perl -e 'print "\377", "\372\42\3\377\377\3\3" x 43, "\377\360"' | nc
-l 23

This results in 300 bytes written into the 128-byte buffer.  On Owl
(telnet client derived from OpenBSD 3.0), the effect was that the
escape character ('^]') stopped working.  Other than that, the client
proceeded to work as usual.  Indeed, with the patch this effect is
gone.

I've also tested this against some Red Hat Linux telnet packages
(Linux NetKit) installed on top of Owl, with the same effect.

Gael Delalleau's more elaborate "exploit" (that's been available to
affected vendors via iDEFENSE) has the same effect on our telnet
client, but actually crashes Red Hat's telnet client builds that I've
tested.

-- 
Alexander Peslyak <solar at openwall.com>
GPG key ID: B35D3598  fp: 6429 0D7E F130 C13E C929  6447 73C3 A290
B35D 3598 http://www.openwall.com - bringing security into open
computing environments


<Prev in Thread] Current Thread [Next in Thread>