The OpenNET Project / Index page
BSD, Linux, Cisco, Web, Palm, other unix
RUSSIAN version

Search
Хинт: Для быстрого перемещения к разделам можно обращаться как: news.opennet.ru, forum.opennet.ru, man.opennet.ru, docs.opennet.ru и т.д.
SOFT - Unix Software catalog
LINKS - Unix resources
TOPIC - Articles from usenet
DOCUMENTATION - Unix guides
News | Tips | MAN | Forum | BUGs | LastSoft | Keywords | BOOKS (selected) | Linux HowTo | FAQ Archive

w00w00's efnet ircd advisory (exploit included)


<< Previous INDEX Search src Set bookmark Go to bookmark Next >>
Date: Fri, 13 Aug 1999 11:01:58 +0400
From: Shok <shok@CANNABIS.DATAFORCE.NET>
To: BUGTRAQ@SECURITYFOCUS.COM
Subject: w00w00's efnet ircd advisory (exploit included)

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--717427360-938467936-934527718=:12840
Content-Type: TEXT/PLAIN; charset=US-ASCII

[http://www.w00w00.org, comments to shok@dataforce.net]

SUMMARY
efnet ircd hybrid-6 (up to beta 58) have a vulnerability that can allow
remote access to the irc server.  In most cases, you'll gain privileges of
the 'irc' user.

COMMENTS
This vulnerability was discovered by jduck and stranjer of w00w00 at
least 2 months ago.  After discussing the vulnerability, it was reported
to Dianora by jduck and fixed.  Hopefully the vulnerable irc servers have
been fixed.  If not, it's unfortunate Dianora didn't notify the vulnerable
irc servers or they didn't take these 2 months to fix themselves (note:
we didn't wait that long on purpose.. we were just sidetracked with a
million other things).

DESCRIPTION
The vulnerability is in the invite handling code (m_invite).  In a
channels with operators (ops) and modes +pi (paranoid + invite-only), a
channel invitation is reported to all other operators.  The buffer used to
store the invitation notice can overflow its boundaries by up to 15
bytes.

Steps:
1. Client 1 (9chars!10chars@trivial) joins #199chars
2. Client 2 (trivial!trivial@trivial) joins #199chars
3. Client 1 sets mode #199chars +pio Client 2
4. Client 1 invites Client 3 (9chars!10chars@63chars) to #199chars

Note: client 1 and client 3 should _not_ be from the same host.  With our
exploit, client 3 (compile/run hostname.c) first, then compile/run
ircdexp.c.

Client #1's server = vulnerable irc server (such as irc.arpa.com)
Client #2's server = trivial
Client #3's server = ComStud irc server (such as irc.prison.net), because
                     it allows shellcode chars in hostname

Using the following spoofed host (59 chars):
shellcodeshellcodeshellcodeshellcodeshellcodeshellcode.AAAA
[The ComStud ircd will check for a '.']

Here, EIP = 0x41414141 (AAAA).  The other registers are negligable.
The hostlen is actually 63 bytes, but for this specific overflow, EIP is
overwritten at buf[54-58].

We have to take stdout/stdin descriptors into consideration.  We are very
limited in size (only have 54 bytes for shellcode), so we can't fit bind
shellcode.  Instead, we took the standard Linux x86 shellcode, dropped
exit handling code, added a close'd stdin, dup'd cptr->fd (cptr is the
first argument passed to m_invite).  Since we only have 54 bytes to work
with, we can't fit code in to close stdout and dup cptr->fd, so output
will be sent to whatever terminald ircd was started from.  If you do not
wish for the output to be seen, redirect everything (via '>') /dev/null.

As for how to go about spoofing, you have options:
1) Use the old DNS poison caching method
2) Use custom "fake binds" that will just pass on your shellcode as a
   hostname in response to a DNS query (idea from nyt).

Option #2 is the approach we will take (hostname.c generates the shellcode
we'll use). This will work fine as long as you IP/hostname hasn't already
been cached.  Because these "fake binds" are pretty popular (or have been
in the past), they should be easy to come by and are outside the scope of
this advisory.

So full steps are, client with the spoofed hostname, connect to a ComStud
ircd server (such as irc.prison.net), another client join the arbitrary
client, and another client join the target ircd hybrid-6 server (such as
irc.arpa.com).  Once the channel is +pi (and your channel, ident,
username, etc. all the right length), invite the client with the spoofed
hostname.  Fine-tune until you have root.

Thanks to: stranjer and jduck for their input and discovery of this
vulnerability.

People that deserve hellos: Mike (mike@eEye.com), vacuum
(vacuum@technotronic.com), awr (andrewr@rot26.net), dmess0r
(dmessor@el8.org).

-- Matt Conover (Shok) & w00w00 Security Team


--717427360-938467936-934527718=:12840
Content-Type: APPLICATION/octet-stream; name="ircdexp.tgz"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.95.990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VKemzqM7l5rJs
ZygkPEV1Ud6xTOTZqkMuFgji6RnbIgJPFfeDsr6vzT2q/eVeuHKqXsHEwTSL
D3Bj4MPIGWdePMtYH0vjnh5TPBJQvD39+YjSv01/wiuBhcrlmyJCK25jCC4O
QEJ+B06SsPFEHMPTTSR9ykGl/DyKlZfRCAUKYL7mL69/0nlJdpiAAoFCdKL0
YV9/qfB3SXHuE6Nc1XEpWV8S5UIhzG2bViV8gGz3FxJmJBN1ydWByHHpEANz
iMTnoQ528xjmQCpH5bDyhEPk+uL8SdxNxZ6xqaIYoSp95++zWZg8ziKyhbwG
yRQDWFC2Ic79+F3oDNm2GznxSBoad900Ai+NRClU3BARx1wqtPzaxvKE+ODx
yODLZk0oy3gkLjqPnFtxGXYyYZ6UKUaaPFSOV9xxhv5MrGUpx4r9feXraNXz
/29x/6uz08vuf3VaXXH/q91dnf9/jXZWuJWV6CPa0qUsBg9eykKfhiHM8xpd
8Fp0v0sioqNdjYH+10Cil4quyrb06quh12wVwhT0nFTO6TPhUeXxtiVYk0f+
6sWIlf8DS00diEhiwqMlxKFyyATfjjxFFAw674D17NRwHZdnzWMDJw0Sk6il
sS5Ua2qrO2mrtmqrtmqrtmqrtmqrtmqrtmqrtmqrtmqrtmqrtmqr9n/e/gtH
Y4tgAFAAAA==
--717427360-938467936-934527718=:12840--

<< Previous INDEX Search src Set bookmark Go to bookmark Next >>
Закладки
Добавить в закладки
Created 1996-2003 by Maxim Chirkov  
ДобавитьРекламаВебмастеруЦУПГИД  
SpyLOG TopList