How you doing? I'm going to be with you in just a second. I have three versions, we have three versions of this show. And the idea to give you guys a choice for versions kind of came from an old game called Leather Goddesses of Phobos. Anybody ever play that? Yeah, I see a lot of hands. Leather Goddesses had three modes. They had tame, they had moderate, and they had lewd. How many people want a tame presentation? Ooh, how many people want a moderate presentation? Okay, how many people want a lewd presentation? Okay! Is it too early for beer at DEFCON? It's like barely noon. Is it better if it has fruit, like for breakfast? Does that work better? Okay, so lewd it is. Fuck, it ain't right. So, quick introduction. So, I'm Matt Richard. I work for iDefense, a group of, part of VeriSign. I, um, my background is I worked in financial services for about ten years and doing network ops and security ops and then came to VeriSign and just kind of hang out. So, we have a quick talk on exploitability and extrusion. So, it's a quick background, something I wrote, um, as a sort of a hobby just from hanging around and, uh, being on different networks. And, uh, Fred's going to join me. Fred's going to talk a little bit more on the risk angle. Oh, yeah, this is, uh, I'm Fred Doyle. I'm the director of the iDefense Research Lab. Um, I see some people in here that were at our party the other night. I think we had a party. I remember a party, kind of. So, um, I'm hoarse from that party still. We had a good time, though. So, everybody who joined us on that. Thanks a lot for coming. And we're not using the same PC that the presentation was written on. So, we've got a couple little issues. Apple. So, one of the quick things, just to get out of the way. I tend to talk a little fast. So, if I start rolling too fast, just throw a beer at me. I'll stop, drink it, slow down, and we'll be good to go. So, a quick agenda. So, we're just going to go through some background on why would you need a tool like extrusion and exploitability scanning. What does it mean? Um, why is vulnerability assessment not enough? What, uh, what does it do and doesn't it do? And by no means are we going to spend, like, 45 minutes on this. So, don't, don't walk out yet. Um, we're going to talk a little bit about extruders. And then we're going to get into the cool details of EE scan, what it does, how it does it, and some of the different cool things it can do. Um, and then go through a couple of real world examples with the code and how it works and, uh, how you can use it for different, uh, test different things. Fred's going to talk a little bit about the, uh, risk angle to it. Like, now that you know, like, all the things that we're going to talk about. All these crazy things that are allowed. What kind of hostile networks you're on. What is the risk level of that kind of stuff. And then, uh, finally I've got some real data from when the tool was run on real networks. Um, especially through, like, real world intrusion prevention and proxy systems. So, we're going to look a little bit at the, at some data to see, like, what kind of attacks do things actually block. You know, look at some of the exploitability data and go through that. So, just a couple of quick definitions. I don't know, uh, if you can see the image there. But exploitability apparently isn't really a word. I've just been using it for a while. So, uh, nothing actually recognizes it. But, what I, in the context that I use, it's basically, when we're looking at exploitability, it's something exploitable through a series of defenses. So, a lot of enterprise networks have intrusion prevention, proxies, and, you know, 15 different layers. The defense in depth model to, uh, try to block attacks. And we just want to know, through all those defenses, is something actually exploitable. We don't care if it's vulnerable. We just want to know if it's exploitable. Can exploits get through? Can we obfuscate them and do things to actually get it to pass through? And then, uh, extrusion, very basic definition there. You know, what kind of traffic can we get to leave a network? Can we use, uh, you know, a lot of people try to lock down protocols and what can be used on their network. So, we're, the E-scan framework gives us a way to test, you know, different protocols and different ports to see what can we actually get out of a network. Okay, we're gonna start out here with, uh, what I call the Ripley moment. And, uh, there was a time when a lot of people, not everybody, but a lot of people, most people, in fact, thought that the internet was safe. In fact, I remember when I had a consulting firm in a computer store, my clients were forced to buy a $1,200 firewall, which, by the way, I set up using Linux and IP chains. Who, did they couple to the modem in this, in this slide? Yeah, yeah, yeah, always had a modem, yeah. Who set up, uh, Linux with IP chains, just a show of hands? Oh, my God, you're still alive. That's a good thing, because it was a pain in the ass. Uh, tables, a lot easier. But anyhow, so, um, a lot of people thought that the internet was safe. Uh, Code Red, for example, came out. All my clients, because it was, of course, on the news, it's like, am I, am I in danger? No, remember that $1,200 device you didn't want to buy, but I made you? So you're all set, right? But bottom line is this, um, next slide, please. Obviously, it's not the case. Once we had one bad person on the internet, everything became bad. And that's why we're here today, all right? Now, what we did, of course, we, uh, developed fields of fire, we said, okay, there's things that we can't control. We'll never control the internet. We can't control, you know, anything behind our modem. And we're mostly facing forward, okay? We are looking forward, looking at threats. And when we do pen testing, we test from the outside looking in. But what we, what we determined that a good way to, uh, solve all these problems is to add layer after layer after layer after layer of security. And that's where we are today. Now, thanks. We, uh, had planned this for remote control. All right, vulnerability assessment, these are all the things that we try to do traditionally to find out how secure we are. We do vulnerability asses- assessment, you know, is there something that can be attacked? Penetration testing, of course, we all know what that is. Risk assessment, um, you know, we're in Vegas. Who here has done good risk assessment in the past? Raise your hand. Okay, of those with your hands up, how many lost money at the tables? Yeah, my hand's still up. Okay, uh, risk assessments, uh, any software vendors in here? If there are software vendors in here, please cover your ears. Because I'm going to tell you right now, software vendors don't do risk assessment. They're whores. They're hookers. And I had to say that for two reasons. I had to say that for two reasons. Reason number one, um, I want to be able to deduct the expense from the other night. Reason number two is because the software consumer is just like a John. They want it, the hooker- the vendors want to give it to us, and we don't care about the risk. We're going to get into more of that later. Okay, Matt. So, um, so one of the other things, and this is kind of where a lot of my background is from, is ad hoc testing. Um, so in doing pen tests and everything else, I mean, a lot of stuff, good testers just sort of makes you up on the fly, right? Like, you don't necessarily have a plan. You just start looking at stuff. You just start making things up. And the real problem with it is it's not necessarily repeatable. It's not a framework. You know, you just, you see an opportunity, you dive at it. It's very ad hoc. Um, that's a lot of where the eScan tool came from, is I used to do a lot of testing and just, uh, just try stuff out, put it in the report, and then eventually I realized maybe it would be nice to actually have a framework to make it a little bit more repeatable and make it work a little bit better and get some better data out of it that could be compared against each other. So the big thing missing with all these, uh, traditional security assurance is, uh, how effective is this stuff at preventing attacks against users? So we're gonna go into, uh, vulnerability assessment and why that's, uh, why it only does half the job and is only half broken. So the key behind vulnerability assessment, right, is you have, uh, some kind of external stimulus and you measure the response and you determine, you know, through a banner, through a test, whether something's vulnerable or not. What that doesn't measure is it doesn't measure what happens when things inside your network generate a stimulus and what the response is, right? So most vulnerability assessment tools are very geared at that, what's listening, what can we talk to that gives us something back, not what might talk to us that we can give something back. So EE Scan's an attempt to, uh, to dive into that arena a bit. So we talked before about, um, about defense in depth. You've got all these layers and obviously no defense in depth system is perfect, otherwise you wouldn't need the depth to begin with. So there's always those cracks, uh, always the cracks in the system, the little ways things can get out, things can get in between. Everything protects against everything. So we want to measure some of those, uh, some of the cracks and try to find them and use a framework to try to get at those cracks. When I was doing, uh, enterprise security, um, one of the things that always cracked me up is, like, CISOs have a big budget, right, and they want to spend lots of money and there's lots of flashy things they want to buy. So you spend, like, $15 billion this year and you get, like, 17 new gadgets and nobody actually knows, like, what works and what doesn't work. It just gets, like, deployed and there's a bunch of stuff out on the network and nobody really does much testing to see, like, does our new shiny IPS actually, like, block anything? Does data leakage do anything at all? Uh, you know, things like that. Um, and one of the other challenges, too, one of the things that makes defense in depth so hard is that protocols are really complex, especially things like HTTP. Um, there's so many things that can happen in HTTP. You've got layer on layer within HTTP, you've got JavaScript and Flash and, you know, it's pretty much a whole stack unto itself. Oh, one of the things I forgot to mention. If there's any questions as we go along, throw them out. By all means, you know, not everything's complete on the slide, so if you see we're missing something, throw it out. Um, so back to the vulnerability assessment gig. So one of the issues with VA, you know, you only check what's listening and, of course, browsers and clients, like users, don't listen at all. Although, so I was doing some research for the presentation. One of the things I found, there's actually a Firefox add-on that creates a web server within Firefox, and that is awesome. Um, so we're going to go through and we're going to create a framework that sees, um, if our protections are easily bypassed, you know, are we blocking common attacks, not, uh, bizarre things. Oh, yeah, and the other interesting thing, being in the enterprise world, is that there are actually people that don't patch because they think all the devices they spent $15 billion on actually do something. So they say, oh, no, no, we don't need to patch against, uh, on Black Tuesday because our IPS already has a signature for that. So we're safe, we're going to be good to go. So, and one of the other problems, so when you get into big enterprises, you know, you have 100 users, patching is easy, right? That's everybody's answer, how do you, how do you solve the vulnerability issue patch? 100 users, easy, not that many applications. What about when you get into, like, 350,000 workstations? Not necessarily as easy to figure out, uh, who's patched and who's not. Um, stuff just falls through the cracks. I mean, even .01%, that still leaves you a bunch of machines to get owned. And at Citibank, 35 exploited machines might get patched. Might not be a good thing. So in larger networks, you usually have more complex systems. Nobody tracks everything. You have ATMs running Windows. You've got camera systems running Windows. All the black box stuff from vendors. Nobody knows what runs on anything. So, um, what I want to do is I want to add, uh, a little, uh, item to the vulnerability assessment. Extrusion exploitability assessment. And so add in all this stuff we've talked about. Measure the risk. Um, and I want to try some cool things, too. Like, I want to look at, like, common attacks that are out there, like MPAC. If our IPS blocks one exploit, does it actually block, like, what MPAC does? And for those that don't know, MPAC is, uh, the Russian attack toolkit that's been widely used. It was part of the Italian job a couple of, uh, months ago. But it's got, uh, eight or nine different exploits in it. It's got a whole bunch of different encoding mechanisms. And it's sold for $1,000 on the underground. So, what are we missing? The text for the slide, obviously. So, another thing that's missing from the vulnerability assessment game is, uh, the extrusion stuff. What can leave our network? How do we know, like, what applications we block? Like, um, you know, maybe, maybe ten years ago, blocking port 5190 actually stopped AIM. But that's not going to happen anymore. So, users want to use applications. Security policies don't. Mainly an enterprise problem. But actually, the roots of this all started back, um, when I was a consultant. I would travel all over. And, of course, you've got tools on, you know, on your machine that you need to, like, do work. Like Skype. And, um, so you plug into somebody's network. And just to get the rude surprise that they don't allow Skype on their network. So, then you've got to go through the hassle of trying to figure out a way to get around it. How to tunnel around it and do all that stuff. So, I actually had started writing some tools to do that automated assessment. Just tell me how to configure my apps so that they'd work once I plugged in without having to do any manual testing. So, when I was, uh, running the big financial network. One of the things that I learned that's completely bizarre is that people love AIM. For no apparent reason. AIM is, like, the most popular application people try to tunnel around. For no reason at all. And they do everything. Like, tech users are, like, doing things like running AIM over Tor just to get AIM. Um, and actually my favorite story is, uh, there was a president of a bank that was one of our customers. And, uh, again, guy loved AIM for some reason. And one of the things he did is he actually installed a modem on his PC. And it was using AOL dial-up to get around it. And he installed it on the firewall filters just for AIM. And, uh, and the best part of it is, so this is, um, this is only, like, a year ago. He's dialed up to AIM. He's dialed up to AOL. He's using his AIM. And he gets SQL slammer. And takes down, like, the whole enterprise network for hours. Nobody can figure it out. All because he just needed AIM. Insane. Um, so how do you determine what works on your network? I mean, the easy thing is go out and, like, download AIM, install it, and see if it works. But that's kind of a pain. You know, especially if you want to do, like, 500 different applications. So, another thing people like to do, extruders like to do, is they like to get remote access to their machine from home. Um, you know, beyond policy. So there's a million different ways to do it. There's reverse CNC, reverse BNC. You can do SSH port forwarding. There's a bunch of commercial stuff. Go to my PC. Log me in. Some of that stuff's easily blocked. Some's not. But how do you know what works and what doesn't work? So, EEScanner is the tool that I wrote. Um, originally just for the extrusion stuff, but then adapted. And we're going to go into a lot of details later. So if you're starting to nod off a little bit, don't worry. We're getting to the cool stuff soon. Um, so we want to do a couple things. We want to measure all that stuff. We want to go into, you know, what are we blocking? What are we not blocking? Yada, yada. Where do the weeds grow through? Did we spend money that falls in line with the threats we were trying to protect against? So, all enterprise networks especially, lots of layers. You've got things like transparent HTTP proxies, transparent SFTP, transparent DNS. Intrusion prevention. All data leakage stuff. So we want to just test through all that stuff and find out what works. Oh, so actually, I'm going to skip most of the slide. But one of the ones that, so one of the exploitability examples I really like was the original VMLO day that came out. And when it did, the proof of concept used the RECT method. And so every IPS vendor out there and every security vendor, they all wrote their SIGs for this RECT vector, right? And it turns out there were like nine different shapes that you could use to get the same exact effect. So the signatures were absolutely useless in protecting all but that proof of concept. So there's a couple of tools that I always used to use. Obviously great tools that work very well. My big crutch with all of them is that none of them had great automated ways for doing it. Like Metasploit, really good for running and seeing if your defenses are blocking certain types of exploits. Works really well. They've got a couple of encoding techniques in it. So you can get a lot of good information using Metasploit for that. There's another tool called Ftester, which does a lot of the same things. It'll do outbound firewall scans. You can take snort signatures and have them pump them out to see what gets picked up. It's good, but it doesn't do everything that I was looking for. It doesn't really behave like a client. Like it was taking just IDS signatures and just pumping them out rather than a full HTTP context and really getting all the data in there. Because sometimes when you mess around with little variables, you find out like a vendor might do something one way with this set of data. And then another way with another set of data. So just pumping SIGs doesn't really do everything you want. Core Impact, really, really cool. You could probably do all this, but it costs a lot, a lot of money. So not necessarily very well for what I was looking for. So my whole goal with this is to write EEScanner. Get it out there. It's going to be free. Most of the stuff is already out there at EEScan.net. And it's going to be up on the iDefense site more than likely, too. Some of the code I didn't get to publish before I left. And I couldn't get a connection from my hotel. So some of it won't come out until I get home Monday. But all this stuff is, we're going to go through and show different ways to use it. So we're going to test for all those things. We're going to do a little bit of, we're going to get some good reports at the end that show us like what gets blocked, what doesn't. So here's a quick overview of the architecture. So EEScan is mainly written in Python. There's a couple of other components like in PHP as well. But one of the things I liked about Python is, one, it keeps me from writing really bad Perl code. And the other thing it does, too, is it gives you a shell that's nice that you can just call functions right from a shell. So if you want to do manual testing, you can do it that way. Or you can script it all. So the real point of EEScan, you have the base classes which implement a whole bunch of things like aim protocols and port scanning and HTTP encoders. And all the stuff that we're going to need to do our testing later on. All in one base class. So we can import those base classes. And there's another section that does unit tests. So we can write a whole bunch of simple tests as unit tests and then have it run through all our unit tests later on. HTTP exploit checks. So there's a module that just does encoding. We'll go through those methods. And aim tests, of course. Everyone needs aim, so we need lots of good tests for aim. And then on the server side, so that's all client side stuff. On the server side, there's a PHP exploiter that takes information and kicks it back out to the client. So it'll actually send the exploits with whatever encoding we want. TCP responder. So when we're testing for things like transparent proxies, we can't always rely on just interacting with the proxy. Sometimes we need something outside of that that we can test through and try to make real connections to to see what gets modified. And then finally, SSH and tunnels and all the things. You know, I didn't rewrite DNS tunnel or ICMP tunnel or any of that stuff. So all that stuff sits on an external server as well. And the real key is we want to run our client side stuff in our network. And we want all the server side stuff outside the defenses. So we're testing through everything rather than just at something. So diving into base classes. So a couple of things. Egress scan is probably one of the simplest modules. It does an outbound port scan. All my examples here are from a Python interpreter. So you drop down to Python, import the base classes, and you can run everything just like this. So egress scanning. We pump in an IP and we tell it we want to scan from port 1 to 1024. And it kicks back the results to us. So I included Paramiko for SSH. So there's a whole wrapper around Paramiko for doing SSH and port forwarding. Real simple to use. You instantiate a class. It goes out, does an egress scan, tells us all the ports that are available. And then we tell it we want to know what protocols are actually, we want to check for which protocols will actually let us pass SSH over them. And it kicks back all the different ways that we can use SSH. So another module is the unit test harness. So you can write, I know it's kind of hard to see up there, but basically with about seven lines you can write test descriptions and tell it, like one of them up there is AIM Tor. So you can tell it that I want to use the Tor module. I want to make a TCP connection over Tor. I want to make it to login.oscar.aol.com. And I want to do it on port 5190. So you create all these little tests written like that. You kick it into the unit tester and it'll tell you all the results coming back. I have maybe like 50 or 60 unit tests, but it's really extensible. You can do pretty much anything you want with it. Anything with TCP, SSH, ICMP tunnel, DNS tunnel, whole list of different protocols and tunneling mechanisms. There's a whole separate Tor support section. It's actually a SOX module, but you can basically use any SOX server because Tor just acts like a SOX 4 and 5 proxy. So you can instantiate a Tor class and then use it just like you would a socket in Python. So you can do send and receive. It does all that legwork for you. And it's actually used by other modules as well if you're doing the Tor testing. So one of the interesting things you can do with like egress scanning is you can see what's proxied and what isn't. So like for people who saw Dan's talk, his big thing was hostile networks. How do you know when you're on a hostile network and things are being proxied? Sometimes it's really easy to tell. You just do like egress scan to a dark IP that doesn't exist at all. In this case, in the hotel that I was staying at, I got three results back. 25, 53, 80. So real easy hint that you're actually in a captive portal and that they're transparently proxying all those protocols. Another thing you can do, like a lot of providers block arbitrary things. They block sometimes IRC or all sorts of random things. So my colo, I wanted to know what protocols they block. Real easy to fire off right from the command prompt. There's actually an extra flag. Blocked equals one, which tells it just only show me ports that are blocked, not ones that are open. And then finally, another module called Check Plane, which tests to see if it's a plain TCP socket as compared to a proxied socket. So you can do things like on port 80, try to make a direct connection, find out if there's a transparent proxy in the way. In this case, the output's a little cryptic, but it's 001, so I tested 25, 80, and 123, 001. So not a plain connection, not a plain connection, not a plain connection, plain. Real simple. All this is actually a lot easier when you do it in scripting, but all easy to do from the interpreter as well. So the other phase, we talk about exploitability testing. We want to know what kind of exploits we can pass and how we can encode them. So HTTP, really complex protocol. Lots of different ways to do stuff. It's got like a whole protocol stack unto itself. You've got JavaScript. It supports native methods at the protocol layer like gzip, deflate, chunked, SSL. So we can try all those different ways of encoding things. We can use lots of different JavaScript methods, some that are used in the wild and some that I just made up. So we'll go through those, things like Ajax, XOR, whitespace, random variables, random functions. A lot of stuff like from the VOMM, stuff like that. So one of the things, obviously IPS and IDS isn't really a great technology, and one of the main reasons behind it, if you take a look, here's a signature for detecting ANI exploits. And the big problem right here, as long as it's going to an HTTP port, it'll detect it. So running things like HTTP over 443, trivial bypass to a signature like this. It's got hard coded bytes in there, so any whitespace or other randomization or encoding completely bypasses it. So some of the tricks, so there's a module with an EESCAN HTTP encoders. So the HTTP encoders allow you to take like an arbitrary payload, do the encoding and then kick it back to the client for testing. So some of the ones, gzip, deflate. Interesting thing with that, so gzip and deflate, does anybody know what gzip and deflate do with browsers? Real simple, right, just gzip the content. Deflate is gzip without a gzip header. Real simple. You'd be surprised how many devices will detect gzip stuff, but not deflate. What the fuck? So anyway. Anyway, so my favorite, Ajax. So that was one I kind of wrote myself. So Ajax is kind of like a frag route for HTTP. So what you do, instead of just sending the entire exploit in one or two packets over a regular HTTP session, you use XML HTTP request and you break it up into chunks. Right, so JavaScript is really nice. You can treat code like data and data like code. So you tell it, go out and get this exploit and break it up into any arbitrary number of chunks. Send it back to me. I'll concatenate them all together and eval it. So, real simple technique. But IDS and other things like that rely on actually seeing the code together. Even if it's obfuscated in the code, a lot of times they can pick it up. But if you break it up and do a frag route type attack, it works much, much better. So, another one of my more favorite Ajax is some of the encoders out there, and I'll actually go through MPAC in a minute. They do things like the XOR, and they'll XOR with a static key. So if you're looking at that in TCP dump or anything or any tool, you can actually see what key they're using to decode the data. Right, simple loop. So what I like to do is I like to actually send the key in a separate XML HTTP request, break it up. That way an analyst looking at it has no idea what the key is unless he's got all the network traffic instead of just a couple of packets. So here's MPAC. It came out a little blurry, but MPAC basically does like a nice little XOR loop. On the top you've got a plain text string. And this is all in the Python interpreter again. You've got document.write hello world. Run it through the MPAC XOR engine. It spits it out as an XOR function with all the data XORed into a blob, which is going to go through an XOR. The browser will then interpret. And then the bottom example is just using the same MPAC XOR, except this time using random function and variable names. Just another way to kind of get around some of the static detection that's out there. So here's an example of the Ajax encoding. Here's the source for it. I mean, it's not complex at all. Literally all you do is you just tell the server, I want to break this up into some random number of chunks, 20, 50, whatever it is. And give me each piece one by one, reassemble them, and eval. One of the interesting things is this is actually, this technique is really easy for humans to evaluate, but really hard for machines. Because humans can just go through, look at the code, and see that, oh yeah, I just need a W to get all the different slices, assemble them back together, and I've got the code. Machines really, really don't like that. So the MPAC attack toolkit, really famous, everything else. They sell it for like $1,000 in the underground. Exorbitant prices for something with a lot of flaws. So what I did when I was going through this is I looked and said, MPAC is just terrible with encoding. So what I'll do is I'll improve it for them and sell it back for like $10,000. Who knows? So one of the stats on MPAC, it only infects 3.3% of machines in the US, which is a terrible rate. It does a lot more in developing countries where every version of Windows is pirated and not patched. But in the US, 3.3%. And one of the reasons is that AV vendors actually pick up the MPAC JavaScript. So they do a terrible job obfuscating other than the one basic technique. So you've got the pseudo code for what they do, just a simple XOR of all the data. So some of my ideas for them that I'm going to kick back to in my business proposal are, random function names, white space comments, XML HTTP requests for the XOR key, GZIP encoding. And for God's sake, these guys have no idea if they've ever heard of Millworm. They use like the newest exploit they have is like ANI from a couple of months ago. They had no exploits at all. It's awful. So I'll go through a couple of real world examples, places where I use it. So reality check number one, checking LovingAim. If you want to actually do the unit test for AIM, the type's a little bit small, but basically you just write a couple of simple tests for each one. Can I connect using default settings? Real easy to write up the test. Can I do crawl settings? Have it do a port scan of all of login.oscar.aol.com. Kick back all the ways you can get there. Tor, same thing. So all this stuff is real easy to implement and automate for a testing scenario. And if it's a protocol that's not supported, you just write a quick Python module for it and off you go. Some of the other cool things, so I really like tunneling stuff, so this will actually go through and do like, there's a DNS tunnel module, ICMP tunnel module, SSH port forwarding built in. So here's some more examples right from the command line if you want to do HTTP exploit checking. It's as simple as calling one function, so you call getHttpMD5. And what's happening behind the scenes, so you've got the two parts, you've got the Python script and then you've also got the server side PHP. The Python script makes a request for the exploit. The server side takes all the content, adds an MD5 header, a HTTPX header for the MD5. Client gets it back, compares the MD5 and now you know if it's been modified in transit. So real simple. So in this case we do HTTPMD5 for, we're passing parameters to a test.php. We tell it the code we want is plain and the exploit is linked in. And it kicks back and tells us in the results that the connection was broken. So in that case what a lot of IPSs do is when they fire on alert instead of modifying the content, they just kill the connection. So a broken TCP connection is a great indication that something's actually just been dropped. Next example, gzip, so we run the same thing. Again, and this time we see MD5 mismatch. So the results that we were expecting were different than what the MD5s say. Usually that stuff, like proxies, like to modify the content instead of just dropping it. So instead of sending the exploit, they send you a page back that says like, we blocked this page for you, you're safe now. So same thing with the mpac one, we see that one gets dropped. And you can go on and on with all the different encoding techniques forever. So one of the things, real easy, just drop in. I have a quick function called try them all, goes through every possible permutation. Kicks back the results to you in HTML and now you can look and see what's being blocked, what isn't. And at the end of the talk I've got some real world data. And you can see some interesting patterns in different devices and how they look at exploits. So we'll look at that later on. We try all the different exploit techniques, all the different encoding techniques, and just for good measure we try a couple different user agents too, just in case maybe there's a difference in user agents. So my favorite one, this one I used to do in operations, is testing incident response plans and MSSPs. So main security providers, you pay a lot of money and you never really know what they do for you. It's kind of like a black box. You call them up, they say, oh yeah, you're covered. But they don't share anything with you. And you never really know if they're alerting you on everything. So one of the things that's easy to script out with this is to do an MSS test. So fire off an exploit, fire off an additional request to get a payload. Then have it fire out a bunch of posts with keylogger data. And then sit back and watch and see what happens. And then of course the most important, set up a cron job to run every Sunday morning at 4.30 just to make sure everyone's on time. Everybody's on their toes. So this is a great slide. So I was doing some research and I like to add an image every now and then. I was looking for something that followed up with risky business, just a random image. And I came across the State of Nevada Risk Management Center. And they have this picture. You can't read the text, but I put it right next to it. Risk management is the expert management of differences that may exist between expectations and reality. And what in the hell is that picture? It blows my mind. What the fuck is that? It's crazy. So Fred's going to tell us exactly how all that works. But the way EEScan fits into the risk assessment process, you get a lot of, you get all this data back. But what does it actually mean to you? What's the, if you're one of the corporate guys that actually needs to do risk assessments, how do you use it for something useful? I read, Matt showed me that the other night. And I thought it was just because my blood alcohol was like a drug. Like a .3. But today when I'm only a .2, it still doesn't make any sense. Risk management, the expert management of differences that sounds like my first marriage. Anyhow, the bad thing is, here's our conventional risk assessment, and that misses a mark too. Who can tell me what any of that means? Well, obviously it's arithmetic. And please don't say mathematics. You know, we have some multiplication, we have some addition in there. But the bottom line is this. When you are making estimates on everything that you're doing, how can you really put a good value on what the risk is? Everything, the single loss expectancy, the annualized rate of occurrence, everything else like that, that's a guess. And if it's not a guess, and if you have the statistics for it, what says that 2008 is going to be the same as 2007? How many people here have actually scanned for extrusions and exploitability? Please raise your hand. Okay. A fair number. Okay. Why hasn't everybody else? Well, the reason is because right now it looks like the risk is zero. It doesn't look like there's a risk from it. Just because we don't notice a rate of occurrence or an occurrence doesn't mean that it's not there. So the holistic threat assessment. Look at that damn picture again. What the hell is it? Okay. The holistic threat assessment. We have to worry about what the asset value is. And instead of going through each one of these things, what I'm going to do is I'm just going to give you an example, okay? I've got a house in Florida. Not really, but I wish. I have a house in Florida. The house in Florida is sustainable. It's susceptible to weather damage. All right? So I've got the asset. I've got the vulnerability. The exacerbation is there's a hurricane off the coast. The mitigation is my house is made of steel. And the perturbation is it's one of those 500-year storms that takes everything out in the path. All right? Now, I defy anybody in this room to use the standard CISSP model to give me a risk based on those things. Wait a minute. Just to check. How many people have the I am not a CISSP badge? Nice. So anyhow, basically what we're doing is we're trying to quantify something that we're just starting off with guesswork. Now, there is a different risk model that we are kind of looking at. The risk model is still in the design stage. It is not arithmetic. It's real math. It's a real model. One of the elements is the holistic design that you saw before, the things that you saw before. But the bottom line is it appears to work very well with CVSS data. If none of you know, iDefense aggregates every vulnerability that is on our covered vendors list. And we keep that data. And right now we're doing the CVS scoring on it, CVSS scoring. And we've even started to use the CVSS version 2 scoring on it. And still we haven't gotten 100%. The first model was maybe 60% to 70%. Now it's 80% to 90% perhaps. Maybe 80%, 85%. But the thing of it is, on those 15% that's left over, you still need a person. So why worry with the model? The model that we're working on actually is pretty much dead on for everything. So it looks good. Okay. So in the real world usage, so this has been run. I've had some people run it for me. I've been using stuff for a while. So as with anything, you get some interesting results back. So I'm going to go through a couple of those. So the first one, for some reason, AOL servers don't respond to any TCP packets without an MSS. And not just max segment size. And there's other things they don't do too. So one of the ideas that I have is I think you can actually probably fingerprint IPS devices just on the results you get back. And weird things like not replying without MSS. Because obviously it could be the servers that drop it, but it could be something else in between. So there's maybe some opportunity to do some fingerprinting of devices passively just by watching what they drop and don't respond to. So the next one, just because they don't ask doesn't mean they don't want it. One of the interesting things I found is that, so browsers, when they want to use an encoding mechanism that's supported, like gzip or deflate or chunked, they ask for it, right? They put an accept header that says, you know, accept gzip, accept deflate. But, you know, sometimes proxies strip that out. Sometimes they don't send it because they don't support it, things like that. One of the interesting things with things like Firefox, IE, and a couple of other browsers is that even if that tag gets stripped out, or even if they don't ask for it, you can send it to them. They still just render it, right? So actually having that in the header means nothing. You can just send it back to them and they'll just render the gzip data just fine. So another interesting thing, simple tactics. This is probably obvious, but are incredibly effective against almost every kind of device, every kind of IPS and a proxy device. Just things like random white space, 50% effective in the real world testing. Like just adding spaces in. It kills that many protections. Remember the old mail bomb with mail servers? So if you wanted to crash a mail server that had like antivirus, you do like dddev0, like a terabyte, and then you gzip it down to like 20k, and you mail it through and it tries to, you know, open it up and it just dies, bombs. Yeah, that kind of works with proxies too. They don't really like gzip data like that. Like a petabyte of zeros doesn't decompress that fast. So, interesting. I don't know if anyone read the interview with the MPAC authors, dream coders team. So they did an interview, it was on security focus with Rob Lemos. So at the very end they talk about, they ask him, you know, if people want to be safe from your attacks, what should they use? And he says, opera. Whatever. It's actually IE4 on NT4. So one of the interesting things is that most of the exploits and most of the encoding mechanisms, it won't even render. So things like gzip, it just dies on, like half that stuff doesn't even work right on it. So it's actually incredibly effective against blocking out all kinds of encoding, because it just doesn't do anything with it. And then as we'll see in the next couple of slides, as long as you can block out all that encoding, some devices actually do a decent job at blocking attacks. So NT4 behind an IPS might actually be safe. So here's some quick output from exploitability scanning just doing some HTTP checking. So the output basically comes out. It tells you, here's the test that you ran. Here's what port we ran it on. Because one of the other things it does, it tries HTTP and HTTPS. Obviously most things don't catch HTTPS unless they're doing an SSL man in the middle, like Bluecoat, some other devices. So it runs through all the tests, goes through all the possible permutations, and it tells you what happened. So in the results we can see here, there were three attacks, three exploits that were actually blocked, indicated by the broken, and the rest all passed right through. So simple things like adding whitespace was able to evade in some cases, or the MPAC encoding. So here's just four quick examples of four things. So this is just graphs of that same data I just showed you, run on different device types. And what's interesting, when you look at it from a distance like this, you can almost see patterns. Like different devices have different ways, their engines have different ways of looking at the exploits and encoding and doing something with it. So let's drill down into a couple of those. So here's one, it's a main service provider, and they have a custom IPS device that's supposed to do stuff. And what we see is that they block plain exploits, and they even handle a couple of encoding, like whitespace and chunked. But they do nothing with JavaScript, and they do nothing with gzip. So if you gzip it, everything goes through. If it's plain, they catch 80%. So next one, we have a proxy device running antivirus. And what we see is it's really bad at catching the exploit itself, but they're really good at catching the encoding mechanism. So something like MPAC, they actually pick up every single time, regardless of what the contents is. They just figure, you know, if it's MPAC encoded, we just kill it. And then they're only like 50% effective when you actually do something with the MPAC encoding and like, say, add whitespace to it. So you can see the effectiveness really drops off pretty quickly. So the Astaro guys, they do a good job. And one of the interesting things from theirs is they actually don't manage to stop anything except gzip stuff. It was the only device I tested that if you didn't send an accept gzip header, they actually thought that that might be a problem when you sent back gzip data. So interesting thing, but they didn't actually stop any of the other exploits, all on a fully updated system. And then, so my last test. So I'm running this through on a couple different device types, and got my switch, I got my device out connected to the internet, and I start, I run it. I'm like, holy crap, this is like the best device I've tested. It gets everything. This is awesome. And then, so I'm just, I'm starting to pump information in, and then I look, and I'm like, and it's wireless. This is really awesome. So yeah, actually unplugging the cable, incredibly effective. And we have a little bit of time here. We weren't really sure if we were going to make this on target, so. I did not tell you my favorite risk assessment story. About 10 years ago when I was 15. Okay, about 35 years ago when I was 15. Fifty. Okay, 36 years ago, to be exact, when I was 15. I worked for my father in his body shop, and he went out to lunch, and back in those days, he usually had a liquid lunch. In fact, to this day, he still has liquid lunch, but that's cool. But he comes back into the shop, and I have a car jacked up, and I'm working underneath the car, and I don't have any jack stands, okay? No, I just have a floor jack, nice solid hydraulic floor jack, and I'm under the car working on the car. He grabs my foot, pulls me out from under the car, pounds the shit out of me, takes a bite out of my ass, explains to me that, no, the chances are the car's not going to fall, but if it does fall, you might get hurt, alright? Here's a guy that didn't have a high school diploma. Here's a guy that just had common sense, but he had more common sense than a lot of CISOs that I see, okay? Yeah, you can clap, go ahead. Shortly after that, I went, went a different way, I actually became a cop, but the third year on the job, I got a call where a guy was under a car in a body shop, and the car had fallen on him. He wasn't using jack stands. So we are not really good at risk. We are not really good at figuring out what risk is. To me, it wasn't risky at all being under there. I mean, the chances are one in a million it's going to fall on me. But if it fell on me, it would have killed me, as it killed this other guy. So, you know, you guys that have to answer to all of this, all these policies and all the modeling that you see out there, all the competition for your money, just step back and say, does this make sense to me? And I think you'll go a lot further. Okay. And so one last comment I wanted to add in is that one of my goals with EEScan and the exploitability testing is to be able to go out and actually profile a wide range of devices, because I think what we're going to find is that seeing what they can block today tells us a lot about what they might be able to block in the future. So it actually is a little bit more predictive and more useful in that means than it is in just knowing, you know, what can actually be sent through. So open up to questions. We have the question room later as well. So anything...