1 00:00:00,000 --> 00:00:05,120 Hello, and welcome to the fabulous executable image exploit. 2 00:00:06,160 --> 00:00:11,980 What I'm going to show you is a very, very simple set of concepts. 3 00:00:12,460 --> 00:00:18,020 And the exploit is not so much the technique, it's what you do with the technique. 4 00:00:20,700 --> 00:00:22,080 So, here's what you're going to learn. 5 00:00:23,080 --> 00:00:25,460 You're going to learn the origins of this little exploit, 6 00:00:25,580 --> 00:00:29,040 and some of the quote-unquote legitimate reasons for doing some of this stuff. 7 00:00:29,600 --> 00:00:34,540 You're going to learn the difference between what I refer to as executable and static images. 8 00:00:35,660 --> 00:00:39,380 You're going to learn how to create images with PHP and the GD library. 9 00:00:42,320 --> 00:00:47,900 Importantly, you're going to learn how to fool your own server into executing what looks like an image. 10 00:00:48,080 --> 00:00:53,880 So, it'll interpret it as a script instead of sending it off to a browser as an image. 11 00:00:54,760 --> 00:00:58,340 And I'm going to teach you how to do some really cool things with Web 2.0 websites. 12 00:01:00,360 --> 00:01:06,160 What you will not learn, okay, this is not the GDI exploit that some of you might be familiar with. 13 00:01:06,300 --> 00:01:11,020 What that was, was they played around with the headers of JPEG, 14 00:01:11,100 --> 00:01:15,140 and basically they screwed up the, I think it was the file length. 15 00:01:15,200 --> 00:01:19,220 They gave it a negative number, and that forced buffer overflow or something. 16 00:01:19,340 --> 00:01:24,580 And Windows machines would then execute code that was in the HTTP header of the file. 17 00:01:24,780 --> 00:01:27,000 This is not that exploit. This is something different. 18 00:01:27,200 --> 00:01:29,020 This works on images. 19 00:01:29,040 --> 00:01:32,180 This is images that people download from your server, okay? 20 00:01:34,420 --> 00:01:36,340 This is not a client-side exploit. 21 00:01:36,580 --> 00:01:40,080 This is something, again, that runs off of a server that you control. 22 00:01:41,320 --> 00:01:42,820 Actually, that's not quite true. 23 00:01:42,900 --> 00:01:46,340 There's one little thing I want to show you here, just to kind of warm things up. 24 00:01:52,020 --> 00:01:53,260 As soon as the browser loads. 25 00:01:59,900 --> 00:02:00,540 There we go. 26 00:02:00,760 --> 00:02:04,440 So if you look up here in the location here, 27 00:02:04,960 --> 00:02:07,880 this is actually a JPEG that ran a piece of JavaScript. 28 00:02:10,200 --> 00:02:14,160 So you could do Ajax or any kind of cool stuff like that. 29 00:02:16,580 --> 00:02:17,520 Okay, some of the goals. 30 00:02:17,700 --> 00:02:20,040 You're going to learn how to program these executable images. 31 00:02:20,960 --> 00:02:24,260 You're going to learn how they can be applied to do some interesting things. 32 00:02:24,640 --> 00:02:28,200 And again, I want to get you guys started doing your own things. 33 00:02:28,200 --> 00:02:31,120 I'm going to give you some examples of things you can do, 34 00:02:31,980 --> 00:02:34,120 but I know you guys can do better than what I came up with. 35 00:02:34,220 --> 00:02:37,520 So my email address is on every one of these screens. 36 00:02:37,900 --> 00:02:38,860 So take it down. 37 00:02:39,080 --> 00:02:41,680 If you do something interesting, I want to know about it, okay? 38 00:02:43,480 --> 00:02:47,140 Also, this is not a code-heavy demonstration. 39 00:02:47,920 --> 00:02:49,040 There's a little bit of code. 40 00:02:49,620 --> 00:02:56,240 I think most of it is on the CD that went out, the conference CD. 41 00:02:56,660 --> 00:02:57,760 What I'm going to do is, 42 00:02:58,200 --> 00:03:01,140 I'm going to take this presentation and put it on my website, 43 00:03:01,380 --> 00:03:04,460 which is also up there, www.shrink.com. 44 00:03:04,740 --> 00:03:09,380 It'll be in the lower left-hand corner down where it says, 45 00:03:09,480 --> 00:03:10,120 Fun with Bots. 46 00:03:11,260 --> 00:03:12,540 That's where you'll find this presentation. 47 00:03:13,720 --> 00:03:14,580 Okay, who am I? 48 00:03:16,440 --> 00:03:19,040 I've been writing web bots for a long, long time. 49 00:03:19,120 --> 00:03:22,200 I've been writing web bots for about 11 or 12 years. 50 00:03:24,000 --> 00:03:27,220 Started off doing a lot of telemedicine kind of stuff with web bots. 51 00:03:27,220 --> 00:03:30,420 Now I do a lot of stuff with Russian companies. 52 00:03:31,400 --> 00:03:32,940 This is my eighth DEF CON. 53 00:03:33,160 --> 00:03:34,600 This is the third time I was a speaker. 54 00:03:36,320 --> 00:03:38,320 First time, to tell you how much things changed, 55 00:03:38,520 --> 00:03:40,900 first time I did DEF CON was DEF CON 5. 56 00:03:41,460 --> 00:03:46,280 And I felt to my employer that I needed to legitimize going out to DEF CON. 57 00:03:46,600 --> 00:03:49,100 So I covered it for Computer World magazine. 58 00:03:49,260 --> 00:03:50,440 So I had an alibi. 59 00:03:52,100 --> 00:03:56,560 Based in Minneapolis, which unfortunately has been in the news way too much this week. 60 00:03:56,560 --> 00:03:58,000 For all the wrong reasons. 61 00:03:59,020 --> 00:04:02,720 This week, we're also opening an office in India. 62 00:04:03,480 --> 00:04:06,780 Most of you probably know it as Madras, but they changed the name now. 63 00:04:06,840 --> 00:04:07,500 It's called Cine. 64 00:04:08,440 --> 00:04:11,980 In April, I had a book come out with my friends at No Starch Press 65 00:04:11,980 --> 00:04:14,160 called Web Bots, Spiders, and Screen Scrapers. 66 00:04:14,320 --> 00:04:15,940 Now available in Italian. 67 00:04:16,680 --> 00:04:21,680 And this month, I also have the cover story on PHP Architect. 68 00:04:23,960 --> 00:04:25,520 Okay, origins of the exploit. 69 00:04:26,840 --> 00:04:30,780 Originally, my goal was to come up with a really good MySpace tracker. 70 00:04:34,040 --> 00:04:35,680 And I had a couple of reasons for doing that. 71 00:04:35,800 --> 00:04:40,720 I mean, there are, what do they say, 200,000 sexual predators on MySpace. 72 00:04:40,800 --> 00:04:43,020 You know, it would be nice to kind of keep track of these people. 73 00:04:43,600 --> 00:04:46,880 I was thinking you could maybe make a tool for parents to kind of monitor 74 00:04:46,880 --> 00:04:49,240 what their kids are doing with MySpace or who their friends are. 75 00:04:49,500 --> 00:04:50,720 That was kind of the goal. 76 00:04:52,380 --> 00:04:53,720 That and a lot of curiosity. 77 00:04:55,520 --> 00:04:58,860 So what I wanted to do is I wanted to add images to people's pages 78 00:04:58,860 --> 00:05:00,120 like you can do with MySpace. 79 00:05:00,260 --> 00:05:04,920 In fact, a lot of web 2.0 sites where you can, you know, 80 00:05:04,940 --> 00:05:07,540 there's like message areas where you can upload messages 81 00:05:07,540 --> 00:05:09,000 and you can include a little HTML 82 00:05:09,520 --> 00:05:12,440 and you can refer to images that are on different servers. 83 00:05:12,840 --> 00:05:13,820 That's what I wanted to do. 84 00:05:13,880 --> 00:05:17,920 And I wanted to put up an image that looked like this. 85 00:05:18,100 --> 00:05:22,100 Basically, a simple little PHP program with a little thing on a query here. 86 00:05:23,040 --> 00:05:25,500 Well, I got frustrated because MySpace doesn't let you do that. 87 00:05:25,520 --> 00:05:29,000 And they've got good reasons for not letting you do that. 88 00:05:29,140 --> 00:05:30,560 And we'll talk about those later. 89 00:05:31,800 --> 00:05:34,920 In fact, most web 2.0 sites, the good ones, 90 00:05:35,980 --> 00:05:38,040 they won't let you post stuff like that. 91 00:05:38,120 --> 00:05:41,000 If you have the source for an image tag, 92 00:05:41,160 --> 00:05:44,900 if it's not a JPEG, if it's not a GIF, if it's not a PNG, 93 00:05:45,200 --> 00:05:47,300 they will not let you put it up there. 94 00:05:47,360 --> 00:05:48,100 They'll filter it out. 95 00:05:51,000 --> 00:05:55,480 And the reason they do that is because it's a program. 96 00:05:55,480 --> 00:05:56,380 It's not an image. 97 00:05:56,840 --> 00:05:58,560 It can be executable. 98 00:05:59,240 --> 00:06:02,780 And it might still send an image to someone's browser. 99 00:06:02,900 --> 00:06:03,840 It'll look like an image. 100 00:06:04,080 --> 00:06:06,840 But in reality, it also has the ability to write cookies, 101 00:06:07,060 --> 00:06:10,300 track environment variables, access databases, 102 00:06:11,040 --> 00:06:15,400 send instant messages, send faxes, blah-de-blah. 103 00:06:15,500 --> 00:06:16,800 Anything a program can do, 104 00:06:16,900 --> 00:06:21,320 you can do if you insert a PHP program as a source for an image. 105 00:06:23,680 --> 00:06:25,460 So an executable image, 106 00:06:25,480 --> 00:06:27,420 is a program. 107 00:06:27,640 --> 00:06:30,120 It's not just a static piece of data. 108 00:06:30,300 --> 00:06:31,220 It's an actual program. 109 00:06:32,120 --> 00:06:34,800 And there are some legitimate uses for this kind of stuff. 110 00:06:35,320 --> 00:06:37,000 A lot of times, 111 00:06:39,540 --> 00:06:43,480 people will store images as blobs or something in a database, 112 00:06:43,680 --> 00:06:45,380 and they'll use a piece of dynamic code 113 00:06:45,380 --> 00:06:47,680 to pull it out of the database and send it out. 114 00:06:47,760 --> 00:06:48,640 It's perfectly legitimate. 115 00:06:49,260 --> 00:06:52,860 A lot of times, people will also use executable images like this 116 00:06:52,860 --> 00:06:55,320 to put watermarks on things, 117 00:06:55,480 --> 00:06:57,680 so you can tell when an image was downloaded, 118 00:06:57,940 --> 00:06:59,880 who did it, at what time, 119 00:06:59,900 --> 00:07:01,740 what their IP address was, all that kind of stuff. 120 00:07:01,840 --> 00:07:03,560 You just kind of log that kind of stuff in the image. 121 00:07:03,860 --> 00:07:05,480 It's also used a lot in CAPTCHAs, 122 00:07:06,100 --> 00:07:08,480 where you want to have an image, 123 00:07:08,540 --> 00:07:11,560 but you don't want the file name to represent what's in the image, 124 00:07:11,760 --> 00:07:15,020 so it's all done behind the scenes with a dynamic image. 125 00:07:15,160 --> 00:07:16,120 And that's what we're talking about here. 126 00:07:16,240 --> 00:07:18,260 We're talking about dynamic images. 127 00:07:19,600 --> 00:07:21,740 So here's a quick little piece of code 128 00:07:21,740 --> 00:07:23,520 that shows how some of this works, 129 00:07:23,600 --> 00:07:25,120 how you would pull stuff out of a database. 130 00:07:27,580 --> 00:07:28,880 So here's our query. 131 00:07:29,080 --> 00:07:30,520 We've got something called show image, 132 00:07:31,020 --> 00:07:33,580 and we're giving it on the query string an ID of 34. 133 00:07:34,220 --> 00:07:36,320 So in our imaginary world here, 134 00:07:36,380 --> 00:07:39,020 we've got a table called dbtable, 135 00:07:39,160 --> 00:07:42,280 and we've got images that are in a column called image, 136 00:07:42,780 --> 00:07:45,740 and we've got an ID associated with each one of those. 137 00:07:45,920 --> 00:07:47,160 So you can do a little query, 138 00:07:47,420 --> 00:07:48,640 pull out the image, 139 00:07:51,500 --> 00:07:52,760 and create a header. 140 00:07:53,180 --> 00:07:54,400 This is your MIME type 141 00:07:54,400 --> 00:07:55,420 for the media, 142 00:07:55,620 --> 00:07:57,440 and then you just echo out 143 00:07:57,440 --> 00:07:58,920 the stuff you got back from the database. 144 00:07:59,280 --> 00:08:02,820 I usually like to base 64 and code all this stuff, 145 00:08:02,980 --> 00:08:06,000 because that way you're guaranteed 146 00:08:06,000 --> 00:08:09,000 that you'll never ever have any toxic bit combinations 147 00:08:09,000 --> 00:08:12,680 that might be represented as some special character or something. 148 00:08:17,100 --> 00:08:18,220 This one? 149 00:08:19,660 --> 00:08:21,720 I have some similar to this. 150 00:08:22,300 --> 00:08:23,480 Do you see a bug? 151 00:08:26,960 --> 00:08:28,260 There might be a bug, I don't know. 152 00:08:28,440 --> 00:08:30,040 This is the general concept. 153 00:08:30,640 --> 00:08:32,380 I can tell you, no, I don't. 154 00:08:32,400 --> 00:08:33,780 This is heavily abstracted. 155 00:08:37,060 --> 00:08:38,060 Did I answer your question? 156 00:08:41,740 --> 00:08:42,140 Okay. 157 00:08:43,380 --> 00:08:44,380 To do something like this, 158 00:08:44,400 --> 00:08:46,520 it doesn't require any special graphics libraries. 159 00:08:47,360 --> 00:08:49,320 You have to previously store the image 160 00:08:49,320 --> 00:08:51,140 as a blob in the database. 161 00:08:52,900 --> 00:08:54,380 Images can be referenced by it, 162 00:08:54,400 --> 00:08:56,060 by an index or by a name, what have you. 163 00:08:56,320 --> 00:08:58,240 This is really useful in cases 164 00:08:58,240 --> 00:09:00,100 where your web server doesn't have write permissions 165 00:09:00,100 --> 00:09:01,100 on your files. 166 00:09:01,640 --> 00:09:04,680 In case you want to upload user-uploaded images, 167 00:09:04,840 --> 00:09:06,380 but you can't save them to a file, 168 00:09:06,580 --> 00:09:08,160 you can store them in the database usually. 169 00:09:11,660 --> 00:09:13,100 Here's an example of this. 170 00:09:13,640 --> 00:09:16,400 This is not taking it from a database, 171 00:09:16,600 --> 00:09:19,340 but it's taking the information 172 00:09:19,340 --> 00:09:21,520 from the query string. 173 00:09:22,220 --> 00:09:23,440 The way this would work, 174 00:09:23,440 --> 00:09:24,420 as you come in, 175 00:09:25,580 --> 00:09:26,680 again, you make this thing look 176 00:09:26,680 --> 00:09:28,160 just like the source for an image tag. 177 00:09:28,380 --> 00:09:29,500 You send out a header. 178 00:09:30,020 --> 00:09:31,220 You create the image. 179 00:09:31,260 --> 00:09:32,640 This is using GD. 180 00:09:33,820 --> 00:09:36,140 It's a library that's packaged with PHP. 181 00:09:36,700 --> 00:09:38,900 Basically, you grab the name of the image, 182 00:09:39,380 --> 00:09:42,300 and this image should be sitting someplace on a file. 183 00:09:42,600 --> 00:09:43,680 It creates a handle. 184 00:09:44,080 --> 00:09:46,280 You create the image, send it out to the browser, 185 00:09:47,040 --> 00:09:49,960 destroy the image so you don't run into memory issues 186 00:09:49,960 --> 00:09:50,640 with your server, 187 00:09:50,800 --> 00:09:52,520 do an exit, and get out of there. 188 00:09:53,440 --> 00:09:54,780 The way this would look 189 00:09:55,920 --> 00:09:57,420 is you'd have something like this. 190 00:10:00,220 --> 00:10:05,520 We've got a file called show reference. 191 00:10:07,020 --> 00:10:08,140 If we hit it down here, 192 00:10:08,280 --> 00:10:09,260 we change the data, 193 00:10:09,360 --> 00:10:10,340 and we have one of the Riviera. 194 00:10:10,560 --> 00:10:11,280 Simple stuff. 195 00:10:13,720 --> 00:10:14,940 I'm showing you this because 196 00:10:14,940 --> 00:10:16,760 when you do one of these things, 197 00:10:16,860 --> 00:10:19,080 you have to still masquerade as an image. 198 00:10:19,780 --> 00:10:21,220 It's important to be able to, 199 00:10:21,220 --> 00:10:22,480 in addition to doing all the cool stuff, 200 00:10:22,480 --> 00:10:24,600 you still have to be able to take an image 201 00:10:24,600 --> 00:10:27,940 and get it out to the server. 202 00:10:28,080 --> 00:10:30,320 You have to still mimic a real image, 203 00:10:30,480 --> 00:10:31,000 in other words. 204 00:10:32,580 --> 00:10:33,560 Here's another example. 205 00:10:33,640 --> 00:10:34,320 It's a little more interesting, 206 00:10:34,460 --> 00:10:35,200 a little more dynamic. 207 00:10:36,280 --> 00:10:38,400 Again, I'm going to grab an image from an ID. 208 00:10:39,320 --> 00:10:43,040 I'm going to define a font 209 00:10:43,660 --> 00:10:45,160 and a color for the font. 210 00:10:45,720 --> 00:10:47,840 I'm going to have some executable content here. 211 00:10:47,960 --> 00:10:48,660 In this case, 212 00:10:49,100 --> 00:10:50,720 basically it's just a timestamp, 213 00:10:50,720 --> 00:10:52,640 and I'm going to change the angle 214 00:10:52,640 --> 00:10:55,140 at which it's rendered from 0 to 90 degrees. 215 00:10:55,940 --> 00:10:57,540 Then again, create the header, 216 00:10:58,160 --> 00:10:59,260 send the image out, 217 00:11:00,140 --> 00:11:01,100 destroy the handle, 218 00:11:01,240 --> 00:11:02,420 and exit out of there. 219 00:11:02,660 --> 00:11:03,900 The way this looks, 220 00:11:07,240 --> 00:11:08,260 this is a couple of images, 221 00:11:08,860 --> 00:11:11,280 and every time I flow the page, 222 00:11:12,100 --> 00:11:13,500 you see the image is different. 223 00:11:13,600 --> 00:11:14,700 Again, I'm just showing you this 224 00:11:15,200 --> 00:11:16,300 so that you can see 225 00:11:17,020 --> 00:11:18,400 how this kind of stuff is done, 226 00:11:18,520 --> 00:11:20,360 because you still have to be able to 227 00:11:20,720 --> 00:11:22,260 mimic an actual image 228 00:11:22,260 --> 00:11:23,440 when you're doing this kind of stuff. 229 00:11:30,240 --> 00:11:31,280 Real quickly, 230 00:11:31,480 --> 00:11:33,160 an executable image can display images 231 00:11:33,160 --> 00:11:34,080 that are stored in databases. 232 00:11:34,640 --> 00:11:36,660 You can programmatically select images 233 00:11:36,660 --> 00:11:37,660 that you want to display. 234 00:11:38,460 --> 00:11:41,240 You can dynamically produce image content, 235 00:11:41,800 --> 00:11:44,500 but you can also do everything 236 00:11:44,500 --> 00:11:46,200 that a regular script can do. 237 00:11:46,520 --> 00:11:47,420 In other words, 238 00:11:47,440 --> 00:11:48,600 you can read refer variables, 239 00:11:49,260 --> 00:11:50,320 and you can do that 240 00:11:50,720 --> 00:11:51,100 so that you can see the page 241 00:11:51,100 --> 00:11:53,480 that the viewer was looking at 242 00:11:53,480 --> 00:11:54,880 before they came to the page 243 00:11:54,880 --> 00:11:55,860 with your image on it. 244 00:11:56,060 --> 00:11:57,660 You can also see the query string, 245 00:11:57,880 --> 00:11:59,880 and in the case of what I was trying to do, 246 00:11:59,940 --> 00:12:00,560 that was really important, 247 00:12:00,720 --> 00:12:02,960 because I wanted to track users on MySpace, 248 00:12:03,160 --> 00:12:05,280 and that's where that information was kept. 249 00:12:06,760 --> 00:12:08,280 You can also read and write cookies, 250 00:12:08,760 --> 00:12:10,300 and you do this, obviously, 251 00:12:10,340 --> 00:12:11,180 to track individuals, 252 00:12:11,680 --> 00:12:14,180 and this actually also works across domains, 253 00:12:14,440 --> 00:12:15,880 and that's kind of an interesting thing, 254 00:12:15,940 --> 00:12:16,880 and I'll show you some reasons 255 00:12:16,880 --> 00:12:19,220 for that being interesting here in a bit. 256 00:12:20,720 --> 00:12:22,640 And you can keep track of histories of stuff, 257 00:12:22,720 --> 00:12:23,720 so you can store all your stuff 258 00:12:23,720 --> 00:12:25,020 that you've found in a database. 259 00:12:25,660 --> 00:12:27,360 And again, you can also communicate 260 00:12:27,360 --> 00:12:28,640 whatever you want to communicate 261 00:12:29,400 --> 00:12:30,820 when these images are downloaded. 262 00:12:32,120 --> 00:12:33,700 So here, for example, 263 00:12:34,680 --> 00:12:36,780 on top we've got the header 264 00:12:36,780 --> 00:12:38,180 that we've seen a number of times. 265 00:12:38,500 --> 00:12:40,080 On the bottom, we've got the place 266 00:12:40,080 --> 00:12:41,420 where it's actually creating the image. 267 00:12:41,780 --> 00:12:42,520 But in between, 268 00:12:42,680 --> 00:12:44,500 this is how you would set a cookie. 269 00:12:45,320 --> 00:12:46,760 This is how you would read a cookie. 270 00:12:47,260 --> 00:12:48,900 This is how you would get a refer variable, 271 00:12:48,900 --> 00:12:52,380 and here's how you would get a query string, okay? 272 00:12:52,500 --> 00:12:54,160 And primarily, those are the things 273 00:12:54,160 --> 00:12:55,100 that you really want to do. 274 00:12:56,100 --> 00:12:57,420 Those are the useful things. 275 00:13:00,600 --> 00:13:02,360 Okay, the problem with this, 276 00:13:02,420 --> 00:13:03,560 I mean, this all looks great, right? 277 00:13:03,700 --> 00:13:06,560 The problem is the sites you want to use this on 278 00:13:06,560 --> 00:13:07,800 won't allow you to do it. 279 00:13:08,700 --> 00:13:10,620 They'll let you do what's on top, 280 00:13:10,800 --> 00:13:12,480 but they won't let you do what's on the bottom. 281 00:13:13,000 --> 00:13:15,080 Anything that looks like something 282 00:13:15,080 --> 00:13:16,400 that's not a real image, 283 00:13:17,440 --> 00:13:18,660 MySpace in particular, 284 00:13:18,680 --> 00:13:18,880 MySpace in particular, 285 00:13:18,900 --> 00:13:19,160 in my case, 286 00:13:19,340 --> 00:13:20,820 would not allow you to upload. 287 00:13:20,960 --> 00:13:22,940 They would just parse it away, filter it out. 288 00:13:23,800 --> 00:13:24,760 So here's what you do. 289 00:13:25,660 --> 00:13:26,580 If you're running Apache, 290 00:13:27,240 --> 00:13:29,520 go into the .htaccess file, 291 00:13:29,700 --> 00:13:31,340 and you want to add a little line of code 292 00:13:31,800 --> 00:13:33,140 that will tell your server 293 00:13:33,140 --> 00:13:35,800 that every time you see a file 294 00:13:37,400 --> 00:13:38,200 that's requested, 295 00:13:38,680 --> 00:13:41,020 and if it's got a .jpg extension, 296 00:13:41,580 --> 00:13:43,760 you're going to interpret that as a PHP file. 297 00:13:44,480 --> 00:13:46,660 You don't have to do this with JPEGs. 298 00:13:46,740 --> 00:13:48,300 You could do it with any other kind of image type. 299 00:13:48,300 --> 00:13:49,060 You can do it with GIFs. 300 00:13:49,080 --> 00:13:49,920 You can do it with PNGs. 301 00:13:50,360 --> 00:13:51,200 For that matter, 302 00:13:51,280 --> 00:13:52,300 you don't have to do this with PHP. 303 00:13:52,620 --> 00:13:54,080 You could also do this with Perl. 304 00:13:54,080 --> 00:13:56,420 You could do it with whatever you're using. 305 00:13:56,680 --> 00:13:58,060 Can you do it with .mov? 306 00:13:59,080 --> 00:13:59,440 .what? 307 00:13:59,880 --> 00:14:00,240 .mov. 308 00:14:00,860 --> 00:14:01,220 .mov. 309 00:14:02,180 --> 00:14:02,540 .mov. 310 00:14:02,600 --> 00:14:02,960 .mov. 311 00:14:03,460 --> 00:14:03,820 .mov. 312 00:14:05,900 --> 00:14:06,260 .mov. 313 00:14:06,260 --> 00:14:06,400 .mov. 314 00:14:06,400 --> 00:14:06,460 .mov. 315 00:14:06,460 --> 00:14:06,580 .mov. 316 00:14:07,520 --> 00:14:07,880 .mov. 317 00:14:09,240 --> 00:14:09,600 .mov. 318 00:14:09,880 --> 00:14:10,240 .mov. 319 00:14:11,440 --> 00:14:11,800 .mov. 320 00:14:17,680 --> 00:14:18,040 .mov. 321 00:14:18,040 --> 00:14:18,200 .mov. 322 00:14:21,200 --> 00:14:22,080 .mov. 323 00:14:26,400 --> 00:14:26,840 .mov. 324 00:14:26,840 --> 00:14:26,960 .mov. 325 00:14:27,400 --> 00:14:28,280 .mov. 326 00:14:28,460 --> 00:14:28,740 .mov. 327 00:14:28,740 --> 00:14:29,080 .mov. 328 00:14:29,080 --> 00:14:29,680 .mov. 329 00:14:29,680 --> 00:14:30,020 .mov. 330 00:14:30,020 --> 00:14:30,060 .mov. 331 00:14:30,060 --> 00:14:30,160 .mov. 332 00:14:31,120 --> 00:14:32,000 .mov. 333 00:14:32,280 --> 00:14:33,160 .mov. 334 00:14:34,200 --> 00:14:35,080 .mov. 335 00:14:35,080 --> 00:14:35,580 .mov. 336 00:14:36,560 --> 00:14:37,440 .mov. 337 00:14:39,980 --> 00:14:40,860 .mov. 338 00:14:41,020 --> 00:14:41,560 .mov. 339 00:14:41,820 --> 00:14:42,300 .mov. 340 00:14:43,120 --> 00:14:44,000 .mov. 341 00:14:48,320 --> 00:14:51,420 So once it's done, you can have an image that looks like this. 342 00:14:52,040 --> 00:14:54,500 So for example, I've got an example right here. 343 00:14:56,400 --> 00:14:58,840 This is the same example we had before. 344 00:15:00,400 --> 00:15:02,820 But this time, if I come in here and do a view image, 345 00:15:03,340 --> 00:15:06,860 notice it still works, but now we're looking at a JPEG. 346 00:15:06,920 --> 00:15:08,400 We're not looking at a... 347 00:15:08,400 --> 00:15:11,740 There's nothing here that would identify this as being active. 348 00:15:14,140 --> 00:15:17,360 It's just a plain old JPEG as far as anyone's concerned. 349 00:15:17,360 --> 00:15:21,020 But in reality, it's a script that's running dynamically. 350 00:15:21,260 --> 00:15:22,120 Yes, question back there. 351 00:15:22,320 --> 00:15:25,200 No, you had a question for somebody in the back of the room. 352 00:15:26,600 --> 00:15:28,000 No problem. No problem. 353 00:15:28,400 --> 00:15:29,980 I can go back there. That'd be fine. 354 00:15:35,860 --> 00:15:36,340 Okay. 355 00:15:36,760 --> 00:15:38,100 So, applications. 356 00:15:40,700 --> 00:15:45,620 These can be used on a lot of Web 2.0 websites, 357 00:15:45,620 --> 00:15:49,860 which are basically sites where the users build the content. 358 00:15:50,160 --> 00:15:51,880 So any place where there's a bulletin board, 359 00:15:52,100 --> 00:15:53,460 any place where there's a message board, 360 00:15:54,060 --> 00:15:56,820 any place where you're allowed to post content, 361 00:15:57,040 --> 00:15:58,960 you can use this kind of image. 362 00:15:59,620 --> 00:16:05,260 So that would include places like Craigslist, eBay, MySpace, Fark. 363 00:16:06,060 --> 00:16:07,720 I haven't found a use for this one yet, 364 00:16:07,720 --> 00:16:09,360 but you can actually do it on PayPal as well. 365 00:16:09,960 --> 00:16:11,980 If you are a PayPal merchant, 366 00:16:12,620 --> 00:16:14,760 you can brand the checkout process 367 00:16:14,760 --> 00:16:15,400 with a... 368 00:16:15,400 --> 00:16:16,360 like a banner image. 369 00:16:16,800 --> 00:16:18,800 That can be a dynamic image as well. 370 00:16:19,260 --> 00:16:21,200 Again, I haven't figured out a use for that yet, 371 00:16:21,260 --> 00:16:22,940 but that is something you can do. 372 00:16:23,020 --> 00:16:23,140 Yes? 373 00:16:23,880 --> 00:16:25,140 Updating the latest bid? 374 00:16:29,200 --> 00:16:30,540 Like on eBay? 375 00:16:37,480 --> 00:16:40,380 Yeah, and I've got some eBay examples I'll show later. 376 00:16:40,860 --> 00:16:41,300 Yeah. 377 00:16:41,740 --> 00:16:42,880 But good, you're thinking. 378 00:16:43,880 --> 00:16:45,140 So when you do something cool, 379 00:16:45,140 --> 00:16:45,960 I want to know about it. 380 00:16:47,220 --> 00:16:49,200 You can also use this technique 381 00:16:49,200 --> 00:16:51,880 in some non-traditional web environments. 382 00:16:52,160 --> 00:16:54,020 You can use it in newsgroups, 383 00:16:54,540 --> 00:16:57,680 because a lot of people use browser-based newsgroup readers. 384 00:16:57,940 --> 00:16:59,160 You can use it in email, 385 00:16:59,460 --> 00:17:00,420 all kinds of cool stuff. 386 00:17:01,540 --> 00:17:03,940 So here's what I started doing. 387 00:17:04,340 --> 00:17:05,920 I would go into MySpace, 388 00:17:06,580 --> 00:17:10,780 and in that area where you can leave people a little love, 389 00:17:10,900 --> 00:17:11,960 send them a little message, 390 00:17:12,640 --> 00:17:14,960 basically you would post your script, 391 00:17:15,140 --> 00:17:15,780 hey, how you doing? 392 00:17:15,840 --> 00:17:16,960 Haven't seen you for a while. 393 00:17:17,360 --> 00:17:18,460 And here's an image. 394 00:17:19,540 --> 00:17:21,320 This is not one of mine, by the way. 395 00:17:21,360 --> 00:17:22,560 I just pulled this off of MySpace. 396 00:17:25,080 --> 00:17:27,240 But you could put a dynamic image here. 397 00:17:27,800 --> 00:17:29,260 And then what happens is 398 00:17:30,300 --> 00:17:32,820 when that person who owns that MySpace account, 399 00:17:32,940 --> 00:17:36,020 when they come in and they're in their home page, 400 00:17:36,440 --> 00:17:38,460 not in their profile, but in their home page, 401 00:17:38,760 --> 00:17:40,320 they look to see, oh, friend requests. 402 00:17:40,500 --> 00:17:40,860 Cool. 403 00:17:41,020 --> 00:17:44,220 They go click on that, or new messages, or new comments. 404 00:17:44,340 --> 00:17:44,920 They click on those. 405 00:17:45,140 --> 00:17:46,860 When they get to the point 406 00:17:46,860 --> 00:17:48,260 where they're looking at your image, 407 00:17:49,280 --> 00:17:54,360 their user ID is exposed in the server HTTP refer. 408 00:17:55,240 --> 00:17:57,440 And in the case of MySpace, that's really cool 409 00:17:57,440 --> 00:18:01,360 because inside their query string, 410 00:18:02,420 --> 00:18:04,900 you've got their friend ID, which is their user ID, 411 00:18:05,180 --> 00:18:09,780 which basically will tell you exactly who they are in MySpace. 412 00:18:10,460 --> 00:18:12,420 And then if you write a cookie to them, 413 00:18:12,660 --> 00:18:14,760 any time they come back to your page, 414 00:18:14,760 --> 00:18:23,840 even if they didn't capture their query string again, 415 00:18:24,120 --> 00:18:26,120 the fact that you wrote a cookie to them, 416 00:18:26,260 --> 00:18:28,380 every time they come back, you're going to know who they are. 417 00:18:28,560 --> 00:18:30,240 So you're going to be able to track them that way. 418 00:18:31,940 --> 00:18:33,640 So here's some fun you can have with MySpace. 419 00:18:34,760 --> 00:18:38,520 You can write an application that shows the viewing habits of all your friends 420 00:18:38,520 --> 00:18:42,120 by sending each one of them a message that contains an executable image. 421 00:18:42,980 --> 00:18:43,420 Okay? 422 00:18:44,760 --> 00:18:46,400 You can capture this information. 423 00:18:46,500 --> 00:18:48,080 Maybe you send it in an email. 424 00:18:48,680 --> 00:18:50,120 And they say, here, look at this image. 425 00:18:50,780 --> 00:18:51,860 And they look at it. 426 00:18:52,220 --> 00:18:53,840 You get their cookie on their browser. 427 00:18:54,180 --> 00:18:59,480 And then when they come to view any of your other dynamic images on MySpace, 428 00:18:59,540 --> 00:19:00,880 you can say, oh, I know this person. 429 00:19:01,040 --> 00:19:02,000 I wrote their cookie. 430 00:19:04,720 --> 00:19:06,960 Here's something else I think would be kind of a fun thing to do. 431 00:19:07,680 --> 00:19:10,740 Once you've got people's IDs and you've written your cookies, 432 00:19:10,940 --> 00:19:14,740 you could show one set of images on MySpace, 433 00:19:14,760 --> 00:19:15,940 to all your MySpace friends, 434 00:19:16,140 --> 00:19:18,220 and another set of images to everybody else, 435 00:19:18,380 --> 00:19:19,340 which would be kind of cool. 436 00:19:22,960 --> 00:19:28,360 You can use these same cookies to track people's movements to other sites, 437 00:19:28,460 --> 00:19:30,540 to, again, like eBay, Craigslist, what have you. 438 00:19:30,720 --> 00:19:33,740 And since your cookies all belong to your domain, 439 00:19:34,920 --> 00:19:36,680 wherever your executable images are, 440 00:19:36,760 --> 00:19:37,900 and they could be multiple images, 441 00:19:38,100 --> 00:19:40,200 but they're all on the same domain, they're on your domain, 442 00:19:40,740 --> 00:19:43,620 your cookies will at least appear to function across domains. 443 00:19:44,760 --> 00:19:45,780 Let me show you what I'm talking about here. 444 00:19:46,900 --> 00:19:50,420 So if you're on eBay, putting your browser on eBay, 445 00:19:50,880 --> 00:19:52,240 eBay's going to write you a cookie. 446 00:19:52,820 --> 00:19:55,980 If you're on MySpace, MySpace is going to write you a cookie. 447 00:19:56,200 --> 00:19:59,620 But the server on eBay and the MySpace server, 448 00:19:59,780 --> 00:20:01,500 they cannot see each other's cookies. 449 00:20:02,720 --> 00:20:05,720 However, if you have an executable image on each one of those, 450 00:20:05,840 --> 00:20:09,900 and they're both coming from your server, one domain, right, 451 00:20:10,040 --> 00:20:13,600 you can say, oh, I wrote you a cookie 452 00:20:13,600 --> 00:20:15,880 when you saw my image on eBay, 453 00:20:16,160 --> 00:20:20,560 and then I see that you're also at my MySpace page. 454 00:20:20,840 --> 00:20:23,100 And I know that's the same person, because I wrote you a cookie. 455 00:20:23,260 --> 00:20:24,400 And I can read that, 456 00:20:24,500 --> 00:20:26,780 even though you picked them up from two different domains. 457 00:20:28,440 --> 00:20:30,800 So this is what's called third-party cookies. 458 00:20:31,120 --> 00:20:33,460 So example, if MySpace writes you a cookie, 459 00:20:33,600 --> 00:20:35,880 and then an advertiser writes you a cookie, 460 00:20:35,980 --> 00:20:39,020 that advertiser's cookie is called a third-party cookie. 461 00:20:39,540 --> 00:20:42,340 Now, you might be saying, you can't do that. 462 00:20:42,940 --> 00:20:44,560 Browsers don't let you do that. 463 00:20:44,640 --> 00:20:45,840 This isn't 1996. 464 00:20:46,800 --> 00:20:48,380 Well, actually, it is 1996. 465 00:20:49,900 --> 00:20:54,740 The default configuration for Firefox enables third-party cookies. 466 00:20:55,000 --> 00:20:57,260 In fact, it's really hard to turn it off. 467 00:20:57,780 --> 00:20:59,700 You can't do it from the tools area. 468 00:20:59,920 --> 00:21:01,160 There's no simple configuration. 469 00:21:01,680 --> 00:21:04,760 What you need to do is you need to type about colon config 470 00:21:04,760 --> 00:21:09,260 in your location bar, and then it's way down. 471 00:21:09,400 --> 00:21:11,140 It's probably like the 200th command. 472 00:21:11,520 --> 00:21:12,320 You need to do that. 473 00:21:12,320 --> 00:21:15,040 You change the network cookie behavior, 474 00:21:15,940 --> 00:21:18,060 the default from zero to one. 475 00:21:18,960 --> 00:21:20,300 Pretty obvious, right? 476 00:21:20,580 --> 00:21:22,660 That's how you turn off third-party cookies. 477 00:21:22,900 --> 00:21:27,140 So obvious to say, most people running Firefox 478 00:21:27,140 --> 00:21:29,180 allow third-party cookies. 479 00:21:30,420 --> 00:21:32,200 With Microsoft, it's even easier. 480 00:21:32,360 --> 00:21:34,940 The default configuration for IE says 481 00:21:35,800 --> 00:21:37,640 it's going to block third-party cookies 482 00:21:37,640 --> 00:21:40,640 that do not have a compact privacy policy. 483 00:21:41,080 --> 00:21:42,120 So all you have to do is, 484 00:21:42,120 --> 00:21:43,300 you have to supply one, okay? 485 00:21:43,580 --> 00:21:45,440 And the way you do that is in your header, 486 00:21:45,920 --> 00:21:47,340 right after you define your MIME type, 487 00:21:47,420 --> 00:21:48,320 you do something like this. 488 00:21:48,500 --> 00:21:50,540 In fact, you could steal somebody's privacy, 489 00:21:50,980 --> 00:21:52,140 compact privacy thing. 490 00:21:52,500 --> 00:21:53,340 Not a big deal. 491 00:21:53,500 --> 00:21:55,580 And if you don't really understand it, 492 00:21:55,620 --> 00:21:58,840 Microsoft will show you how to defeat their own. 493 00:22:01,100 --> 00:22:04,500 So there are some things Microsoft does very, very well. 494 00:22:04,880 --> 00:22:05,900 And this is one of them. 495 00:22:05,960 --> 00:22:06,880 I have to hand it to them. 496 00:22:07,260 --> 00:22:08,960 This is actually a very good reference 497 00:22:08,960 --> 00:22:11,040 if any of you are interested in this kind of stuff. 498 00:22:14,000 --> 00:22:18,900 Okay, some more fun stuff to do with executable images. 499 00:22:19,320 --> 00:22:21,880 You could show high-quality images 500 00:22:21,880 --> 00:22:23,860 to the members of your website, 501 00:22:24,100 --> 00:22:26,060 but people who haven't signed up 502 00:22:26,060 --> 00:22:27,700 are gonna see very poor-quality images. 503 00:22:28,580 --> 00:22:30,980 And this might even have a commercial use. 504 00:22:31,080 --> 00:22:32,960 One of the things I was thinking about doing with this 505 00:22:32,960 --> 00:22:36,980 is selling an image service to museums 506 00:22:36,980 --> 00:22:42,100 because they're very touchy about having their images, 507 00:22:42,100 --> 00:22:43,540 end up on T-shirts and whatnot. 508 00:22:44,380 --> 00:22:46,940 So what you could do is you could have certain sets of people 509 00:22:46,940 --> 00:22:49,560 could be able to see the full images and other people not. 510 00:22:51,360 --> 00:22:54,480 And if you wanted to, you could even watermark those images. 511 00:22:54,820 --> 00:22:56,700 So if they ever did show up someplace, 512 00:22:56,920 --> 00:22:57,860 you would know, oh, wait a minute, 513 00:22:57,940 --> 00:22:59,260 you're a member of our website. 514 00:22:59,520 --> 00:23:00,360 I know who you are. 515 00:23:00,520 --> 00:23:03,380 And you downloaded this image at such and such time 516 00:23:03,380 --> 00:23:04,360 with this IP address. 517 00:23:05,320 --> 00:23:07,780 And we even wrote a cookie to you when you did it. 518 00:23:07,860 --> 00:23:10,060 And now we see this image appearing other places 519 00:23:10,060 --> 00:23:12,080 and we really like you to take it. 520 00:23:12,080 --> 00:23:12,320 Take it off. 521 00:23:15,240 --> 00:23:17,080 This is something that you were kind of referring to 522 00:23:17,080 --> 00:23:17,500 with eBay. 523 00:23:18,040 --> 00:23:19,180 One of the things you could do 524 00:23:19,180 --> 00:23:21,460 is you can have dynamic eBay auctions. 525 00:23:21,620 --> 00:23:23,920 And this is something that eBay would never allow you to do. 526 00:23:24,340 --> 00:23:27,860 But you could actually change the images in your auction 527 00:23:27,860 --> 00:23:29,840 based on events. 528 00:23:31,920 --> 00:23:36,880 Maybe if nobody's bidding on your auction, 529 00:23:37,120 --> 00:23:40,520 maybe you might wanna make your images different. 530 00:23:40,720 --> 00:23:41,480 I don't know what you would do, 531 00:23:41,480 --> 00:23:42,840 but maybe you would change them somehow. 532 00:23:44,440 --> 00:23:45,800 Perhaps you'd change descriptions. 533 00:23:45,980 --> 00:23:48,440 Maybe you've got text in images 534 00:23:48,440 --> 00:23:50,640 and you're changing the text. 535 00:23:53,240 --> 00:23:54,340 Something else you could do, 536 00:23:54,460 --> 00:23:56,560 and this, again, I don't know that this is practical, 537 00:23:56,640 --> 00:23:57,900 but I'm trying to get you guys thinking 538 00:23:57,900 --> 00:23:59,660 about some of the possibilities for this. 539 00:24:00,120 --> 00:24:02,620 You could have an eBay auction set up 540 00:24:02,620 --> 00:24:04,980 and you could have something on Craigslist at the same time. 541 00:24:05,380 --> 00:24:09,420 So if somebody's on Craigslist and they see your stuff 542 00:24:09,420 --> 00:24:11,000 and then they go see your stuff on eBay, 543 00:24:11,180 --> 00:24:11,460 and they go see your stuff on eBay, 544 00:24:11,480 --> 00:24:12,620 you could show them something different. 545 00:24:13,760 --> 00:24:15,640 Something that nobody else would see 546 00:24:15,640 --> 00:24:18,120 if they hadn't previously seen your ad on Craigslist. 547 00:24:18,320 --> 00:24:20,720 Or vice versa, it would work either way. 548 00:24:22,320 --> 00:24:25,220 You could also use this tool to evaluate websites 549 00:24:25,220 --> 00:24:26,600 that you wanna advertise on. 550 00:24:26,700 --> 00:24:28,520 For example, if you're on someplace like FARC 551 00:24:28,520 --> 00:24:32,300 and you wanna find out how many times people download things, 552 00:24:32,480 --> 00:24:34,940 how many unique IP addresses, browsers, 553 00:24:35,280 --> 00:24:36,180 all that kind of stuff. 554 00:24:37,020 --> 00:24:38,740 IP addresses, trying to figure out 555 00:24:38,740 --> 00:24:40,440 what parts of the country people are coming from. 556 00:24:40,700 --> 00:24:41,460 You could do this. 557 00:24:41,480 --> 00:24:42,900 You could do that just by posting a few images 558 00:24:42,900 --> 00:24:44,380 and seeing what happens. 559 00:24:45,780 --> 00:24:49,460 Theoretically, you could also audit results 560 00:24:49,460 --> 00:24:52,040 if you're taking out ads on a place like FARC. 561 00:24:53,800 --> 00:24:56,480 You could also do some non-repudiation with emails. 562 00:24:56,720 --> 00:24:59,740 For example, you could put a executable image 563 00:25:00,280 --> 00:25:03,500 inside of an HTML formatted email 564 00:25:04,240 --> 00:25:06,040 and if somebody reads the email, 565 00:25:06,300 --> 00:25:08,220 you could get an instant message, right? 566 00:25:08,500 --> 00:25:10,040 Because it's a dynamic image. 567 00:25:10,140 --> 00:25:11,460 You can do anything that a program can do. 568 00:25:11,460 --> 00:25:13,620 So if someone says, 569 00:25:13,800 --> 00:25:15,500 no, Mike, I never got your email. 570 00:25:15,740 --> 00:25:16,600 You can say, yeah, you did. 571 00:25:17,020 --> 00:25:18,400 You got it at five o'clock 572 00:25:18,400 --> 00:25:19,860 and I wrote you a cookie to prove it. 573 00:25:20,160 --> 00:25:21,240 It's on your hard disk. 574 00:25:22,040 --> 00:25:24,460 So this is another thing you can do with this kind of stuff. 575 00:25:26,200 --> 00:25:27,680 Something else that would be fun to do, 576 00:25:27,760 --> 00:25:30,220 and again, I have not figured out an application for this, 577 00:25:30,340 --> 00:25:33,240 is to develop expiring images. 578 00:25:33,520 --> 00:25:35,300 Images with an expiration date. 579 00:25:35,900 --> 00:25:37,340 So you throw them up in your server 580 00:25:37,720 --> 00:25:40,320 and after a certain time, they no longer exist. 581 00:25:41,460 --> 00:25:42,440 Or they change. 582 00:25:44,000 --> 00:25:48,160 Or they're dependent on any other kind of event. 583 00:25:48,320 --> 00:25:49,580 Like, when was the first time 584 00:25:49,580 --> 00:25:51,340 that particular person saw that image? 585 00:25:51,600 --> 00:25:53,320 You know, they've got a limited amount of time 586 00:25:53,320 --> 00:25:55,300 to enjoy that image or what have you. 587 00:25:55,360 --> 00:25:58,300 But you can do images with expiration dates on them. 588 00:26:00,020 --> 00:26:01,720 Okay, I've given you some ideas 589 00:26:01,720 --> 00:26:02,820 for what you can do with this. 590 00:26:04,220 --> 00:26:05,620 Here's some things that you can use 591 00:26:05,620 --> 00:26:07,520 to kind of move things along on your own. 592 00:26:08,940 --> 00:26:10,660 Focus on applications where images 593 00:26:10,660 --> 00:26:12,460 can be loaded from your server. 594 00:26:12,800 --> 00:26:13,220 Okay? 595 00:26:13,400 --> 00:26:15,980 And again, the most powerful things you're going to do 596 00:26:15,980 --> 00:26:18,600 are those things where it can happen across domains. 597 00:26:19,200 --> 00:26:21,180 So you've got images on one domain 598 00:26:21,180 --> 00:26:24,740 or that are referred to from one domain, 599 00:26:25,520 --> 00:26:27,180 images that are referred to from another domain, 600 00:26:27,760 --> 00:26:29,820 and start to triangulate that information. 601 00:26:31,340 --> 00:26:32,280 Use cookies. 602 00:26:32,620 --> 00:26:34,040 Use referrer variables. 603 00:26:34,280 --> 00:26:37,880 And also use query strings. 604 00:26:38,940 --> 00:26:40,220 And as I showed you before, 605 00:26:40,280 --> 00:26:40,640 it's very easy to do. 606 00:26:40,640 --> 00:26:42,140 It's very easy to manipulate images. 607 00:26:42,300 --> 00:26:44,760 So if you wanted to do an expiring image 608 00:26:44,760 --> 00:26:46,520 or an image that fades over time 609 00:26:46,520 --> 00:26:47,420 or something like that, 610 00:26:47,540 --> 00:26:49,700 it's very easy to do that kind of stuff 611 00:26:49,700 --> 00:26:52,860 with PHP and the GD library. 612 00:26:54,480 --> 00:26:55,460 Okay, what can you do? 613 00:26:55,800 --> 00:26:56,920 Supposing you've got a website 614 00:26:56,920 --> 00:26:58,680 and you don't want people doing this kind of stuff. 615 00:26:58,800 --> 00:26:59,260 What can you do? 616 00:26:59,620 --> 00:27:00,940 Well, the first thing you should do 617 00:27:00,940 --> 00:27:03,380 is you should watch what you put in your query strings. 618 00:27:04,040 --> 00:27:06,500 Because if you're putting session information, 619 00:27:06,900 --> 00:27:08,120 if that session information 620 00:27:08,740 --> 00:27:10,620 is not also backed up by the query strings, 621 00:27:10,620 --> 00:27:12,280 by information that's in a cookie or something, 622 00:27:12,480 --> 00:27:14,620 you can hijack sessions this way. 623 00:27:14,900 --> 00:27:16,800 Because you've got the query string, right? 624 00:27:17,000 --> 00:27:18,680 So if you just took that query string, 625 00:27:18,740 --> 00:27:19,700 loaded it into a browser, 626 00:27:20,040 --> 00:27:21,620 it suddenly becomes your session. 627 00:27:22,040 --> 00:27:24,080 So be careful what you put in your query strings. 628 00:27:25,580 --> 00:27:26,860 The other safe thing to do 629 00:27:26,860 --> 00:27:28,380 is that if you're going to allow people 630 00:27:28,380 --> 00:27:31,240 to have, you know, upload images 631 00:27:31,240 --> 00:27:32,380 or refer to images, 632 00:27:32,580 --> 00:27:34,440 it's much, much better 633 00:27:34,440 --> 00:27:37,000 to have them upload them to your server. 634 00:27:37,220 --> 00:27:38,280 Because at that point, 635 00:27:38,320 --> 00:27:40,400 you control them and you ensure 636 00:27:40,400 --> 00:27:42,200 the fact that they are indeed static 637 00:27:42,200 --> 00:27:45,400 and that they don't have dynamic content. 638 00:27:45,980 --> 00:27:47,160 The downside is that 639 00:27:47,160 --> 00:27:48,320 it's going to take more server space 640 00:27:48,320 --> 00:27:49,560 and it's going to have more bandwidth 641 00:27:49,560 --> 00:27:50,400 that it's going to use, 642 00:27:50,600 --> 00:27:52,980 but it does remove the executable 643 00:27:52,980 --> 00:27:54,680 from the whole executable image thing. 644 00:27:54,920 --> 00:27:56,260 And it also gives you the opportunity 645 00:27:56,260 --> 00:27:58,680 to scale images and do thumbnails 646 00:27:58,680 --> 00:27:59,440 and stuff like that. 647 00:28:00,620 --> 00:28:02,200 All right, that is it. 648 00:28:02,280 --> 00:28:04,600 As I told you, it's a very simple concept. 649 00:28:04,940 --> 00:28:07,260 If you guys come up with some interesting uses for this, 650 00:28:07,320 --> 00:28:09,060 by all means, shoot me an email. 651 00:28:09,160 --> 00:28:10,180 I'd love to hear it. 652 00:28:10,400 --> 00:28:11,360 So, yeah, you have a question? 653 00:28:18,200 --> 00:28:19,920 There's not a microphone out there, is there? 654 00:28:21,220 --> 00:28:22,980 Okay, talk loud and I'll repeat the question. 655 00:28:30,800 --> 00:28:32,560 Yeah, there's a couple things you can do. 656 00:28:32,920 --> 00:28:34,160 One of the things you can do 657 00:28:34,160 --> 00:28:36,780 is turn off the third-party cookies. 658 00:28:38,540 --> 00:28:39,840 And either you do that 659 00:28:39,840 --> 00:28:40,380 by sitting down and saying, 660 00:28:40,380 --> 00:28:41,400 are you setting your security high 661 00:28:41,400 --> 00:28:43,000 in Internet Explorer? 662 00:28:43,540 --> 00:28:45,860 Or, better yet, don't use Internet Explorer, 663 00:28:46,080 --> 00:28:46,740 use Firefox, 664 00:28:47,420 --> 00:28:48,900 do the about config, 665 00:28:49,260 --> 00:28:50,700 and look for that place 666 00:28:50,700 --> 00:28:54,360 and then change that image behavior 667 00:28:54,360 --> 00:28:55,640 to a one. 668 00:29:05,240 --> 00:29:06,680 That I don't know. 669 00:29:06,840 --> 00:29:07,600 That I don't. 670 00:29:07,660 --> 00:29:09,800 But, you know, if you start doing that kind of stuff, 671 00:29:09,800 --> 00:29:11,220 you're also going to miss out a lot of things. 672 00:29:11,580 --> 00:29:13,620 So, I think it's better to restrict 673 00:29:14,200 --> 00:29:15,940 how cookies are used in your browser. 674 00:29:16,100 --> 00:29:16,760 And then the other thing, 675 00:29:16,900 --> 00:29:17,880 if you're running Norton, 676 00:29:18,520 --> 00:29:19,940 Norton will strip off, 677 00:29:20,440 --> 00:29:22,380 or can be set up to strip off, 678 00:29:23,280 --> 00:29:23,680 referrers. 679 00:29:24,540 --> 00:29:26,320 So, if someone's running Norton 680 00:29:26,320 --> 00:29:27,700 and if it's configured properly, 681 00:29:28,160 --> 00:29:30,400 the MySpace thing that I showed you would never work. 682 00:29:32,220 --> 00:29:32,620 Okay? 683 00:29:33,740 --> 00:29:34,140 Yes? 684 00:29:34,720 --> 00:29:35,120 Yes? 685 00:29:42,020 --> 00:29:44,360 The question was executing something 686 00:29:44,360 --> 00:29:45,980 out of MySQL Lite. 687 00:29:52,560 --> 00:29:53,740 I'm not sure you can do that. 688 00:29:53,840 --> 00:29:55,660 It would have to run on your server 689 00:29:55,660 --> 00:29:58,880 and I don't know that there would be an advantage 690 00:29:58,880 --> 00:30:01,760 of doing MySQL Lite over doing Postgres 691 00:30:01,760 --> 00:30:03,540 or Oracle or anything. 692 00:30:03,820 --> 00:30:04,380 Excuse me? 693 00:30:05,760 --> 00:30:06,320 250K? 694 00:30:08,500 --> 00:30:09,060 Okay. 695 00:30:09,140 --> 00:30:09,780 But, I don't know. 696 00:30:09,780 --> 00:30:12,580 I mean, beyond size and price and what have you, 697 00:30:12,620 --> 00:30:13,200 I don't see it. 698 00:30:17,580 --> 00:30:18,640 MySQL Lite, I don't think, 699 00:30:18,640 --> 00:30:19,660 is a client-side database. 700 00:30:21,120 --> 00:30:22,140 I think it... 701 00:30:22,140 --> 00:30:22,740 Okay. 702 00:30:24,300 --> 00:30:25,240 Now, the cool thing, 703 00:30:25,300 --> 00:30:26,880 and I just kind of brushed on it a little bit, 704 00:30:26,920 --> 00:30:29,020 is the fact that you can run JavaScript in these things. 705 00:30:29,820 --> 00:30:30,380 You know? 706 00:30:30,760 --> 00:30:32,740 And basically, all I did there 707 00:30:32,740 --> 00:30:34,620 is I set up the image the way 708 00:30:34,620 --> 00:30:36,420 I did the other one so that 709 00:30:36,420 --> 00:30:38,780 it would execute the .jpj 710 00:30:38,780 --> 00:30:41,160 or .jp... 711 00:30:41,160 --> 00:30:42,060 Yeah, .jpj. 712 00:30:42,520 --> 00:30:43,000 JPEG. 713 00:30:43,380 --> 00:30:45,160 And it would see it as a script 714 00:30:45,160 --> 00:30:46,920 and instead of putting PHP in there, 715 00:30:47,000 --> 00:30:49,980 I just put a couple of JavaScript open and close tags 716 00:30:49,980 --> 00:30:51,280 and threw up an alert. 717 00:30:51,920 --> 00:30:54,300 But you don't have to do just something simple 718 00:30:54,300 --> 00:30:54,900 like an alert. 719 00:30:55,000 --> 00:30:59,060 Like I said, you could run some really cool AJAX in there. 720 00:30:59,340 --> 00:30:59,760 Yeah? 721 00:31:00,780 --> 00:31:01,260 Yeah. 722 00:31:01,260 --> 00:31:02,500 So, specifically about that, 723 00:31:02,600 --> 00:31:03,620 when you're doing JavaScript, 724 00:31:04,520 --> 00:31:08,000 if you upload that next to your social network, 725 00:31:08,000 --> 00:31:09,500 instead of, like, say, MySpace, 726 00:31:09,720 --> 00:31:11,400 would that JavaScript execute 727 00:31:11,400 --> 00:31:15,640 or execute in the JavaScript sandbox 728 00:31:15,640 --> 00:31:18,140 of MySpace or your server 729 00:31:18,140 --> 00:31:19,660 that the server's actually running? 730 00:31:20,260 --> 00:31:22,340 Well, MySpace won't know about it 731 00:31:22,340 --> 00:31:23,160 because MySpace says, 732 00:31:23,240 --> 00:31:23,800 oh, they're just... 733 00:31:23,800 --> 00:31:24,520 Here's an image. 734 00:31:24,960 --> 00:31:26,820 And then it's your client. 735 00:31:26,880 --> 00:31:29,660 Your browser is going to load that from your server 736 00:31:29,660 --> 00:31:33,420 and it's going to execute the JavaScript on the client. 737 00:31:33,780 --> 00:31:36,640 So, it can't be used for a browser server? 738 00:31:36,900 --> 00:31:37,020 Yeah. 739 00:31:38,100 --> 00:31:38,740 Not so much. 740 00:31:38,860 --> 00:31:39,720 No, no, no. 741 00:31:39,940 --> 00:31:41,100 No, it's not that kind of a thing. 742 00:31:44,560 --> 00:31:44,860 Yes? 743 00:31:47,180 --> 00:31:47,480 Yes? 744 00:32:02,000 --> 00:32:03,700 Well, here, let me show you what... 745 00:32:03,700 --> 00:32:04,260 No. 746 00:32:04,920 --> 00:32:05,220 No. 747 00:32:09,100 --> 00:32:10,200 Let me get back to that. 748 00:32:15,480 --> 00:32:16,360 Oh, I passed it. 749 00:32:22,320 --> 00:32:23,040 Where is it? 750 00:32:25,480 --> 00:32:25,840 Okay. 751 00:32:41,140 --> 00:32:41,760 There it is. 752 00:32:43,580 --> 00:32:44,720 This is really pretty simple. 753 00:32:45,180 --> 00:32:46,200 So, you load the image. 754 00:32:47,160 --> 00:32:48,620 So, basically, if you did this, 755 00:32:48,840 --> 00:32:50,040 you'd have file... 756 00:32:54,120 --> 00:32:55,160 What am I looking for? 757 00:32:56,240 --> 00:32:56,600 View. 758 00:32:56,700 --> 00:32:57,120 There we go. 759 00:33:00,240 --> 00:33:00,820 There we go. 760 00:33:00,880 --> 00:33:01,820 That took long enough. 761 00:33:02,060 --> 00:33:03,560 That's basically all that's in the image. 762 00:33:04,480 --> 00:33:05,900 So, yeah, it would be difficult 763 00:33:05,900 --> 00:33:07,840 to embed this in HTML. 764 00:33:08,000 --> 00:33:10,460 But if you could get people to load the file, 765 00:33:10,680 --> 00:33:12,860 you know, like here's an image for you to look at, 766 00:33:12,960 --> 00:33:13,600 that kind of thing. 767 00:33:13,900 --> 00:33:14,820 Click on the image. 768 00:33:21,440 --> 00:33:22,200 One more time. 769 00:33:32,060 --> 00:33:32,660 I'm sorry. 770 00:33:33,740 --> 00:33:35,300 Get me after the talk 771 00:33:35,300 --> 00:33:37,680 and I'll answer your question. 772 00:33:40,240 --> 00:33:40,620 Yes. 773 00:33:45,360 --> 00:33:45,740 Yes. 774 00:33:50,720 --> 00:33:51,700 Yeah, I think it would. 775 00:33:52,820 --> 00:33:55,160 I think if you turned off JavaScript in your browser, 776 00:33:55,280 --> 00:33:56,120 yeah, it absolutely would. 777 00:33:56,340 --> 00:33:57,900 But, again, most people don't do that 778 00:33:57,900 --> 00:34:00,720 because, you know, how many websites 779 00:34:00,720 --> 00:34:03,260 could you really use now if you turned off JavaScript? 780 00:34:04,020 --> 00:34:05,640 You know, especially with all the Ajax 781 00:34:05,640 --> 00:34:07,860 and the dynamic HTML and stuff that's going on. 782 00:34:08,000 --> 00:34:11,440 So, you could do that, but very, very few people will. 783 00:34:13,940 --> 00:34:14,580 Anybody else? 784 00:34:15,480 --> 00:34:15,880 Yes. 785 00:34:18,040 --> 00:34:18,440 No. 786 00:34:19,680 --> 00:34:20,500 What would that do? 787 00:34:24,380 --> 00:34:24,960 You could. 788 00:34:25,040 --> 00:34:25,200 Yeah. 789 00:34:25,300 --> 00:34:25,720 I mean, absolutely. 790 00:34:25,920 --> 00:34:29,000 You could probably do some interesting things that way. 791 00:34:29,060 --> 00:34:29,340 Absolutely. 792 00:34:29,520 --> 00:34:29,760 Yeah. 793 00:34:30,820 --> 00:34:31,820 That's an interesting point. 794 00:34:32,780 --> 00:34:33,820 So, do one. 795 00:34:33,960 --> 00:34:34,860 Send me an email. 796 00:34:35,560 --> 00:34:36,380 I'm going to see it work. 797 00:34:36,740 --> 00:34:37,980 The one thing that you can't do, 798 00:34:37,980 --> 00:34:41,220 is you cannot start an image, 799 00:34:42,620 --> 00:34:43,480 prematurely end it, 800 00:34:44,040 --> 00:34:45,260 insert a bunch of stuff, 801 00:34:45,540 --> 00:34:47,440 and then complete the old image, you know? 802 00:34:47,700 --> 00:34:49,320 Like, so you're kind of like inserting stuff 803 00:34:49,320 --> 00:34:51,680 in the middle of an image, you know what I mean? 804 00:34:52,040 --> 00:34:54,040 So, like, if you've got an image you want to show, 805 00:34:54,560 --> 00:34:56,080 and it goes off and grabs it, 806 00:34:56,940 --> 00:34:59,280 you prematurely end it, insert a bunch of stuff, 807 00:34:59,760 --> 00:35:02,120 and then start another image and have it all interpreted, 808 00:35:02,300 --> 00:35:03,140 that will not work. 809 00:35:03,400 --> 00:35:05,360 And the reason that won't work is because 810 00:35:05,880 --> 00:35:07,180 that's not the way browsers work. 811 00:35:07,680 --> 00:35:08,980 Browsers download the page, 812 00:35:09,180 --> 00:35:11,400 they figure out all the media that they need to load, 813 00:35:11,580 --> 00:35:13,020 they figure out what they've got in cache, 814 00:35:13,380 --> 00:35:15,000 and then they load the individual files. 815 00:35:15,200 --> 00:35:15,980 So that would not work. 816 00:35:16,720 --> 00:35:18,100 And that was something I was thinking about. 817 00:35:18,140 --> 00:35:19,200 Gee, how could you get that to work? 818 00:35:19,260 --> 00:35:22,100 Could you insert things in the middle of images? 819 00:35:22,220 --> 00:35:23,860 But no, I don't believe you can. 820 00:35:24,780 --> 00:35:25,800 I don't think that would work. 821 00:35:25,900 --> 00:35:26,060 Yeah. 822 00:35:28,000 --> 00:35:28,320 . 823 00:35:33,200 --> 00:35:33,520 . 824 00:35:38,460 --> 00:35:38,740 . 825 00:35:40,260 --> 00:35:40,540 . 826 00:35:40,940 --> 00:35:41,220 . 827 00:35:41,220 --> 00:35:41,420 . 828 00:35:42,900 --> 00:35:43,180 . 829 00:35:43,560 --> 00:35:43,840 . 830 00:35:46,980 --> 00:35:47,260 . 831 00:35:47,260 --> 00:35:47,280 . 832 00:35:47,280 --> 00:35:47,500 . 833 00:35:47,500 --> 00:35:47,520 . 834 00:35:47,520 --> 00:35:47,540 . 835 00:35:47,540 --> 00:35:47,560 . 836 00:35:47,560 --> 00:35:47,580 . 837 00:35:47,580 --> 00:35:48,000 . 838 00:35:48,000 --> 00:35:48,040 . 839 00:35:48,040 --> 00:35:48,160 . 840 00:35:48,160 --> 00:35:48,180 . 841 00:35:48,180 --> 00:35:48,320 . 842 00:35:48,320 --> 00:35:48,460 . 843 00:35:48,460 --> 00:35:48,520 . 844 00:36:07,920 --> 00:36:09,000 Yep, yep. 845 00:36:09,060 --> 00:36:11,460 That would be another way of doing the same thing. 846 00:36:11,600 --> 00:36:12,160 Absolutely. 847 00:36:13,460 --> 00:36:14,020 Yes? 848 00:36:21,400 --> 00:36:23,780 I don't think so. 849 00:36:25,020 --> 00:36:30,040 You know, some of the things you can do is in the header, 850 00:36:30,140 --> 00:36:34,540 well, from the standpoint of the person creating the image, 851 00:36:35,100 --> 00:36:37,380 there are things that you can do in the header, 852 00:36:37,480 --> 00:36:38,680 like with dates and stuff, 853 00:36:38,860 --> 00:36:40,800 that it'll always say, okay, I've got to fetch this. 854 00:36:41,800 --> 00:36:45,320 From the standpoint of a client having these things saved in cache, 855 00:36:46,180 --> 00:36:47,920 I don't see any danger in that 856 00:36:47,920 --> 00:36:49,440 because by the time they end up in your cache, 857 00:36:49,640 --> 00:36:50,540 they're no longer dynamic. 858 00:36:51,380 --> 00:36:52,260 They're dead. 859 00:36:52,400 --> 00:36:53,720 They're static at that point. 860 00:36:55,440 --> 00:36:57,260 So they're only dynamic when they're downloaded. 861 00:36:57,340 --> 00:36:59,320 After that, just an image. 862 00:37:02,280 --> 00:37:02,960 Anybody else? 863 00:37:05,560 --> 00:37:06,200 Yes? 864 00:37:09,800 --> 00:37:12,960 Well, cookies will not work across browsers. 865 00:37:13,580 --> 00:37:15,800 So if you save a cookie on Firefox 866 00:37:15,800 --> 00:37:19,720 and someone comes and downloads the same page with Internet Explorer, 867 00:37:19,960 --> 00:37:21,460 those cookies are not interoperable. 868 00:37:22,000 --> 00:37:23,260 They're in different places. 869 00:37:24,840 --> 00:37:29,160 So it'll work with a wide variety of browsers, 870 00:37:29,980 --> 00:37:32,840 but it won't happen cross-browser, 871 00:37:32,940 --> 00:37:33,940 if that's what your question is. 872 00:37:34,740 --> 00:37:37,460 But it's worked in every browser I've tried with the default settings. 873 00:37:38,020 --> 00:37:38,460 Sure. 874 00:37:44,740 --> 00:37:45,940 Oh, yeah, yeah. 875 00:37:46,100 --> 00:37:48,660 The only time I've had a problem with that is 876 00:37:49,100 --> 00:37:51,220 I had a problem once a long time ago. 877 00:37:51,300 --> 00:37:55,040 I don't know if they fixed this or if it was not intended to be fixed. 878 00:37:56,200 --> 00:38:00,600 But at one point, I had to run Apache on IIS. 879 00:38:01,400 --> 00:38:04,180 And they have a problem with something called dual parsed headers. 880 00:38:04,540 --> 00:38:07,680 Where if you send, like with Apache, 881 00:38:07,980 --> 00:38:10,400 you can pretty much sit there and send out headers all day long 882 00:38:10,400 --> 00:38:14,380 before you send out the first actual HTML. 883 00:38:15,580 --> 00:38:20,000 For a while, IIS, I, I, excuse me. 884 00:38:21,800 --> 00:38:26,320 Yeah, I was running, excuse me, I was running PHP on IIS, not Apache. 885 00:38:26,540 --> 00:38:27,160 That doesn't make sense. 886 00:38:28,140 --> 00:38:30,860 And IIS would not allow you to do that 887 00:38:30,860 --> 00:38:32,980 because it's this dual parsed header thing. 888 00:38:33,160 --> 00:38:34,220 And they reserved. 889 00:38:34,220 --> 00:38:35,900 They reserved that for their own web server. 890 00:38:36,040 --> 00:38:42,180 So you could only do it on, at that time it was NT4. 891 00:38:42,760 --> 00:38:47,520 You could only run dual parsed headers with PHP 892 00:38:48,340 --> 00:38:54,660 if you were running it on, excuse me, I'm getting confused here. 893 00:38:54,800 --> 00:38:57,440 It was one of those intentional bugs that Microsoft put in 894 00:38:57,440 --> 00:39:01,400 so you'd have to use ASP as opposed to PHP. 895 00:39:01,820 --> 00:39:03,280 At least that's how I interpreted it. 896 00:39:05,400 --> 00:39:06,820 But that was a long time ago. 897 00:39:06,860 --> 00:39:07,760 I can hardly remember that. 898 00:39:08,420 --> 00:39:10,860 I'm, I'm surprised I remember dual parsed headers. 899 00:39:12,420 --> 00:39:13,200 Anything else? 900 00:39:15,500 --> 00:39:16,600 Well, thank you very much. 901 00:39:16,620 --> 00:39:17,120 I appreciate it.