1 00:00:00,320 --> 00:00:04,300 So I'm here to talk about active HTTPS cookie hijacking. 2 00:00:06,020 --> 00:00:07,560 First of all, who am I? 3 00:00:07,640 --> 00:00:08,280 What do I do? 4 00:00:08,760 --> 00:00:10,060 I'm a volunteer Tor developer. 5 00:00:10,520 --> 00:00:15,800 I work on the latest Tor button release for secure Tor toggling and isolation of cookies 6 00:00:15,800 --> 00:00:20,920 and all that stuff, and a set of Tor scanners and libraries for monitoring Tor performance 7 00:00:20,920 --> 00:00:21,460 and scanning. 8 00:00:21,480 --> 00:00:22,880 There's a node called Torflow. 9 00:00:23,560 --> 00:00:26,420 General privacy advocate, censorship opponent. 10 00:00:26,420 --> 00:00:32,140 My day job is being a forward and reverse engineer for a network acceleration company 11 00:00:32,140 --> 00:00:32,920 called Riverbed. 12 00:00:33,060 --> 00:00:34,820 We make awesome network acceleration gear. 13 00:00:36,320 --> 00:00:40,720 I'm also a flexitarian, which means it's sort of like a step below vegetarian. 14 00:00:41,120 --> 00:00:44,980 Absolutely no meat unless it's free range or particularly delicious. 15 00:00:46,880 --> 00:00:52,480 Now the problem is I've had a lot more success converting vegetarians to flexitarianism than 16 00:00:52,480 --> 00:00:54,180 normals to flexitarianism. 17 00:00:54,300 --> 00:00:56,240 So I don't know if I'm not positive yet. 18 00:00:56,240 --> 00:00:56,800 But maybe. 19 00:00:57,000 --> 00:00:57,780 Maybe someday. 20 00:00:59,100 --> 00:01:00,360 I'm also a random hacker. 21 00:01:00,420 --> 00:01:03,740 I do all sorts of random stuff as the mood strikes me. 22 00:01:03,900 --> 00:01:06,480 I've got an IRC bot that passed the Turing test. 23 00:01:06,720 --> 00:01:09,960 It was quoted as a human in a magazine, a human consultant. 24 00:01:10,320 --> 00:01:11,560 So that was pretty good. 25 00:01:13,200 --> 00:01:14,200 So what am I doing? 26 00:01:14,340 --> 00:01:15,000 Why am I doing this? 27 00:01:15,560 --> 00:01:21,020 So in about two weeks, I'll be releasing code that can steal insecure HTTPS cookies. 28 00:01:21,900 --> 00:01:26,000 I actually announced this to BugTrack a year ago and notified Google. 29 00:01:27,860 --> 00:01:32,500 And there's been almost no action on it from pretty much any website for the past year. 30 00:01:32,900 --> 00:01:37,980 And the vector can be done from more than just local Wi-Fi networks. 31 00:01:38,100 --> 00:01:42,320 You can leverage Dan Kaminski's DNS hijacking attack and a whole bunch of other vectors 32 00:01:42,320 --> 00:01:43,700 as well, which we'll get into later. 33 00:01:44,700 --> 00:01:46,100 And a whole bunch of sites are vulnerable. 34 00:01:46,300 --> 00:01:50,660 They think that maybe they do development via HTTP and they slap HTTPS on later. 35 00:01:50,940 --> 00:01:53,420 And so they just don't set the bits on the cookies for convenience. 36 00:01:55,180 --> 00:01:55,980 So the response has been pretty good. 37 00:01:56,000 --> 00:02:00,420 The response is to try and raise awareness to release a fully automated tool that shows 38 00:02:00,420 --> 00:02:05,360 just how dangerous this is, not setting the secure bit on these cookies. 39 00:02:05,660 --> 00:02:11,060 And it's a very easy fix, just basically setting a property on a cookie to cause it 40 00:02:11,060 --> 00:02:11,660 not to be transmitted. 41 00:02:12,280 --> 00:02:14,180 So let's go back to the basics then. 42 00:02:14,300 --> 00:02:15,320 Why does this work? 43 00:02:15,420 --> 00:02:16,520 Or what is a cookie? 44 00:02:16,640 --> 00:02:17,160 How does it work? 45 00:02:17,740 --> 00:02:21,360 So obviously, they're used for authentication and tracking in your web browser. 46 00:02:21,620 --> 00:02:24,080 They're basically a variable that gets set by a website. 47 00:02:24,620 --> 00:02:25,980 There are a few cases. 48 00:02:25,980 --> 00:02:29,200 There are a few key properties that they have and that govern when they're transmitted. 49 00:02:29,600 --> 00:02:36,200 And that is they have a domain, a path, which they're only transmitted for sites that match 50 00:02:36,200 --> 00:02:36,900 the domain and path. 51 00:02:37,100 --> 00:02:38,040 And they have an expiration time. 52 00:02:38,260 --> 00:02:41,960 And then the secure bit, the SSL bit, which is what's of interest here. 53 00:02:44,420 --> 00:02:50,320 So last year, my announcement was sort of overshadowed by Robert Graham's hijacking 54 00:02:50,320 --> 00:02:51,980 attack announcement at DEF CON. 55 00:02:52,500 --> 00:02:53,940 Or Black Hat, I'm sorry. 56 00:02:55,980 --> 00:02:56,180 What was that? 57 00:02:56,220 --> 00:03:02,380 Basically, it was a glorified sniffer that just passively captured cookies to non-SSL 58 00:03:02,380 --> 00:03:05,320 websites that people were visiting on the local network. 59 00:03:05,600 --> 00:03:12,900 And he had a janky proxy-based interface for that, for doing that cookie setting and interception. 60 00:03:13,600 --> 00:03:17,900 And he did try to save path info, but it was a little bit too specific in some cases, 61 00:03:17,920 --> 00:03:18,840 and that could lead to issues. 62 00:03:19,140 --> 00:03:23,980 But he did manage to raise the alarm pretty good for at least that issue, the lack of 63 00:03:23,980 --> 00:03:25,360 SSL and how dangerous that is. 64 00:03:25,420 --> 00:03:25,960 So I'm happy with that. 65 00:03:25,980 --> 00:03:31,360 I'm hoping to try and do the same here and encourage sites to actually set this property. 66 00:03:31,920 --> 00:03:34,420 So let's take that attack a step further. 67 00:03:34,920 --> 00:03:39,880 If you want to grab arbitrary cookies from somebody without them actually visiting a 68 00:03:39,880 --> 00:03:45,200 site, basically the scenario is a user logs into a site that's not secure. 69 00:03:46,520 --> 00:03:54,700 Sometime in the past, they set the Remember Me flag, and then the local attacker can then 70 00:03:54,700 --> 00:03:55,960 inject arbitrary cookies. 71 00:03:55,960 --> 00:03:56,500 And they inject them into a page that's not secure. 72 00:03:56,500 --> 00:03:57,340 It's called an auxiliary content element, something that's an arbitrary content element, 73 00:03:57,480 --> 00:04:03,220 like images or iframes or what have you, that will cause the browser to transmit any 74 00:04:03,220 --> 00:04:06,820 cookies that it has for that domain. 75 00:04:07,080 --> 00:04:12,040 So in this case, injecting an image source for Yahoo into a page will cause the browser, 76 00:04:12,160 --> 00:04:14,700 of course, to transmit the cookies for Yahoo. 77 00:04:14,700 --> 00:04:22,300 It's sort of the common name for this is cross-site request forgery, but we don't really care 78 00:04:22,300 --> 00:04:24,960 about performing any particular action on the server in this case. 79 00:04:25,060 --> 00:04:28,920 We just want to cause the client to transmit its cookies, its authentication tokens. 80 00:04:29,240 --> 00:04:31,900 We don't care if the request succeeds or not at the server. 81 00:04:31,980 --> 00:04:35,020 It doesn't really matter if the actual URL is valid or an image or anything. 82 00:04:38,160 --> 00:04:44,700 You can then save these cookies and write them to a Firefox-compatible cookies.txt file. 83 00:04:45,660 --> 00:04:49,120 How does this HTTPS cookie hijacking thing work? 84 00:04:50,440 --> 00:04:51,640 It's very similar. 85 00:04:51,900 --> 00:04:59,320 Yesterday, instead of logging into the insecure service, they log into the secure service, 86 00:05:00,480 --> 00:05:02,400 HTTPSmail.google.com, for example. 87 00:05:04,000 --> 00:05:11,800 Then, with that cookie set to be persistent, later they log into www.cnn.com, for example, 88 00:05:11,960 --> 00:05:14,220 on an insecure network with a malicious attacker. 89 00:05:14,540 --> 00:05:16,280 We'll get into exactly what that is. 90 00:05:16,360 --> 00:05:20,040 It turns out basically every network is a malicious network as far as this attack is concerned. 91 00:05:23,540 --> 00:05:30,100 The attacker then can inject the same image source, but this time without the HTTPS, just 92 00:05:30,100 --> 00:05:30,620 HTTP. 93 00:05:30,620 --> 00:05:36,020 Because the SSL-only property is not set on these cookies, they just get transmitted, 94 00:05:36,160 --> 00:05:38,140 and then the attacker can observe and then record them. 95 00:05:39,600 --> 00:05:44,440 Then you can write them out to a Firefox-compatible cookies.txt and load that into your browser 96 00:05:44,440 --> 00:05:46,000 and impersonate that user. 97 00:05:46,300 --> 00:05:51,480 If you're on the local network, some sites will have, only allow me to connect from this 98 00:05:51,480 --> 00:05:51,980 IP address. 99 00:05:52,160 --> 00:05:56,320 If you're on the local network, you can spoof that IP address, borrow their MAC, impersonate 100 00:05:56,320 --> 00:05:57,820 them, write on their connection. 101 00:05:59,360 --> 00:06:00,600 Or, if it's behind you, you can do that. 102 00:06:00,620 --> 00:06:04,780 The NAT, the IP is the same, so you're still able to impersonate them fully. 103 00:06:06,540 --> 00:06:11,780 The key point here is the user doesn't even have to be using whatever service that they 104 00:06:12,340 --> 00:06:14,760 log into via the hostile network. 105 00:06:15,420 --> 00:06:16,920 How did we go all the way up there? 106 00:06:19,020 --> 00:06:25,100 As I said before, this is not just a problem with open wireless networks. 107 00:06:25,800 --> 00:06:27,020 There's tons of vectors for this. 108 00:06:27,120 --> 00:06:30,580 You can do, of course, the ARP poisoning attack, ARP spoofing attack. 109 00:06:30,620 --> 00:06:40,020 You can do the DHCP server exhaustion, where you request all the leases from a DHCP server 110 00:06:40,020 --> 00:06:43,300 so that it runs out, stops answering, and then you start answering for it. 111 00:06:43,440 --> 00:06:46,340 So then you say, oh, the gateway's over here, route everything through me, please. 112 00:06:46,560 --> 00:06:47,740 And then you can do this attack. 113 00:06:48,380 --> 00:06:50,400 Dan Kaminski's DNS hijacking attack. 114 00:06:51,400 --> 00:06:58,540 I believe he said that somewhere between 30 to 40% of the DNS servers out there still 115 00:06:58,540 --> 00:07:00,600 have a DNS hijacking attack. 116 00:07:00,620 --> 00:07:01,640 I'm not sure if that's true. 117 00:07:01,640 --> 00:07:03,840 And then you can do a fix source port so that his attack can still work. 118 00:07:03,940 --> 00:07:06,060 And that was the estimate of a few days ago. 119 00:07:06,120 --> 00:07:07,620 He may have been scanning continuously more. 120 00:07:07,920 --> 00:07:10,620 I've heard higher estimates from other people, significantly higher. 121 00:07:12,300 --> 00:07:18,740 So the other thing is we saw a couple of cable modem talks yesterday, where they were able 122 00:07:18,740 --> 00:07:19,840 to read the down... 123 00:07:19,840 --> 00:07:24,420 Sniff the downstream traffic and inject traffic into there. 124 00:07:25,000 --> 00:07:29,080 This attack really needs upstream to be able to capture the client, the cookies sent by 125 00:07:29,080 --> 00:07:29,440 the client. 126 00:07:29,440 --> 00:07:34,080 So the attacker sort of needs a custom cable modem that they've hacked to be able to read, 127 00:07:34,240 --> 00:07:36,360 capture the upstream frequencies as well. 128 00:07:36,560 --> 00:07:40,260 So at this point, without a hardware hack, it might not be possible. 129 00:07:40,380 --> 00:07:44,160 But still, a sophisticated attacker can potentially hack their modem to do this. 130 00:07:44,780 --> 00:07:46,900 And there is DOCSIS encryption, but it's weak. 131 00:07:46,960 --> 00:07:47,700 It's 56-bit. 132 00:07:47,860 --> 00:07:51,660 So I think that can be cracked, if it's even enabled. 133 00:07:53,580 --> 00:07:57,640 So how is this attack executed without sophistication? 134 00:07:58,080 --> 00:07:59,420 There's this utility error. 135 00:07:59,440 --> 00:08:03,280 It's called AirPoon, which I pronounce Poon because there's no O in Poon. 136 00:08:03,640 --> 00:08:07,920 And I figure Poon is just a little bit more dirty or dirty enough to be a little shocking. 137 00:08:08,220 --> 00:08:09,520 So it's pretty quality. 138 00:08:10,200 --> 00:08:12,300 But probably nobody's going to adopt that anyways. 139 00:08:13,200 --> 00:08:18,740 So you basically can use this tool and could inject these elements for your target domain 140 00:08:18,740 --> 00:08:24,540 and then use Wireshark as a script to grab those cookies and then write them out manually. 141 00:08:26,320 --> 00:08:28,220 Wireshark has a scriptable interface. 142 00:08:28,400 --> 00:08:29,420 It used to be called tetherroot.com. 143 00:08:29,420 --> 00:08:33,420 It's probably called T-Wireshark now, basically shell scripting type stuff. 144 00:08:35,940 --> 00:08:38,420 So what is this utility that I'm going to be releasing? 145 00:08:38,760 --> 00:08:40,700 It's a fully automated PyLoricon tool. 146 00:08:41,940 --> 00:08:44,140 It basically caches DNS responses. 147 00:08:44,380 --> 00:08:48,320 So you see a DNS request for a particular domain. 148 00:08:48,500 --> 00:08:49,280 You cache that name. 149 00:08:49,520 --> 00:08:54,300 And then you listen for SSL connections to port 443 for an IP. 150 00:08:54,540 --> 00:08:57,060 You look up in your cache DNS table, what was the domain for that? 151 00:08:57,260 --> 00:08:57,820 And you say, oh. 152 00:08:57,820 --> 00:09:01,740 Here is the domain for this IP. 153 00:09:02,580 --> 00:09:03,420 That's a target. 154 00:09:03,540 --> 00:09:05,060 I want to inject that into that user later. 155 00:09:05,920 --> 00:09:07,660 So you store it into a queue for injection. 156 00:09:08,300 --> 00:09:14,220 And the next time that target IP connects to any HTTP website, CNN or whatever, then 157 00:09:14,220 --> 00:09:21,140 you inject this DNS name into that stream and cause them to transmit their cookies. 158 00:09:21,240 --> 00:09:22,280 So it can be fully automated. 159 00:09:23,160 --> 00:09:27,800 And then the tool will write any resulting cookies out to a client. 160 00:09:27,820 --> 00:09:30,020 And then it will send you a cookies.txt file that you can use in Firefox 2. 161 00:09:30,220 --> 00:09:32,000 I haven't done Firefox 3 support yet. 162 00:09:32,100 --> 00:09:32,980 It's SQLite. 163 00:09:33,060 --> 00:09:34,420 There are Python libraries for that. 164 00:09:34,500 --> 00:09:35,480 I just haven't gotten to it yet. 165 00:09:37,460 --> 00:09:37,820 OK. 166 00:09:37,940 --> 00:09:39,720 So there is a little bit of configuration now. 167 00:09:39,920 --> 00:09:42,760 It's not 100% automatable. 168 00:09:42,800 --> 00:09:43,380 But it is close. 169 00:09:44,420 --> 00:09:48,180 So you need the path for it to be able to entice sites to transmit if they have a path 170 00:09:48,180 --> 00:09:51,660 restriction, like mail.google.com has the path restriction set. 171 00:09:52,340 --> 00:09:53,580 But that's not a problem. 172 00:09:53,760 --> 00:09:55,680 I mean, that's the same for every site. 173 00:09:55,780 --> 00:09:57,800 So you can just have a table of common sites. 174 00:09:57,820 --> 00:10:01,940 sites. You might also want to steal arbitrary 175 00:10:02,280 --> 00:10:06,780 cookies for non-SSL sites as well. You can provide a target list for that, so 176 00:10:06,780 --> 00:10:10,160 I want to always grab Facebook cookies or whatever in addition to any other injection. 177 00:10:12,900 --> 00:10:17,040 So Cookie Monster's been doing without cookies for quite a while. 178 00:10:17,280 --> 00:10:21,100 So they've been starting to feed him fruit. So cookies are sometimes food, you know. 179 00:10:21,200 --> 00:10:25,760 So he's getting pretty pissed off. So I think we need to feed him some cookies. 180 00:10:25,760 --> 00:10:37,280 Now, let's see. So the first target. So I've been mentioning, well, let's just 181 00:10:37,280 --> 00:10:41,700 do this first one. I've been mentioning mail.google.com as a target. 182 00:10:42,800 --> 00:10:53,660 Interestingly enough, damn it. Oh, this is not that important. I don't know 183 00:10:53,660 --> 00:10:55,180 if I can change the font size. 184 00:11:15,280 --> 00:11:19,420 So I'm just running the tool. It has some command-line arguments. It's probably good 185 00:11:19,420 --> 00:11:22,440 that I'm, that you can't see the font because it has a web key on there that I don't want 186 00:11:22,440 --> 00:11:23,620 people injecting stuff into. 187 00:11:24,620 --> 00:11:25,740 So it's just. . . I'm just trying to show you why some people are injecting stuff into. 188 00:11:25,740 --> 00:11:28,480 Just running the tool from this command line, it has a few arguments to say the interface, 189 00:11:28,600 --> 00:11:31,240 the key, and MAC address that you want to watch. 190 00:11:31,880 --> 00:11:36,680 So now I'm going to go over and hit addons.mozilla.org. 191 00:11:36,900 --> 00:11:44,320 Now addons.mozilla.org has a feature where you can, if you're an add-on developer, you 192 00:11:44,320 --> 00:11:45,780 can be a trusted add-on developer. 193 00:11:46,160 --> 00:11:52,380 And now what this does is allows you to upload add-ons and have them instantly be propagated 194 00:11:52,380 --> 00:11:56,180 to all the users that have subscribed to that particular add-on. 195 00:11:56,400 --> 00:12:00,420 So if there's a vulnerability in this site, and you can capture the cookies of somebody, 196 00:12:00,580 --> 00:12:03,720 you can potentially cause a whole bunch of users to install malicious Firefox extensions 197 00:12:04,300 --> 00:12:08,820 that then go on themselves, have full access to your system, they can run arbitrary code, 198 00:12:09,100 --> 00:12:12,420 and then when the update comes to try and revert it, they're already running other malware. 199 00:12:12,960 --> 00:12:17,700 So the DEF CON network has not been the greatest, but at this point I already have enough information 200 00:12:17,700 --> 00:12:22,360 to be able to inject the content element if the network will hold up for the success of 201 00:12:22,380 --> 00:12:23,380 the next request. 202 00:12:26,160 --> 00:12:27,680 So let's see here. 203 00:12:27,920 --> 00:12:28,740 Let me double check here. 204 00:12:38,180 --> 00:12:39,500 So now I'm going to go to CNN. 205 00:12:41,360 --> 00:12:43,660 And note there was a quick little refresh. 206 00:12:45,300 --> 00:12:51,280 It transferred some data from addons.mozilla.org, and then the page loads CNN as normal. 207 00:12:51,280 --> 00:12:54,480 Now, successive reloads of this user might be like, well, that was kind of weird. 208 00:12:54,600 --> 00:12:56,200 I had a little white page for a little while there. 209 00:12:56,240 --> 00:12:56,880 What the hell was that? 210 00:12:57,300 --> 00:13:00,900 You know, they hit reload, and the tool has noted that it's already captured the cookies, 211 00:13:01,020 --> 00:13:06,040 so the second time around, it doesn't inject the white screen. 212 00:13:06,940 --> 00:13:14,840 So now I'm going to copy these cookies over to my Firefox profile. 213 00:13:16,100 --> 00:13:18,780 So I guess I could try and do a K term so I could show you that. 214 00:13:19,800 --> 00:13:20,400 What is it? 215 00:13:20,400 --> 00:13:21,080 Okay, console. 216 00:13:24,100 --> 00:13:26,380 I'll show you that there's nothing up my sleeve here. 217 00:13:26,680 --> 00:13:29,660 If I can change the font, what are we doing on time? 218 00:13:44,460 --> 00:13:45,220 Which one? 219 00:13:45,340 --> 00:13:45,680 How's that? 220 00:13:46,340 --> 00:13:47,280 There, there, there? 221 00:13:48,320 --> 00:13:48,700 Eighteen. 222 00:13:48,840 --> 00:13:49,220 Eighteen. 223 00:13:49,320 --> 00:13:49,540 All right. 224 00:13:52,840 --> 00:13:54,640 So here's the profile that I'm going to use. 225 00:13:55,500 --> 00:13:58,060 There is no cookies.txt here. 226 00:13:58,220 --> 00:14:02,820 I'm going to copy it over from the file that I just created. 227 00:14:04,720 --> 00:14:05,120 What? 228 00:14:05,340 --> 00:14:05,660 Oh, wait. 229 00:14:06,200 --> 00:14:06,980 Oh, there's a cookie. 230 00:14:07,120 --> 00:14:07,280 Whoops. 231 00:14:07,500 --> 00:14:07,900 Less. 232 00:14:09,260 --> 00:14:10,040 Check the sleeve. 233 00:14:10,740 --> 00:14:11,540 No, it's empty. 234 00:14:12,160 --> 00:14:14,300 And there's this sketchiness. 235 00:14:14,360 --> 00:14:16,660 We'll get rid of that just so you know that I'm not screwing around with that. 236 00:14:17,560 --> 00:14:18,120 All right. 237 00:14:18,200 --> 00:14:18,820 All right. 238 00:14:19,040 --> 00:14:19,440 All right. 239 00:14:21,880 --> 00:14:22,320 Let's check the cookies. 240 00:14:22,320 --> 00:14:22,980 Copy cookies. 241 00:14:25,060 --> 00:14:26,920 So here's the cookies file. 242 00:14:31,300 --> 00:14:33,040 Less cookies.txt. 243 00:14:33,260 --> 00:14:35,380 And here is all the cookies that have been written out. 244 00:14:37,720 --> 00:14:40,240 Now we'll fire up a different browser. 245 00:14:42,140 --> 00:14:47,200 I guess there could be tons of things up my sleeve still, so you just have to trust me 246 00:14:47,200 --> 00:14:48,340 and check the tool in a couple weeks. 247 00:14:48,940 --> 00:14:49,980 So now we'll hit... 248 00:14:49,980 --> 00:14:53,380 In this other browser, which is a different profile, it has Tor button installed. 249 00:14:53,580 --> 00:14:54,320 This one doesn't. 250 00:14:55,900 --> 00:14:57,720 Hit addons.mozilla.org. 251 00:15:02,880 --> 00:15:05,000 And now I'm still logged in. 252 00:15:05,140 --> 00:15:06,420 So there's the developer tools. 253 00:15:06,600 --> 00:15:09,120 I can go and potentially upload a malicious extension. 254 00:15:11,600 --> 00:15:13,840 The same thing is applicable to Gmail. 255 00:15:14,040 --> 00:15:19,960 However, about 20 minutes before the talk, they changed how the cookie headers were being 256 00:15:19,960 --> 00:15:20,200 transmitted. 257 00:15:20,860 --> 00:15:22,340 And the tool stopped working. 258 00:15:24,740 --> 00:15:26,580 So that was a little strange. 259 00:15:26,880 --> 00:15:28,740 I mean, it could have been me doing something retarded. 260 00:15:28,800 --> 00:15:30,800 I was trying to do a couple of last-minute changes. 261 00:15:31,480 --> 00:15:35,680 But it sure looks like the cookie header is being transmitted in a way that wouldn't 262 00:15:35,680 --> 00:15:36,600 normally be... 263 00:15:36,600 --> 00:15:38,700 You know, it's truncated, basically. 264 00:15:38,900 --> 00:15:40,780 The HTTP header is not long enough to include it. 265 00:15:42,680 --> 00:15:44,040 So let's see here. 266 00:15:45,660 --> 00:15:46,640 So we'll hit... 267 00:15:47,940 --> 00:15:48,920 Where is this? 268 00:15:49,120 --> 00:15:49,340 Oh, there it is. 269 00:15:49,340 --> 00:15:49,480 There it is. 270 00:15:49,480 --> 00:15:49,560 There it is. 271 00:16:01,660 --> 00:16:04,920 All right, so let's hit hbsmail.google.com. 272 00:16:10,600 --> 00:16:12,960 And so we loaded the page, we stored the map. 273 00:16:13,220 --> 00:16:14,560 And then we'll hit CNN. 274 00:16:15,160 --> 00:16:16,160 Let's see if this works. 275 00:16:19,100 --> 00:16:19,540 All right. 276 00:16:20,560 --> 00:16:22,220 No, it's not getting it. 277 00:16:22,860 --> 00:16:23,660 Something changed. 278 00:16:25,780 --> 00:16:26,320 Oh, well. 279 00:16:26,400 --> 00:16:26,840 That's broken. 280 00:16:26,940 --> 00:16:28,520 It'll be fixed by the time I release the tool. 281 00:16:28,860 --> 00:16:29,260 Apologies. 282 00:16:29,560 --> 00:16:30,260 So Google... 283 00:16:30,260 --> 00:16:30,720 So, all right. 284 00:16:30,760 --> 00:16:31,720 Let's go back to the slides. 285 00:16:35,480 --> 00:16:36,280 All right. 286 00:16:36,300 --> 00:16:37,940 So Cookie Monster is feeling much better. 287 00:16:38,060 --> 00:16:39,820 We've given them at least add-ons on mozilla.org. 288 00:16:40,220 --> 00:16:43,060 Gmail is still vulnerable in the default configuration. 289 00:16:44,000 --> 00:16:45,380 So let's do... 290 00:16:45,820 --> 00:16:47,380 What can you do to protect yourself? 291 00:16:47,840 --> 00:16:48,440 So, okay. 292 00:16:48,500 --> 00:16:49,520 So about a week or so ago, we got a call from Google. 293 00:16:49,520 --> 00:16:52,380 And a week ago, Google did announce that we have... 294 00:16:52,380 --> 00:16:54,940 They have a HTTPS pref for... 295 00:16:54,940 --> 00:16:55,720 You know, if it... 296 00:16:55,720 --> 00:16:59,920 If you set this pref in your options, you're aware of it. 297 00:17:00,020 --> 00:17:03,320 Then you can say, oh, I want Gmail to be HTTPS only. 298 00:17:04,500 --> 00:17:09,580 So the problem with this, though, is that if you... 299 00:17:09,580 --> 00:17:14,080 If you're not aware of it, the default behavior of Gmail, if you're familiar, you log in via 300 00:17:14,600 --> 00:17:15,040 HTTPS. 301 00:17:16,000 --> 00:17:17,760 It'll keep you in HTTPS afterwards. 302 00:17:17,880 --> 00:17:19,260 And you'll think that you're secure. 303 00:17:19,880 --> 00:17:21,080 But you're really not. 304 00:17:22,480 --> 00:17:25,440 The cookie is still set without the secure bit. 305 00:17:25,560 --> 00:17:27,140 If you haven't set this pref and you're not aware of it. 306 00:17:27,280 --> 00:17:32,800 So it's my opinion that it really should be the case that Gmail is... 307 00:17:32,800 --> 00:17:33,700 You know, should... 308 00:17:33,700 --> 00:17:38,500 You know, since it already is tracking the fact that you are logging in via HTTPS and 309 00:17:38,500 --> 00:17:41,960 knows to redirect you to HTTPS afterwards, the cookie should still have that property. 310 00:17:42,020 --> 00:17:42,700 But it does not. 311 00:17:44,380 --> 00:17:45,840 So that would be the ideal fix. 312 00:17:46,440 --> 00:17:48,220 You can also use this force HTTPS. 313 00:17:48,500 --> 00:17:48,900 Firefox. 314 00:17:49,260 --> 00:17:49,580 I don't know what it's called. 315 00:17:49,580 --> 00:17:49,600 I don't know what it's called. 316 00:17:49,600 --> 00:17:50,780 But it's very complicated. 317 00:17:51,000 --> 00:17:54,420 You have to edit some browser preferences to be able to specify that you want to force 318 00:17:54,420 --> 00:17:55,180 specific domains. 319 00:17:55,500 --> 00:17:57,620 The UI is not done yet. 320 00:17:58,020 --> 00:18:01,220 The other thing you do is just log out of your SSL services when you're done. 321 00:18:01,520 --> 00:18:03,080 And clear your cookies regularly. 322 00:18:03,640 --> 00:18:06,220 And not access things outside of SSL. 323 00:18:07,300 --> 00:18:12,500 So, as I said before, there's another potential vector where a large portion of the Internet 324 00:18:12,500 --> 00:18:13,040 can be... 325 00:18:14,020 --> 00:18:17,400 Have their Gmail captured, especially if they're not aware of this attack. 326 00:18:17,400 --> 00:18:25,000 Basically, the Metasploit module for the DNS hijack has been out for a while. 327 00:18:25,260 --> 00:18:27,620 The Computer Academic Underground, I think, put it out. 328 00:18:28,220 --> 00:18:31,060 So you basically scan for these vulnerable DNS servers. 329 00:18:31,320 --> 00:18:34,880 You can hijack Google.com by using the glue... 330 00:18:34,880 --> 00:18:37,820 Spoofing the glue record after you spoof the sequence number. 331 00:18:38,080 --> 00:18:46,400 And then you can inject these content elements into the domain for the page that you're targeting. 332 00:18:46,960 --> 00:18:52,320 It would be a good idea to target Google.com because people will probably hit Google for... 333 00:18:52,320 --> 00:18:54,340 Before doing it pretty commonly to do a search. 334 00:18:54,460 --> 00:18:55,780 And then you only have to do one hijack. 335 00:18:56,400 --> 00:19:00,240 And you can modify this tool to passively collect these cookies at your IP. 336 00:19:00,520 --> 00:19:01,760 And it's a two-line change. 337 00:19:02,040 --> 00:19:02,420 And then... 338 00:19:03,160 --> 00:19:04,060 Question, question, question. 339 00:19:04,580 --> 00:19:05,020 Profit. 340 00:19:06,360 --> 00:19:08,980 Additional services that are vulnerable are... 341 00:19:10,840 --> 00:19:14,400 Additional services that are vulnerable are Google Docs. 342 00:19:14,940 --> 00:19:16,380 All the Google services haven't been updated. 343 00:19:16,400 --> 00:19:17,060 They've been upgraded as well. 344 00:19:17,340 --> 00:19:20,380 So all those cookies still are insecure. 345 00:19:21,140 --> 00:19:21,740 You can grab... 346 00:19:21,740 --> 00:19:24,820 There's a lot of corporations will store sensitive stuff in their Google Docs. 347 00:19:24,920 --> 00:19:30,280 The Google domain, for example, the pref to set for the domain wide is $50 a seat. 348 00:19:30,420 --> 00:19:37,760 So it can cost a great deal of money to be able to pay for the right to set this pref across the domain. 349 00:19:38,040 --> 00:19:44,060 And the individual pref has not been rolled out to the individual user accounts for the Google domain services yet. 350 00:19:44,920 --> 00:19:45,440 So... 351 00:19:46,040 --> 00:19:47,080 Little bit of thanks. 352 00:19:47,280 --> 00:19:48,820 I want to thank Damon McCoy. 353 00:19:48,900 --> 00:19:55,300 He helped out with additional wireless drivers and headers for the injection. 354 00:19:55,520 --> 00:19:56,840 So it would work on arbitrary networks. 355 00:19:57,180 --> 00:19:59,200 Colin Jackson for his force HPS work. 356 00:19:59,400 --> 00:20:01,120 A lot of conversations with Nick Weaver. 357 00:20:01,800 --> 00:20:02,840 He actually... 358 00:20:02,840 --> 00:20:09,080 His blog describes a bounce attack that you can use to get arbitrary Google session cookies for any arbitrary service. 359 00:20:09,360 --> 00:20:12,620 So if you Google for his blog post on the topic, he outlines that there. 360 00:20:12,740 --> 00:20:13,640 So that's another potential... 361 00:20:13,640 --> 00:20:14,540 Vulnerability. 362 00:20:15,160 --> 00:20:17,520 And then, of course, all the LoreCon and Python... 363 00:20:17,520 --> 00:20:19,700 PyLoreCon authors and the dpacket team. 364 00:20:20,480 --> 00:20:20,940 Yeah.