1 00:00:01,200 --> 00:00:07,740 By changing where you'd want to put in grep-i anonymous, you'd do grep-i failed or refused. 2 00:00:07,860 --> 00:00:11,160 You could pick up any failed or refused login attempts to the FTP server. 3 00:00:11,780 --> 00:00:14,540 So basically you can just filter your logs like that. 4 00:00:15,120 --> 00:00:17,960 It's a little bit easier for some people who might be new to the OS X environment 5 00:00:17,960 --> 00:00:24,900 and who aren't used to using Linux or Unix environment in terms of checking their logs and everything. 6 00:00:26,040 --> 00:00:32,200 Basically, you could also modify the script further to perhaps beep or send out an email alert 7 00:00:32,200 --> 00:00:36,040 if you have multiple login failures, stuff like that, just for basic system maintenance. 8 00:00:37,080 --> 00:00:45,200 As far as AppleScript goes for an attack tool, it can be used, definitely used for attack means on a Macintosh system. 9 00:00:45,500 --> 00:00:46,120 Excuse me. 10 00:00:50,440 --> 00:00:54,180 Basically, over the past few years, there have been a couple AppleScript trojans or viruses 11 00:00:54,180 --> 00:00:54,880 that have been used to attack your OS X environment. 12 00:00:54,900 --> 00:00:56,640 But they mainly only do one of two things. 13 00:00:56,900 --> 00:01:01,440 They either take a look at the system and just mess around with files, you know, delete stuff, 14 00:01:01,640 --> 00:01:03,640 or else they exploit a scriptable application, 15 00:01:04,280 --> 00:01:09,980 where a scriptable application would be any application on the system that accepts Apple events 16 00:01:09,980 --> 00:01:12,120 and thus AppleScripts. 17 00:01:12,900 --> 00:01:16,640 Basically, in terms of some different attack methods that could be used, 18 00:01:16,860 --> 00:01:22,380 the Mac.Simpsons AppleScript worm that was released about a year ago, I believe, 19 00:01:23,120 --> 00:01:24,760 basically duped gullible users. 20 00:01:24,900 --> 00:01:28,920 into downloading and executing the AppleScript, which was included as an email attachment. 21 00:01:29,380 --> 00:01:36,640 Once it had done that, it popped open a Simpsons webpage and went from there to open up Outlook 22 00:01:36,640 --> 00:01:42,280 and send itself out to everybody in the address book, just like any typical Microsoft worm does these days. 23 00:01:42,380 --> 00:01:48,020 So that was exploiting Outlook's scriptability in terms of the Macintosh there with the AppleScript. 24 00:01:48,740 --> 00:01:54,740 In this case, pardon me, another similar case there was Eudora had a similar exploit, 25 00:01:54,900 --> 00:02:03,440 a few years ago, where basically it accepted AppleScripts and then could be used to send an email out without the user knowing, of course. 26 00:02:03,980 --> 00:02:11,100 Luckily, there was no malicious payload included in either of those basically worms that I just described there, 27 00:02:11,200 --> 00:02:16,300 but it would have been very easy for them to modify the AppleScript a bit to, say, delete documents or something like that 28 00:02:16,300 --> 00:02:17,440 while the AppleScript was running. 29 00:02:17,800 --> 00:02:22,740 In OS X, especially with the Unix commands, that can be particularly destructive, 30 00:02:23,040 --> 00:02:24,620 and I will demonstrate that. 31 00:02:24,900 --> 00:02:33,420 Right now, basically I'm going to open up my system here real quick and open up documents. 32 00:02:34,400 --> 00:02:35,120 Let's see here. 33 00:02:35,260 --> 00:02:36,840 Okay, we have some basic stuff in here. 34 00:02:36,960 --> 00:02:39,640 We'll duplicate this copy of my speech here. 35 00:02:40,400 --> 00:02:42,120 Save the real one since I don't want to lose it. 36 00:02:42,560 --> 00:02:45,200 And we'll duplicate this iTunes folder right here. 37 00:02:46,440 --> 00:02:48,880 So basically we have some stuff sitting in my documents folder right now. 38 00:02:49,020 --> 00:02:53,360 If we go ahead and run an AppleScript, again using shell commands, 39 00:02:54,420 --> 00:02:54,840 basically... 40 00:02:54,900 --> 00:02:56,780 we're going to clear everything out in there. 41 00:02:56,920 --> 00:03:06,160 So, rm-rf, and then tlday slash documents, which will remove everything in my documents folder. 42 00:03:10,740 --> 00:03:14,760 And if you take a look then, there is no documents folder, period. 43 00:03:15,280 --> 00:03:18,820 That could be especially destructive if somebody went ahead and made another scriptable worm 44 00:03:18,820 --> 00:03:22,160 that exploited even mail or something like that in the OS X environment. 45 00:03:22,420 --> 00:03:24,660 It could easily be put to use in terms of destroying. 46 00:03:24,900 --> 00:03:30,580 Files on the computer are even worse, downloading the various password files, anything like that. 47 00:03:31,520 --> 00:03:36,260 As far as going ahead and exploiting a scriptable application goes, it's very easy to do. 48 00:03:36,920 --> 00:03:41,500 It's as easy as going up to file when you're inside the script editor. 49 00:03:42,020 --> 00:03:44,960 And you go to open dictionary, just like this. 50 00:03:46,420 --> 00:03:50,980 And as soon as my G3 here catches up, maybe. 51 00:03:51,780 --> 00:03:54,600 Anyway, it will bring up a list of dictionaries. 52 00:03:54,900 --> 00:03:58,640 And these are all the applications on your system that could be scriptable. 53 00:03:59,080 --> 00:04:05,740 So you go ahead and you pick one, let's just say Internet Explorer, and it will open up 54 00:04:05,740 --> 00:04:12,440 a dictionary for that, which you probably can't read very well, but it basically gives 55 00:04:12,440 --> 00:04:13,700 you a list of things you can do with this. 56 00:04:13,780 --> 00:04:20,180 You could open up a URL, you can close all windows, activate it, all of these things. 57 00:04:20,240 --> 00:04:24,880 And if you go through different scriptable applications, you will find ones that you could export. 58 00:04:25,680 --> 00:04:30,420 Possibly sending out mail, going to a web page with some malicious Java embedded in it, something like that. 59 00:04:30,940 --> 00:04:35,780 So that's a very easy way to go ahead and just find out what applications you can script. 60 00:04:36,280 --> 00:04:38,100 And that gives you the whole dictionary you need there. 61 00:04:38,680 --> 00:04:45,840 As far as OS9 is concerned, going back a minute there, OS9 had some pretty scary scriptable applications. 62 00:04:46,260 --> 00:04:53,460 The Keychain Manager, for those of you who do use it, it's basically you take a key, which is your password, 63 00:04:53,640 --> 00:04:54,880 and you put it on the keychain and you lock it in. 64 00:04:54,900 --> 00:04:56,620 You lock the keychain with one other password. 65 00:04:56,860 --> 00:04:58,520 All the passwords that are on it are encrypted. 66 00:04:59,280 --> 00:05:01,560 The thing is, it's not necessarily locked. 67 00:05:02,160 --> 00:05:05,540 And if it's unlocked, anybody can go in with AppleScript and delete all your keys, 68 00:05:05,780 --> 00:05:08,440 download your keys with your passwords, anything like that. 69 00:05:09,160 --> 00:05:14,620 The Keychain Manager is present in OS10, but it is not scriptable as of yet. 70 00:05:15,740 --> 00:05:21,500 So personally, my opinion on that is that it's better for any method where you just encrypt your passwords. 71 00:05:21,760 --> 00:05:23,100 Someday the encryption is going to be broken. 72 00:05:23,320 --> 00:05:24,060 So my opinion, 73 00:05:24,900 --> 00:05:27,020 it's better to keep your passwords where you know they'll be safe, which is in your head. 74 00:05:28,180 --> 00:05:30,980 If you continue on with permissions of OS10, 75 00:05:31,560 --> 00:05:34,340 they play a big role in exploiting any of these scriptable applications. 76 00:05:35,140 --> 00:05:38,480 For example, the permissions with NetInfoManager, by default, 77 00:05:38,600 --> 00:05:43,620 are those that you can get basically the password list of all users on the system. 78 00:05:44,200 --> 00:05:45,880 So we're going to do another shell script here. 79 00:05:48,160 --> 00:05:49,400 Network, InfoManager, Dump. 80 00:05:49,480 --> 00:05:51,100 And then we're going to dump the password file here. 81 00:05:55,280 --> 00:05:56,760 And when we do that, 82 00:05:58,100 --> 00:05:59,600 you can't really see that, 83 00:05:59,680 --> 00:06:03,900 but we have the list of password hashes for root, 84 00:06:04,060 --> 00:06:06,480 as well as other users on the system that were enabled, 85 00:06:06,720 --> 00:06:09,740 and those would be crackable then if you used crack or anything else. 86 00:06:09,920 --> 00:06:13,900 You could very easily incorporate this AppleScript into a small Trojan 87 00:06:14,460 --> 00:06:19,940 and have it send the password file remotely for cracking on your own system or, you know, an enemy system, 88 00:06:20,200 --> 00:06:22,060 and then go ahead and log in remotely. 89 00:06:22,340 --> 00:06:23,260 In this sense, 90 00:06:23,360 --> 00:06:24,880 you could access the NetInfoManager, 91 00:06:24,880 --> 00:06:25,980 information there, 92 00:06:26,140 --> 00:06:29,020 if you have local access and a shell access on the machine, 93 00:06:29,440 --> 00:06:31,140 but sometimes you do not have that, 94 00:06:31,920 --> 00:06:35,820 and that would be possible then to go ahead and get into a system. 95 00:06:36,040 --> 00:06:39,720 I do have that as proof of concept script that I've flushed out from this. 96 00:06:40,400 --> 00:06:41,700 Unfortunately, due to time constraints, 97 00:06:41,820 --> 00:06:43,020 I didn't get it on the CD in time, 98 00:06:43,140 --> 00:06:45,240 but I will have it available for anybody who'd like it. 99 00:06:45,840 --> 00:06:47,940 Otherwise, it would be on the DEF CON network for the whole weekend. 100 00:06:50,600 --> 00:06:51,400 Moving onward, 101 00:06:52,760 --> 00:06:54,320 AppleScript can be used as a defense tool. 102 00:06:55,480 --> 00:06:58,820 Basically, AppleScript can be used to check and kill processes running in OS X. 103 00:06:59,580 --> 00:07:01,740 So if you notice a process that shouldn't be running, 104 00:07:01,920 --> 00:07:05,020 you can go ahead and, again, using terminal application, 105 00:07:08,480 --> 00:07:09,940 and I don't have anything running. 106 00:07:10,100 --> 00:07:11,860 But if I had had anything running, 107 00:07:12,320 --> 00:07:18,520 you can go ahead and kill it by just typing kill and then the process ID in an AppleScript. 108 00:07:19,620 --> 00:07:23,800 You can also do this to list applications that are running. 109 00:07:25,120 --> 00:07:27,800 This is a non-terminal one, again. 110 00:07:28,140 --> 00:07:30,260 So this is going to be, let me see what I have here. 111 00:07:34,740 --> 00:07:39,320 We're going to tell the finder to list all of the applications that are running right now. 112 00:07:50,920 --> 00:07:54,860 And here we have a list of basically everything that's running on the system right now. 113 00:07:54,880 --> 00:07:59,000 And you can go ahead and get the process ID then and cause any of those to quit. 114 00:07:59,680 --> 00:08:03,180 So basically, you can keep up with what's running on your system, 115 00:08:04,500 --> 00:08:07,600 again, with AppleScript showing its robustness in this. 116 00:08:08,440 --> 00:08:12,320 You can display a list of users just by using the normal finger command in a Unix shell, 117 00:08:12,800 --> 00:08:14,460 which you can do with AppleScript, of course. 118 00:08:14,880 --> 00:08:19,640 Basically, I realize that these are all Unix commands that can really easily be done in the terminal. 119 00:08:20,340 --> 00:08:23,060 But when combined with AppleScript and maybe put into a nice GUI, 120 00:08:23,120 --> 00:08:24,860 they do turn into quite a nice little program. 121 00:08:24,880 --> 00:08:26,940 You can just do, you know, one click, check your system. 122 00:08:27,260 --> 00:08:29,220 It's also good for people who are new to OS X. 123 00:08:29,620 --> 00:08:33,220 Anybody who's really migrated just over from OS 9 without any Unix background, 124 00:08:33,820 --> 00:08:35,780 it does help them get a little bit more accustomed to it. 125 00:08:36,880 --> 00:08:39,340 As far as AppleScript security practices go, 126 00:08:39,860 --> 00:08:43,500 a general rule of thumb is not to run compiled AppleScripts on your system 127 00:08:43,500 --> 00:08:45,080 until you're positive you know what they do. 128 00:08:45,780 --> 00:08:48,820 For the most part, you know, that sounds like it'd be something that you'd normally do. 129 00:08:48,900 --> 00:08:52,120 You just check the source code if you can, verify that it's legit, 130 00:08:52,280 --> 00:08:53,740 and then go ahead and compile and run it yourself. 131 00:08:54,920 --> 00:08:58,440 Sometimes it's not so obvious, though, that a downloaded script is, 132 00:08:58,580 --> 00:09:01,160 or downloaded program file, whatever, is not an AppleScript 133 00:09:01,160 --> 00:09:04,040 or another malicious application, for that matter. 134 00:09:04,440 --> 00:09:10,000 In that case, you know, a malicious person could just change the icon of the item 135 00:09:10,000 --> 00:09:11,640 and make it look like a text file. 136 00:09:11,900 --> 00:09:16,160 In OS X, you could easily go ahead and make that AppleScript open up a text file, 137 00:09:16,300 --> 00:09:19,220 have, pardon me, a text edit, have some text listed on the screen, 138 00:09:19,300 --> 00:09:20,960 and go ahead and delete everything in the background. 139 00:09:21,720 --> 00:09:24,860 This is basically the way the Mac.Simpson's worm function works. 140 00:09:24,880 --> 00:09:28,280 And by displaying the Simpsons website, the user didn't realize 141 00:09:28,280 --> 00:09:30,220 that it was sending out the email in the background. 142 00:09:30,940 --> 00:09:33,440 So the script can be more than meets the eye there. 143 00:09:33,900 --> 00:09:38,440 To verify the validity of a downloaded file, just use the git info command in the Finder. 144 00:09:39,100 --> 00:09:40,400 Basically, let's do that right now. 145 00:09:43,780 --> 00:09:48,000 I'll just open up this DEF CON speech that I had before and git info. 146 00:09:48,260 --> 00:09:51,460 And it's listed as a rich text format document under the kind. 147 00:09:51,740 --> 00:09:53,660 I just want to make sure that it wouldn't say, you know, 148 00:09:53,660 --> 00:09:57,600 application or compiled script if it looks like a text file. 149 00:09:57,720 --> 00:09:59,520 You know, you should be fine if it's a text file. 150 00:10:00,240 --> 00:10:06,400 Other than that, you can go on that if you are going to run a compiled script 151 00:10:06,400 --> 00:10:08,760 that you know is a compiled script, think twice before running it. 152 00:10:08,820 --> 00:10:10,120 Just make sure you know who sent it to you, 153 00:10:10,900 --> 00:10:13,280 just because it can do some nasty stuff now in OS X. 154 00:10:13,980 --> 00:10:17,760 Another good idea is to change the permissions on files and applications in OS X 155 00:10:18,740 --> 00:10:21,400 that you wouldn't want other users to be able to access. 156 00:10:21,460 --> 00:10:23,640 Just use the chmod command. 157 00:10:23,660 --> 00:10:26,300 As far as looking towards the future goes, 158 00:10:26,760 --> 00:10:32,120 as OS X matures, AppleScript is sure to enjoy an even tighter integration into the OS 159 00:10:32,120 --> 00:10:33,080 than it has already. 160 00:10:33,640 --> 00:10:37,200 And as more and more software companies make their programs scriptable, 161 00:10:37,400 --> 00:10:39,320 the more possible exploits there'll be. 162 00:10:40,020 --> 00:10:42,500 As far as AppleScript, it can be powerful, 163 00:10:42,660 --> 00:10:45,320 used for good reasons or bad reasons, just like anything else. 164 00:10:45,860 --> 00:10:49,720 So in my opinion for this speech, I just kind of want to make sure people realize 165 00:10:49,720 --> 00:10:51,520 that AppleScript is a very powerful tool. 166 00:10:51,700 --> 00:10:53,160 It can be very good on the network, 167 00:10:53,160 --> 00:10:55,500 but it also can definitely have some bad consequences 168 00:10:55,500 --> 00:10:57,580 if you run scripts that really shouldn't be run. 169 00:10:58,000 --> 00:11:02,840 Right now I'm going to just demo a couple things with these scripts that I showed you before. 170 00:11:02,980 --> 00:11:04,480 Let me just kind of fix the font thing real quick. 171 00:11:30,780 --> 00:11:31,180 . 172 00:11:33,000 --> 00:11:37,700 Okay, going back, AppleScript can also be used to run shell scripts. 173 00:11:37,980 --> 00:11:40,340 It can execute basically any application and cause it to open. 174 00:11:40,660 --> 00:11:42,840 So if you wanted to with that password dump before, 175 00:11:42,960 --> 00:11:45,000 you could take it, get the password dump file, 176 00:11:45,200 --> 00:11:49,160 and then go ahead and send it to crack to start cracking password files. 177 00:11:50,040 --> 00:11:53,060 I was going to do that, but I do not have the copy of crack on my system, 178 00:11:53,160 --> 00:11:54,740 right now, so I can't exactly show you that. 179 00:11:56,400 --> 00:12:00,720 Overall, basically, I guess it's just mainly a concept of just making sure 180 00:12:00,720 --> 00:12:03,700 when you're programming, if you program for Macintosh, 181 00:12:03,820 --> 00:12:06,800 just make sure you think before you put in scriptable parts of your application. 182 00:12:07,120 --> 00:12:10,160 It definitely helps for those of us who do programming in AppleScript, 183 00:12:10,320 --> 00:12:14,100 but just make sure it doesn't do anything that could lead to a compromise in the system, 184 00:12:14,240 --> 00:12:15,320 especially mail programs. 185 00:12:16,160 --> 00:12:18,300 They do tend to have issues like that. 186 00:12:19,280 --> 00:12:21,180 Basically right now I've got, 187 00:12:21,360 --> 00:12:23,140 it's going to take a little bit of a break, 188 00:12:23,160 --> 00:12:27,660 I've got some books, Cara of Freaky from Freaks Mac Archives and securemac.com 189 00:12:27,660 --> 00:12:28,720 that he got from O'Reilly. 190 00:12:29,540 --> 00:12:32,280 I definitely do recommend O'Reilly's books, I guess. 191 00:12:32,560 --> 00:12:35,920 I use this one, as you can see, quite a bit for AppleScript. 192 00:12:36,020 --> 00:12:36,660 It's a pretty good book. 193 00:12:36,780 --> 00:12:37,920 Not much in OS X, though. 194 00:12:38,440 --> 00:12:40,760 But I've got a couple books that they gave him. 195 00:12:40,960 --> 00:12:45,880 So, okay, we've got Mac OS X Pocket Reference. 196 00:12:46,900 --> 00:12:47,840 Anybody want this? 197 00:12:49,740 --> 00:12:50,900 All right, I'm going to throw this out. 198 00:12:50,940 --> 00:12:52,140 I hope I won't break anything this year. 199 00:12:55,440 --> 00:12:56,720 Okay, throw another one. 200 00:12:58,620 --> 00:12:59,780 Oh, well, things can go far. 201 00:13:00,720 --> 00:13:02,160 Okay, throw one over here now. 202 00:13:04,960 --> 00:13:06,020 It's like a baseball game. 203 00:13:07,220 --> 00:13:10,760 Okay, we've also got a few Unix for Mac OS X. 204 00:13:11,800 --> 00:13:13,020 All right, I knew that one would draw some. 205 00:13:14,120 --> 00:13:15,380 Okay, where should I throw this one? 206 00:13:17,900 --> 00:13:18,860 We'll throw it over there. 207 00:13:20,460 --> 00:13:23,140 And that one, oh, that's just those stupid little postcards. 208 00:13:23,140 --> 00:13:26,200 All right, we've got one more. 209 00:13:29,200 --> 00:13:30,840 Okay, I hope I don't hit the projector over there. 210 00:13:34,080 --> 00:13:35,580 All right, one more. 211 00:13:40,600 --> 00:13:41,240 All right. 212 00:13:41,880 --> 00:13:44,920 I'm also supposed to give away these. 213 00:13:45,880 --> 00:13:48,620 I believe it's a tape drive, I think. 214 00:13:50,340 --> 00:13:52,060 Okay, I'm not going to throw one of these. 215 00:13:52,200 --> 00:13:52,600 So... 216 00:13:53,680 --> 00:13:54,080 Hmm. 217 00:13:56,220 --> 00:13:57,000 Okay, let's see. 218 00:13:57,100 --> 00:13:59,180 We'll do some question and answer stuff right now. 219 00:13:59,280 --> 00:14:00,400 So if anybody has any questions, 220 00:14:01,460 --> 00:14:03,280 if you have a decent question that I like answering, 221 00:14:03,380 --> 00:14:04,400 then I'll give you one of these things. 222 00:14:05,300 --> 00:14:06,620 Okay, anybody have any questions? 223 00:14:10,640 --> 00:14:20,260 You can go ahead with the dictionary and let me just show you real quick. 224 00:14:20,860 --> 00:14:22,500 If you don't see anything that's listed, 225 00:14:22,600 --> 00:14:26,460 these are the ones that actually tell OS X that, yes, I have a dictionary. 226 00:14:26,800 --> 00:14:28,860 You can go ahead and you can browse the system yourself. 227 00:14:32,640 --> 00:14:34,280 Okay, the question was... 228 00:14:37,440 --> 00:14:42,820 Okay, I see what the question was. 229 00:14:42,960 --> 00:14:46,160 If you're inside an application, you see where it says what it does, 230 00:14:46,300 --> 00:14:48,420 you want to know if you can add more to that. 231 00:14:49,240 --> 00:14:51,640 Without having the source code to the program, that's not really possible. 232 00:14:52,480 --> 00:14:53,760 Because it's just what... 233 00:14:53,760 --> 00:14:56,340 When you program a Macintosh program there, 234 00:14:56,460 --> 00:15:00,800 you'd need to say, okay, when you receive this Apple script, do this. 235 00:15:01,160 --> 00:15:04,200 And if you don't have the source code to that program to add that code, 236 00:15:04,340 --> 00:15:05,540 you can't do that on your own. 237 00:15:06,200 --> 00:15:09,320 The company or person who programmed the software originally could, though. 238 00:15:11,140 --> 00:15:13,180 As far as if you were making your own program, though, 239 00:15:13,240 --> 00:15:16,900 you could feel free to add it whenever you wanted to in terms of that. 240 00:15:17,520 --> 00:15:20,760 So if you want to come up here, you can have one of these tape drives if you'd like. 241 00:15:34,720 --> 00:15:36,040 All right. 242 00:15:36,040 --> 00:15:37,140 All right, any other questions? 243 00:15:47,700 --> 00:15:50,220 Basically, in the OS X Server version, 244 00:15:50,220 --> 00:15:53,340 there is a lot that's still with Apple script. 245 00:15:53,520 --> 00:15:54,860 I mean, if you have it enabled in your system, 246 00:15:54,960 --> 00:15:58,480 it can still cause damage if somebody runs it maliciously. 247 00:15:58,540 --> 00:16:00,920 I guess the only thing to really do is if you are running the server, 248 00:16:01,340 --> 00:16:02,780 you know, just make sure you know what you're running. 249 00:16:02,880 --> 00:16:07,620 For the most part, Macs are still secure enough that you can't just break into one 250 00:16:08,680 --> 00:16:11,320 without doing something like, you know, throwing a Trojan on the system first 251 00:16:11,320 --> 00:16:15,280 or having some services running that, you know, really... 252 00:16:15,280 --> 00:16:18,480 I mean, as far as Unix goes, yeah, if you run services, you might get hacked. 253 00:16:18,780 --> 00:16:20,200 But if you're smart about it, you might get hacked. 254 00:16:20,220 --> 00:16:21,560 But if you're smart and you have your last patches and everything, 255 00:16:21,980 --> 00:16:23,560 it really shouldn't cause you any trouble there. 256 00:16:26,240 --> 00:16:27,740 If you want a tape drive, you can have one too. 257 00:16:44,740 --> 00:16:46,760 All right, unfortunately, I don't have anything else to give out, 258 00:16:46,840 --> 00:16:48,100 but I can take more questions. 259 00:16:50,260 --> 00:16:50,640 . 260 00:17:00,980 --> 00:17:02,800 Actually, I really can't hear you. 261 00:17:02,860 --> 00:17:04,480 Do you want to come up here with one of the mics? 262 00:17:06,840 --> 00:17:08,220 The fans up here are kind of noisy. 263 00:17:12,680 --> 00:17:13,060 . 264 00:17:16,360 --> 00:17:16,740 . 265 00:17:16,740 --> 00:17:16,840 . 266 00:17:31,000 --> 00:17:31,040 . 267 00:17:33,400 --> 00:17:33,440 . 268 00:17:34,600 --> 00:17:34,640 . 269 00:17:36,880 --> 00:17:36,920 . 270 00:17:37,080 --> 00:17:37,120 . 271 00:17:37,240 --> 00:17:37,280 . 272 00:17:37,280 --> 00:17:37,300 . 273 00:17:37,300 --> 00:17:37,320 . 274 00:17:37,320 --> 00:17:37,380 . 275 00:17:37,460 --> 00:17:37,500 . 276 00:17:37,500 --> 00:17:37,520 . 277 00:17:37,520 --> 00:17:37,540 . 278 00:17:37,540 --> 00:17:37,560 . 279 00:17:37,560 --> 00:17:37,580 . 280 00:17:37,580 --> 00:17:37,600 . 281 00:17:37,600 --> 00:17:37,620 . 282 00:17:37,620 --> 00:17:37,640 . 283 00:17:37,640 --> 00:17:37,660 . 284 00:17:37,660 --> 00:17:37,680 . 285 00:17:37,680 --> 00:17:37,700 . 286 00:17:37,700 --> 00:17:37,720 . 287 00:17:37,720 --> 00:17:37,800 . 288 00:17:38,560 --> 00:17:38,600 . 289 00:17:38,600 --> 00:17:43,820 it then, as if it was, you know, a text file or whatever, it will not run the script, so 290 00:17:43,820 --> 00:17:48,060 basically we get a bunch of gibberish. That's the way it works for most of OS X, in terms 291 00:17:48,060 --> 00:17:50,700 of changing the names and stuff. Any other questions? 292 00:17:53,620 --> 00:17:58,100 So you showed how to get to the command line from AppleScript. How about the other way around? 293 00:17:58,420 --> 00:18:03,300 The other way around for getting... Sorry, my hearing's horrible, so... 294 00:18:04,320 --> 00:18:07,880 So you showed how to get to the command line from AppleScript. How about the other way around? 295 00:18:08,600 --> 00:18:11,900 All right, the question was that I showed how to get to the command line from AppleScript, 296 00:18:12,060 --> 00:18:15,860 and he was asking how about the other way around. Yes, you can. You can write scripts 297 00:18:15,860 --> 00:18:22,180 in the terminal. You can also just go directly from the terminal, I believe. Let's just open 298 00:18:22,180 --> 00:18:24,480 that up here. Not Internet Explorer. 299 00:18:35,140 --> 00:18:38,140 Okay, SCPT is the extension for AppleScript, is what you said there. 300 00:18:38,600 --> 00:18:44,760 Okay. Basically, I believe it's the OSA line, if I remember correctly, that will list the 301 00:18:44,760 --> 00:18:48,140 normal scripts that are listed, what you can use for the scripting system, AppleScript 302 00:18:48,140 --> 00:18:52,340 and generic scripting system. You can compile scripts in the terminal, although I will 303 00:18:52,340 --> 00:18:57,460 admit that I have not really messed around that myself too much. I do prefer the Apple 304 00:18:57,460 --> 00:19:02,460 editor, script editor program, just because I usually suck at typing, so I make lots 305 00:19:02,460 --> 00:19:07,620 of mistakes. But it is possible to go back to back, you know, compile something in the 306 00:19:08,600 --> 00:19:12,360 editor that can execute terminal commands, pardon me, that's something that a terminal 307 00:19:12,360 --> 00:19:16,800 can do, AppleScripts. So that is right, I can do that. Any other questions? 308 00:19:19,560 --> 00:19:20,140 Pardon me? 309 00:19:21,560 --> 00:19:22,200 OSA script. 310 00:19:23,100 --> 00:19:23,540 Yes. 311 00:19:25,680 --> 00:19:26,900 Okay. Any other questions? 312 00:19:30,940 --> 00:19:34,340 In terms of accessing, okay, the question was accessing applications. 313 00:19:36,580 --> 00:19:37,120 Mm-hmm. 314 00:19:42,760 --> 00:19:47,460 Okay. There's actually a lot of different general commands that a lot of the applications 315 00:19:47,460 --> 00:19:54,020 hold. So when you go to open up something, let's just go back to, let's say I choose 316 00:19:54,020 --> 00:20:00,040 this. In this dictionary that comes up, we basically have a list of the subset of the 317 00:20:00,040 --> 00:20:05,500 standard commands, which are basically the same for the whole system. Then each one has 318 00:20:05,500 --> 00:20:08,580 its own separate ones that might not be the same on all systems. So, you know, you can 319 00:20:13,260 --> 00:20:18,080 access a number of general ones that are the same for the whole system. Is that pretty 320 00:20:18,080 --> 00:20:18,860 much what you're wondering about? 321 00:20:23,240 --> 00:20:31,920 Okay. In terms of security, accessing between two applications, you can use it to access 322 00:20:31,920 --> 00:20:35,760 different applications, you know, cause them to run whatever you want, unless the permissions 323 00:20:35,760 --> 00:20:38,460 are such that the user that's logged into running the AppleScript cannot. 324 00:20:39,100 --> 00:20:39,460 Okay. 325 00:20:39,460 --> 00:20:42,060 So for the most part, it is open that you could run between two applications, and that 326 00:20:42,060 --> 00:20:44,040 does have some security issues inherent to that. 327 00:20:45,320 --> 00:20:45,680 Okay. 328 00:20:48,440 --> 00:20:53,040 Yes, you can run scripts as different users. You can, right now, the terminal commands 329 00:20:53,040 --> 00:20:57,920 are a little shoddy still in OS 10. Just the shell that you get that AppleScript executes 330 00:20:57,920 --> 00:21:02,680 with is not, you know, it's not going to give you a full-fledged command over the system. 331 00:21:03,060 --> 00:21:07,780 There are ways, I believe, I'm not positive on this, to pass the password. 332 00:21:08,600 --> 00:21:11,700 The one with the shell commands, you can change, you know, switch users and execute something 333 00:21:11,700 --> 00:21:15,380 like sudo, or whatever you want to do there, so you could execute something as root, yes. 334 00:21:16,520 --> 00:21:17,280 Any other questions? 335 00:21:27,340 --> 00:21:31,480 Okay, he was asking, do you have to set an implicit quit at the end when you, like, say 336 00:21:31,480 --> 00:21:36,420 I open up the Apple remote or Apple system profile over there, when it accesses it, for 337 00:21:36,420 --> 00:21:38,540 the most part, because I was accessing it. 338 00:21:38,600 --> 00:21:41,660 For instance, Dictionary, it opened it up. If you're running a program that would access 339 00:21:41,660 --> 00:21:45,800 it and just get some information of it, sometimes it won't even open up the program unless it 340 00:21:45,800 --> 00:21:52,100 needs to actually access something in terms of opening, probably, yes, it got lost there. 341 00:21:52,900 --> 00:21:57,960 Basically, what you do there is, yes, sometimes you do need an implicit quit if you're going 342 00:21:57,960 --> 00:22:02,380 to want the program to close, but there are, I believe, a number of scripts that you can 343 00:22:02,380 --> 00:22:04,820 run, for the most part, where it would not even open that application. It would just 344 00:22:04,820 --> 00:22:07,800 pass the argument right through to wherever you want it to be sent to. 345 00:22:08,780 --> 00:22:09,620 Any other questions? 346 00:22:11,300 --> 00:22:11,980 Okay, over there. 347 00:22:12,220 --> 00:22:14,540 Can you embed Apple script into an email? 348 00:22:16,160 --> 00:22:19,980 The question is, can you embed Apple script into an email? You can attach Apple script, 349 00:22:20,100 --> 00:22:23,100 but as of now, even with the mail program, you can't actually embed something in the 350 00:22:23,100 --> 00:22:27,620 email that would run. You can, however, have an Apple script that, say, would find a certain 351 00:22:27,620 --> 00:22:32,020 email. You could have it be pulling the mailbox, and when it sees that email, it could execute 352 00:22:32,020 --> 00:22:34,540 then. So, if there's something on the system already, you could have something along those 353 00:22:34,540 --> 00:22:34,980 lines, yes. 354 00:22:36,740 --> 00:22:37,440 Anybody else? 355 00:22:37,960 --> 00:22:38,360 Right there. 356 00:22:38,420 --> 00:22:38,580 Yes. 357 00:22:43,660 --> 00:22:47,380 The question was, are there any known experts for Apple scripts with Apple events, you said? 358 00:22:50,420 --> 00:22:53,680 Okay, I actually didn't catch that last part there. 359 00:22:55,460 --> 00:22:55,860 Remote. 360 00:22:56,220 --> 00:22:56,620 Remote. 361 00:22:57,200 --> 00:22:57,280 Remote. 362 00:22:57,860 --> 00:22:58,260 Remote. 363 00:22:58,260 --> 00:22:58,400 Remote. 364 00:22:58,480 --> 00:22:58,880 Remote. 365 00:22:58,880 --> 00:22:59,260 Remote. 366 00:22:59,660 --> 00:23:00,060 Remote. 367 00:23:01,940 --> 00:23:02,340 Remote. 368 00:23:02,760 --> 00:23:03,160 Remote. 369 00:23:10,020 --> 00:23:10,380 Remote. 370 00:23:10,380 --> 00:23:11,740 Is under the network, no. 371 00:23:12,860 --> 00:23:13,200 Pardon me. 372 00:23:13,220 --> 00:23:13,940 Not network users. 373 00:23:15,160 --> 00:23:16,420 Why am I confusing myself now? 374 00:23:18,480 --> 00:23:19,200 Sharing, sharing. 375 00:23:19,420 --> 00:23:19,760 Sharing. 376 00:23:20,100 --> 00:23:20,260 Okay. 377 00:23:20,320 --> 00:23:20,540 Yes. 378 00:23:20,560 --> 00:23:21,300 It's been a long day. 379 00:23:21,340 --> 00:23:22,620 I drove 33 hours to get out here. 380 00:23:23,940 --> 00:23:27,600 Okay, you can allow remote login, as well as allow remote Apple events. 381 00:23:28,140 --> 00:23:29,700 Allows users to send Apple events to your computer. 382 00:23:29,840 --> 00:23:32,980 Yes, that could be a security issue, because you could send anything from a shutdown command. 383 00:23:34,040 --> 00:23:38,580 The core of Apple script is Apple events, which, so basically, Apple events can set a recordingpor 384 00:23:38,580 --> 00:23:40,140 Any Apple script you could do, you could do with an Apple event. 385 00:23:40,200 --> 00:23:43,120 It's a little bit low level in terms of the programming for that, 386 00:23:43,260 --> 00:23:45,820 but yes, that would definitely be a security issue. 387 00:23:45,920 --> 00:23:48,660 I do not know of any exploits per se, though, that are out for that. 388 00:23:51,260 --> 00:23:53,120 Okay, anybody else have any questions? 389 00:23:54,320 --> 00:23:56,560 Or are we all ready to go drink and party tonight? 390 00:23:58,400 --> 00:23:59,860 All right, well, I'll wrap this up, 391 00:23:59,900 --> 00:24:03,020 but I am going to be available for any questions if anybody has any. 392 00:24:03,120 --> 00:24:04,600 I'll be around here all weekend. 393 00:24:04,680 --> 00:24:07,900 I'll probably just be going over to the seller's area right now, 394 00:24:07,900 --> 00:24:08,500 and I'll go to the seller's area.