1 00:00:00,000 --> 00:00:03,840 Hello, everyone. The talk you're sitting in on right now is Cypher Spaces and Darknets, 2 00:00:03,960 --> 00:00:08,700 an overview of attack strategies. First of all, quickly a little bit about me. I run 3 00:00:08,700 --> 00:00:13,700 irongeek.com. Hopefully some of you have visited the website before. I have an interest in 4 00:00:13,700 --> 00:00:17,860 infosec education. I don't know everything. I'm just a geek with time on my hands. So if I 5 00:00:17,860 --> 00:00:22,220 get something slightly wrong on one of these darknets I'll be talking about, come up to me 6 00:00:22,220 --> 00:00:27,740 after the talk. I'll be interested in hearing about it. Back in the Q&A room. I'm also an 7 00:00:27,740 --> 00:00:32,780 irregular on the ISD podcast. They podcast five times a week. I'm usually on Thursdays. And 8 00:00:32,780 --> 00:00:35,940 I'm also a researcher for the Tenacity Institute, which was kind enough to sponsor me coming 9 00:00:35,940 --> 00:00:41,720 here today. All right. A little bit of background information. First of all, what do I mean 10 00:00:41,720 --> 00:00:45,180 when I say a darknet? Now, there's a lot of different definitions and it can get a little 11 00:00:45,180 --> 00:00:48,940 confusing. There's a name collision out there. But I'm using the broader sense of darknet to 12 00:00:48,940 --> 00:00:55,360 be just an anonymizing network. Generally speaking, these darknets are also known as 13 00:00:55,360 --> 00:00:57,720 mixnets, where you have mixnets, which is a network of darknets, which is a network of 14 00:00:57,740 --> 00:01:01,240 multiple proxies that you hop through and different levels of encryption so that you can 15 00:01:01,240 --> 00:01:07,120 communicate and people don't know both where you're communicating to or what you're 16 00:01:07,120 --> 00:01:12,940 communicating. I also love the term cypher space. And that might be a little clearer term to 17 00:01:12,940 --> 00:01:19,180 use for some of these networks. The two ones I'll be using as reference examples are, of 18 00:01:19,180 --> 00:01:25,840 course, Tor and I2P. But there's a lot of other ones. And some of the attack strategies I'll be 19 00:01:25,840 --> 00:01:27,720 talking about here are very accurate. And some of the attacks that I'll be talking about here are 20 00:01:27,720 --> 00:01:35,880 academic and there's actually mitigations in place in both Tor and I2P to hopefully make them not 21 00:01:35,880 --> 00:01:42,860 be nearly the size of the problem that they could be. Things get subtle when you start talking 22 00:01:42,860 --> 00:01:50,360 about attacking mixnets. Terms kind of vary between researcher and researcher, what they mean, 23 00:01:50,480 --> 00:01:57,540 some particular term means. For instance, who here has ever heard of a Sybil attack? Who here has 24 00:01:57,540 --> 00:02:03,260 ever heard of a sock puppet? Probably a few more people who have heard of sock puppet? I'm going to 25 00:02:03,260 --> 00:02:06,420 go through definitions of all of those. But a lot of literature out there is very academically 26 00:02:06,420 --> 00:02:10,420 oriented and I'm going to try to make this talk begin in such a way that it helps people 27 00:02:10,420 --> 00:02:15,040 understand the academic research without necessarily having to have read 20 papers on the 28 00:02:15,040 --> 00:02:20,700 subject. There's a lot of weaknesses that are interrelated. Sybil attacks, for instance, can be 29 00:02:20,700 --> 00:02:27,460 used to help augment attacks with traffic correlation. And like I said there's a lot of other 30 00:02:28,640 --> 00:02:33,480 cypher spaces out there besides Tor and I2P. The ones you see up there on the screen, just to 31 00:02:33,480 --> 00:02:39,400 name a few. But Tor seems to have gotten most of the ground and I2P is sort of a runner up. If 32 00:02:39,400 --> 00:02:44,900 anybody wants stickers from the I2P project, come up to me at the Q&A room. I have some. But 33 00:02:44,900 --> 00:02:50,760 like I said before, I'm going to focus on Tor and I2P for my illustrations. And some of the 34 00:02:50,760 --> 00:02:53,940 talks we've had are academic and I'm going to try to give a few real world examples though to 35 00:02:53,940 --> 00:03:00,720 illustrate how they can be used. Now, when it comes to attacking dark nets, threat model 36 00:03:00,720 --> 00:03:06,660 matters a whole lot. You can't really protect against everything. Some protocols may just be 37 00:03:06,660 --> 00:03:09,940 lost causes. One of the problems with some of these cypher spaces is people try to throw 38 00:03:09,940 --> 00:03:14,020 protocols across them that just were never designed to be anonymized. BitTorrent would be a 39 00:03:14,020 --> 00:03:18,660 good example which I'll go into a little bit later on. Users may do things to reveal 40 00:03:18,660 --> 00:03:23,060 themselves. No matter how anonymous someone is, if they start using a dark net and use their 41 00:03:23,060 --> 00:03:23,920 real name, they're not going to be able to protect themselves. They're not going to be able to 42 00:03:23,920 --> 00:03:28,420 say, well, you know who they are. Not all the attacks that we're talking about necessarily 43 00:03:29,060 --> 00:03:34,040 reveal the actual identity of the person. They may just reveal the IP address they're truly 44 00:03:34,040 --> 00:03:37,840 talking from or may just reduce the anonymity set. For instance, you don't know the true IP 45 00:03:37,840 --> 00:03:45,000 they are from, but you know they use ISPX or their in country Y. Also, when it comes to 46 00:03:45,000 --> 00:03:48,940 attackers, there's different types. You have your active versus passive ones. Your active ones 47 00:03:48,940 --> 00:03:52,320 are actively doing stuff to manipulate the network and passive ones are just sitting there 48 00:03:52,320 --> 00:03:52,940 listening. 49 00:03:55,680 --> 00:04:00,400 You also have location, location, internal versus external. Externally listening like your ISP 50 00:04:00,400 --> 00:04:04,860 might be internally somebody who decides to join the dark net and screw around with other peers 51 00:04:04,860 --> 00:04:10,680 to see what they can find out. Adversaries, of course, also vary by their power level. You have 52 00:04:10,680 --> 00:04:15,100 like nation states, which have a certain high level of power. You're going to have things like 53 00:04:16,620 --> 00:04:21,160 ISPs as well. Then there's differences between western democracies and other places. For 54 00:04:21,160 --> 00:04:23,900 instance, some of these dark nets, they might even do a very good job. They might do a very good 55 00:04:23,900 --> 00:04:28,980 job of hiding who you're talking to and what you're sending. Everybody knows you're using it. 56 00:04:29,140 --> 00:04:32,900 And some countries, just the fact that you're trying to hide something from the government may be 57 00:04:32,900 --> 00:04:41,860 enough to have someone come knock at your door. Also, some private interest groups may also be 58 00:04:41,860 --> 00:04:48,940 interested in finding out who's actually behind a certain pseudonym or who's actually exchanging 59 00:04:48,940 --> 00:04:53,880 information in these dark nets. And finally, those schmucks like me all are about to get a good job of hiding. 60 00:04:53,900 --> 00:04:58,840 just like to play around. All right. The two dark nets I'm going to use for most of my 61 00:04:58,840 --> 00:05:02,900 illustrations are both Tor and I2P. I'm only going to quickly cover those. How many people 62 00:05:02,900 --> 00:05:07,640 here have heard of Tor before? Pretty much everybody. How many people have heard of I2P? 63 00:05:08,980 --> 00:05:15,060 That's cool. Awesome. But Tor essentially you have multiple levels of encryption. You pass 64 00:05:15,060 --> 00:05:21,220 something in. It's like Chinese nesting dolls or like an ogre with layers. And each layer 65 00:05:21,220 --> 00:05:24,740 along the way gets stripped off until you get to the exit point and then you reverse the 66 00:05:24,740 --> 00:05:30,340 process to get back in. Hidden services are a slightly different issue where you can host 67 00:05:30,340 --> 00:05:36,600 something inside the Tor network. But it's mainly focused on out proxying to the public 68 00:05:36,600 --> 00:05:42,940 Internet. I2P, on the other hand, a little bit different. Instead of using bidirectional 69 00:05:42,940 --> 00:05:46,680 tunnels where you build a circuit and it's both your in and your out, it has unidirectional 70 00:05:46,680 --> 00:05:50,620 tunnels where basically you have a series of out tunnels. You send something out and you 71 00:05:50,620 --> 00:05:51,200 send them into somewhere else. And then you have a series of out tunnels where basically you 72 00:05:51,200 --> 00:05:56,240 have someone else's in tunnels and you have in tunnels of your own which is coming to you from 73 00:05:56,240 --> 00:06:02,280 other people's out tunnels. This unidirectionality is there to hopefully mitigate some traffic 74 00:06:02,280 --> 00:06:06,680 analysis attacks because you have to compromise more nodes in the network to figure out who's 75 00:06:06,680 --> 00:06:12,380 talking to who. It also uses layered encryption. It generally refers to it as garlic routing. 76 00:06:12,700 --> 00:06:19,180 And I'll try to discuss the difference, sorry, well, garlic packets and I'll try to explain some 77 00:06:19,180 --> 00:06:21,000 of the definitional differences between the two. 78 00:06:21,500 --> 00:06:27,320 But its key focus isn't out proxying to the public Internet. It can do that, but generally you have 79 00:06:27,320 --> 00:06:31,720 like one out proxy. Its main goal is so you can host something internally without other people 80 00:06:31,720 --> 00:06:35,440 knowing you're the one hosting it. And this could be anything from, well, an EAP site, which is a 81 00:06:35,440 --> 00:06:44,360 website, to a box you can SSH into, IRC, all those sorts of things. And in my opinion, this is 82 00:06:44,360 --> 00:06:51,100 rather subjective, it seems to do the hidden services types of functionality faster than Tor does. But it 83 00:06:51,100 --> 00:06:54,980 doesn't really have great out proxying ability to the public Internet because you generally have one 84 00:06:54,980 --> 00:07:00,480 out proxy, so it's easy to detect. Not that Tor can't be detected, but that's another subject matter. 85 00:07:05,340 --> 00:07:10,600 Essentially you have, with ITP, three levels of encryption. You have your end to end, you have 86 00:07:10,600 --> 00:07:18,440 between each hop, and you have between your in tunnel and your out tunnel. Conceptually, though, it's 87 00:07:18,440 --> 00:07:21,080 pretty similar to onion routing. It's a little bit different, but it's a little bit different. It's a little bit 88 00:07:21,100 --> 00:07:26,080 different. The key difference is it's called garlic because you have cloves in a piece of garlic. To 89 00:07:26,080 --> 00:07:30,660 where in theory you could make a message, send it to an end point, actually have it separate out and 90 00:07:30,660 --> 00:07:35,160 have it separate out in separate messages and have them all return to you in different ways. Now, 91 00:07:35,200 --> 00:07:40,060 the way ITP currently implements this, it doesn't really take that full functionality. It's 92 00:07:40,060 --> 00:07:45,320 actually a little closer to onion routing than that picture illustrates. But that's a concept of 93 00:07:45,320 --> 00:07:51,080 what you could potentially do with garlic routing. And if you accentuate that some more, it's a little 94 00:07:51,080 --> 00:07:57,300 more. Imagine if you could send a message out and have cloves of it separate here, separate there, 95 00:07:57,460 --> 00:08:01,680 come back in different directions. And they're asking for this masking traffic for each other as 96 00:08:01,680 --> 00:08:07,440 you're sending these packets out on the network. It's not exactly implemented that way in ITP as of 97 00:08:07,440 --> 00:08:16,560 yet, but the packet format has that potential. All right. The first vulnerabilities we're going to 98 00:08:16,560 --> 00:08:20,960 be talking about are untrusted exit nodes. You're only as anonymous as the data you're 99 00:08:20,960 --> 00:08:28,540 sending. Quick overview, this is mostly Tor centric. You've got to wonder, is the person who's 100 00:08:28,540 --> 00:08:33,660 running the exit point you're going through, are they looking at your data? The traffic may be 101 00:08:33,660 --> 00:08:38,600 encrypted while it's inside the network, but once it hits that exit point, it's unencrypted. Or 102 00:08:38,600 --> 00:08:44,860 it's encrypted as whatever protocol is riding inside of Tor. If you're using HTTPS, you may be 103 00:08:44,860 --> 00:08:50,940 okay, depending. And I'll get up to that depending here in a second. A few incidences, if you're 104 00:08:50,940 --> 00:08:57,440 using this, Dan Egerstad, the whole thing, Embassy hack, was called back in 2007, essentially a 105 00:08:57,440 --> 00:09:03,300 bunch of people, workers at embassies were using Tor to tunnel out of the host country so they 106 00:09:03,300 --> 00:09:09,580 could do things anonymously. Unfortunately, the things they were doing didn't lend themselves to 107 00:09:09,580 --> 00:09:13,220 being particularly anonymous. Yeah, the host country may not have been able to directly spy on 108 00:09:13,220 --> 00:09:19,740 their communications, but when you're using POP3, SMTP, HTTP basic authentication, and other plain text protocols, 109 00:09:20,940 --> 00:09:25,220 the person who's sitting there on that exit point can sniff it. What Dan did was he set up his own 110 00:09:25,220 --> 00:09:30,520 exit point and started sniffing the traffic to see what was going on out there. Not exactly the best 111 00:09:30,520 --> 00:09:34,620 way to keep yourself private if you're using Tor for those sorts of functionalities. So keep in 112 00:09:34,620 --> 00:09:38,380 mind, if you're using Tor, be careful what you send out there. You're only as anonymous as the 113 00:09:38,380 --> 00:09:44,360 data you request and send. Also, Moxie Mullenspike had a similar thing. And this is where my 114 00:09:44,360 --> 00:09:50,820 little note about SSL comes in. He set up his own exit point and he put SSL strip on it. So even if 115 00:09:50,940 --> 00:09:57,400 someone was trying to use HTTPS and have it extra encrypted inside the Tor tunnel, he'd use SSL 116 00:09:57,400 --> 00:10:03,400 strip, knock that connection down to HTTP, and be able to look at it. And if the person who was 117 00:10:03,900 --> 00:10:08,740 surfing using Tor wasn't paying attention and didn't notice that the lock wasn't there, the URL 118 00:10:08,740 --> 00:10:16,400 didn't say HTTPS, then they might very well have been owned. Quick illustration of what this 119 00:10:16,400 --> 00:10:20,740 looks like and also gives you a better idea of what I mean by onion routing. Since 120 00:10:20,740 --> 00:10:26,600 essentially you have three layers of encryption on a message. One layer gets stripped off on 121 00:10:26,600 --> 00:10:33,800 each hop. Hits the exit point. Goes out unencrypted. And at that point, the person can look at 122 00:10:33,800 --> 00:10:39,560 it and possibly modify it to do some other attacks I'll be talking about later on. You can 123 00:10:39,560 --> 00:10:43,960 tell some people when they draw node diagrams of cipher spaces and mix nets, they give you 124 00:10:43,960 --> 00:10:47,580 like circles and lines. So this is my interpretation of what a dark net should look like. 125 00:10:52,320 --> 00:10:57,260 It's all one big happy duck net. And of course any time you see someone with a goatee, we 126 00:10:57,260 --> 00:11:06,760 obviously know the goatee one is evil. Okay. Keep in mind, mitigation wise, Tor is for 127 00:11:06,760 --> 00:11:11,380 anonymity, not necessarily security. But only as secure as the protocols you're trying to 128 00:11:11,380 --> 00:11:17,760 make right on top of it. Use end-to-end encryption. Don't use plain text protocols. And if 129 00:11:17,760 --> 00:11:20,720 you do use plain text protocols, expect the other people to take advantage of it. But if you don't 130 00:11:20,720 --> 00:11:23,680 take advantage of it, you might be able to see them. But sometimes that's fine. You just want to 131 00:11:23,680 --> 00:11:27,200 visit a web page without other people knowing you're visiting that web page. You don't care if 132 00:11:27,200 --> 00:11:32,460 they see that someone accessed this web page. Your e-mail, however, is a slightly different 133 00:11:32,460 --> 00:11:40,860 matter. Don't use plain text protocols that send usernames and e-mail addresses. You're not very 134 00:11:40,860 --> 00:11:48,080 anonymous if people know your e-mail address and name. But strangely enough, people at that 135 00:11:48,080 --> 00:11:50,700 embassy were doing it. The next type of attack is the one that's more likely to be used in the 136 00:11:50,700 --> 00:11:53,920 future. The next type of attack I want to talk about is DNS leaks and other protocol leaks on 137 00:11:53,920 --> 00:12:02,520 the application layer. Does all the traffic you're trying to send actually go through the proxy or 138 00:12:02,520 --> 00:12:08,940 does some of it leak out in other ways? DNS leaks are a classic example. And badly configured 139 00:12:08,940 --> 00:12:12,700 proxy settings could also lead to some types of traffic to go elsewhere. And I'll show some of 140 00:12:12,700 --> 00:12:18,840 those bad configurations here shortly. A snooper can set up web bugs and if the protocol that the 141 00:12:18,840 --> 00:12:24,200 web bug is accessed via isn't properly supported by the dark net, it's possibly confining the real 142 00:12:24,200 --> 00:12:30,840 IP address of someone visiting a site. HTTPS is a good example of this. But plug-ins can also be an 143 00:12:30,840 --> 00:12:35,500 issue. There's a lot of plug-ins out there that don't necessarily properly respect the proxy 144 00:12:35,500 --> 00:12:41,520 settings of the browser they're embedded in. Application level stuff is generally a problem. A 145 00:12:41,520 --> 00:12:46,660 whole lot of things in academia seem to revolve around traffic analysis attacks. But it takes a 146 00:12:46,660 --> 00:12:48,820 little bit more powerful adversary to pull some of those off. So, if you're looking for some sort of a 147 00:12:48,820 --> 00:12:52,860 tool to pull off the application layer stuff, most people can pull off, I imagine, in this room. 148 00:12:55,980 --> 00:13:03,820 JavaScript is pretty much just hosed. Definitely use the Tor browser, Tor button from the Tor 149 00:13:03,820 --> 00:13:09,160 browser bundle. It tries to sanitize some of the JavaScript issues. Probably won't turn 150 00:13:09,160 --> 00:13:12,920 scripting off. But for more information on how JavaScript can totally pwn somebody, go check out 151 00:13:12,920 --> 00:13:18,280 Gregory Fleischer's talk from DEF CON 17. But to give you a graphical illustration, 152 00:13:18,280 --> 00:13:23,120 here's what a DNS leak looks like. Let's say you go out and you visit irongeek.com, but you 153 00:13:23,120 --> 00:13:27,680 don't want anybody to know you're visiting irongeek.com. Well, sometimes when people configure 154 00:13:27,680 --> 00:13:33,980 Tor or ITP, for that matter, if the request for that host name is not sent into the dark net 155 00:13:33,980 --> 00:13:40,740 itself, it may be sent out to the public Internet. Now, in this particular illustration, my ISP 156 00:13:40,740 --> 00:13:47,360 wouldn't necessarily know what information I'm sending out onto the dark net. But since they see 157 00:13:47,360 --> 00:13:48,260 I'm making a DNS leak, I'm going to send it out to the public Internet. I'm going to send it to the 158 00:13:48,260 --> 00:13:51,760 public Internet. Well, the person who sends me a request for irongeek.com, well, they know I'm 159 00:13:51,760 --> 00:13:55,500 going to be web surfing there, even though they don't know what data I'm getting from irongeek.com. 160 00:13:55,840 --> 00:14:01,800 The same thing goes for .onion and .ITP addresses. These are hidden services and eep sites 161 00:14:01,800 --> 00:14:07,120 respectively. While your communications to them might be secured and no one can see what you are 162 00:14:07,120 --> 00:14:12,560 sending, if your DNS entries or your DNS settings are misconfigured or your browser is not 163 00:14:12,560 --> 00:14:17,620 properly supporting them, someone who controls the DNS server can just sniff that connection to 164 00:14:17,620 --> 00:14:22,460 the DNS server can figure out, oh, well, I'm not sure what he's doing with this I2P site, but I 165 00:14:22,460 --> 00:14:25,960 know he's contacting it. And depending on what the site is, that could be bad enough. 166 00:14:27,880 --> 00:14:32,900 Mitigations for this? Well, first thing you should probably do is connect to a Tor I2P, 167 00:14:33,360 --> 00:14:41,280 follow up Wireshark or TCP dump and use that little TCP dump filter, port 53, and see if 168 00:14:41,280 --> 00:14:45,080 anything is actually going out there on port 53. See if anybody is doing any kind of DNS 169 00:14:45,080 --> 00:14:52,360 communications while you're surfing around using Tor I2P. If you have Firefox set up, you may 170 00:14:52,360 --> 00:14:57,200 want to make sure that this particular configuration is set. You go in the out config and 171 00:14:57,200 --> 00:15:03,160 just set it to use remote DNS through the proxy to hopefully mitigate those kind of leaks. 172 00:15:03,480 --> 00:15:07,360 Now, some applications, no matter what, they don't have a setting where you can say send 173 00:15:07,360 --> 00:15:14,360 everything through my SOX proxy to do all name resolutions. So Tor button can also help with 174 00:15:14,360 --> 00:15:15,060 this. Tor app button can also help with this. Tor app button can also help with this. Tor app button 175 00:15:15,080 --> 00:15:19,640 can actually make some of these settings for you. Other applications vary where you have to 176 00:15:19,640 --> 00:15:25,900 make these settings. You may have to firewall off the machines. Port 53 entirely might be an 177 00:15:25,900 --> 00:15:31,260 option. Another option out there is inside of Tor, you can edit the RC file and there's a 178 00:15:31,260 --> 00:15:37,220 setting called DNS port 53. You set DNS port 53 and your local machine will now have a DNS 179 00:15:37,220 --> 00:15:44,420 server on it and you can set your machine to use that as its DNS server in your IP settings so that 180 00:15:44,900 --> 00:15:49,820 hopefully that will totally mitigate the problem of people being able to see your DNS traffic 181 00:15:49,820 --> 00:15:56,260 and figuring out where you're surfing. Another thing is grabbing content outside the 182 00:15:56,260 --> 00:16:03,780 doc net. I stumbled across this while I was playing around with I2P and didn't exactly have all 183 00:16:03,780 --> 00:16:10,220 my settings done correctly. Essentially what happens is let's say someone requests a hidden 184 00:16:10,220 --> 00:16:14,400 server or an EAP site and that server is not working. So you have to set up an IP server and 185 00:16:14,400 --> 00:16:20,260 that server has some extra stuff embedded in it. This could be a plug-in. It could be just an 186 00:16:20,260 --> 00:16:27,220 image. In this case I had configured an HTTP proxy using I2P but I did not configure an HTTPS 187 00:16:27,220 --> 00:16:34,580 proxy. So if someone happened to have an image embedded in the page that said HTTPS some URL to 188 00:16:34,580 --> 00:16:39,580 some image, it would not be going through my doc net. Instead it would be going directly and 189 00:16:39,580 --> 00:16:44,380 let's say they're serving up serial numbered images, they can quickly correlate who visited the 190 00:16:44,400 --> 00:16:57,600 page with this particular person who contacted me inside of the doc net. Now here's what I 191 00:16:57,600 --> 00:17:03,940 screwed up. When I first did my settings on I2P, I just set an HTTP proxy. A couple options I 192 00:17:03,940 --> 00:17:08,180 could set. I could say use this proxy for all protocols. In I2P's case that setting isn't 193 00:17:08,180 --> 00:17:13,280 exactly ideal because all those other protocols are not supported by the proxy. But at least it's 194 00:17:13,280 --> 00:17:19,440 keeping that little SSL issue from happening. Another option would be to actually configure an 195 00:17:19,440 --> 00:17:28,020 SSL proxy which I2P does have, but that particular out proxy has a tendency to be down. Slightly 196 00:17:28,020 --> 00:17:31,800 related would be things like cookies. Let's say you're web surfing along, you're visiting 197 00:17:31,800 --> 00:17:37,920 Google and you go, okay, I'm going to go look for some websites now and I want to be anonymous. 198 00:17:38,200 --> 00:17:42,760 However, you didn't change context or anything like that and you just started and said, okay, 199 00:17:42,760 --> 00:17:49,160 start using my Tor proxy. Well, if you got a cookie while you were outside the doc net and you 200 00:17:49,160 --> 00:17:55,180 haven't changed context, you switched into private browser mode or used a different browser or 201 00:17:55,180 --> 00:18:02,460 changed profiles, well that same cookie could very well be served up to the host while inside the 202 00:18:02,460 --> 00:18:05,560 doc net and through it and then go, well, I saw this person coming to me from the public 203 00:18:05,560 --> 00:18:10,500 internet and now I see them coming to me from the doc net with the same cookie, I know it's the 204 00:18:10,500 --> 00:18:12,740 same person. So, I'm going to do that. I'm going to do that. I'm going to do that. I'm going to 205 00:18:12,760 --> 00:18:20,820 do that. There's also a possibility of making hidden services contact you. For instance, let's 206 00:18:20,820 --> 00:18:25,840 say someone's running a vulnerable web application on an EAP site or Tor hidden service. It's 207 00:18:25,840 --> 00:18:31,040 possible you could throw an exploit in payload, something like, let's say, some kind of shell 208 00:18:31,040 --> 00:18:37,440 execution vulnerability and actually get that remote target server to contact you outside the 209 00:18:37,440 --> 00:18:42,740 doc net and now you know who they actually are. All right. So, I'm going to show you some 210 00:18:42,760 --> 00:18:46,380 examples. Another example would be BitTorrent. Now, BitTorrent has a lot of issues and all this 211 00:18:46,380 --> 00:18:51,440 work I've pulled from the folks whose names are at the bottom of the slide. I really don't want to 212 00:18:51,440 --> 00:18:57,260 butcher their names. So, go out and check it out later. It should be on your DEF CON CD. But 213 00:18:59,100 --> 00:19:05,960 BitTorrent has multiple issues. One of its issues is if Tor is only being used for contacting the 214 00:19:05,960 --> 00:19:12,320 tracker, I could just watch announce messages and extension protocol handshakes to extract real IPs. 215 00:19:14,280 --> 00:19:19,300 Another thing is, again, if Tor is only being used for contacting the tracker and SSL is not 216 00:19:19,300 --> 00:19:25,260 used, I could sit there as the exit point and I could change the return peer list to point to me as 217 00:19:25,260 --> 00:19:31,880 one of the sources and watch for the outside contact, then try to correlate an IP based on the 218 00:19:31,880 --> 00:19:39,620 peer ID and the port. Another option would be even if the peer traffic is sent over Tor, which 219 00:19:39,620 --> 00:19:42,660 generally most people are hopefully not going to do. First of all, using the 220 00:19:42,760 --> 00:19:53,280 Tor for BitTorrent is kind of frowned upon, but even if you did do it, it's a pretty slow thing to 221 00:19:53,280 --> 00:19:59,700 do. So, most people only configure the tracker for Tor use, not necessarily direct 222 00:20:00,280 --> 00:20:07,260 communication to other clients. But even if the peer traffic is sent over Tor, if the DHT is used, 223 00:20:07,300 --> 00:20:12,740 the distributed hash table is used, the IP may still be revealed because UDP packets are still 224 00:20:12,760 --> 00:20:17,560 not sent over Tor. So, you can scrape the DHT and find out who all is sharing that particular 225 00:20:17,560 --> 00:20:28,000 file based on peer ID and port ID. You may also then be able to, because you've 226 00:20:28,000 --> 00:20:32,680 de-anonymized someone via BitTorrent and figured out who they are, you see messages coming 227 00:20:32,680 --> 00:20:37,640 through that same circuit, through that same tunnel and some other protocol like HTTP, well, 228 00:20:37,680 --> 00:20:41,920 you go, it's coming from the same circuit, I've de-anonymized the BitTorrent use, so I know it's the 229 00:20:41,920 --> 00:20:46,280 same person who is visiting this particular website. So, it can also leak out and cause issues 230 00:20:46,280 --> 00:20:52,280 for other protocols you're using at the same time. Another example of an application flaw I'd 231 00:20:52,280 --> 00:20:57,360 like to mention is IRC. And for a while now, I was trying to keep a different identity inside 232 00:20:57,360 --> 00:21:04,060 the ITP network and I kind of botched it. But I was using Pigeon as my IRC client and by 233 00:21:04,060 --> 00:21:10,560 default, if you don't configure its ident information, whenever someone does a who is on your 234 00:21:10,560 --> 00:21:16,600 NIC in IRC, they can find out what username you log into a machine as. Now, in my case, if you 235 00:21:16,600 --> 00:21:22,260 Google up ITP and Adrian, it comes pretty quick to figure out who I am, even though I was using a 236 00:21:22,260 --> 00:21:28,600 different handle while I was inside of IRC. Luckily, you can fix this, and this is going to 237 00:21:28,600 --> 00:21:35,740 vary from client to client. You can go in and set a username and real name so you can put 238 00:21:35,740 --> 00:21:40,540 information that's not necessarily connected to you. Then when someone does a who is, you can 239 00:21:42,380 --> 00:21:51,220 log into the box with. Probably a good call. Some general mitigations. Client-wise, make sure 240 00:21:51,220 --> 00:21:54,600 your browser is set to send all the traffic through the dark net. You may want to start using 241 00:21:54,600 --> 00:22:00,360 dark net, fire up a sniffer, test a few protocols, go, hmm, is anything leaking out to the 242 00:22:00,360 --> 00:22:05,980 public Internet that I wouldn't want people to see? Also, look into setting up firewall rules 243 00:22:05,980 --> 00:22:10,540 on a box so that nothing can go out besides going out through the dark net's port. If you're 244 00:22:11,560 --> 00:22:14,760 using a web browser, limit the plug-ins used. If you decide that you want to use every single 245 00:22:14,760 --> 00:22:18,100 possible plug-in out there, you don't know whether or not they properly respect proxy 246 00:22:18,100 --> 00:22:23,940 settings, you're probably going to be hosed. And using a separate browser, like I keep a copy of 247 00:22:23,940 --> 00:22:28,220 the Tor browser bundle that I've also configured so I can switch between it and the ITP back and 248 00:22:28,220 --> 00:22:33,320 forth, separate from everything else, and I only use that for accessing these networks, and I 249 00:22:33,320 --> 00:22:40,540 don't use my core web browser at all. Also, you might want to check, you know, if you're using a 250 00:22:40,560 --> 00:22:42,480 dark net, when you're using one of these dark nets, visit one of these sites like 251 00:22:42,480 --> 00:22:48,140 Decloca.net and Panopticlick. Decloca.net is from the same people that do the Metasploit project. 252 00:22:48,580 --> 00:22:53,060 Basically they try a bunch of different, embedding a bunch of different file types, like 253 00:22:53,060 --> 00:22:57,100 let's say, Word docs, and they try a few different plug-ins and so forth, and try to get something 254 00:22:57,100 --> 00:23:02,400 not to respect your proxy settings in your browser and find out your real IP address that way. 255 00:23:03,160 --> 00:23:08,720 Panopticlick is somewhat similar. It's more about trying to figure out how anonymous you are via 256 00:23:08,720 --> 00:23:10,540 your user agent structure. It's more about trying to figure out how anonymous you are via your user 257 00:23:10,560 --> 00:23:14,300 agent string and a few other factors like JavaScript, what JavaScript returns, and it tries to 258 00:23:14,300 --> 00:23:19,540 figure out, out of this many hundreds of thousands of people, how unique is your particular web 259 00:23:19,540 --> 00:23:24,600 browser. Obviously, you don't want to be unique, because if you are unique, then you can be 260 00:23:24,600 --> 00:23:31,220 profiled. Also, of course, on the hidden server side, don't run vulnerable web applications or any 261 00:23:31,220 --> 00:23:35,500 other kind of applications inside of a dark net. If you do, and someone happens to be able to hit 262 00:23:35,500 --> 00:23:40,540 it with an exploit, doing a payload that does a reverse, you know, reverse, you know, reverse 263 00:23:40,560 --> 00:23:48,200 TCP connect, well, they quickly figure out who you are. Also, don't run on a box that routes to the 264 00:23:48,200 --> 00:23:53,620 public Internet. If you're going to have a box that you want to host stuff as a hidden service or a 265 00:23:53,620 --> 00:23:58,980 tor-eap site, there's no real reason it has to contact the Internet other than just the dark net 266 00:23:58,980 --> 00:24:03,000 client, and it could actually be running on a different machine on your network. The dark net 267 00:24:03,000 --> 00:24:08,100 client could be running on another machine and just communicate and forward all its port activity, 268 00:24:08,320 --> 00:24:10,540 but the box you're actually running, you're not going to be able to get access to the internet. 269 00:24:10,560 --> 00:24:14,200 You can't directly contact the Internet no matter what people send it. And that might be a good 270 00:24:14,200 --> 00:24:21,560 call, as well. Another class of attack I like to talk about is attacks on central resources and 271 00:24:21,560 --> 00:24:30,760 infrastructure attacks, as well as just general DOS attacks. Now, as far as DOS attacks on an 272 00:24:30,760 --> 00:24:36,140 individual host inside the network, more than likely most of the blunt of the damage that's going to 273 00:24:36,140 --> 00:24:40,540 happen to all the nodes between you and them. So, you know, if you're going to run on a 274 00:24:40,540 --> 00:24:45,200 network, it's going to be more of a DOS against the network than any individual hidden service 275 00:24:45,780 --> 00:24:51,320 inside of it. There's a whole bunch of categories of general DOS attacks on the network, just like 276 00:24:51,320 --> 00:24:56,060 starvation attacks where you maybe promise to give certain resources and don't. Partitioning 277 00:24:56,060 --> 00:24:59,540 attacks where you do various things on the network saying, all right, if I take out this particular 278 00:24:59,540 --> 00:25:03,960 one that's routing and this particular one that's routing, can I still get a message out? I've 279 00:25:03,960 --> 00:25:08,920 split down the network and I start whittling it down towards a smaller cross section and I have 280 00:25:08,920 --> 00:25:14,440 less possible people to have to look at. And, of course, there's this flooding that's sending a 281 00:25:14,440 --> 00:25:23,720 crap ton of stuff into the dark net to disturb it. Standard DOS attacks, generally speaking, well, 282 00:25:23,800 --> 00:25:35,340 first of all, people who do DOS for the sake of being a political advocate, thank you. Yeah, just 283 00:25:35,340 --> 00:25:38,540 don't. And if you're going to do it, definitely don't do it over talk because you're going to be 284 00:25:38,920 --> 00:25:43,860 destroying Tor, not whoever you're targeting anyway. But I find the maturity, if you're into 285 00:25:43,860 --> 00:25:49,840 free speech, then pretty much at all times DOS is wrong. You can debate with me about that in the 286 00:25:49,840 --> 00:25:56,640 Q&A session later on. I'm sure someone would want to. Shared known infrastructure is also a 287 00:25:56,640 --> 00:26:01,760 problem. This is not necessarily a direct attack inside the dark net, but if certain core servers 288 00:26:01,760 --> 00:26:06,180 out there, like let's say the Tor directory servers are taken out, well, it becomes really hard 289 00:26:06,180 --> 00:26:08,900 for people to be able to use Tor if they can't find it. So, I'm going to talk about that a little bit. 290 00:26:08,900 --> 00:26:12,560 And then I'll be talking about how to get anybody to route through. Similar things with I2P. If the 291 00:26:12,560 --> 00:26:16,760 I2P website went down, a lot of people wouldn't know where to download the client. Also, they 292 00:26:16,760 --> 00:26:22,980 have... well, they try to use a distributed system where you don't necessarily have to talk to a 293 00:26:22,980 --> 00:26:26,160 directory server to figure out other people you can bounce through. They use a distributed hash 294 00:26:26,160 --> 00:26:31,980 table called NetDB. However, there are also re-seeds that are used so that if you're a new 295 00:26:31,980 --> 00:26:36,720 client, it will start to re-seed to get to your initial contacts inside that distributed hash 296 00:26:36,720 --> 00:26:38,880 table. If you don't have that initial re-seed, you're going to have to re-seed. So, when you do a 297 00:26:38,880 --> 00:26:43,240 you can't contact that, well, you're pretty much not going to be able to get on the network. 298 00:26:44,720 --> 00:26:50,200 Also, of course, total or severe blocking of the Internet will keep a dark net from functioning 299 00:26:50,200 --> 00:26:55,560 at all, obviously. Now, a few incidents have happened in the past. Back in 2009 when China 300 00:26:55,560 --> 00:26:59,940 blocked some of the Tor directory servers, this caused huge issues for people being able to use 301 00:26:59,940 --> 00:27:07,000 Tor. Luckily there's mitigations out there for that. There's also other general blocking of 302 00:27:07,000 --> 00:27:14,100 the Internet that's happened, like Egypt and Libya and Iran in more recent days. So let's say 303 00:27:14,100 --> 00:27:18,980 someone tosses the directory server. If they do that, then you can't find nodes to route 304 00:27:18,980 --> 00:27:24,420 through. If you can't find nodes to route through, you can't get on Tor. General mitigation, 305 00:27:24,800 --> 00:27:30,420 well, for Tor there's something called bridge nodes. Instead of having all the routers in Tor be 306 00:27:30,420 --> 00:27:35,360 announced via the directory servers, you can actually find out these bridge nodes in other 307 00:27:35,360 --> 00:27:36,980 ways. It could be something like... 308 00:27:38,400 --> 00:27:44,640 email someone at the Tor project and they send you back a small list of bridge nodes. Or you 309 00:27:44,640 --> 00:27:47,900 could maybe meet someone at a conference and say, yeah, I run a bridge node in that particular 310 00:27:47,900 --> 00:27:53,620 country. Here, connect to this and I'll get you on the rest of the network. The core idea is not 311 00:27:53,620 --> 00:27:57,920 to have all your eggs in one basket where someone can easily block all access to Tor. 312 00:27:59,980 --> 00:28:03,920 Distributed infrastructure may help. For instance, ITP, instead of having core directory 313 00:28:03,920 --> 00:28:06,980 servers, tries to do everything in a distributed hash table where everything is in the 314 00:28:06,980 --> 00:28:11,200 same hash table. So everybody is kind of responsible for sharing this information and once 315 00:28:11,200 --> 00:28:17,520 you get in the network and you've had some time to get well integrated into it, this kind of 316 00:28:17,520 --> 00:28:22,960 information just comes to you and you... it's sort of like a distributed database. So that 317 00:28:22,960 --> 00:28:29,420 might help somewhat, but even ITP does have some central infrastructure. Protocol obfuscation may 318 00:28:29,420 --> 00:28:34,320 help in some cases so that people don't know that you're using Tor or ITP. And I know both of 319 00:28:34,320 --> 00:28:36,960 those projects are working on better forms of obfuscation. So if you're using Tor or ITP, you're 320 00:28:36,960 --> 00:28:39,800 going to want to be careful. Because in some cases, like I said before, depending on what 321 00:28:39,800 --> 00:28:44,700 country you're working out of, just the fact that you're hiding something may be enough for 322 00:28:44,700 --> 00:28:50,260 someone to come knocking on your door. Also, total and severe blocking of the Internet, that's a 323 00:28:50,260 --> 00:28:53,580 little bit harder problem to get around and this is one I'd really like to do more research on. So 324 00:28:53,580 --> 00:28:57,840 if anybody has any information on this, come up to me during the Q&A session. I'd like to hear it. 325 00:28:59,200 --> 00:29:05,180 Mesh networks. The core idea is, think of kind of like a, I guess a layer one dark net where you 326 00:29:05,180 --> 00:29:06,340 basically build your own infrastructure. 327 00:29:08,960 --> 00:29:13,840 So let's say you had some cheap hardware with some kind of wireless connectivity. You could 328 00:29:13,840 --> 00:29:21,400 spread these nodes out across the geographical location and basically have messages bounce 329 00:29:21,400 --> 00:29:26,760 around in them. So this host may forward a message for this host to here, to here, to here, to 330 00:29:26,760 --> 00:29:31,500 here, and eventually get it out on the public Internet in some way. Now depending on the 331 00:29:31,500 --> 00:29:36,780 location, though, and the type of message you're trying to get out, you may not 332 00:29:36,780 --> 00:29:41,260 necessarily be able to be fully integrated at all times and get a message out. So there's also 333 00:29:41,260 --> 00:29:46,180 things like store and forward where essentially someone creates a message and let's say you made a 334 00:29:46,180 --> 00:29:50,500 client for phone systems where, okay, this person is trying to get a message out. They do the 335 00:29:50,500 --> 00:29:53,600 message and they carry it around in their pocket. Whenever their phone comes in reach of another 336 00:29:53,600 --> 00:29:58,580 phone that can send the message out, it passes it along, passes it along, store and forward until 337 00:29:58,580 --> 00:30:01,840 eventually it can get to a place where that message gets out. Now obviously we're not talking 338 00:30:01,840 --> 00:30:06,760 about low latency protocols like HTTP for this. But if you're trying to get a message out, you need to 339 00:30:06,780 --> 00:30:11,780 be able to do this. But for an e-mail, just trying to get an e-mail out of a country, the store 340 00:30:11,780 --> 00:30:16,200 and forward method might very well work. So I'd be interested in seeing more work on mesh 341 00:30:16,200 --> 00:30:20,540 networks and easily deploying them to get around problems where people do complete blocking of 342 00:30:20,540 --> 00:30:27,080 the Internet. All right. For more info on mesh networks, I've got a few resources for you. I 343 00:30:27,080 --> 00:30:30,720 don't know of any clear frontrunners saying this is the technology we'd be able to use to 344 00:30:30,720 --> 00:30:36,380 quickly and cheaply deploy a bunch of nodes in a mesh network. Wikipedia has a few entries, of 345 00:30:36,380 --> 00:30:42,380 course. Also there's the village infrastructure in a kit alpha project you might want to check out. 346 00:30:43,360 --> 00:30:48,200 And maybe some of you have heard about the whole Internet in a suitcase project. The New York 347 00:30:48,200 --> 00:30:51,260 Times had an article on that a while back where the U.S. government is funding money so they can 348 00:30:51,260 --> 00:30:59,000 send these basically Internet in a box to various countries to help dissidents out. The next 349 00:30:59,000 --> 00:31:06,140 category of attack I want to talk about are clock based attacks. Some protocols out there, like 350 00:31:06,380 --> 00:31:12,920 HTTP, for example, allow you to check the remote system's clock. So clock differences can be an 351 00:31:12,920 --> 00:31:17,300 issue. If someone's clock is set way different than yours and way different than everybody else you 352 00:31:17,300 --> 00:31:22,960 contact in the network, well, that's a point of profiling. Major differences are easy to spot. 353 00:31:23,740 --> 00:31:27,120 Minor differences are a little bit more difficult, but there has been some work on doing 354 00:31:27,120 --> 00:31:33,820 statistical analysis where even if it's a very minor difference, with enough time, you can do 355 00:31:33,820 --> 00:31:36,360 your thing. Now, a few incidences. I'm going to show you a few instances where you can do your thing. 356 00:31:36,360 --> 00:31:42,960 One major paper that's been in research circles on this would be Steve Murdock's hot or not. This is a 357 00:31:42,960 --> 00:31:51,260 neat concept. Essentially different hardware has different reactions when it gets hot, its internal 358 00:31:51,260 --> 00:31:56,220 clock skews a little bit. And not all hardware is the same and not everybody is going to be in the 359 00:31:56,220 --> 00:32:01,620 same temperatures. So there's a certain unique pattern to how much this internal clock skews. So 360 00:32:01,620 --> 00:32:06,180 what he did is he set up his own private Tor network and did some experimentation and was able to 361 00:32:06,360 --> 00:32:12,000 at least partially de-anonymize people or de-anonymize nodes based on how different the clock 362 00:32:12,000 --> 00:32:17,800 was. And he was using HTTP requests and pulling off the time header. Now, unfortunately, though, 363 00:32:17,800 --> 00:32:23,760 he was having to do this inside of ‑‑ it's been a while since I read the full paper, but he had 364 00:32:23,760 --> 00:32:29,160 to do this on his own private Tor network because the general Tor network ‑‑ how many people 365 00:32:29,160 --> 00:32:35,320 have complained about Tor network being slow? So there's enough network jitter as far as timing out 366 00:32:35,320 --> 00:32:39,100 there already that it makes some types of attack hard to do because you don't know whether or not 367 00:32:39,100 --> 00:32:43,680 is this guy two seconds off of my clock or did it just take two seconds for the message to get to 368 00:32:43,680 --> 00:32:48,880 me? Or in some cases, is this guy really five minutes off and did it take five minutes to get 369 00:32:48,880 --> 00:32:54,660 back to me? There's also been some research on I2P clock differences and I'm going to show you a 370 00:32:54,660 --> 00:33:03,120 table here in a second for a project I did for Tenacity a few months back. But quick illustration, 371 00:33:03,560 --> 00:33:05,300 just because I love putting up these smiley computers. I'm going to show you a table here in a 372 00:33:05,300 --> 00:33:09,620 second. You ask what time it is, you get a report back and you can start profiling, well, how 373 00:33:09,620 --> 00:33:13,340 different is this person from me and how different is he from everybody else on the network? 374 00:33:14,240 --> 00:33:19,520 Now, here's a table I generated and hopefully it's somewhat readable, where I essentially went 375 00:33:19,520 --> 00:33:26,200 out there and looked at each node I could find inside of I2P that was running an EAP site, and 376 00:33:26,200 --> 00:33:30,740 requested it from its EAP site, hey, give me this web page and I took note of the time. At 377 00:33:30,740 --> 00:33:35,200 that particular time, I2P didn't strip out the server headers so you knew what type of server it 378 00:33:35,300 --> 00:33:42,080 was if it returned that information. So I'd find out is this EAP site hosted via Apache or IIS 379 00:33:42,080 --> 00:33:48,160 or something else. They've since stripped this out, which was a great thing to do. They're very 380 00:33:48,160 --> 00:33:54,900 responsive. But let's ignore that for a second. I was pulling down times and if the time is only a 381 00:33:54,900 --> 00:33:58,900 few seconds different for me, that could very well be network jitter. It takes a while for that 382 00:33:58,900 --> 00:34:04,280 tunnel to build and for a message to get out my out tunnel into someone else's in tunnel, out 383 00:34:04,280 --> 00:34:08,540 there, out tunnel and back into my internals. That all takes time with multiple hops. So a few 384 00:34:08,540 --> 00:34:12,760 seconds, that probably isn't significant. However, when someone is almost a minute different 385 00:34:12,760 --> 00:34:20,380 than me and I found an IP address on the public Internet that I knew was using I2P that was about 386 00:34:20,380 --> 00:34:24,820 the same difference, I have a good idea, especially when I find out that the web service 387 00:34:24,820 --> 00:34:29,360 software is the same, that those are probably the exact same box. The reason I could know the 388 00:34:29,360 --> 00:34:33,540 IP addresses of the people who are using I2P is I basically scraped that distributed hash table 389 00:34:33,540 --> 00:34:34,260 for, oh, I don't know, I don't know, I don't know, I don't know, I don't know, I don't know, I 390 00:34:34,260 --> 00:34:37,100 don't know. So I was like give me all the IPs of anybody who is using this. And I sit there and 391 00:34:37,100 --> 00:34:42,340 wait for a while and log them and log them and log them and basically go out there and well, this 392 00:34:42,340 --> 00:34:48,720 next graphic should illustrate that better. I'll do it in a second. Let's see. These attacks can 393 00:34:48,720 --> 00:34:53,160 be kind of hard to pull off from the standpoint, actually I don't want to illustrate it in this 394 00:34:53,160 --> 00:35:03,960 one, pardon me. Essentially what I did was basically query all those websites inside of I2P via 395 00:35:03,960 --> 00:35:09,500 the EAP site address, find out the time difference, then query all those IP addresses, see if 396 00:35:09,500 --> 00:35:14,880 they were running a web server, find out its time difference and start correlating them. Now 397 00:35:14,880 --> 00:35:19,880 some of these attacks, there's actually inverted mitigations in there already. By their very 398 00:35:19,880 --> 00:35:23,020 nature, mix nets are going to be slower than the public internet because you have to hop through 399 00:35:23,020 --> 00:35:27,820 multiple proxies to be able to get anywhere. So that little bit of timing jitter can 400 00:35:28,520 --> 00:35:33,860 obfuscate those clock differences. Also, setting your clock to a reliable NTP server, 401 00:35:33,860 --> 00:35:39,780 will probably help. Some protocols actually have stuff in place already to try to synchronize 402 00:35:39,780 --> 00:35:45,140 timers. For instance, I2P does a lot of work to try to make sure that its internal clock is set 403 00:35:45,140 --> 00:35:50,160 appropriately. But I2P's internal clock isn't necessarily used to set the web server software 404 00:35:50,160 --> 00:35:56,800 that you're hosting from. So it only goes so far. Back to the NTP server thing, I specifically 405 00:35:57,400 --> 00:36:02,320 outlined it has to be reliable. Because if it's not reliable, well, using an NTP server that's 406 00:36:02,320 --> 00:36:03,840 reliably three minutes off, it's not going to be reliable. So it's going to have to be reliable. 407 00:36:03,860 --> 00:36:08,600 But if it's three minutes off, it's still a point of profiling. Another class of attack that I 408 00:36:08,600 --> 00:36:17,820 think is fascinating is attacks in metadata, using metadata to profile people. Now, data, first 409 00:36:17,820 --> 00:36:23,640 of all, who all knows what metadata is? All right. I'm preaching to the crowd then. Metadata is 410 00:36:23,640 --> 00:36:29,180 essentially data about data. All sorts of examples out there. If you look at a PDF, it might be 411 00:36:29,180 --> 00:36:33,840 embedded in who the author was. Same thing for Word doc. Then there's things like EXIF data that's 412 00:36:33,860 --> 00:36:39,520 inside of JPEGs that might give you information like GPS coordinates. Lovely stuff. Way too many 413 00:36:39,520 --> 00:36:46,260 to possibly name. And in some older formats of office docs, they actually embed a Mac address in 414 00:36:46,260 --> 00:36:51,560 your Word doc. Now, that's good profiling right there. But that's been a while. I think that was 415 00:36:51,560 --> 00:36:58,260 Office 97 that did that. Now, I don't know if anybody who's actually been de-anonymized inside 416 00:36:58,260 --> 00:37:02,880 of a doc net because of metadata, but it's easy to see how someone could be. Let's say you're hosting 417 00:37:02,880 --> 00:37:07,540 some site inside of ITP or Tor. You have a bunch of PDFs on it. Someone can start looking at these 418 00:37:07,540 --> 00:37:11,600 PDFs and going, huh, what can I find out about the person who offered it? But to give you some 419 00:37:11,600 --> 00:37:15,480 examples of where people have been pwned by metadata, Kat Schwartz is one of my favorite 420 00:37:15,480 --> 00:37:23,140 examples. A few years back, she took a sexy picture of herself with her head leaned back, smoking, 421 00:37:23,780 --> 00:37:29,260 and she cropped it and posted it up on her blog so that people could, you know, look at the 422 00:37:29,260 --> 00:37:32,860 photo. Well, when she cropped it, the software she used, the software she used, the software she 423 00:37:32,860 --> 00:37:38,740 used, didn't rewrite the EXIF data. One of the things the EXIF data actually maintains besides 424 00:37:38,740 --> 00:37:43,420 just things like GPS coordinates if someone decides to put them in there, or if the application 425 00:37:43,420 --> 00:37:49,080 decides to put them in there, is a thumbnail. Well, when she cropped the image, the application 426 00:37:49,080 --> 00:37:53,040 she used cropped the main image but did nothing to the thumbnail. So let's just say that picture 427 00:37:53,040 --> 00:37:57,840 goes down a little bit further than what I have up on the screen right now. Another example would 428 00:37:57,840 --> 00:38:02,440 be Dennis Rader, better known as the BTK killer. Way back before everybody in the 429 00:38:02,860 --> 00:38:07,660 house had a computer in the home, he would taunt the police and so forth and get away with it and 430 00:38:07,660 --> 00:38:10,860 they wouldn't be able to chase him down. Eventually, I think someone was writing a book on him and 431 00:38:10,860 --> 00:38:15,440 he decided to start taunting the police again, so he sends like a floppy disk with a Word doc on it 432 00:38:15,440 --> 00:38:20,200 to the police with a taunt. Well, they look at the Word doc, I guess they right clicked on it and 433 00:38:20,200 --> 00:38:24,840 looked at its properties, and saw that it was offered by Dennis and it was registered to some 434 00:38:24,840 --> 00:38:30,820 church. So they go visit that church, find the guy named Dennis, and they caught him. A funnier 435 00:38:30,820 --> 00:38:31,960 example might be a... 436 00:38:32,540 --> 00:38:36,560 I have no idea how to mouth that man's handle, so I'm just going to call him Nephew Chan. 437 00:38:37,000 --> 00:38:41,760 Nephew Chan decided to post pictures of, he apparently took of his iPhone of his aunt showering 438 00:38:41,760 --> 00:38:47,660 on 4Chan. Probably not a good idea, especially if you don't sanitize data. Well, anonymous being 439 00:38:47,660 --> 00:38:51,880 anonymous, decides to look at these JPEGs and goes, hey, you know what? The GPS information is 440 00:38:51,880 --> 00:38:56,020 still in that EXAF data because at the time the iPhones were thrown in there by default. And it 441 00:38:56,020 --> 00:38:59,440 was saying things like, well, we're going to tell your aunt what a perv you are unless you give 442 00:38:59,440 --> 00:39:00,200 us the rest of the pictures. 443 00:39:01,960 --> 00:39:06,740 Now, the sources for this are gone because Encyclopedia Dramatica that once was, either deleted 444 00:39:06,740 --> 00:39:12,540 the article or, well, as it was, it's now gone. But at some point in time, even before it was gone, 445 00:39:12,620 --> 00:39:17,140 they deleted the article. Luckily, there was archive.org, which has a version of the page from 446 00:39:17,140 --> 00:39:22,920 many years ago if you want to read more about that story. Well, mitigations, there's not a lot I 447 00:39:22,920 --> 00:39:27,020 can say here other than clean it out. But that varies from application to application. Make sure 448 00:39:27,020 --> 00:39:31,460 that your applications don't have metadata. Go on your phone, make sure you don't have it set to a 449 00:39:31,960 --> 00:39:38,660 store GPS coordinates and so forth. But of course, apps vary from app to app on how well you can do 450 00:39:38,660 --> 00:39:45,380 this and how you do it. Local attacks. Okay, at this point it's pretty much a lost cause. But we'll 451 00:39:45,380 --> 00:39:50,680 talk a little bit about them. If someone has access to your local box, well, it's only so 452 00:39:50,680 --> 00:39:57,060 anonymous you can actually be. Of course, at this point it comes down to, you know, classic data 453 00:39:57,060 --> 00:40:01,940 forensics, data in your hard drive, someone looking for cached URLs, memory forensics, data in your hard drive, someone 454 00:40:01,940 --> 00:40:07,580 forensics if necessary. So to mitigate this, this is just your general anti-forensics techniques 455 00:40:08,000 --> 00:40:12,760 and I have a three hour class out there on anti-forensics. This would be things like using a 456 00:40:12,760 --> 00:40:18,280 boot CD, using a boot USB so hopefully when you shut the machine down and no one gets to the 457 00:40:18,280 --> 00:40:22,400 memory fast enough or if you shut the machine down and hold it away from the person attacking 458 00:40:22,400 --> 00:40:27,820 you like that for a little while, you could hopefully get away with it. Though Andrew Case 459 00:40:27,820 --> 00:40:33,260 has been doing some work on if you find a box that is currently booted from a live CD or USB, 460 00:40:33,460 --> 00:40:38,480 looking at memory and being able to carve stuff and information out of that and he has his 461 00:40:38,480 --> 00:40:43,280 PDF out there on the Black Hat website if you want to view it. Hopefully he'll be able to post 462 00:40:43,280 --> 00:40:48,800 this video sometime on his blog. Also of course, full hard drive encryption is probably a good 463 00:40:48,800 --> 00:40:57,800 option. Now on to Sybil attacks. It's a good idea to have a hard drive on your computer. 464 00:40:57,820 --> 00:41:01,720 I asked earlier how many people have heard of Sybil attacks and not a whole lot have in this 465 00:41:01,720 --> 00:41:05,760 crowd. That's because mostly you see people refer to Sybil attacks, it's usually in academia. You 466 00:41:05,760 --> 00:41:10,760 don't see them referred to as much in the hacker scene. But think of sock puppets. One entity 467 00:41:10,760 --> 00:41:14,680 acting as many and there's multiple reasons why someone might want to do this. This allows them 468 00:41:14,680 --> 00:41:19,600 to control some things, especially in systems that have a more distributed way of handling 469 00:41:19,600 --> 00:41:24,240 routing. They might be able to say, let's say your mix net is based on a random walk where you 470 00:41:24,240 --> 00:41:27,800 randomly decide which way to go. Well, it's possible that you're going to be able to do a lot of 471 00:41:27,820 --> 00:41:31,260 things. If someone controls more of those nodes and there's some kind of peer profiling place 472 00:41:31,260 --> 00:41:36,000 saying, who do you trust? Well, if I can vote, hey, I own a thousand nodes and all of them vote, 473 00:41:36,080 --> 00:41:41,440 this guy is trustworthy, that's probably a bad thing. It makes a lot of other attacks easier. 474 00:41:41,820 --> 00:41:45,560 The more nodes that you own in the network, the easier it is to pull off traffic analysis attacks 475 00:41:45,560 --> 00:41:50,080 because you can see the data passing through you at more locations. So to give you an 476 00:41:50,080 --> 00:41:54,540 illustration of that, all these different nodes may look like they all belong to different 477 00:41:54,540 --> 00:41:57,800 people, but if they're all controlled by the same person, he can start manipulating them. So 478 00:41:57,800 --> 00:42:03,000 you can manipulate the network in various ways. For instance, in the case of I2P, the core 479 00:42:03,000 --> 00:42:07,480 people who are taking care of distributed hash table are, if I recall right, the flood fill 480 00:42:07,480 --> 00:42:12,340 routers. There's only so many of these and it's partly based on what kind of resources they 481 00:42:12,340 --> 00:42:16,640 have. So let's say you start controlling a large percentage of the flood fill routers, put up a 482 00:42:16,640 --> 00:42:20,440 lot of boxes with a lot of bandwidth, donate a lot to the network, and then all of a sudden 483 00:42:20,440 --> 00:42:24,540 decide to start manipulating them. Well, that would be an example of a Sybil attack. A whole 484 00:42:24,540 --> 00:42:27,780 bunch of nodes all controlled by one person. So you can control a whole bunch of nodes and 485 00:42:27,800 --> 00:42:32,580 manipulate them. Now, there's no absolute fixes out there for Sybil attacks. You can make it 486 00:42:32,580 --> 00:42:37,380 cost more to have nodes in the network so that someone can't spin up 5,000 nodes in the 487 00:42:37,380 --> 00:42:41,120 network to try to manipulate it, using some kind of proof of work algorithm like hash 488 00:42:41,120 --> 00:42:46,700 cache. How many people are familiar with Bitcoin? Bitcoin, then, is a similar concept. You 489 00:42:46,700 --> 00:42:52,620 have cryptographical problems that are easy to check whether or not someone got them right, but 490 00:42:52,620 --> 00:42:57,780 hard to actually calculate CPU-wise, or take longer to calculate CPU-wise. So you have a lot of 491 00:42:57,800 --> 00:43:03,020 problems. Another mitigation that's out there, both Tor and I2P restrict peering between two 492 00:43:03,020 --> 00:43:09,340 nodes that are on the same slash 16 IP network. This is to keep you from hitting someplace and 493 00:43:09,340 --> 00:43:15,540 going, okay, you have a tunnel through this network, but all the ISPs in your tunnel, sorry, 494 00:43:15,680 --> 00:43:19,520 all the IPs in your tunnel all belong to the same ISP and they can look at all of it. That would 495 00:43:19,520 --> 00:43:26,380 not be so good for anonymity. Also, central infrastructure may be somewhat more resilient to 496 00:43:27,800 --> 00:43:33,260 peering, though, as I discussed earlier, it has its own issues. And hopefully better peering and 497 00:43:33,260 --> 00:43:38,720 profiling strategies might help to be able to spot bad actors in the network. There's also been 498 00:43:38,720 --> 00:43:45,580 some ideas put forth like civil limits, civil guard, and civil identifier, which try to rely on 499 00:43:46,540 --> 00:43:50,800 real life social networks to decide whether or not, as I understand it, whether or not you 500 00:43:50,800 --> 00:43:57,740 should peer with somebody. But after the whole Robin Sage event, yeah, people were peering if 501 00:43:57,740 --> 00:44:03,960 anyone. People allow other people to say to their friends even if they're not. Next class of 502 00:44:03,960 --> 00:44:08,220 attacks I'm going to talk about are traffic analysis attacks. And as I said before, academia 503 00:44:08,220 --> 00:44:11,580 really likes to focus on traffic analysis attacks, though I really think the application layer 504 00:44:11,580 --> 00:44:17,440 stuff is where most people are going to have issues as far as their identity being revealed. But 505 00:44:17,440 --> 00:44:22,480 it's all sorts of classes of this. And there's a lot of subtle variations on how people are 506 00:44:22,480 --> 00:44:27,220 profiling this traffic. It could be things like timing of data exchanges, the total amount of data 507 00:44:27,220 --> 00:44:31,920 someone sends in their network, tagging of the traffic by colluding peers so that, hey, I'm the 508 00:44:31,920 --> 00:44:38,140 first hop, I mess with the data, I pass it along, later on I see it again and I'm going, oh, so I 509 00:44:38,140 --> 00:44:42,540 know you're the person that contacted me on this node back here, so I can make a connection 510 00:44:42,540 --> 00:44:49,480 there. Also, it generally takes a more powerful adversary to pull off. And it's really hard to 511 00:44:49,480 --> 00:44:53,300 defeat in low latency networks. By low latency, I mean things like HTTP where you expect a quick 512 00:44:53,300 --> 00:44:57,200 response. Email systems, well, those could be a little bit more complex, but it's really hard to 513 00:44:57,220 --> 00:45:04,680 be made somewhat more resilient. But to give you an example, this is an example of a one-way mesh 514 00:45:04,680 --> 00:45:10,640 network. Your ISP's view of it might be something more like this. Once it gets out of your 515 00:45:10,640 --> 00:45:13,900 connection, they may not know who else is talking to it, but they can watch all the traffic going 516 00:45:13,900 --> 00:45:20,520 to and from you and may still be able to do some kind of correlation from that. But let's go back 517 00:45:20,520 --> 00:45:25,560 to the earlier example. Let's say all the data is encrypted, as in Tor, and someone controls both 518 00:45:25,560 --> 00:45:27,200 your first hop and your last hop. And you're going to have a lot of data that's going to be 519 00:45:27,220 --> 00:45:32,760 encrypted. Well, you send in 5 megs of data. They send back 8 megs of data. And this may also 520 00:45:32,760 --> 00:45:37,620 have timings to it, like how many seconds between each exchange of data. Well, they control both 521 00:45:37,620 --> 00:45:43,700 the first hop and the last hop. Well, even if the information is encrypted, they can go, huh, 522 00:45:43,900 --> 00:45:49,020 this person sent 10 megs of data, and I just received 10 megs of data on the exit point. At the 523 00:45:49,020 --> 00:45:52,920 exit point, I can actually unencrypt it and look at it. I can kind of draw a connection there. Or 524 00:45:52,920 --> 00:45:57,200 if they see a protocol that sends 2K of data, waits 3 seconds, sends 4K of data, it's going to 525 00:45:57,200 --> 00:46:00,920 be 4K of data. And they see that same pattern later on, even though it's encrypted, and 526 00:46:00,920 --> 00:46:06,800 encrypted with a different key later on, just that pattern, that profile, they can use to 527 00:46:06,800 --> 00:46:12,700 de-anonymize. Another example might be timing correlations. Like I was saying, there was that 528 00:46:12,700 --> 00:46:18,240 whole delay between exchanges, between different nodes in the dark net. They could also do things 529 00:46:18,240 --> 00:46:23,980 like DDoS nodes they know that are in the path, and try to cause a certain pattern in that 530 00:46:23,980 --> 00:46:27,180 timing by overloading a server and making it delay of a packet. And then they can use that 531 00:46:27,200 --> 00:46:32,020 so they can impose the timing themselves. If they happen to be in the path, they can try to 532 00:46:32,020 --> 00:46:37,060 pulse the data flow and tag it via timing, though both Tor and I2P, I believe, signed the data 533 00:46:37,060 --> 00:46:41,760 they're sending, so they can't directly tag it, but they might be able to tag it via timing. I'm 534 00:46:41,760 --> 00:46:46,640 not sure. I need to look deeper into the protocols for that. Also just change the load in the 535 00:46:46,640 --> 00:46:53,360 path, like I was mentioning before. Mitigation, of course, more routers help. The more routers you 536 00:46:53,360 --> 00:46:57,180 have, the more people you have to bounce through. More code, the more people you have to 537 00:46:57,180 --> 00:47:00,200 cover traffic will help, because the more people out there talking, the more confusing it 538 00:47:00,200 --> 00:47:05,740 would be to an adversary trying to figure out who's talking to who. Entry guards may help. 539 00:47:05,820 --> 00:47:10,420 Entry guards is a concept that Tor uses, where essentially you have a certain set of points 540 00:47:10,420 --> 00:47:14,620 that are always going to be your first hop, and then you might somewhat randomly choose from 541 00:47:14,620 --> 00:47:19,420 there on out. Now, the first obvious thing to do would be to randomly choose your path every 542 00:47:19,420 --> 00:47:24,200 single time. The problem with this is, eventually, you may randomly choose someone who 543 00:47:24,200 --> 00:47:27,160 controls both, or you may randomly choose someone who controls both, or you may randomly 544 00:47:27,180 --> 00:47:31,960 choose a first hop and a last hop that are controlled by the same person. Now, it's granted, 545 00:47:32,080 --> 00:47:37,660 it's true with entry guards, you may have bad, and eventually, it's true with entry guards, you 546 00:47:37,660 --> 00:47:42,960 may eventually have really bad luck, and on your initial setup, choose someone who is 547 00:47:42,960 --> 00:47:47,340 malicious, and so you're always being profiled, no matter what, but at least you have a chance of 548 00:47:47,340 --> 00:47:52,840 that. In the case of a random choice every single time, eventually, with enough time, someone's 549 00:47:52,840 --> 00:47:56,060 going to be both the first hop and the last hop, control both nodes and be able to look at your 550 00:47:56,060 --> 00:47:56,400 traffic. 551 00:47:57,840 --> 00:48:02,120 One-way tunnels may also help somewhat. If your message is going out one set of nodes, but it's 552 00:48:02,120 --> 00:48:07,080 not coming back the same path, it should confuse some traffic analysis attacks. Short-lived 553 00:48:07,080 --> 00:48:12,140 tunnels may also help, giving people less time to profile. Better peer profiling to try to spot 554 00:48:12,140 --> 00:48:18,760 bad actors. Signing up the data, of course. And fixed speeds is another thing that's been 555 00:48:18,760 --> 00:48:23,600 proposed to where someone only sends at a certain data rate. Of course, in low latency networks, 556 00:48:23,720 --> 00:48:27,160 this is hard to pull off, not to mention various dark networks. So, you might want to look at 557 00:48:27,180 --> 00:48:33,060 how fast they can communicate. Probably cause problems for people. There's also the idea of 558 00:48:33,060 --> 00:48:37,860 padding and chaffing, to where basically you pad a message so people can't see how big it is, and 559 00:48:37,860 --> 00:48:44,100 later on you drop off some of that extra added useless data so that the same message is 5K here, 560 00:48:44,660 --> 00:48:49,800 20K here, 4K here, and still gets out, but it's harder to know whether or not it was the same 561 00:48:49,800 --> 00:48:55,020 message originally. The problem with this, of course, is it takes up extra bandwidth. Also 562 00:48:55,020 --> 00:48:57,160 non-trivial delays, making a message a little bit faster, but it's not going to be the same 563 00:48:57,180 --> 00:49:01,380 message a while before it's sent out can also confuse an attacker. For low latency protocols 564 00:49:01,380 --> 00:49:05,980 like HTTP, this really isn't so much of an option. But for things like mail, does it really 565 00:49:05,980 --> 00:49:12,700 matter if it gets there a minute from now or five minutes from now? Probably not. Then 566 00:49:12,700 --> 00:49:18,660 there's also intersection and correlation attacks. This could be as simple as knowing who's 567 00:49:18,660 --> 00:49:24,340 up in the hidden service at the same time as the public IP address is available. These 568 00:49:24,340 --> 00:49:27,160 techniques can be used to reduce an anonymity set. Maybe not necessarily, but it can be used to 569 00:49:29,600 --> 00:49:37,300 help you profile them. You can use various harvesting attacks to find out who's inside of a 570 00:49:37,300 --> 00:49:41,260 dark net so that you can try to contact them outside the dark net and use the information from 571 00:49:41,260 --> 00:49:46,480 that plus the existence inside the dark net to figure out who they are. To give you an example 572 00:49:46,480 --> 00:49:52,020 of that, I'm using ping, but a better example would be an HTTP request. You might make an HTTP 573 00:49:52,020 --> 00:49:57,160 request to a bunch of nodes you know are inside of the dark net. If you're using an HTTP request, 574 00:49:57,180 --> 00:50:01,580 well, first you check a bunch of hidden services to see whether or not they're up now. Then a 575 00:50:01,580 --> 00:50:05,920 bunch of suspect nodes on the public Internet, you may send a request to each one of them and see 576 00:50:05,920 --> 00:50:09,880 if they're up at the same time. If you did that profiling over a long enough period, you may 577 00:50:09,880 --> 00:50:14,000 eventually be able to figure out, okay, this particular hidden service or EAP site is down at 578 00:50:14,000 --> 00:50:19,040 the same time this particular IP address is down and be able to correlate those two or possibly 579 00:50:19,040 --> 00:50:26,960 the same. You can also do various things to cut down the number of checks. One minute. What service 580 00:50:27,180 --> 00:50:31,240 is running on the EAP site? I mentioned that somewhat before. You can harvest as many IPs as 581 00:50:31,240 --> 00:50:37,200 possible. Is the web server on the public facing IP running the same daemon? You can make a V host 582 00:50:37,200 --> 00:50:43,480 request and see if you can get the EAP site from the public facing IP address. And if so, 583 00:50:43,600 --> 00:50:49,820 yippee, you've found what box that is. Mitigations, well, more nodes helps, being a smaller 584 00:50:49,820 --> 00:50:56,480 needle in a larger haystack. Giving less data also helps, which is a good thing why ITP pulled out 585 00:50:56,480 --> 00:50:57,160 the server. It's a good thing. It's a good thing. It's a good thing. It's a good thing. It's a 586 00:50:57,180 --> 00:50:58,220 good thing. It's a good thing. By the way, there's a link to the web server header in newer 587 00:50:58,220 --> 00:51:04,540 versions. Making harvesting and scraping harder. Checking out, check out my article on a 588 00:51:04,540 --> 00:51:10,400 De-anonymizing ITP later on. I go into a lot more details of how those attacks work. Various 589 00:51:10,400 --> 00:51:14,980 links out there for if you want more information on this and this is all on your DEF CON CD. 590 00:51:16,840 --> 00:51:23,300 And thanks to the Comet organizers for having me. My buddies from derpy con and the ISD 591 00:51:23,300 --> 00:51:29,760 the podcast and of course the open icon library for some of the artwork I used. Events and 592 00:51:30,380 --> 00:51:31,880 questions which I'll be doing back in the room.