So, wow, this is like my sixth year doing this stuff. We got more toys to show off. All right, who here did it the first time to one of my talks? Awesome. Thanks for coming, guys. So, I don't know if anyone else does this. I sure do. I like good questions. I like insightful thoughts. I like people who mess with my head, and I reward such behavior with cool alcoholic beverage. So, if you've got an idea of something going on, think of it after the talk. There's a mic. Come up. Ask a question if it's good. Good things will happen. For now, let's talk about some pattern recognition. So, who am I? Some guy. What are we here to do today? Oh, there are talks where I talk about one thing and just go really in-depth. This isn't that talk. We're going to do like six or seven things, and we're going to go pretty quick because, you know, there's just not enough time to do everything, but that's never stopped me before. So, we are going to show off some mechanisms that enforce network neutrality. The telcos are up to some damn creepy stuff, and, well, what can I say? I like messing with them. We are going to, you know, I have me a nice little box that I can send packets faster. I cannot send packets faster than this network can route them. So, let's go. I can send lots of traffic, and I do on a regular basis. So, I looked at some SSL servers. I also looked at online banking. This is so embarrassing that someone has to do this work, but, oh, well, I'll fix it too. I kind of put a bug in OpenSSH a few years ago. Let's fix it. I'll do it with pattern recognition and just entropy. And, of course, pretty, pretty pictures. Now, I have a habit of showing off really cool, pretty pictures that, well, aren't necessarily useful. This time around, we are going to do, wow, that needs a little bit more light, but whatever. We are going to compare two files visually at a size of 16,000 pixels by 13,000 pixels. And the similarities will be completely visually identifiable. But, first off, let's talk about network neutrality. Telcos. Telcos have basically said, you know, we've been looking at this network traffic. There's some pretty cool stuff you're saying on our networks. We should charge you more for that. It gets a little creepy. When you actually filter it all down, it devolves down to an old thing that we have in the crypto world. Alice and Bob are in prison and are attempting to communicate without the warden interfering. How do they do that? Now, I never actually looked at my ISP as my prison warden, but, hey, it's an interesting thought experiment. Don't believe me? Check out this quote from Comcast. This is great. To accommodate the needs of our customers who do choose to operate VPN, Comcast offers the Comcast at-home professional product. At-home pro is designed to meet the needs of the ever-growing population, the small office, blah, blah, $95 a month if you want to check your email from home. No one actually thought, like, who here has had a minimum wage job? Funny thing, guys. So, you guys are making a couple bucks an hour. YouTube's losing a million bucks a month. You guys made more than YouTube. Network neutrality has nothing to do with YouTube. Those guys just shovel cash into a firing hole. No, no, no, no, no. It's all about freaking VPNs. It's all about $1,100 a year per telecommuter. Yeah, I'm a geek, but you know what? The price of oil has tripled. Pretty soon we're going to see a heck of a lot more telecommuting. They want their $45 billion a year, and they're going to break my network to do it. I don't like that. So, what am I going to do about it? TCP bandwidth estimation. You guys didn't actually think I was done with crazy little TCP hacks. Oh, no, no, no, no. I just get to keep playing with this stuff forever. So, TCP bandwidth estimation, an elegant weapon for a more civilized age. TCP, standard protocol for doing communication between points on the Internet, is very flexible, very well-tuned, very auto-tuning to the capabilities of a network. It is able to automatically determine the amount of available bandwidth, between any two points. Now, if you have two different clients that are using the exact same network, they actually do manage to figure out how much traffic they can split. But these boxes do not talk directly to one another. The entire process of figuring out how much speed to put on the wire, how many packets, is done by just looking for dropped packets. Oh, wow, a packet dropped. I better slow the hell down. That's pretty much how TCP works. Now, what this means is that dropped packets are an information channel They're a source of useful entropy on the net. Well, we're trying to figure out, TCP traditionally figures out that packets have dropped. Can we figure out why? So, here's what we're gonna do. TCP has told us that you can only send packets at 5k a second. And if you send them faster than 5k a second, something bad's gonna happen. You're gonna drop traffic. So, what do you do? You send packets faster than 5k a second. You send it one hop. So, you have your stream going. It's 5k a second. It's working. It's going. And you start putting on more traffic than the network has told you it can do. But you only let it go one hop in the network. What happens? Most likely nothing. It's only gone one hop. It's probably just on your local LAN. You let it go two hops. You let it go three hops. Oh, now you have gotten a total of 10k a second onto a router that has basically been dropping packets down on you until 5. Now, you go ahead and get it. You get packets dropping. Now, you're able to identify the specific hop and thus the specific internet service provider that has its limitations. Now, you say, that's kind of a neat little trick. And of course, it's not difficult. You can do this with HPing. I didn't even need to write any code to do this. You like run HPing with a couple of straight up obvious commands and it goes. As long as we're injecting interference, you know, we can control exactly what that interference is. So, you say, huh. More traffic. Packets get dropped. What if Viacom sent that traffic? What if NBC sent that traffic? What if my workplace sent that traffic? You can change the source IP. Now, you go, oh, but Dan, how will you ever see any replies? Well, you're not looking for replies from your spoofed source IP. You don't care about the actual interference. You're just injecting interference. And the back channel is in the TCP session that's been going at 5k a second and suddenly dropped down to zero. So, you go ahead. You drop it. You change the source IP. You can also go ahead and mess with the content. Say, oh, I'm going to put in some encrypted packets and see if this causes any particular deviation of behavior. Now, you say, well, why would an ISP ever do anything to affect encrypted traffic? Well, they did it, right? I mean, Comcast a couple of years back actually did go ahead and start blocking VPN in Washington State. Washington needed to go ahead and actually buy DSL connections for some ungodly number of users because the cable modem stopped working. Great. We know that they want to make a lot of money doing this. We know whenever you put firewalls in front of a lot of people, for some strange reason, they start running tunnels, possibly over DNS. But you see now, that's theft of service. And profit capture. Let's look at who actually legitimately uses encryption from their perspective. A, workplaces who have people who are checking their email from home. And B, e-commerce sites that make money from consumers at home. In both of these scenarios, there is a direct profit motive in keeping the encrypted link alive. The telcos really can take a look at encryption as, hey, if we shut that down, we can go ahead and get people to pay a lot of money to bring it back. And I really do not want to see that happen. As security professionals, as hackers, guys, it's a pain in the ass getting people to deploy things securely. I don't need to hear, yeah, but the telco is going to block us. So, let's mess with them. What's up, Toby? Ah, so what Toby was asking me is if I'm expecting to see silent dropping versus getting an alert. The problem with an out-and-out ban is that it's really obvious that your cable modem is broken. What they would rather do is they would rather make the traffic really bad. That way, instead of blaming the cable modem, you blame your provider. And you blame your company. And you say, you know, my company should be spending more on giving me a high-speed link, with more being defined as giving my telco money. Telcos like things that give them money. So, what I was asked is if I'd seen any redirection. I don't really have time to tell this story, but I'm totally going to do it anyway. Check this out. So, the porn world has weird issues like you would not believe. It's almost like there's not much legal enforcement in that land. So, there's this spyware that the porn guys have that hits them. And it's got a EULA. Who here loves EULAs, eh? Oh, they're just wonderful things. Yeah. So, the EULA actually said, somehow the spyware had a EULA. And the EULA said, we reserve the right to deem certain sites as unsafe. And to silently redirect you to sites we consider safe. So, what was happening is that people would spend 30 bucks a month on a porn site. It would move their money to a different site. Ha. Then they'd just silently go, oh, you're trying to go to that porn site? Well, here's porn. And there's your money. And it just kind of went somewhere else. So, that's the most I've seen in terms of a redirection. Speaking of secure solutions, let's talk a little bit of SSL for a moment. SSL, probably the standard way to do secure communication on networks. It's got a couple of basic rules for deployment. Don't put anything secret into an SSL cert. It's called a public key for a reason. You'll see in a future slide. Just how embarrassing this can be. And for the love of God, do not put the same key on two different boxes. Because if you do an SSL, each box can read each other box's traffic. So, I went ahead and scanned the world for SSL servers. Found lots and lots and lots of certs. And what kind of stuff did I find? Okay. If you are the sort of site, and you know who you are, that does not want people knowing all your internal DNS names, be very careful what SSL certs you let the public scan for. And quite specifically, if you have a honeypot, and the purpose of this honeypot is to trick people into attacking, you might not want to call it honeypot.yourcompany.com. And if you do, you might not want to get an SSL cert for it. Because you go to the site, it's like, hi, I'm the honeypot. Puts the pot in honeypot. So, what did I actually see when I did this scan? Good times. 90% of keys are actually deployed correctly. We're only seeing on one box. About 10% of keys were seen on multiple boxes. A lot. A hell of a lot. Only about one in three SSL servers I saw actually had a unique key because of this. You know, wouldn't it be depressing if there were a couple companies that put in, you know, made an SSL cert, put it in the device, shipped it to 10,000 people? That'd be just horribly depressing. Yeah, it's everywhere. Wouldn't it be even more depressing if a group that really should know better and has people in this room said, you know, we need to monitor SSL on our network. We better go ahead and take all 61,580 servers. And give them the same SSL cert. Yeah, any of those boxes can read the traffic from any other of those boxes. I'm sure that's going to be real secure. So, but there is actually a bigger SSL flaw that we have to deal with in everyday behavior. And that is the world's most depressing Google search. If you search for the phrase, why is this secure? You will get a lot of online banks that are very happy to say they take security seriously. They're very worried about phishing. They want to protect your money. Yeah, so they give you this form over HTTP, which is totally hackable. That's real nice. So yeah, you know, you've got these forms here, and then if you actually submit, you go to login, it submits to HTTPS unless there's a bad guy. You know, there would never be a bad guy. It's almost like this whole form's existence is to protect against bad guys. But, you know, it's okay. Because they have pictures of locks. Did you know if you put a picture of a lock on, your site is 83.2% more secure? I read it somewhere. 26% of the top 50 banks do this. This isn't like a little tiny problem. This is like multi-billion dollar sites completely ignoring the threat model of SSL. Now why would they do this? You know, it's actually interesting if you go ahead and you think about what's going on. We basically got three groups, right? You got the perf guys who are like, hell no, you are not putting our website on SSL entirely. Our site will melt down. The only online bank that actually has this set up is Wells Fargo. You go there, actually it's not the only one. They're the most prominent one. There are about five of the top 50. You go there, you move to SSL. It's just done. So the perf guys go, hell no. The UI guys say, if we don't show someone a username and login form on every single page that they see when they come to our site, they might not use online banking. And if they don't use online banking, they're going to call us on the phone or come in person. And users are fucking annoying. I never want to see them. I never want to hear from them. Do you know how dumb they are? I don't care if it's insecure. I don't want to speak to that bastard again. So yeah, what ends up happening is you end up with, you know, why is this secure? I mean, look at this. Social security number or tax ID. Could there be a bigger hack me button? Question. Is it possible for you to actually get all three groups, for you to get perf and UI and security to actually be happy? All right. Check this out, guys. So web pages aren't static. We got JavaScript. We got a little bit of an execution environment. What you do is when the user goes to start typing in their username, you go, oh, crap, things are happening. I bet they're putting in their username now. I think they're going to log in. Shocking, I know. And so what you do is you have an iframe open up. Iframe being a little tiny window that is a window into another page. And you have it open up the page in SSL. So while you're typing the username, a process that takes a couple of seconds, in the background, the SSL page is opening up. You go to type in your password. And it goes, oh, hang on. This would be horribly insecure if you gave me the password here. Let me move you over somewhere where it will be safe. The screen flashes. The tool bar changes color. Everything looks good. And you go, oh, but the UI guys will never accept this. You know how you make the UI guys accept it? Okay. See all these stupid little locks? You turn them into animated GIFs. And you let the lock close. Welcome to security in the weird world. So code is simple. This is how you do it. Bug me later and I'll show you the demo site. And it ends up just looking like username. You type in the username. The iframe shows up. Yahoo. Yahoo should know better. And you get the redirect. Now, as long as we're talking about bugs and crypto systems, I did one. This is a slide from my first talk here ever. Was anyone here actually at my SSH talk like five years ago? Fuck yeah. Holy crap. Yeah. So that dynamic forwarding stunt I did had a bit of a problem. Well, you know how later on I started researching DNS? Well, I kind of looked at this stuff through the DNS lens. And I'm like, ooh, you VPN over there, but your DNS is from here. So I SSH somewhere and I'm using dynamic forwarding from a malicious network DEF CON. And, yeah, I made all my connections there. And I'm like, oh, my DNS may be going out over this encrypted link, but they're going to places that some jackass here is controlling, and that's not good. Now, I got this partially addressed a little while ago. I went ahead and got a thing called SOCKS5 support put into open SSH so that applications could go ahead and say, hey, I want you, SSH, to handle my traffic, and here's the DNS name. And you do the lookup because this network is fucked. But you know what? There's a couple clients out there that no matter how much I try, Internet Explorer, are just not going to go ahead and support SOCKS5. Can I still bring them on board into the 21st century? Okay, guys, this is going to be horrible. Why can't SSH move DNS? Well, DNS is a UDP protocol, and SSH doesn't do the whole UDP thing. That's just not its gig. It's really a TCP only thing, TCP being a nice consistent stream of data, UDP being individual messages. Now, I could put a huge translation layer into SSH that actually spoke all sorts of DNS and did all this work and moved it back and forth and had a custom server and will put in thousands and thousands of lines of code and Theodorat will kill me. Or, so it turns out DNS, if you just tell it, yeah, I know how you gave me that request over UDP, but my response is just way too big for UDP. Why don't you retry that in TCP? DNS will go, yeah, there's a truncation bit. I better retry that in TCP. Works like a freaking charm. It's great. This is totally the way to do that. But it does lead to a problem. It means I'm going to hell. See, I had DNS over SSH working. I had SSH over DNS working, which means DNS to SSH to DNS. Yes, guys, I finally did write DNS over DNS. See what I go through for you guys. Another bug with SSH. SSH, the authenticity of 1.2.3.4 can't be established. RSA key fingerprint is 0989B1998. Am I supposed to do something with that? Oh, yeah. Crypto people will look you very solemnly in the eye and say, yes, you're supposed to recognize that key. You should see that and go, oh, yeah, yeah, that's totally blah. I see that all the time. No problem. No. So there's a group out there called ADM that basically has a great attack. It's called generate 2 billion SSH keys and see the one that looks the closest and host that one. Works like a charm. It's almost like the human brain wasn't built to look at strings of hex. I don't know. So kind of new field that I'm spawning naming called crypto mnemonics. It's basically how the hell do we patch crypto into the human brain? I like saying that. So there are three classes. Oh, wait, guys, who are you still in college? Who are you that are still in college are taking comp sci classes? Okay, guys, take some sci classes too. Just trust me. Sci classes are awesome. And they will mess with other people's heads, which is even more awesome. Yes, it's computer engineering for girls. Hey, you know, we hack computers, they hack us. I can either confirm or deny that last comment. But please come up here and grab a beer. All right, so check this out, crew. We got three useful things we can pull out of the human brain for crypto use. We've got rejection. What the hell is that? I have never seen that before in my life. We got recognition. It's that one. And we got recollection. Here, I'm going to tell you exactly what it is. That last one, recollection, is all about passwords. You know, recollect your password. Needless to say, people's memory for passwords sucks ass. People's ability to recognize stuff. I pick it out of a lineup. It's a bit more. And your ability to say what the hell is that is huge. It turns out the less you ask the human brain to do, the better it does. That's all right. Okay. You know, we can use that. We can use that. So what else can we, since hex is a clear and utter failure, what else can we use? Well, there have been some other attempts. They go ahead, instead of doing recollection for passwords, they try to do recognition, where you recognize. Something vaguely defined as artwork. Or you recognize human faces that are automatically generated. Now, if you actually look at this pass faces system where you recognize the face that you look at. See, we got five attempts. You got to pick one of nine. Nine to the fifth is 59,000. Wow, that's not even 16 bits of entropy in that password. Or pass face. And? . . So what Toby just said is, and humans have the documented tendency to pick the most beautiful face in a series. Which is why pass faces doesn't let you choose which face to authenticate against. It just says, you're going to recognize this one, this one, this one, this one, and this one. Precisely get around that bug. But the bottom line is, pass faces can only get about 16 bits of entropy. Now, this isn't a problem. Interesting point, though, by the way. Grab a beer if you want. So, pass faces can only do so much. That works for online, right? Like, if pass faces isn't noticing a brute force attempt that's going through 59,000 tries, they're not doing something right. But we don't have online when it comes to SSH keys. You're just handed something and told, here's your hash. You recognize it. And for that, we're going to need something else. And speaking of going to hell, I'm probably going to hell for this one, too. So, check this out. Check this out, crew. Bet you didn't think I could make an ENS reference. You're going to be totally wrong. So, humans do not remember arbitrary strings of characters effectively. That's just not how we work. What we remember are stories. Homer's epics are enormous. But, you know, there's a funny little thing about stories. I don't know if you noticed. They kind of change over time. You know, things get embellished. Things get changed. Things get dropped. But the only consistent thing in storytelling are names. And when it comes to names, those things stay stable. Homer's been Homer and Homer for a long time. Simpson. So, we seem to have hardware acceleration for names. So, what if we went ahead and took that huge string of hex and turned it into a series of names? Like so. Well, we take U.S. census data for names available at the census gov. We note there are more unique female names than male names. We know that there are way more last names than either. We take 512 male names. That's 9 bits. 1,024 female names. That's 10 bits. 8,192 last names. That's 13 bits. We try to get as different names as possible. We use something called the Levenstein algorithm to come up with an edit distance. The max minimum number of changes from one thing to another to go ahead and turn the first into the second. I'm mentioning this in detail because we're going to abuse the hell out of it later. So, what we want to do is we want to make sure the two names are the same. The names don't look similar. And we can do that because there's a fair amount of entropy around names. And we split our 160-bit big mess of hex into five married couples. I got to say, it's kind of weird, but Julio and Epifania de Zutti is a hell of a lot more readable than A1321651. The crazy thing... Okay. So, this is really interesting. I actually got to tell Phil Zimmerman about this. And I got to get his jaw to drop, which pretty much made my year. And Phil Zimmerman is like, yeah, we hired this linguist. And he went ahead and he studied and did all these genetic algorithms to determine words that wouldn't be confused for one another. You know what else we're not optimized to handle? Random freaking words. We can handle arbitrary names. We're damn good at that. Random words, not so much. It's almost like we suck at learning new languages. Three years of French, remember nothing. It is, first of all, shocking that this actually works. That's kind of a surprising thing, but it does. It is critical you actually show the user the key every time they log in. You can't just be like, oh, hey, I guess you should probably learn to authenticate this guy. Hey, you recognize this? Like, I've never seen it before. Sure. No, you actually need to show them for every legitimate use. Then when there's a challenge, the memories have been created. So speaking of broken representations of entropy, you're looking at a file, new file, never seen it before. And you're like, oh, well, let's look at a hex dump of it. And what do we see? 6A, AC, 06, 2D. Again, am I actually supposed to do something with this? Now, what OD tries to do, octal dump, is octal dump will actually go ahead and take, oh, here's a whole bunch of zeros. I'm just going to shrink all these down. Well, gee, thanks. I appreciate that. But still. 6A, AC, 06. What the hell? People go, ah, yes, for our hex dumper, we'll add ASCII. Okay. That's still not very helpful. We need a little better. Now, why do we need better? Well, first of all, because if you're like me, you're a moschus, you like looking at random protocols and seeing what the heck they do. And second, fuzzing. Anyone notice fuzzing is breaking the crap out of everything? So I've been playing around with fuzzing stuff. And, you know, fuzzing, you have files. The files are just bits. I've got to figure out some way to find structure on it. How am I going to do that? So we've got two different ways of doing fuzzing right now. A, dumb fuzzing. I don't know what I'm doing. We're just going to, like, flip a bunch of bits and see what happens. And that can be helpful. In fact, that destroys the crap out of a whole bunch of stuff if it's not specifically designed. It's a little depressing. There's also smart fuzzing, where you have total knowledge of what the system is, and you just do this full analysis, and then you fuzz in the structure, and you go back and forth. It's a huge amount of development. And you can do it. But, you know, you don't get to be a lazy bastard. I like being a lazy bastard. I don't want to have to understand all the things I break. That's hard. Can't a computer do it for me? Isn't that kind of the point of our entire industry? Can't someone else do it? So can we increase the intelligence of dumb fuzzing? Well, the first thing we're going to have to do for that is get me beer. Because nothing increases intelligence like beer. Mm-hmm. Yes, things get very fuzzed. Things get very fuzzy. So there's a freaking cool tool. Check this out, guys. It's called Sequitur, right? Sequitur is a linear time pattern finder. You hand it big old piles of crap, and it doesn't care how much you throw into it. It just goes ahead and creates sequences and patterns out of it. Actually, the technical term are hierarchical context-free grammars. Now, what the heck is that? Here's a switch statement, right? Switch C, case 1, value 2. Case 2, value 3. Case 3, value 4. You know, a little bit of redundancy in there, right? You would pass that to Sequitur, and Sequitur would say, oh, no, no, okay, we'll represent it as switch C, A1, B2, A2, B3, B3, A4. So it's actually a compression algorithm, but with a very nice trait of you can actually look under the covers and see how it's doing its work. That's kind of cool. This is a smart guy. He should end up somewhere like Google. Okay, he's the chief research scientist. His thesis is awesome. I suggest you check it out. So here's what we're going to do, right? Oh, wow, that's totally not visible at all. Oh, well, you'll have to find me later to see the actual live version of this. But check this out, guys. In Sequitur, Sequitur goes ahead and creates a tree that you have to traverse to get back each byte because, you know, it's like, for example, everything in case, you have to go down one level in the grammar to reconstruct the word case. So what we're going to do is we're going to take each byte and we are going to render each byte by how deep in the tree we had to go to recover that particular byte. With this completely idiotically stupid little design, what you end up getting, and you totally can't see it on the projectors, is there any way someone can kill those lights up there or any other light on this? Probably not. But what you end up seeing is you end up seeing this. Oh, yeah. There we go. Sweet. All right, check this out, guys. Look, instead of this just being a random string of bytes, you have no idea what's going on, what's this huge blob right here? What are these, like, basic offset, you know, white lines right here? We ended up getting full-on visual identification of segments and sections. I have no, okay, actually, this is the Windows NT kernel. It's like, oh, look, okay, repeated structure, repeated offset. It's just all visually aligned with absolutely no knowledge. So we have significant improvement on analysis. Ah, now we start up a new tool. We can bring lights back up now. I'll tell you later when we can shut them back. Oh, we can keep on and off. It doesn't matter. So you go ahead and you look in this guy's paper. He shows off one of the things that makes his stuff cool is now that you go ahead and you have this symbol-level view of our data, we can go ahead and we can generate graphs out of it. The symbol switch leads to A1, B2, A2, B3. You know, switch leads to case. Case leads to 1.2. 1.2. 1.2. 1.2 or 3 or 4 which always goes to value. This batching up is actually kind of meaningful. Now you go, but, Dan, you know, I can read this. I can see C. I can manage to handle it. Yeah, that's because C is designed for the human brain. This crap works on anything. So you can just take arbitrary stuff and it will find structure that you can run through this process. It will create symbols that you can manipulate and link together. And any time we have a symbolic-level view, we can fuzz at that view. So I'm creating a new tool called the CFG 9000, context-free grammar, 9000 ways to fuzz. We reduce our input stream data to a stream of symbols. We fuzz the data at the symbol level rather than pure bytes. We do shuffling. We do dropping. We do repeating. Now, Sequitur is not necessarily the best algorithm to go ahead and generate our sequence of symbols. Oh, we got a kid. Wait. Is this the newest spot the Fed? I mean, are we starting a little young here? What's up? Wait. Is this the lost and found? Because that's going to be really depressing. It wouldn't be a Dan Kaminsky talk if I didn't have to come in here and lecture you again on keeping the aisles clear. If you're in the aisles right now and sitting down, you need to get up and either find a seat, move to an area where you're not in an aisle, or you need to leave. Okay? There's some space right up here in front of the stage. So you can come up here. Everyone from over here, guys, come on in. Actually, all you over here, why don't you shift over to this side because there's a huge amount of free space and we can let all the people out from there. Exactly. Like, along this wall over here, there's a lot of free space if you all can... And no exit, very visible to get us kicked the hell out. Yeah, please. Sorry to interrupt again. It wouldn't be a Dan Kaminsky talk if I didn't do a spot the Fed, I had to interrupt to get a lecture. It's all cool, man. That's my son, by the way. Oh. Very cool. Can I give him a beer? But it's DEFCON. All right, guys. We don't have a huge amount of time, but we still have lots of toys to play with. So what does CFG's output look like? This is just very, very basic, basic fuzzing that I'm doing on the symbol layer. I'm not even fuzzing, like, the internal graph of how things all align, but still. So I went ahead and I threw Secquitur through its own code, the actual code for Secquitur through the fuzzer. What you end up seeing is, wow, this thing straight up identified, calculate rule usage, calculate rule usage, calculate rule usage, this thing has identified a basic, what's it called? Stack depth attack. Now, you might say, yeah, but syntactically, you know, it's missing the closing braces. But hey, with literally no work, this algorithm figured out interesting sections to repeat. So it's kind of cool. And yes, things blow up. Things to do. Create Recquiter, which is the Secquitur implementation optimized for fuzzing use. Need to generate larger symbols. Need to eliminate redundant symbols using work by a guy named Kaifern Yang. Yeah, if you have two symbols that reduce down to the same message, how about we merge them? Secquitur is linear time. It, however, takes absolute crap tons of memory. So you can get about 150 megs through before your memory usage is at about 900 megs, which is okay. But, you know, hey, what can I say? I want to take the entire contents of my hard drive and run it through Secquitur. I'm going to need something out of memory. And add the ability to compare files against foreign grammars. Now Secquitur is really cool, but it's not where we need it yet. There's another approach that I remembered. And it worked. It was called Dot Plots. There's this paper called Visualizing Music and Audio Using Self-Similarity. It's a very brute force solution. You compare a song against itself, you know, little tiny chunks. And you see, you know, does this chunk sound like that chunk? There's a tool called Disassociated Audio that will make graphs like this for you. It's actually a Beatles track. Actually, why don't we drop the lights again? So this went ahead and this identified individual sections of this track. And they're very visually distinct. Now I said, could we do this possibly with something else? And you're saying, eh, we might want to fuzz, like the Pirate Baby MPEG at the beginning of this video. Go ahead and you run this exact process on something on your hard drive where you take it, you split it into chunks, you do analysis. I'll do a deeper description in a sec. You get really distinct and useful visual patterns. What the hell is going on here? Let me tell you. Jonathan Hellman wrote this thing called Dot Plot Patterns, a literal look at pattern languages. And if you look at this in an example from Shakespeare, 2B or not 2B, we get this big diagonal line of similarity, 2 equals 2, B equals B, or equals or, et cetera. We also get a second diagonal line from the repeat of this 2B and that 2B. So instead of having individual words with a single bit, whether it's the same word or different words, we use a similarity metric. Well, where did we have a similarity metric? Oh, yeah, we had one when we were identifying how names were different. Well, instead of doing names, we're going to do chunks of individual files, 32-bit chunks. We're going to arrange them in the X dimension. We're going to arrange them in the Y dimension, and we're going to do a self-similar comparison. So what does this end up looking like? Java class files, .NET assemblies, CNN's homepage, of course, HTML being far more self-referential, far smaller tags that repeat, and thus the density is much higher. Packets, SMB torture packets. Kernel32.dll. All right. The human chromosome 22. The legend of freaking Zelda. I don't know crap about 6502, but I can take a look. So why is this useful? Because if I'm doing, imagine if I had a big old packet trace and I could not separate my packet, you know, the file into individual packets. How would I go ahead and identify what was going on? Well, what this is doing, this is at least saying, with no prior knowledge, this is a different section than this. This is a different section than this. And I can fuzz them one at a time. Can I potentially do more? Well, what are my actual messages here? Well, from the paper, we do actually see this is a full on, a diagonal is a full on repeat. Squares are sections that are self-referential when you change from one section to another. Kind of get an idea there is actually a visual language going on here. But there is a lot of research to do because there is some weird ass stuff in files. Like, I have, what the hell is that? I am not, what? But you know this is good, right? It's nice to have a tool that's showing you better things than you can identify easily. Because that means there is, you know, hey, it was just a hex thump to me before. And random string of bytes, we're just random string of bytes. That's just how it was. This is showing me something different. Now, there is more research to do. Figure out what the hell these things mean. Create some interactive tools for dot plot evaluation, do a little, you know, data microscopy. Color. Different similarity metrics. We can have different colors. Better symbol selection. I am being an idiot when it comes to this stuff. I don't have a clue what's going on in the x86 layer. My similarity metric is raw bytes. I could have so much better stuff if I had a clue. But you know what? Right now I've got pretty pictures and I'll take that too. You don't think I'm done. No, no, no. I've got one thing left. All right. If autocorrelation is interesting, if it's cool to compare A to A, what if we didn't compare a file against itself? What if we compared it against a different file? Now, if it's a totally different file, you get this thing, it's called ass, it looks like it. But what if you compare a file to an older version of itself? Well, normally when it's the same, you get this hard diagonal line because, of course, a file is the same. You know, the first 32 bytes are the same as the first 32 bytes. The second 32 bytes are the same as the second 32 bytes. And it works, you know, whatever. But what if it's two different versions? Well, let's ditch the slides for a second because, you know, I like megapixels. Nothing says hacking like 16,000 by 13,000 pixels. Awesome. I can neither confirm nor deny. All right. Let's check this out. We're going to open a little image here. It's going to take a little while because it's, you know, a couple hundred megapixels. This should not actually be useful. So yeah, I re-implemented all my code in C just, you know, because it might be a little faster. I got an 80 times speed improvement, hell yeah. So I'm like, wow, I'm going a lot faster here. I should go ahead and start trying to, come on, you can load any minute now. Okay. Let's go ahead and just, as a lark, see what happens if we allow two different files to compare against each other. Oh, well, check this out. Instead of having this hard diagonal line, we've got this little meandering thing. Oh, look, new data over here, new data over here, back to normal, new data over here. Big, huge insertion of new code. We should probably look at this. Guys, it's a visual bin diff. I didn't think this would actually be useful. But you can just visually trace it out. Okay. You've got one-third of your brain dedicated to visual processing, at least me, believe you me, I'm willing to use it. So yeah, you can basically just go through files, find the differences, figure out what is going on. In summary, your VPN is under threat, if you've got one, you might want to tell your boss that the telcos are evil bastards. SL has got some issues, especially online banking. Especially those of you who are putting the same sort on 60,000 boxes. Please stop. There's some fun DNS games you can play. Oh, please, for the love of God, if you're writing code, fuzz your file formats. This is ridiculous. It should not be this easy to knock your crap over. And take a look at your data. You might be surprised at what you find. Now I've talked too long. Get the light on. I've got some beers to give away. Thank you.