Exploiten für Doofe: dsidentity in MacOS 10.4.x bis 10.4.2
Im vorangegangen Posting über MacOS X war von dsidentity die Rede. Auf Astros Anregung hin will ich mal kurz erläutern, warum dieser Exploit allerorten so viel Heiterkeit ausgelöst hat. Aus der Manpage:
dsidentity is a setuid tool that allows addition or removal of identity user accounts in Directory Services. The dsidentity tool creates a partial but valid system identity in the local Directory System. This identity is created with the intent to support remote sharing capabilities. Version 1.00 supports local shadowhash passwords as regular local user records.
Der exploitbare Teil des Codes dazu sieht so aus:
char *envStr = nil;
envStr = getenv("USER");
//check for member of admin group
if ( (envStr != nil) && UserIsMemberOfGroup( inDSRef, inDSNodeRef, envStr, "admin" ) )
{
return true;
}
Gucken wir doch mal, was die Umgebungsvariable USER zurückgibt — so mancher wird sich jetzt schon den Bauch halten:
neutron:~ % export USER=rootoderhansoderso neutron:~ % env|grep USER
USER=rootoderhansoderso
Interessantes Konzept jedenfalls …
Ach ja, es gibt noch eine andere lesenswerte Beschreibung dazu.