UNOFFICIAL FULL DISLOSUREARDAgent.app ExploitAFFECTED: Mac OS X 10.4 - 10.5
Risk: CriticalUSAGE: EasyHistory: Discovered at
http://www.macshadows.com/forums/index.php...8640&st=430 by members callmenames, Wawl, Oktane and andrewtheshit. First implemented in AppleScript but can be ported into Bash (Bourne Again Shell). Used in proof of concept type trojans throughout the thread. Poses high risk for ease of use and lack of experience required. Allows the attacker to run any code, malicious or otherwise. This vulnerability also affects all operating systems released 10.4 and above, because this application is included default.
Usage:Original Script (AppleScript):
CODE
tell application "ARDAgent.app" to do shell script "id"
Bash Script (Bourne Again Shell):
CODE
osascript -e 'tell application "ARDAgent" to do shell script "id"'
This will give an output of uid 0 or root, the superuser of Unix based computers when run by an administrator. The reason for this vulnerability is that the application ARDAgent.app (located: /Systems/Library/CoreServices/ARDAgent.app) runs as root. An over look or mistake by the programmers and maintainers of Mac OS X. Note that this exploit can only be achieved if the effected user is an administrator.
Solutions: Temporary solutions for the mainstream Mac OS X owner until a patch is released by Apple in a future Software Update. Is to change the permissions of the application ARDAgent.app. This is an easy fix and should be distributed immediately as the trojans specified above have been released into the public.
1. Open Terminal (Menu Bar -> Go -> Utilities -> Terminal.app)
2. Enter:
CODE
cd /Systems/Library/CoreServices
3. Enter:
CODE
sudo chmod u-s ARDAgent
4. You will be prompted to enter your password, do so.
5. Check to make sure that this is working by running the exploit again.
Enter:
CODE
osascript -e 'tell application "ARDAgent" to do shell script "id"'
You should see your username displayed as the uid.
com.apple.SystemLoginItems.plist ExploitAFFECTED: Mac OS X 10.3 - 10.5
Risk: MediumUSAGE: MediumHistory: Made public at
http://www.macshadows.com/forums/index.php...8640&st=430 by members callmenames, Lokin, Oktane and andrewtheshit. First implemented in AppleScript but can be ported into Bash (Bourne Again Shell) and other programming languages. Used in proof of concept type trojans throughout the thread. Poses medium risk for medium ease of use and number of computers affected. Allows the attacker to run any code, malicious or otherwise. This exploit has evidently existed for quite some time now (the better half of a decade).
Usage: The file is located in /Library/Preferences/com.apple.SystemLoginItems.plist
Example:
CODE
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AutoLaunchedApplicationDictionary</key>
<array>
<dict>
<key>Hide</key>
<true/>
<key>Path</key>
<string>/Library/Caches/.trojan.app</string>
</dict>
</array>
</dict>
</plist>
The file can be overwritten, edited or replaced. The fault lies in the permissions set upon this file. Allowing anyone to edit the SystemLoginItems.plist. Upon restart the application is then run as a start up item under root or uid 0 the superuser of Unix based computers. A payload for this exploit could be easily created as a compiled AppleScript application (or bundle) which already exists in the wild. The reason for the medium risk also involves the easy detection of the exploit by knowledgeable users. A trojan can hide itself and replace the plist file after use but the user must not detect the attack before restarting the computer. However the trojan might actually restart the computer on its own posing a larger risk but higher rate of detection.
b]Solutions:[/b] Temporary solutions for the mainstream Mac OS X owner until a patch is released by Apple in a future Software Update. Is to change the permissions of the plist file /Library/Preferences/com.apple.SystemLoginItems.plist. This is an easy fix and should be distributed immediately as the trojans specified above have been released into the public.
1. Open Terminal (Menu Bar -> Go -> Utilities -> Terminal.app)
2. Enter:
CODE
cd /Library/Preferences
3. Enter:
CODE
sudo chmod u-s com.apple.SystemLoginItems.plist
4. You will be prompted to enter your password, do so.