IFRANCISCO ARDAgent does not need to be running, osascript calls the ARDAgent executable, which has root:wheel and S_ISUID, and tells it to execute a command of some sort.
The ARDAgent applescript dictionaries contain the "do shell script" command, and quite simply put, if you take a mac out of the box, and use osascript to tell ARDAgent to run a shell script, it *will* run a shell script with root privelages. If you tell ARDAgent to run whoami and it returns "root", then you are *not* safe, but if you get an error, it means your ARDAgent has been restricted to the default applescript dictionaries via the NSAppleScriptEnabled flag, and you are safe. This could be due to 1 of 2 reasons, either Remote Management is enabled, or you have the NSAppleScriptEnabled flag set to YES in ARDAgent.app's Info.plist. Either way, good for you, but millions of Macs out there *do* return "root", and thats enough to prove that they are vulnerable to a local attack vector.
If you would like to discuss this further with me please email me at yousef AT ifrancis DOT net
Youssef Francis
(Version 1.0)