Hello, everyone. Welcome to our talk, and welcome to DEF CON 0x0F. Let me just do a brief introduction, since this is our first time ever presenting at DEF CON. I'm Ben Feinstein. I'm a security researcher with SecureWorks in Atlanta, Georgia. My background is primarily as a software engineer for a variety of security tools and security products, and I have a background early on in IDS. To my right is Daniel Peck. He's also a researcher with SecureWorks, proud graduate of the Georgian Institute of Technology. He's likely our strongest reverse engineer and jack-of-all-trades in a lot of other tasks that we tackle on the research team in Atlanta. So our talk involves malicious JavaScript, and for some of you, you may ask the question, why should you care? Well, if you've seen some of the talks, this week over at Black Hat and here at DEF CON, you could see that JavaScript is a pretty severe security problem. A lot of malware and spyware downloaders use JavaScript to get malicious code onto your system and execute it. As we've seen with some interesting talks this week, browser exploitation is a major topic. Basically, dynamic scripting in the browser can be used to basically use your browser as an attack point into your internal network. Also, scripting is frequently used for information leakage purposes, such as your browser history, cookies you have stored on your system, lists of sites you frequently go to, stored passwords and credentials that are cached in the browser. So basically, JavaScript has access to a lot of dangerous information and a lot of pretty severe functionality there. What we're primarily looking at today is its use as an evasion tool in the browser. and security bypass technology. So just to give a real brief background of JavaScript, I apologize for those of you that you're already familiar with this. Back in the 90s, Netscape came up with this concept in their early browsers, and the idea really was to offer a scripting language so that website authors could make the browser experience richer for the user. After Netscape introduced JavaScript, Microsoft came along with their own version called JScript, and eventually it was standardized under ECMA or ECMA script under the auspices of the ECMA group. And what is not generally understood is that a lot of parts that we associate with JavaScript aren't really part of the standard. One example of this is the document object, which is really defined in the browsers. It's typically just an extension in the browser, and it happens to be mostly compatible across them, but if you've ever tried to write scripting to work reliably across a lot of these browsers for website purposes, it can be a challenge. And one of the reasons this is a security issue is this JavaScript tends to blur the line between data and code. And what I mean by that is that to a lot of security devices, the JavaScript that's coming back from a web server is really just viewed as data. It's simply part... The response of that web request that you sent and it's coming back over the wire. In reality, it's code, and it's going to be dynamically interpreted and executed inside your browser running on your local area network. We'll talk about that a little bit more later. So, like all great tools, or all great technologies, there tends to be feature and functionality bloat. A lot of this involves AJAX and Web 2.0 technology. The XML, HTTP request object is a very powerful part of JavaScript that allows you to really asynchronously control requests to and from the browser and the web server. And, as our experience has shown, more features always equals a larger attack service which to exploit, and greater potential for security-critical bugs. So, I'll hand off to Daniel. He'll talk a little bit more about the Web 2.0 effect. Web 2.0, ain't it grand? If you've tried using a browser lately with JavaScript turned off, using the NoScript plug-ins for Mozilla and various other things to turn off JavaScript, it's pretty unusable these days. Most of your major sites have so much JavaScript integrated into it that it's just not feasible as a security measure to turn off JavaScript. While this advice might have been good in the early 2000s, late 90s, when a lot of security problems with JavaScript were found, they're not really practical anymore for anybody but the most hardcore security people. It's not practical for grandma, mom kind of atmospheres. So, there's some real problems here. JavaScript is a vice of your typical web developer and designer. It's thrown out there without a lot of thought. It's just put in there to make something happen. There's not a lot of training involved in it. And most of the scripts are put together with examples from the web. These examples tend to be not the most secure. Or the most well-written in any way, shape, or form. There's just big JavaScript library repositories online that you pull down stuff from, edit the code just enough to make it do what you want. And you're not really sure what's going on in a lot of cases. Continuing with the most many popular sites, try MySpace, try YouTube, try any number of other sites. They're pretty much unusable. It's a staple of the web and it's here to stay. And it's only going to get more and more involved in our daily website. And it's going to get more and more involved in our web surfing browsing habits. Is it really that dangerous? We get this question a lot in regards to JavaScript. Is it all theoretical? Is it things that are just, you know, out there but not really being exploited? Well, we saw some examples in the month of browser bugs. Number 25 is a good example of a vulnerability in JavaScript itself. Where the vulnerability involved iterating over a native JavaScript function. Using a for loop to go through it. And after a while you would get a denial of service and you'd have to go through it again. And potentially remote code exploitation or execution. Number 8 was an example of how JavaScript makes exploitation easier, but isn't an exploit with JavaScript. Which is primarily what we'll be talking about. In this case, an ActiveX control was created. And it used a function that was called 65,000 times to iterate, get an integer underflow, and then you've got successfully, you're successfully able to access pretty much whatever part of the memory you want. Some other things that are happening with these tools these days. The GNU Citizen group has the JavaScript attack API. Which I don't know how many of you are familiar with it. I haven't used it extensively myself. But it's becoming a more and more popular and quite mature tool for what it's doing. And things are really coming together there and it gives a great framework and tool set for JavaScript exploitation. Other things we've seen, last year the browser based port scanning was a big deal. I was at Spy Dynamics along with Jeremiah Grossman and a handful of other people kind of had the same idea at the same time. And started working through these. And recently Dan Kaminski at his talk at Black Hat and here this week just a few hours ago, talked about scanning inside the network using Flash. Which is sort of similar and there's some overlap there that we'll talk about briefly. But there's a lot of things that the browser allows the user to do that aren't normal. Aren't part of your usual applications. Phishing and cross-site scripting. Cross-site scripting is the seemingly ubiquitous vulnerability. More are being created each day than are being found. And they're just going to continue to be there. What used to be just a cute little attack that you could show how a website was coded poorly to show an alert is now being usable for serious malicious activity. More every day. Some examples of things involving that were the eBay seller ratings recently. Which allowed the seller to change their icon to be a power seller. To have over a thousand positive remarks or positive transactions. And you know that might not matter to you and me again. But it matters to most normal people. They're going to check and see oh well this has over a thousand quality sales. I'm safe doing business with this guy. Which lures you further into the phishing vulnerability mode. Following that, address bar spoofing. There's been so many vulnerabilities that allow this to happen. It would be a waste of time to enumerate them all. But it seems like there's one every couple of months. And this is incredibly useful in phishing or any number of other attacks that involve information stealing. Couple of postmortems of real life events from the last year also. There was the Super Bowl 40 Dolphin Stadium site hack. It was dealt with the web server compromised. There was iframe injection which tried to exploit two already patched but widely unpatched in the populace Microsoft vulnerabilities. One involving VML and the other one I believe it was MDAC but don't quote me on that for the 07-004. So this brings to light the whole JavaScript issue as Ben spoke about earlier. It really blurs the line between code and data. And that's what we've got in these QuickTime embedded movie files. They can now have JavaScript in them. Maybe not the best design decision but it's there and you can run arbitrary code through a movie. Years ago would you have thought that was possible? Probably not. They were just movie files. Shockwave Flash. Shockwave is going with the inner-inner platform effect where you have not only the browser running on the OS you have Shockwave and Flash running in the browser and you have full access to a network stack now. We're starting to see things creep up and they're probably only going to get worse. A big thing and fairly underrated this year is the Adobe PDF cross-site scripting vulnerability. This was released early in the year I think around March. Basically arbitrary JavaScript alerts, cross-site scriptings anything else very easily. It was trivial to exploit. So now we're going to move into talking about some of the obfuscation and evasion techniques that are used by JavaScript to hide what the actual exploit is doing and really evade IDS, IPS and all sorts of other detection mechanisms. There are a variety of evasion and obfuscation techniques that are typically used in the wild and that we see in JavaScripts. Probably the simplest to understand and the simplest to implement is white space randomization or randomized comments. The reason this is effective against certain security technologies is if you're inspecting the return content from a website or web request on the wire and you're using a signature based analysis technology or detection technology you can insert any amount of white space or random comments throughout that JavaScript and it's going to break signature detection. Basically the byte stream on the wire is going to be completely different than the signature based content that you're looking for for a particular malicious JavaScript call or a particular section of script that you've written a signature for. Another common technique that's not only applicable to JavaScript but is basically used in a lot of attacks is string encoding and unencoding. Typically you can encode strings using hex characters the ASCII equivalent percent encodings or unicode encodings. Some ones I did not list up here include wide and extended unicode character sets. We've seen recently some vulnerabilities or some bypasses of intrusion detection technologies based on some unusual wide and extended unicode encodings. Another relatively simple technique that we see in the wild is string splitting. So if you anticipate that a security technology is going to be looking for a particular string value on the wire or in a web page in the browser you could take that payload essentially and break it up into any number of strings, concatenate those strings together dynamically during interpretation and execution time and naive or signature based analysis of the content on the wire is going to fail. This is a very simple example. Lots of detections fail and you could simply break that up into four strings throughout the script, concatenate those together and dynamically in the browser that string will be produced but on the wire you're never going to see that all together. Another technique is integer obfuscation. If you could imagine if you will that you're an attacker and you want to encode a particular integer value in your script be it a port number, a key to some value, any number of reasons. Well, there's essentially infinite ways you can represent that integer. You could basically create that integer dynamically using any of the mathematical operators at your disposal and a very simple example is if you wanted to encode 31337 you could simply perform five additions and dynamically that value will be created in your script. Very simple stuff. On to a more sophisticated JavaScript attack technique, heap spray and it's more advanced cousin feng shui. Our presenter Sadorov gave a great talk this week at Black Hat kind of reviewing heap spray and his feng shui attack technique and his heap lib tool. I hope to do it justice but the basic description is that the JavaScript is executing in the browser the activity of that JavaScript is allocating memory in the browser's heap. So if you have the client dynamically interpreting your script you can allocate arbitrary segments in the heap fill it with nop sleds and shellcode and then basically what you need is an exploit that's going to overwrite a function pointer and redirect it back into the heap. Typically you would use a nop sled that would be a valid heap memory address so that when you overwrite the function pointer redirect back into the heap it'll interpret that as a memory address jump to it and then you're in your nop sled or your shellcode. And I would recommend you check out his slides or look up on that more, it's a great technique. And JavaScript is very dynamic. Any function or any variable can be renamed. You could rename the document object foobar. So for a security technology that's looking for particular calls or instantiating a particular object or class earlier in the script that attacker could have redefined that name to whatever he or she chooses. So that's another way you can defeat security technologies is basically dynamically reassigning the names of your functions. You could, for instance, assign unencode or encode to different function names that seem more benign. And that's a potential way you could bypass a security technology. On to a slightly more sophisticated cousin here is block randomization. Typically security technologies aren't going to interpret this JavaScript and walk through loops in it. Pairing this with string splitting or integer obfuscation you can create for loops, while loops do while loops that within the code of that loop you're dynamically crafting your payload for exploitation. And most technologies aren't going to understand and execute this loop properly create the shellcode and then be able to match that against whatever signature or analysis they're trying to do. Typically these techniques are used in conjunction with one another and that also affects or increases the effectiveness of them. So you're seeing more and more malicious JavaScripts that combine all these techniques into one really ugly mess. We want to credit the folks over at Metasploit for coming up with the Aveda-matic module. They really kind of discussed these techniques and wrote about them so they kind of came up with this classification that we're using here. To put up an example of what we considered a highly obfuscated JavaScript this is something that was found in the wild and it is very difficult for an analyst to manually figure out what this is doing either as part of an incident response or an intrusion detection analyst trying to look at this attack and see what the implications are or even if it is an attack, could it be benign? By the way, I'll buy anyone a beer if they can tell me what this does before we get to that slide later. Anyone who wasn't at the Black Hat talk? Ah, good caveat there. So like so many good ideas Caffeine Monkey was born at the local bar. Sitting around, myself, Ben, and another security researcher discussing current and future exploitation techniques and just where browser exploitation and the web is going in general when it comes to security. So we wanted a couple of things in this tool that we wanted to categorize and do a lot of fingerprinting and such with this. We're on a central database for collection and an easy way to get to the analysis. We wanted this collection to include web pages, JavaScript, and anything else that you find on the web. We want it categorized you know, in various different buckets where you could combine them or break them apart and get down to the lowest level. We also wanted a great and very easy mechanism to feed into the various browsers and other things that we were using to identify and analyze these results. One caveat in fairness is that in the browser or spidering these JavaScripts were identified by MIME types, which we realized does not catch everything but allows us to very quickly get through it without dealing with a lot of HTML parsing and reparsing as the onion script happens. And we felt it gave us enough to get there. We also wanted a safe and lightweight alternative. As we'll talk about later, in a lot of the current methodologies of detecting and analyzing malicious JavaScript, they're neither lightweight as they involve multiple VMware images, lots of snapshots, restarts, and lots of time and resources for the individual researcher or analyst to set up. And if you're working in on the spot incident and trying to figure out exactly what this is doing, then you don't want to deal with all that. You want a quick and easy way to tell what's going on. Safe also, a lot of these exploits that we have seen are taking care of the current ways of getting around it. They do things like closing off text areas, breaking out of sandboxed areas, which are kind of naive approaches with the way a lot of analysts are doing it right now. And we'll talk about those some more later. So, to get this across, thankfully we have a lot of great open source software to work on. SpiderMonkey is what we worked on as our basis. We extended that into the CaffeineMonkey. This is a great piece of software. It's been around for a long time. It's very mature. It's been being developed since 1995 in one form or another. And it's extremely extendable. And basically you can drop a JavaScript interpreter into any program you write with very easy bindings between the two. And you can control your function input and output with JavaScript. So this made it very easy for us to work this into a quick prototype. We also had the Heritrix web crawler from the good people at archive.org. Another very mature piece of software. If you ever need to spider a collection of web pages, it's a great tool to use. And the good people at the University of Michigan who had some scripts for taking apart those archive files and allowing us easy access into them. So this tool has and will be released under the GPL version 3. Everything about it is pretty much GPL. It's on our website that we'll get to the links later on in the page. But we hope that the community will continue to use it and extend it if they find it useful and work from there. So basically the heart of SpiderMonkey is that it wraps and logs functions in almost the syscall area of JavaScript. We're not just walking through it syntactically. We're hooked in at a deeper level somewhere with the debugger. And instead of manually running a debugger and running through all the JavaScript and all the loops and such and cataloging it you have logging functionality that's occurring and outputting. And currently it's very verbose. But that's because we wanted an easy way to get statistical analysis and the best way to do that is to be as verbose as possible. So here's a screenshot of the Heritrix web crawler. You see a couple of the jobs being done. Finished, finished. Enabled by operator. Very easy to work through. Just I can't say enough about how easy it was to set up and use effectively. Some more things of it is downloading some progress bars. Nothing special but again very easy and very grateful to have this to build on. But moving into what you're here to see is the demo for CaffeineMonkey. Here you'll see we're at the command line and Unix based and we've got the JavaScript from the earlier slide, the highly obfuscated pasted in there. And we were going to do this live but like all demos those are doomed to fail so we figured screenshots are the best bet. If you want to play with the tool yourself later you can download it. So here's some of the logging being printed out and we just write these to files. You can't analyze a big file as it's scrolling across the screen because it just produces too much output. But as you see new strings are being created here. Every time a string concatenation occurs which is a very large occurrence in both malicious JavaScript and simply just obfuscated JavaScript. New strings are created thousands of times throughout the script. You see here documents being built up, document.write, document.write and as you can see further it's producing the strings that it's going to write into the HTML web page. Moving further down the line you see eval is hooked in. You can see exactly what's being passed into eval. It's a document.write. You see it continues down as it's having to make some new strings because it again passed in some string concatenation to eval. And finally you see document.write being called with the script and a source to an external JavaScript. For completeness as it turns out this particular one was a highly nested advertisement for the Spanish speaking adult friend finder world. And that's what you'll find is there's a lot of redirection and you just keep passing through these onions. So imagine if you walked through this script yourself only to get to find out that it's just pointing somewhere else where you have to go through it again. Not a fun day. So here's the result like I said. The obfuscated JavaScript all boiled down into this. Not a lot there but a lot of code around it to make it happen. Yeah. So they wanted to see the original. Here it is again. You can see here how it's working. It's just a lot of care adds. A lot of string from cares. And it's got a little cipher in there. I think this turned out to be your typical Caesar cipher. You know moving by an offset of 24 to go around. Yeah. So that's what it started at. And after the tool ran through it, this is what it ended up. And the tool is very quick. This is a matter of a second. It's zero time at all. Moving into some of the pitfalls of current technologies and why we developed the tool. Well there's a lot of honey clients out there. It's an area that's been very ripe for research in the past few months and years. Had the MS Strider project which was kind of the first widespread use of a honey monkey type product project of a piece of software going out, scouring the web, running against multiple versions of IE. Now there's not a lot of info published about this. But from what I understand and from the information I've gathered is that a lot of exploits were found using these tools and a lot of patches were made that we've seen come out. Other things that have come across are the Mitre honey client project, Capture, Honey C. These are all relatively similar in the way they act. They have caveats one way or the other of what they're designed to do better or worse. The problem with a lot of them though is that they're very heavyweight and resource intensive like I spoke about earlier. Using either VMs and multiple snapshots or heavy duty hardware, lots of drive space and just in general taking a long time and a lot of resources to use. There's also the other methods being used which are very high interaction from the human perspective and are very slow to work. Imagine there are analysts and I've seen them do it that step through this code manually by hand writing down the results as they go through this obfuscated JavaScript. It'll take them hours to step through it and figure out exactly what's happening. It's a real waste of human time. Not to mention it's very error prone. You mess up one or two steps in something like the example we showed and you're not going to have a clue what happened. Because if that result is used later on then you've thrown off your whole analysis and you're going to have to start over. Speaking of the safety issue, again the text area wrap, I wouldn't trust it under O-Day conditions. I don't think anyone should. It's a good way to get your browser DOST and bypass your analysis and make you have to start all over and find a different approach. So Daniel talked about the web crawler component of the software. Essentially we wanted to spider some websites or basically start spidering with seeds of some websites we thought would yield interesting samples of JavaScript. What immediately came to mind was MySpace social networking site. Basically this is a site you're all familiar with and one of the characteristics of it is it allows user defined content to be uploaded including scripting. To hop right back to the Heritrix crawler, you could see essentially we defined several jobs in the Heritrix terminology. A job essentially starts with a list of seed URLs that it's going to start crawling with. From those seed URLs it basically will run either till it's completed the task and it's basically spidered the entire tree to completion or until the operator essentially cuts it off. As you can see we've targeted MySpace initially. We also targeted Whereas and Serial sites for pirated software. Using some Google hacking, we identified a list of .edu servers that had been compromised and that were hosting pornography and malware. Basically after those results we decided maybe we should check out some .mil, .countrycode sites that had been compromised and were hosting malware and porn. There are some out there. It's quite easy with Google using the NURL flag looking for .mil and then looking for various terms indicative of pornography. Also stopbadware.org is a great site for if you're looking for compromised web servers. Also shadowserver.org I believe is another one. The guys at stopbadware have an exhaustive list of sites they've identified as being malicious or attempting to exploit your browser. If you're a security researcher you could use these lists. Some of these sites will have already been taken down but many of them will have not been taken down. You could use these to perform some research. Also I've heard that Google, which has their own internal effort to identify malicious sites and filter their search results out, is now starting to share more information and more of their list of bad sites that they've identified. So what did we find here? Well, I'm basically talking about the MySpace run. We spidered MySpace for about three and a half days we collected about eight gigabytes of data. In that eight gigabytes of data there are approximately four to five hundred unique JavaScript documents that we collected. So the vast majority was text HTML. This is a crawl report of our MySpace crawl. So you can see there's almost 121,000 unique HTML documents that were returned. There's 78,000 JPEGs. But we only found 500 Javascripts. And again, as Daniel said, we were identifying Javascripts by their mind type. Obviously that's an incomplete solution because you can embed scripts in various ways. You don't necessarily even need a script tag for your Javascript to be dynamically interpreted. But that really wasn't the problem we were trying to solve and we thought, just looking at mind type would be a good enough approximation and get us some data pretty quickly. Those are unique documents. And you see we had 4.9 gigabytes of text in HTML. So we found lots of obfuscated scripts, cookie manipulation, adware or ad syndication, tracking of your behaviors. But essentially, it was all benign. We did not identify of those 400 from MySpace, anything that we could really determine that was trying to exploit your browser. Sure, there was ad syndicators that were trying to get their advertisements past ad filters. But that's really not what we were concerned about at this point. There's all sorts of technologies for tracking people visiting your website, where they click on, how long they linger at places. And a lot of these scripts also use these obfuscation and evasion techniques because they don't want various filtering technologies to be able to block them. So we were somewhat surprised based on our limited run at MySpace. It seemed to be a relatively cleaner ship than we thought we'd find. So kudos to the security team at MySpace, I assume. So how do we go about classifying these JavaScripts? Now that we've collected a corpus of JavaScripts from MySpace, we went along in the research community and we found some researchers' websites that had examples of some nasty JavaScripts. So as Daniel talked about, we had hooked in the JavaScript interpreter a bunch of key functions, everything from object instantiation, string concatenation, escape and unescape, CHR functions, those kind of things. So the idea we had was basically to look at the usage of all these methods and these calls and compare running the corpus of benign JavaScript through the tool versus some samples of known malicious JavaScript. Essentially we were profiling the script execution by instrumenting the interpreter. And like I said before, we saw some benign uses of these obfuscation and evasion techniques. So this first graph here, I apologize if you can't make out the titles, is four samples of malicious JavaScript, monkey chow one through four, and basically we broke it down into stacked bar graphs based on the frequency of calls that we had hooked in the interpreter. The very bottom of the stacked bar graph in light blue is document write. So you see, document write isn't called very frequently, once or twice or three times in these samples. The large stack over that is string instantiation. And string instantiation turns out to be very frequent in these malicious JavaScripts. In fact, to generate usable graphs that really showed anything, we were having to scale the string instantiation by a factor of about 50 here. Calls to eval are indicated here, element instance calls of the document object, and also object instantiation. To compare this visually with our samples from MySpace, we broke down all the JavaScripts from MySpace by domain name. We took the top ten by the number of unique JavaScripts that were returned. And on the far left, by far the most JavaScripts were hosted up at the MySpace .com domain. These could be people's profiles, these could be MySpace's own internal JavaScripts to manage login and cookie tracking, etc. All the way, rounding out the top nine, actually, because we had a tie, is Hillaryclinton.com. And she is very popular on MySpace, many links lead to her website. And she hosted several JavaScripts that we ran through our analysis engine. Of note also is photofile.ru. So apparently hosting photos in the Russian networks is quite popular on MySpace for whatever reason. And here you see that document write is relatively more common. Document write is being called a lot more in these scripts. String instantiations are less frequent. Calls to eval are of different magnitude. And to put these two next to each other, I think you can visually see some of the patterns we found here. The four stack bar graphs on your left are known malicious JavaScripts. The rest of them are those top nine domains by the JavaScript samples in our MySpace spider run. So immediately it jumps out at you that wow, document write is rarely called in these malicious scripts, but it's called all over the place in these benign JavaScripts. Another thing that struck us is that relatively string instantiation is happening much more in these malicious JavaScripts. To speculate on why that is, like we spoke before, the string splitting method of evasion is used throughout these malicious scripts and these benign scripts don't seem to be splitting up their strings or instantiating new strings with string concatenation nearly as frequently. Also you see eval is called relatively more frequently in the benign samples than it is in the malicious samples. And object instantiation is happening much more at being the top bar chart in pink in these monkey chow malicious samples than in our MySpace spider run over here. And when you download our tool from the website the data this is based on is available in the form of a spreadsheet and a CSV file. If you email us I'll also provide you a database dump if you're curious. So what's the future of CaffeineMonkey? Well the code is being made available on the research tool slash blog section of our corporate website because like most people in here we're owned by somebody. So there's a lot of directions this can move. And it'd be great if the community as a whole is going to take it up expand on it and save everybody some time. Because it takes analysts more and more time to go through these. Especially if you're working in IPS, IDS or any sort of incident response capacity to find out what really happened. It's going to take a long time. So potential things that could happen are inclusion in a web proxy of some sort, IDS, IPS heuristics based addition to signature based platforms or yet another point of logic for heuristics based platforms or anything else. Another crazy interplatform thing that could happen is a Firefox plugin that would run your JavaScript before it ran your JavaScript. Crazier things have happened. Not suggesting that one but if anybody wants to do it, knock yourself out. It might be very useful and you'll probably learn a lot in the time. So moving on from there we got about seven or eight minutes for a Q&A before we move into the smaller room. So if anybody has anything please raise your hand. Yes. Right. I'm sorry. Yes. The logging shows command by command that has been hooked as it runs through the tool. It shows everything that happens. For every Yeah. Among other things. On the graph. So basically the legend here. Oh, here. This is just a selection of the ones that we believed would show the best output. There are other ones that are output. We haven't fully put together everything in the Caffeine Monkey because Mozilla and IE both have extended JavaScript some past the basic engine approach but a lot of things are in there that would be called. Sparkly shirt. The question was the presentation on the CD. Yes it is. The skeleton version of it. It's not full but it's pretty close. Yes. The white paper should also be on the CD. You don't see the We'll go It should be downloadable from the same location as the tool. Which again it's right there. Okay. Sound guy? Or not. Right. So the question that was asked is about application security in this context. It seems like you're going to have to have an application that allows this to run that scans it beforehand. And that's exactly a lot of the problem we're seeing is that these are just run straight out beforehand and your AV might catch it, it might not. With AV it all depends. AV makes the first hit. AV isn't based on preemptive detection except with some of their heuristics models. Correct. That is correct. The sandboxing technology that the gentleman up here is mentioning could be used and should be used in a lot of web browsers and it probably will continue probably will be like that in the future. Yeah. Right. Essentially our web crawler was set up on one, you know, mid-level recent vintage Dell workstation. It was hanging off a residential broadband connection. And we gathered the eight gigabytes off MySpace over approximately three and a half days. I believe we had, you know, say 120,000 HTML documents, 77,000 JPEGs, 500 JavaScripts in that corpus. And I'd be happy to I don't have the numbers off the top of my head for the other runs, but just to give you an idea of how long that took. What really concerns me is the heap spray and feng shui attacks. Basically they yield directly into remote code execution through the browser. They're hard to detect. And they're quite reliable. Based on my understanding of heap spray, and I'm not the expert on this, essentially the JavaScript, since it's running in the browser, when you're doing things it's allocating heap space in the browser's heap. Okay. And so you could spray a particular nop-sled that is a valid heap address followed by your shellcode. And then you need to combine it with one more the final punch and the one-two setup to essentially overwrite a virtual function pointer. It's going to redirect you back into the heap. And then it'll, when you overwrite that function pointer, like I said, it's a heap address, nop-sled, that's going to jump you or trampoline you over to your shellcode. From what I can tell, the heap lib tool that Alexander Sadarov released, it's quite reliable. And it's improving on the initial heap spray attacks. Right. The basic SpiderMonkey you're going to download doesn't have a document object. It doesn't have a navigator object or a location. So we implemented the document object, we implemented navigator, we implemented location, the screen object, can't recall the others. So we were adding in functionality and we were also hooking a lot of the existing calls. We hooked the internal function that does string instantiation. We hooked the escape and unescape functions. We hooked the internal function that yields object instantiation. And in that method we didn't care about the syntax or the semantics of the script as it's presented. We're essentially hooked in the interpreter and profiling the dynamic execution. . We weren't the first to come up with this idea. Didier Stevens had a blog post where he was exploring this idea. There's a couple others that had mentioned it. I think we may be the first that added that much more functionality to it. I'd be happy if you guys checked out the code. If you got improvements, we'd like to see them. So it's out there for anybody to use. If that's all the questions, we may be moving over to the Q&A track room across the hallway. Thank you.