Hello, everyone. The talk you're sitting in on right now is Cypher Spaces and Darknets, an overview of attack strategies. First of all, quickly a little bit about me. I run irongeek.com. Hopefully some of you have visited the website before. I have an interest in infosec education. I don't know everything. I'm just a geek with time on my hands. So if I get something slightly wrong on one of these darknets I'll be talking about, come up to me after the talk. I'll be interested in hearing about it. Back in the Q&A room. I'm also an irregular on the ISD podcast. They podcast five times a week. I'm usually on Thursdays. And I'm also a researcher for the Tenacity Institute, which was kind enough to sponsor me coming here today. All right. A little bit of background information. First of all, what do I mean when I say a darknet? Now, there's a lot of different definitions and it can get a little confusing. There's a name collision out there. But I'm using the broader sense of darknet to be just an anonymizing network. Generally speaking, these darknets are also known as mixnets, where you have mixnets, which is a network of darknets, which is a network of multiple proxies that you hop through and different levels of encryption so that you can communicate and people don't know both where you're communicating to or what you're communicating. I also love the term cypher space. And that might be a little clearer term to use for some of these networks. The two ones I'll be using as reference examples are, of course, Tor and I2P. But there's a lot of other ones. And some of the attack strategies I'll be talking about here are very accurate. And some of the attacks that I'll be talking about here are academic and there's actually mitigations in place in both Tor and I2P to hopefully make them not be nearly the size of the problem that they could be. Things get subtle when you start talking about attacking mixnets. Terms kind of vary between researcher and researcher, what they mean, some particular term means. For instance, who here has ever heard of a Sybil attack? Who here has ever heard of a sock puppet? Probably a few more people who have heard of sock puppet? I'm going to go through definitions of all of those. But a lot of literature out there is very academically oriented and I'm going to try to make this talk begin in such a way that it helps people understand the academic research without necessarily having to have read 20 papers on the subject. There's a lot of weaknesses that are interrelated. Sybil attacks, for instance, can be used to help augment attacks with traffic correlation. And like I said there's a lot of other cypher spaces out there besides Tor and I2P. The ones you see up there on the screen, just to name a few. But Tor seems to have gotten most of the ground and I2P is sort of a runner up. If anybody wants stickers from the I2P project, come up to me at the Q&A room. I have some. But like I said before, I'm going to focus on Tor and I2P for my illustrations. And some of the talks we've had are academic and I'm going to try to give a few real world examples though to illustrate how they can be used. Now, when it comes to attacking dark nets, threat model matters a whole lot. You can't really protect against everything. Some protocols may just be lost causes. One of the problems with some of these cypher spaces is people try to throw protocols across them that just were never designed to be anonymized. BitTorrent would be a good example which I'll go into a little bit later on. Users may do things to reveal themselves. No matter how anonymous someone is, if they start using a dark net and use their real name, they're not going to be able to protect themselves. They're not going to be able to say, well, you know who they are. Not all the attacks that we're talking about necessarily reveal the actual identity of the person. They may just reveal the IP address they're truly talking from or may just reduce the anonymity set. For instance, you don't know the true IP they are from, but you know they use ISPX or their in country Y. Also, when it comes to attackers, there's different types. You have your active versus passive ones. Your active ones are actively doing stuff to manipulate the network and passive ones are just sitting there listening. You also have location, location, internal versus external. Externally listening like your ISP might be internally somebody who decides to join the dark net and screw around with other peers to see what they can find out. Adversaries, of course, also vary by their power level. You have like nation states, which have a certain high level of power. You're going to have things like ISPs as well. Then there's differences between western democracies and other places. For instance, some of these dark nets, they might even do a very good job. They might do a very good job of hiding who you're talking to and what you're sending. Everybody knows you're using it. And some countries, just the fact that you're trying to hide something from the government may be enough to have someone come knock at your door. Also, some private interest groups may also be interested in finding out who's actually behind a certain pseudonym or who's actually exchanging information in these dark nets. And finally, those schmucks like me all are about to get a good job of hiding. just like to play around. All right. The two dark nets I'm going to use for most of my illustrations are both Tor and I2P. I'm only going to quickly cover those. How many people here have heard of Tor before? Pretty much everybody. How many people have heard of I2P? That's cool. Awesome. But Tor essentially you have multiple levels of encryption. You pass something in. It's like Chinese nesting dolls or like an ogre with layers. And each layer along the way gets stripped off until you get to the exit point and then you reverse the process to get back in. Hidden services are a slightly different issue where you can host something inside the Tor network. But it's mainly focused on out proxying to the public Internet. I2P, on the other hand, a little bit different. Instead of using bidirectional tunnels where you build a circuit and it's both your in and your out, it has unidirectional tunnels where basically you have a series of out tunnels. You send something out and you send them into somewhere else. And then you have a series of out tunnels where basically you have someone else's in tunnels and you have in tunnels of your own which is coming to you from other people's out tunnels. This unidirectionality is there to hopefully mitigate some traffic analysis attacks because you have to compromise more nodes in the network to figure out who's talking to who. It also uses layered encryption. It generally refers to it as garlic routing. And I'll try to discuss the difference, sorry, well, garlic packets and I'll try to explain some of the definitional differences between the two. But its key focus isn't out proxying to the public Internet. It can do that, but generally you have like one out proxy. Its main goal is so you can host something internally without other people knowing you're the one hosting it. And this could be anything from, well, an EAP site, which is a website, to a box you can SSH into, IRC, all those sorts of things. And in my opinion, this is rather subjective, it seems to do the hidden services types of functionality faster than Tor does. But it doesn't really have great out proxying ability to the public Internet because you generally have one out proxy, so it's easy to detect. Not that Tor can't be detected, but that's another subject matter. Essentially you have, with ITP, three levels of encryption. You have your end to end, you have between each hop, and you have between your in tunnel and your out tunnel. Conceptually, though, it's pretty similar to onion routing. It's a little bit different, but it's a little bit different. It's a little bit different. The key difference is it's called garlic because you have cloves in a piece of garlic. To where in theory you could make a message, send it to an end point, actually have it separate out and have it separate out in separate messages and have them all return to you in different ways. Now, the way ITP currently implements this, it doesn't really take that full functionality. It's actually a little closer to onion routing than that picture illustrates. But that's a concept of what you could potentially do with garlic routing. And if you accentuate that some more, it's a little more. Imagine if you could send a message out and have cloves of it separate here, separate there, come back in different directions. And they're asking for this masking traffic for each other as you're sending these packets out on the network. It's not exactly implemented that way in ITP as of yet, but the packet format has that potential. All right. The first vulnerabilities we're going to be talking about are untrusted exit nodes. You're only as anonymous as the data you're sending. Quick overview, this is mostly Tor centric. You've got to wonder, is the person who's running the exit point you're going through, are they looking at your data? The traffic may be encrypted while it's inside the network, but once it hits that exit point, it's unencrypted. Or it's encrypted as whatever protocol is riding inside of Tor. If you're using HTTPS, you may be okay, depending. And I'll get up to that depending here in a second. A few incidences, if you're using this, Dan Egerstad, the whole thing, Embassy hack, was called back in 2007, essentially a bunch of people, workers at embassies were using Tor to tunnel out of the host country so they could do things anonymously. Unfortunately, the things they were doing didn't lend themselves to being particularly anonymous. Yeah, the host country may not have been able to directly spy on their communications, but when you're using POP3, SMTP, HTTP basic authentication, and other plain text protocols, the person who's sitting there on that exit point can sniff it. What Dan did was he set up his own exit point and started sniffing the traffic to see what was going on out there. Not exactly the best way to keep yourself private if you're using Tor for those sorts of functionalities. So keep in mind, if you're using Tor, be careful what you send out there. You're only as anonymous as the data you request and send. Also, Moxie Mullenspike had a similar thing. And this is where my little note about SSL comes in. He set up his own exit point and he put SSL strip on it. So even if someone was trying to use HTTPS and have it extra encrypted inside the Tor tunnel, he'd use SSL strip, knock that connection down to HTTP, and be able to look at it. And if the person who was surfing using Tor wasn't paying attention and didn't notice that the lock wasn't there, the URL didn't say HTTPS, then they might very well have been owned. Quick illustration of what this looks like and also gives you a better idea of what I mean by onion routing. Since essentially you have three layers of encryption on a message. One layer gets stripped off on each hop. Hits the exit point. Goes out unencrypted. And at that point, the person can look at it and possibly modify it to do some other attacks I'll be talking about later on. You can tell some people when they draw node diagrams of cipher spaces and mix nets, they give you like circles and lines. So this is my interpretation of what a dark net should look like. It's all one big happy duck net. And of course any time you see someone with a goatee, we obviously know the goatee one is evil. Okay. Keep in mind, mitigation wise, Tor is for anonymity, not necessarily security. But only as secure as the protocols you're trying to make right on top of it. Use end-to-end encryption. Don't use plain text protocols. And if you do use plain text protocols, expect the other people to take advantage of it. But if you don't take advantage of it, you might be able to see them. But sometimes that's fine. You just want to visit a web page without other people knowing you're visiting that web page. You don't care if they see that someone accessed this web page. Your e-mail, however, is a slightly different matter. Don't use plain text protocols that send usernames and e-mail addresses. You're not very anonymous if people know your e-mail address and name. But strangely enough, people at that embassy were doing it. The next type of attack is the one that's more likely to be used in the future. The next type of attack I want to talk about is DNS leaks and other protocol leaks on the application layer. Does all the traffic you're trying to send actually go through the proxy or does some of it leak out in other ways? DNS leaks are a classic example. And badly configured proxy settings could also lead to some types of traffic to go elsewhere. And I'll show some of those bad configurations here shortly. A snooper can set up web bugs and if the protocol that the web bug is accessed via isn't properly supported by the dark net, it's possibly confining the real IP address of someone visiting a site. HTTPS is a good example of this. But plug-ins can also be an issue. There's a lot of plug-ins out there that don't necessarily properly respect the proxy settings of the browser they're embedded in. Application level stuff is generally a problem. A whole lot of things in academia seem to revolve around traffic analysis attacks. But it takes a little bit more powerful adversary to pull some of those off. So, if you're looking for some sort of a tool to pull off the application layer stuff, most people can pull off, I imagine, in this room. JavaScript is pretty much just hosed. Definitely use the Tor browser, Tor button from the Tor browser bundle. It tries to sanitize some of the JavaScript issues. Probably won't turn scripting off. But for more information on how JavaScript can totally pwn somebody, go check out Gregory Fleischer's talk from DEF CON 17. But to give you a graphical illustration, here's what a DNS leak looks like. Let's say you go out and you visit irongeek.com, but you don't want anybody to know you're visiting irongeek.com. Well, sometimes when people configure Tor or ITP, for that matter, if the request for that host name is not sent into the dark net itself, it may be sent out to the public Internet. Now, in this particular illustration, my ISP wouldn't necessarily know what information I'm sending out onto the dark net. But since they see 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 public Internet. Well, the person who sends me a request for irongeek.com, well, they know I'm going to be web surfing there, even though they don't know what data I'm getting from irongeek.com. The same thing goes for .onion and .ITP addresses. These are hidden services and eep sites respectively. While your communications to them might be secured and no one can see what you are sending, if your DNS entries or your DNS settings are misconfigured or your browser is not properly supporting them, someone who controls the DNS server can just sniff that connection to the DNS server can figure out, oh, well, I'm not sure what he's doing with this I2P site, but I know he's contacting it. And depending on what the site is, that could be bad enough. Mitigations for this? Well, first thing you should probably do is connect to a Tor I2P, follow up Wireshark or TCP dump and use that little TCP dump filter, port 53, and see if anything is actually going out there on port 53. See if anybody is doing any kind of DNS communications while you're surfing around using Tor I2P. If you have Firefox set up, you may want to make sure that this particular configuration is set. You go in the out config and just set it to use remote DNS through the proxy to hopefully mitigate those kind of leaks. Now, some applications, no matter what, they don't have a setting where you can say send everything through my SOX proxy to do all name resolutions. So Tor button can also help with this. Tor app button can also help with this. Tor app button can also help with this. Tor app button can actually make some of these settings for you. Other applications vary where you have to make these settings. You may have to firewall off the machines. Port 53 entirely might be an option. Another option out there is inside of Tor, you can edit the RC file and there's a setting called DNS port 53. You set DNS port 53 and your local machine will now have a DNS server on it and you can set your machine to use that as its DNS server in your IP settings so that hopefully that will totally mitigate the problem of people being able to see your DNS traffic and figuring out where you're surfing. Another thing is grabbing content outside the doc net. I stumbled across this while I was playing around with I2P and didn't exactly have all my settings done correctly. Essentially what happens is let's say someone requests a hidden server or an EAP site and that server is not working. So you have to set up an IP server and that server has some extra stuff embedded in it. This could be a plug-in. It could be just an image. In this case I had configured an HTTP proxy using I2P but I did not configure an HTTPS proxy. So if someone happened to have an image embedded in the page that said HTTPS some URL to some image, it would not be going through my doc net. Instead it would be going directly and let's say they're serving up serial numbered images, they can quickly correlate who visited the page with this particular person who contacted me inside of the doc net. Now here's what I screwed up. When I first did my settings on I2P, I just set an HTTP proxy. A couple options I could set. I could say use this proxy for all protocols. In I2P's case that setting isn't exactly ideal because all those other protocols are not supported by the proxy. But at least it's keeping that little SSL issue from happening. Another option would be to actually configure an SSL proxy which I2P does have, but that particular out proxy has a tendency to be down. Slightly related would be things like cookies. Let's say you're web surfing along, you're visiting Google and you go, okay, I'm going to go look for some websites now and I want to be anonymous. However, you didn't change context or anything like that and you just started and said, okay, start using my Tor proxy. Well, if you got a cookie while you were outside the doc net and you haven't changed context, you switched into private browser mode or used a different browser or changed profiles, well that same cookie could very well be served up to the host while inside the doc net and through it and then go, well, I saw this person coming to me from the public internet and now I see them coming to me from the doc net with the same cookie, I know it's the 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 do that. There's also a possibility of making hidden services contact you. For instance, let's say someone's running a vulnerable web application on an EAP site or Tor hidden service. It's possible you could throw an exploit in payload, something like, let's say, some kind of shell execution vulnerability and actually get that remote target server to contact you outside the doc net and now you know who they actually are. All right. So, I'm going to show you some examples. Another example would be BitTorrent. Now, BitTorrent has a lot of issues and all this work I've pulled from the folks whose names are at the bottom of the slide. I really don't want to butcher their names. So, go out and check it out later. It should be on your DEF CON CD. But BitTorrent has multiple issues. One of its issues is if Tor is only being used for contacting the tracker, I could just watch announce messages and extension protocol handshakes to extract real IPs. Another thing is, again, if Tor is only being used for contacting the tracker and SSL is not used, I could sit there as the exit point and I could change the return peer list to point to me as one of the sources and watch for the outside contact, then try to correlate an IP based on the peer ID and the port. Another option would be even if the peer traffic is sent over Tor, which generally most people are hopefully not going to do. First of all, using the Tor for BitTorrent is kind of frowned upon, but even if you did do it, it's a pretty slow thing to do. So, most people only configure the tracker for Tor use, not necessarily direct communication to other clients. But even if the peer traffic is sent over Tor, if the DHT is used, the distributed hash table is used, the IP may still be revealed because UDP packets are still not sent over Tor. So, you can scrape the DHT and find out who all is sharing that particular file based on peer ID and port ID. You may also then be able to, because you've de-anonymized someone via BitTorrent and figured out who they are, you see messages coming through that same circuit, through that same tunnel and some other protocol like HTTP, well, you go, it's coming from the same circuit, I've de-anonymized the BitTorrent use, so I know it's the same person who is visiting this particular website. So, it can also leak out and cause issues for other protocols you're using at the same time. Another example of an application flaw I'd like to mention is IRC. And for a while now, I was trying to keep a different identity inside the ITP network and I kind of botched it. But I was using Pigeon as my IRC client and by default, if you don't configure its ident information, whenever someone does a who is on your NIC in IRC, they can find out what username you log into a machine as. Now, in my case, if you Google up ITP and Adrian, it comes pretty quick to figure out who I am, even though I was using a different handle while I was inside of IRC. Luckily, you can fix this, and this is going to vary from client to client. You can go in and set a username and real name so you can put information that's not necessarily connected to you. Then when someone does a who is, you can log into the box with. Probably a good call. Some general mitigations. Client-wise, make sure your browser is set to send all the traffic through the dark net. You may want to start using dark net, fire up a sniffer, test a few protocols, go, hmm, is anything leaking out to the public Internet that I wouldn't want people to see? Also, look into setting up firewall rules on a box so that nothing can go out besides going out through the dark net's port. If you're using a web browser, limit the plug-ins used. If you decide that you want to use every single possible plug-in out there, you don't know whether or not they properly respect proxy settings, you're probably going to be hosed. And using a separate browser, like I keep a copy of the Tor browser bundle that I've also configured so I can switch between it and the ITP back and forth, separate from everything else, and I only use that for accessing these networks, and I don't use my core web browser at all. Also, you might want to check, you know, if you're using a dark net, when you're using one of these dark nets, visit one of these sites like Decloca.net and Panopticlick. Decloca.net is from the same people that do the Metasploit project. Basically they try a bunch of different, embedding a bunch of different file types, like let's say, Word docs, and they try a few different plug-ins and so forth, and try to get something not to respect your proxy settings in your browser and find out your real IP address that way. Panopticlick is somewhat similar. It's more about trying to figure out how anonymous you are via your user agent structure. It's more about trying to figure out how anonymous you are via your user agent string and a few other factors like JavaScript, what JavaScript returns, and it tries to figure out, out of this many hundreds of thousands of people, how unique is your particular web browser. Obviously, you don't want to be unique, because if you are unique, then you can be profiled. Also, of course, on the hidden server side, don't run vulnerable web applications or any other kind of applications inside of a dark net. If you do, and someone happens to be able to hit it with an exploit, doing a payload that does a reverse, you know, reverse, you know, reverse TCP connect, well, they quickly figure out who you are. Also, don't run on a box that routes to the public Internet. If you're going to have a box that you want to host stuff as a hidden service or a tor-eap site, there's no real reason it has to contact the Internet other than just the dark net client, and it could actually be running on a different machine on your network. The dark net client could be running on another machine and just communicate and forward all its port activity, but the box you're actually running, you're not going to be able to get access to the internet. You can't directly contact the Internet no matter what people send it. And that might be a good call, as well. Another class of attack I like to talk about is attacks on central resources and infrastructure attacks, as well as just general DOS attacks. Now, as far as DOS attacks on an individual host inside the network, more than likely most of the blunt of the damage that's going to happen to all the nodes between you and them. So, you know, if you're going to run on a network, it's going to be more of a DOS against the network than any individual hidden service inside of it. There's a whole bunch of categories of general DOS attacks on the network, just like starvation attacks where you maybe promise to give certain resources and don't. Partitioning attacks where you do various things on the network saying, all right, if I take out this particular one that's routing and this particular one that's routing, can I still get a message out? I've split down the network and I start whittling it down towards a smaller cross section and I have less possible people to have to look at. And, of course, there's this flooding that's sending a crap ton of stuff into the dark net to disturb it. Standard DOS attacks, generally speaking, well, first of all, people who do DOS for the sake of being a political advocate, thank you. Yeah, just don't. And if you're going to do it, definitely don't do it over talk because you're going to be destroying Tor, not whoever you're targeting anyway. But I find the maturity, if you're into free speech, then pretty much at all times DOS is wrong. You can debate with me about that in the Q&A session later on. I'm sure someone would want to. Shared known infrastructure is also a problem. This is not necessarily a direct attack inside the dark net, but if certain core servers out there, like let's say the Tor directory servers are taken out, well, it becomes really hard 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. And then I'll be talking about how to get anybody to route through. Similar things with I2P. If the I2P website went down, a lot of people wouldn't know where to download the client. Also, they have... well, they try to use a distributed system where you don't necessarily have to talk to a directory server to figure out other people you can bounce through. They use a distributed hash table called NetDB. However, there are also re-seeds that are used so that if you're a new client, it will start to re-seed to get to your initial contacts inside that distributed hash table. If you don't have that initial re-seed, you're going to have to re-seed. So, when you do a you can't contact that, well, you're pretty much not going to be able to get on the network. Also, of course, total or severe blocking of the Internet will keep a dark net from functioning at all, obviously. Now, a few incidents have happened in the past. Back in 2009 when China blocked some of the Tor directory servers, this caused huge issues for people being able to use Tor. Luckily there's mitigations out there for that. There's also other general blocking of the Internet that's happened, like Egypt and Libya and Iran in more recent days. So let's say someone tosses the directory server. If they do that, then you can't find nodes to route through. If you can't find nodes to route through, you can't get on Tor. General mitigation, well, for Tor there's something called bridge nodes. Instead of having all the routers in Tor be announced via the directory servers, you can actually find out these bridge nodes in other ways. It could be something like... email someone at the Tor project and they send you back a small list of bridge nodes. Or you could maybe meet someone at a conference and say, yeah, I run a bridge node in that particular country. Here, connect to this and I'll get you on the rest of the network. The core idea is not to have all your eggs in one basket where someone can easily block all access to Tor. Distributed infrastructure may help. For instance, ITP, instead of having core directory servers, tries to do everything in a distributed hash table where everything is in the same hash table. So everybody is kind of responsible for sharing this information and once you get in the network and you've had some time to get well integrated into it, this kind of information just comes to you and you... it's sort of like a distributed database. So that might help somewhat, but even ITP does have some central infrastructure. Protocol obfuscation may help in some cases so that people don't know that you're using Tor or ITP. And I know both of those projects are working on better forms of obfuscation. So if you're using Tor or ITP, you're going to want to be careful. Because in some cases, like I said before, depending on what country you're working out of, just the fact that you're hiding something may be enough for someone to come knocking on your door. Also, total and severe blocking of the Internet, that's a little bit harder problem to get around and this is one I'd really like to do more research on. So if anybody has any information on this, come up to me during the Q&A session. I'd like to hear it. Mesh networks. The core idea is, think of kind of like a, I guess a layer one dark net where you basically build your own infrastructure. So let's say you had some cheap hardware with some kind of wireless connectivity. You could spread these nodes out across the geographical location and basically have messages bounce around in them. So this host may forward a message for this host to here, to here, to here, to here, and eventually get it out on the public Internet in some way. Now depending on the location, though, and the type of message you're trying to get out, you may not necessarily be able to be fully integrated at all times and get a message out. So there's also things like store and forward where essentially someone creates a message and let's say you made a client for phone systems where, okay, this person is trying to get a message out. They do the message and they carry it around in their pocket. Whenever their phone comes in reach of another phone that can send the message out, it passes it along, passes it along, store and forward until eventually it can get to a place where that message gets out. Now obviously we're not talking about low latency protocols like HTTP for this. But if you're trying to get a message out, you need to be able to do this. But for an e-mail, just trying to get an e-mail out of a country, the store and forward method might very well work. So I'd be interested in seeing more work on mesh networks and easily deploying them to get around problems where people do complete blocking of the Internet. All right. For more info on mesh networks, I've got a few resources for you. I don't know of any clear frontrunners saying this is the technology we'd be able to use to quickly and cheaply deploy a bunch of nodes in a mesh network. Wikipedia has a few entries, of course. Also there's the village infrastructure in a kit alpha project you might want to check out. And maybe some of you have heard about the whole Internet in a suitcase project. The New York Times had an article on that a while back where the U.S. government is funding money so they can send these basically Internet in a box to various countries to help dissidents out. The next category of attack I want to talk about are clock based attacks. Some protocols out there, like HTTP, for example, allow you to check the remote system's clock. So clock differences can be an issue. If someone's clock is set way different than yours and way different than everybody else you contact in the network, well, that's a point of profiling. Major differences are easy to spot. Minor differences are a little bit more difficult, but there has been some work on doing statistical analysis where even if it's a very minor difference, with enough time, you can do your thing. Now, a few incidences. I'm going to show you a few instances where you can do your thing. One major paper that's been in research circles on this would be Steve Murdock's hot or not. This is a neat concept. Essentially different hardware has different reactions when it gets hot, its internal clock skews a little bit. And not all hardware is the same and not everybody is going to be in the same temperatures. So there's a certain unique pattern to how much this internal clock skews. So what he did is he set up his own private Tor network and did some experimentation and was able to at least partially de-anonymize people or de-anonymize nodes based on how different the clock was. And he was using HTTP requests and pulling off the time header. Now, unfortunately, though, he was having to do this inside of ‑‑ it's been a while since I read the full paper, but he had to do this on his own private Tor network because the general Tor network ‑‑ how many people have complained about Tor network being slow? So there's enough network jitter as far as timing out there already that it makes some types of attack hard to do because you don't know whether or not is this guy two seconds off of my clock or did it just take two seconds for the message to get to me? Or in some cases, is this guy really five minutes off and did it take five minutes to get back to me? There's also been some research on I2P clock differences and I'm going to show you a table here in a second for a project I did for Tenacity a few months back. But quick illustration, just because I love putting up these smiley computers. I'm going to show you a table here in a second. You ask what time it is, you get a report back and you can start profiling, well, how different is this person from me and how different is he from everybody else on the network? Now, here's a table I generated and hopefully it's somewhat readable, where I essentially went out there and looked at each node I could find inside of I2P that was running an EAP site, and requested it from its EAP site, hey, give me this web page and I took note of the time. At that particular time, I2P didn't strip out the server headers so you knew what type of server it was if it returned that information. So I'd find out is this EAP site hosted via Apache or IIS or something else. They've since stripped this out, which was a great thing to do. They're very responsive. But let's ignore that for a second. I was pulling down times and if the time is only a few seconds different for me, that could very well be network jitter. It takes a while for that tunnel to build and for a message to get out my out tunnel into someone else's in tunnel, out there, out tunnel and back into my internals. That all takes time with multiple hops. So a few seconds, that probably isn't significant. However, when someone is almost a minute different than me and I found an IP address on the public Internet that I knew was using I2P that was about the same difference, I have a good idea, especially when I find out that the web service software is the same, that those are probably the exact same box. The reason I could know the IP addresses of the people who are using I2P is I basically scraped that distributed hash table 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 don't know. So I was like give me all the IPs of anybody who is using this. And I sit there and wait for a while and log them and log them and log them and basically go out there and well, this next graphic should illustrate that better. I'll do it in a second. Let's see. These attacks can be kind of hard to pull off from the standpoint, actually I don't want to illustrate it in this one, pardon me. Essentially what I did was basically query all those websites inside of I2P via the EAP site address, find out the time difference, then query all those IP addresses, see if they were running a web server, find out its time difference and start correlating them. Now some of these attacks, there's actually inverted mitigations in there already. By their very nature, mix nets are going to be slower than the public internet because you have to hop through multiple proxies to be able to get anywhere. So that little bit of timing jitter can obfuscate those clock differences. Also, setting your clock to a reliable NTP server, will probably help. Some protocols actually have stuff in place already to try to synchronize timers. For instance, I2P does a lot of work to try to make sure that its internal clock is set appropriately. But I2P's internal clock isn't necessarily used to set the web server software that you're hosting from. So it only goes so far. Back to the NTP server thing, I specifically outlined it has to be reliable. Because if it's not reliable, well, using an NTP server that's reliably three minutes off, it's not going to be reliable. So it's going to have to be reliable. But if it's three minutes off, it's still a point of profiling. Another class of attack that I think is fascinating is attacks in metadata, using metadata to profile people. Now, data, first of all, who all knows what metadata is? All right. I'm preaching to the crowd then. Metadata is essentially data about data. All sorts of examples out there. If you look at a PDF, it might be embedded in who the author was. Same thing for Word doc. Then there's things like EXIF data that's inside of JPEGs that might give you information like GPS coordinates. Lovely stuff. Way too many to possibly name. And in some older formats of office docs, they actually embed a Mac address in your Word doc. Now, that's good profiling right there. But that's been a while. I think that was Office 97 that did that. Now, I don't know if anybody who's actually been de-anonymized inside of a doc net because of metadata, but it's easy to see how someone could be. Let's say you're hosting some site inside of ITP or Tor. You have a bunch of PDFs on it. Someone can start looking at these PDFs and going, huh, what can I find out about the person who offered it? But to give you some examples of where people have been pwned by metadata, Kat Schwartz is one of my favorite examples. A few years back, she took a sexy picture of herself with her head leaned back, smoking, and she cropped it and posted it up on her blog so that people could, you know, look at the photo. Well, when she cropped it, the software she used, the software she used, the software she used, didn't rewrite the EXIF data. One of the things the EXIF data actually maintains besides just things like GPS coordinates if someone decides to put them in there, or if the application decides to put them in there, is a thumbnail. Well, when she cropped the image, the application she used cropped the main image but did nothing to the thumbnail. So let's just say that picture goes down a little bit further than what I have up on the screen right now. Another example would be Dennis Rader, better known as the BTK killer. Way back before everybody in the house had a computer in the home, he would taunt the police and so forth and get away with it and they wouldn't be able to chase him down. Eventually, I think someone was writing a book on him and he decided to start taunting the police again, so he sends like a floppy disk with a Word doc on it to the police with a taunt. Well, they look at the Word doc, I guess they right clicked on it and looked at its properties, and saw that it was offered by Dennis and it was registered to some church. So they go visit that church, find the guy named Dennis, and they caught him. A funnier example might be a... I have no idea how to mouth that man's handle, so I'm just going to call him Nephew Chan. Nephew Chan decided to post pictures of, he apparently took of his iPhone of his aunt showering on 4Chan. Probably not a good idea, especially if you don't sanitize data. Well, anonymous being anonymous, decides to look at these JPEGs and goes, hey, you know what? The GPS information is still in that EXAF data because at the time the iPhones were thrown in there by default. And it was saying things like, well, we're going to tell your aunt what a perv you are unless you give us the rest of the pictures. Now, the sources for this are gone because Encyclopedia Dramatica that once was, either deleted the article or, well, as it was, it's now gone. But at some point in time, even before it was gone, they deleted the article. Luckily, there was archive.org, which has a version of the page from many years ago if you want to read more about that story. Well, mitigations, there's not a lot I can say here other than clean it out. But that varies from application to application. Make sure that your applications don't have metadata. Go on your phone, make sure you don't have it set to a store GPS coordinates and so forth. But of course, apps vary from app to app on how well you can do this and how you do it. Local attacks. Okay, at this point it's pretty much a lost cause. But we'll talk a little bit about them. If someone has access to your local box, well, it's only so anonymous you can actually be. Of course, at this point it comes down to, you know, classic data forensics, data in your hard drive, someone looking for cached URLs, memory forensics, data in your hard drive, someone forensics if necessary. So to mitigate this, this is just your general anti-forensics techniques and I have a three hour class out there on anti-forensics. This would be things like using a boot CD, using a boot USB so hopefully when you shut the machine down and no one gets to the memory fast enough or if you shut the machine down and hold it away from the person attacking you like that for a little while, you could hopefully get away with it. Though Andrew Case has been doing some work on if you find a box that is currently booted from a live CD or USB, looking at memory and being able to carve stuff and information out of that and he has his PDF out there on the Black Hat website if you want to view it. Hopefully he'll be able to post this video sometime on his blog. Also of course, full hard drive encryption is probably a good option. Now on to Sybil attacks. It's a good idea to have a hard drive on your computer. I asked earlier how many people have heard of Sybil attacks and not a whole lot have in this crowd. That's because mostly you see people refer to Sybil attacks, it's usually in academia. You don't see them referred to as much in the hacker scene. But think of sock puppets. One entity acting as many and there's multiple reasons why someone might want to do this. This allows them to control some things, especially in systems that have a more distributed way of handling routing. They might be able to say, let's say your mix net is based on a random walk where you randomly decide which way to go. Well, it's possible that you're going to be able to do a lot of things. If someone controls more of those nodes and there's some kind of peer profiling place saying, who do you trust? Well, if I can vote, hey, I own a thousand nodes and all of them vote, this guy is trustworthy, that's probably a bad thing. It makes a lot of other attacks easier. The more nodes that you own in the network, the easier it is to pull off traffic analysis attacks because you can see the data passing through you at more locations. So to give you an illustration of that, all these different nodes may look like they all belong to different people, but if they're all controlled by the same person, he can start manipulating them. So you can manipulate the network in various ways. For instance, in the case of I2P, the core people who are taking care of distributed hash table are, if I recall right, the flood fill routers. There's only so many of these and it's partly based on what kind of resources they have. So let's say you start controlling a large percentage of the flood fill routers, put up a lot of boxes with a lot of bandwidth, donate a lot to the network, and then all of a sudden decide to start manipulating them. Well, that would be an example of a Sybil attack. A whole bunch of nodes all controlled by one person. So you can control a whole bunch of nodes and manipulate them. Now, there's no absolute fixes out there for Sybil attacks. You can make it cost more to have nodes in the network so that someone can't spin up 5,000 nodes in the network to try to manipulate it, using some kind of proof of work algorithm like hash cache. How many people are familiar with Bitcoin? Bitcoin, then, is a similar concept. You have cryptographical problems that are easy to check whether or not someone got them right, but hard to actually calculate CPU-wise, or take longer to calculate CPU-wise. So you have a lot of problems. Another mitigation that's out there, both Tor and I2P restrict peering between two nodes that are on the same slash 16 IP network. This is to keep you from hitting someplace and going, okay, you have a tunnel through this network, but all the ISPs in your tunnel, sorry, all the IPs in your tunnel all belong to the same ISP and they can look at all of it. That would not be so good for anonymity. Also, central infrastructure may be somewhat more resilient to peering, though, as I discussed earlier, it has its own issues. And hopefully better peering and profiling strategies might help to be able to spot bad actors in the network. There's also been some ideas put forth like civil limits, civil guard, and civil identifier, which try to rely on real life social networks to decide whether or not, as I understand it, whether or not you should peer with somebody. But after the whole Robin Sage event, yeah, people were peering if anyone. People allow other people to say to their friends even if they're not. Next class of attacks I'm going to talk about are traffic analysis attacks. And as I said before, academia really likes to focus on traffic analysis attacks, though I really think the application layer stuff is where most people are going to have issues as far as their identity being revealed. But it's all sorts of classes of this. And there's a lot of subtle variations on how people are profiling this traffic. It could be things like timing of data exchanges, the total amount of data someone sends in their network, tagging of the traffic by colluding peers so that, hey, I'm the first hop, I mess with the data, I pass it along, later on I see it again and I'm going, oh, so I know you're the person that contacted me on this node back here, so I can make a connection there. Also, it generally takes a more powerful adversary to pull off. And it's really hard to defeat in low latency networks. By low latency, I mean things like HTTP where you expect a quick response. Email systems, well, those could be a little bit more complex, but it's really hard to be made somewhat more resilient. But to give you an example, this is an example of a one-way mesh network. Your ISP's view of it might be something more like this. Once it gets out of your connection, they may not know who else is talking to it, but they can watch all the traffic going to and from you and may still be able to do some kind of correlation from that. But let's go back to the earlier example. Let's say all the data is encrypted, as in Tor, and someone controls both your first hop and your last hop. And you're going to have a lot of data that's going to be encrypted. Well, you send in 5 megs of data. They send back 8 megs of data. And this may also have timings to it, like how many seconds between each exchange of data. Well, they control both the first hop and the last hop. Well, even if the information is encrypted, they can go, huh, this person sent 10 megs of data, and I just received 10 megs of data on the exit point. At the exit point, I can actually unencrypt it and look at it. I can kind of draw a connection there. Or if they see a protocol that sends 2K of data, waits 3 seconds, sends 4K of data, it's going to be 4K of data. And they see that same pattern later on, even though it's encrypted, and encrypted with a different key later on, just that pattern, that profile, they can use to de-anonymize. Another example might be timing correlations. Like I was saying, there was that whole delay between exchanges, between different nodes in the dark net. They could also do things like DDoS nodes they know that are in the path, and try to cause a certain pattern in that timing by overloading a server and making it delay of a packet. And then they can use that so they can impose the timing themselves. If they happen to be in the path, they can try to pulse the data flow and tag it via timing, though both Tor and I2P, I believe, signed the data they're sending, so they can't directly tag it, but they might be able to tag it via timing. I'm not sure. I need to look deeper into the protocols for that. Also just change the load in the path, like I was mentioning before. Mitigation, of course, more routers help. The more routers you have, the more people you have to bounce through. More code, the more people you have to cover traffic will help, because the more people out there talking, the more confusing it would be to an adversary trying to figure out who's talking to who. Entry guards may help. Entry guards is a concept that Tor uses, where essentially you have a certain set of points that are always going to be your first hop, and then you might somewhat randomly choose from there on out. Now, the first obvious thing to do would be to randomly choose your path every single time. The problem with this is, eventually, you may randomly choose someone who controls both, or you may randomly choose someone who controls both, or you may randomly choose a first hop and a last hop that are controlled by the same person. Now, it's granted, it's true with entry guards, you may have bad, and eventually, it's true with entry guards, you may eventually have really bad luck, and on your initial setup, choose someone who is malicious, and so you're always being profiled, no matter what, but at least you have a chance of that. In the case of a random choice every single time, eventually, with enough time, someone's going to be both the first hop and the last hop, control both nodes and be able to look at your traffic. One-way tunnels may also help somewhat. If your message is going out one set of nodes, but it's not coming back the same path, it should confuse some traffic analysis attacks. Short-lived tunnels may also help, giving people less time to profile. Better peer profiling to try to spot bad actors. Signing up the data, of course. And fixed speeds is another thing that's been proposed to where someone only sends at a certain data rate. Of course, in low latency networks, this is hard to pull off, not to mention various dark networks. So, you might want to look at how fast they can communicate. Probably cause problems for people. There's also the idea of padding and chaffing, to where basically you pad a message so people can't see how big it is, and later on you drop off some of that extra added useless data so that the same message is 5K here, 20K here, 4K here, and still gets out, but it's harder to know whether or not it was the same message originally. The problem with this, of course, is it takes up extra bandwidth. Also non-trivial delays, making a message a little bit faster, but it's not going to be the same message a while before it's sent out can also confuse an attacker. For low latency protocols like HTTP, this really isn't so much of an option. But for things like mail, does it really matter if it gets there a minute from now or five minutes from now? Probably not. Then there's also intersection and correlation attacks. This could be as simple as knowing who's up in the hidden service at the same time as the public IP address is available. These techniques can be used to reduce an anonymity set. Maybe not necessarily, but it can be used to help you profile them. You can use various harvesting attacks to find out who's inside of a dark net so that you can try to contact them outside the dark net and use the information from that plus the existence inside the dark net to figure out who they are. To give you an example of that, I'm using ping, but a better example would be an HTTP request. You might make an HTTP request to a bunch of nodes you know are inside of the dark net. If you're using an HTTP request, well, first you check a bunch of hidden services to see whether or not they're up now. Then a bunch of suspect nodes on the public Internet, you may send a request to each one of them and see if they're up at the same time. If you did that profiling over a long enough period, you may eventually be able to figure out, okay, this particular hidden service or EAP site is down at the same time this particular IP address is down and be able to correlate those two or possibly the same. You can also do various things to cut down the number of checks. One minute. What service is running on the EAP site? I mentioned that somewhat before. You can harvest as many IPs as possible. Is the web server on the public facing IP running the same daemon? You can make a V host request and see if you can get the EAP site from the public facing IP address. And if so, yippee, you've found what box that is. Mitigations, well, more nodes helps, being a smaller needle in a larger haystack. Giving less data also helps, which is a good thing why ITP pulled out 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 good thing. It's a good thing. By the way, there's a link to the web server header in newer versions. Making harvesting and scraping harder. Checking out, check out my article on a De-anonymizing ITP later on. I go into a lot more details of how those attacks work. Various links out there for if you want more information on this and this is all on your DEF CON CD. And thanks to the Comet organizers for having me. My buddies from derpy con and the ISD the podcast and of course the open icon library for some of the artwork I used. Events and questions which I'll be doing back in the room.