-
Website
http://www.matasano.com/log -
Original page
http://www.matasano.com/log/1069/apple-ships-suids-with-applescript-dictionaries-hilarity-ensues/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Press Controls
3 comments · 2 points
-
ChrisMtso
12 comments · 1 points
-
Eric Monti
11 comments · 1 points
-
StatlerAndWaldorf
12 comments · 3 points
-
Dave G.
7 comments · 1 points
-
-
Popular Threads
I guess when ARD is turned on, ARDAgent acts as smartly as it should be all of the time. Quite why you're able to script it at *all* when ARD's switched off is beyond me.
I used another workaround for the matter tho.
Second, I think there's a difference between "having an AppleScript dictionary" (which means handling some custom AppleScript commands) and just handling system AppleScript commands (like "do shell script"). ARDAgent falls into the latter, as do any "normal" applications without having to do anything special related to AppleScript.
> Who cares if someone busts root on your Mac?
> It’s a single-user system. I let you in on a
> Matasano state secret: if you break the “tqbf”
> account on my laptop, I’m in trouble. If you’re
> malware and just trying to spread, or redirect my
> browser to phishing pages, you’re wasting your
> time with this “root” silliness.
That raises this point then eh?
sh-3.2$ id
uid=4294967294(nobody) gid=4294967294(nobody) groups=4294967294(nobody)
sh-3.2$ osascript -e 'tell app "Finder" to do shell script "whoami"'
emonti
uid=501(jsiren) gid=501(jsiren) groups=501(jsiren), 81(appserveradm), 79(appserverusr), 80(admin)
$ uname -a
Darwin (redacted) 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386
$ osascript -e 'tell app "ARDAgent" to do shell script "whoami"'
23:47: execution error: ARDAgent got an error: Connection is invalid. (-609)
What am I doing wrong, or does this not work in Tiger? (10.4.11)
This single-user system argument is weird. We all use single-user systems, and none of us want keyloggers installed behind our backs.
I put my own bin directory before /usr/bin in my PATH
cat ~/bin/osascript
$ echo "Damn, that was fun"
Now if I wanted I could create an application that asked me if I wanted to run the osascript first, if I click Yes it would then forward that request to the real osascript, wherever that now is.
Or did I miss something entirely?
> and none of us want keyloggers installed behind our backs.
In the simplest case, in order for this vulnerability to work, the malicious program needs to be already running on your machine, which will most likely be under your user account. Which means that it will already have access to ALL your data and can do ALL the damage to your system that it wants, including installing backdoors/keyloggers etc. Having root will not make the situation that much worse.
That is, unless you have many users on your machine, in which case having root access will allow the the trojan to affect other users.
user@host:/tmp$ osascript -e 'tell app "ARDAgent" to do shell script "whoami"'
23:47: execution error: ARDAgent got an error: "whoami" doesn’t understand the do shell script message. (-1708)