Okay. So it is with great pleasure I introduce a good friend of mine. FX and I have known each other since, was it DEF CON 9 where we ran into each other out in the pool? And I was trying to keep him supported while he was telling me about his talk. And I discovered he's a really smart guy. So you're going to learn a lot from him. But we have to start with a couple of shots of Jägermeister. Thank you. Oh, yeah, bring more Jäger. So today we're talking about safer sex online. How to get not owned by watching porn. Because the problem being the porn comes in flash fights. Okay. So just in the beginning, it's a defense talk. So I'm not semantic. So I'm not telling you this is going to protect you 100%. Because defense and security is actually just about making shit happen less often. You can't really prevent it from happening all the time. So this is what I want to talk about here. We're going to quickly go over the motivation of this work. So the five of you that probably sit there go like Cisco and then flash. What the fuck? This explains why. And then the flash attack surface and who actually has issues with flash security. And I'm getting to the tool demo pretty quickly. So you can either switch talks or then sit through the rest and see how it works. So the idea, this whole thing was actually initiated by a colleague from the German federal office for information security. In contrast to your NSA, our office actually also cares about the citizens and the citizen security. Now that's actually their official mission partially. So they care about things like flash and client side security. And so we looked at a couple of rich Internet application platforms and flash essentially turned out to suck a lot more than all the others in terms of security. And we tried to figure out how to fix that and unfuck flash without firing everyone at Adobe. Because that just simply wasn't in our reach. Not that I would have not considered it. And so and then we also discovered that the traditional detection methods actually don't work too well. And I'm coming to this in the talk. And we also, we see a shitload of new flash exploits all the time. So we're going to talk a little bit about that. And we didn't want to build yet another antivirus engine. So we wanted to build something that is signature free. That is, if the code is actually working, doesn't require any attention anymore and not constant updating and stuff. So that is the higher theoretical goal behind this work. What type of attack surface are we looking for when we load a flash file into a flash player? Well, the things that usually, like, you know, we're looking for when we're looking for a break in software when you try to exploit it are parsers, like the piece of code that actually takes apart the protocol file format. And now the flash file format is actually a container format that contains vector graphics, pixel graphics, fonts, sound data, video data of all types and virtual machine code. What can possibly go wrong? Pretty much everything. So let's say 80 percent of the software is parsing and it's all written in C by people from Adobe. And hence we have a problem. So the first type of person that has problems is end users, like you get owned by surfing porn. What commonly happens is you have a malicious flash file somewhere in the web page or a malicious flash is loaded up while you're watching the porn in the background. And then your flash player plug-in in the browser gets popped. And then it's like, you know, you're in a hurry to get out. And this is in almost all cases by modifying the flash file format in a way that when it is parsed, the parser breaks, like integer overflows and buffer overflows, basically. You also have functionality-based attacks, like DNS rebinding, CSRF style attacks where you essentially use flash to speak UPnP to your home router and open a port so it gets forwarded. Or it is used in exploit toolkits. The problem is 98 percent of the time, we have the 27% of all browsers have flash. And a quote I hear someone saying was telling people not to use flashes like telling people to not smoke. That doesn't work. So what the end user actually wants is something that does Adobe's job. Which is validating that the file he is about to load in the flash player is actually valid and well formatted because if it's valid and well formatted, then it's probably not going to make the flash player fall over. And if you can guarantee that it's well formatted, then you probably have a file that you can watch without getting popped. The thing here is that you actually really want to have that in your web browser on demand. And for end users, performance of such a method for protecting is actually critical. As AV vendors know all the time, because people hate to wait for their porn. So if it's, you know, if it loads slowly, then, you know, it's not cool. Unless you grew up in the mailbox times, then, yeah, you were used to seeing people in pieces. The other group of people that actually really suffer from flash attacks are website owners and ad networks. And interestingly enough here, it's not file format based attacks that they're concerned with. It's actually functionality based attacks. So, you know, there is program code in flash files. And of course you can program your banner to go to a nonmalicious URL. Hello. To go to a nonmalicious URL. And then it gets uploaded into the advertisement network and they click on it, they test it, they see it's fine. They put it out into the content distribution network. And then your banner changes behavior and forwards users' browsers to malicious sites. That happened to a couple of news media sites, including the New York Times. So it's an actual problem for them. Their requirements on flash security are somewhat different. Sure, well formatted files is also of interest to them. Because it helps the people testing them. But it's a little bit of a challenge. It's not getting owned. But desired is also the ability to say, well, contractually we give you banner space to forward to users that click on your banner to this particular URL. If you're diverting it, if you're forwarding them to a different URL, you're violating the contract. The problem is today they can't verify that. They have to trust the code. Because they get precompiled flash files. And it would be nice for them to say, well, we enforce that the code actually can't be used. And that's a little bit of a challenge for them. But it's a little bit of a challenge for them. They cannot do anything else. That, of course, is more computational expensive. Meaning you need more CPU power. But that's not a big problem for them. Because they will run a server site. They will actually run a verification process the moment the flash file gets uploaded. So we have flash provides its own security. Not. But it's a little bit of a challenge. But there is some configuration. Right? There's very limited configuration options. Like you can turn on and off the camera. For whatever that helps you if you got owned. And there is the possibility to disable a lot more things. Like disable file uploading or downloading. The problem is that sits in some configuration file that nobody actually uses. What the hell is going on next door? Do they have next door security? I don't know. I don't know. Like chicks or something? And another thing that flash doesn't have in terms of security is proof of origin. So there is absolutely no way that you can tell where the flash came from. There is no signature mechanism whatsoever. And then there is AVs. So here's the thing about AVs and flash. Flash files can be and most commonly are zip compressed inside. Like the whole thing is it compressed. They can be uncompressed, functional equivalent, it's just that it's compressed. So when you take the most common malware, it is called, no idea who came up with that name. If you upload that to virus tool, you get a coverage of about 70%. Now this is the compressed file. If you simply uncompressed the file, it's still the same file, it's just unzipped. And you upload it again, only 8 out of 40 AVs even detect most common flash malware that we've ever seen. So AVs are an epic fail when it comes to flash. Scratched apart when it comes to flash. So we had an alternative approach on this. So what we provide is a straight command line program, similar to command line AV. And what it does is, you have a command line program. You give it a flash input file that is potentially malicious. And you will receive an output file that is hopefully not. As simple as that. The idea here is that we actually run complete format verification on the file. And then produce a new file for you. And how do you use that? Well, we figured that we first with the release are going to target people that are security conscious anyway. So we have a lot of people that are not. So I thought if you're surfing with the IE6, then you probably don't care about flash security because you have other problems. But if you're surfing with Firefox and no script, then you're probably aware of a few of the things that happen on the Internet. And so you're probably more helpful as a target customer group. So the author of no script was nice enough to build a external filter interface that I proposed to him. So you can hook up other programs. You can write your own programs now that will do filtering of specific mine types. And then you can hook them into no script with no coding whatsoever. But he built it actually for us. So we can integrate our blitz up lighter into this no script thing. It required a lot of work on his side. And it's currently up and running. If you're up on the latest version of no script, you already have that option and you can configure it. And at this point we would like to thank Georgiou very much because it's not like we had to back him or something. It was sending him one e-mail proposing this and he's like, it's cool. And then he started writing code. I think I forgot to mention one thing. The name of the tool, blitz up lighter, is a German word, intentionally. I think it's a German word. It's a German word. Just to make it harder for you guys. It is the term that we use for lightning rod because it turns dangerous lightning into, you know, pretty flashes that don't kill anyone. So that's for the name of it. So here's how the no script integration looks like. It's really just the external filters tab and then you choose the exe file. And he also integrated it into the context menu. So, for example, if the tool will not allow you to see a certain piece of porn and you really want to see it, it's one click away to say for this site, don't run a filter. I want to get owned. The shake is just too hot. So if you want to integrate blitz up lighter into web pages, that's also a trivial thing since it's command line. You're just running it on the web server when the upload happened and check the return value. The operating system exit value of the program works the same way every command line AV ever worked. Depending on the feedback we get, we're going to set up a XML RPC or SOAP or whatever service. You can use AJAX or whatever to send flash files first to us and then get the flash files from us into your web platform. If you want to have such a service being implemented, then please contact us. Drop us a message. If you want to have such a service, drop me an e-mail, something like that. It would be easily doable, but I'm sick of doing stuff that nobody wants to use. And it's open source. Because I don't believe in black or yellow boxes that promise to make me secure and someone else rich because they usually only fulfill the second requirement. And that is not good. So I believe that we should actually start applying principle from the crypto graphy world to the defense world, saying if you use a defense mechanism, you have to be able to verify that it actually does what you're expecting it to do. And for this, the source code is very helpful. We would also love to see integration into other pieces of software. So you're welcome to sign up and get the source ball. That's the URL. But it's going to be on the last slide anyway. And now I'm going to show you the thing in order for you to be able to see what's going on. So this is my very, very small version of the Internet. It has a glass martini and two exploits. So let's first look at the glass of martini. This is what no script is supposed to do, right? Like it prevents the shit from even executing. But if I choose to actually want to see that, it is loading flash and it's taking like on this shitty netbook, it takes about like nine seconds until I get my glass of martini. So this is, you can verify this is flash by seeing the options that I don't see right now. Yeah, I don't have it on my screen here. So it's kind of funny. Are you, is that the back button? Cool. So here you can see what's going on. You can see it's an in the wild exploit. For a relatively recent vulnerability. As you can see, I'm going to fire this. And so nothing happens on your side, but on my screen, which is the primary screen, I get a pop up that looks like this. And it explains that this exploit didn't even bother to set the length fields in the first header. Like the first length field ever in this entire file to set that one right. So I'm going to fire this. And I'm going to fire this. And I'm going to fire this. And I'm going to fire this. And if I actually hit remove, it will fire. Which speaks volumes of like the flash player parser because that would be accepted. So you see two buttons. You can just hit escape and it disappears. But to the left, there is also a button that says tell the people they suck. Which sends us this lock. Because if we filter the porn, you really wanted to see, then you can complain by pressing this button. So and then, you know, you get a replacement file. You can actually configure the replacement file. So you can actually put in here, you know, at the placement file so if you want to flip the finger at exploits you can do that. Let me see. Back button? Cool. Here's another one. I actually like had to figure out what the vulnerability was and write this trigger for the vulnerability myself. So this one actually cares about setting the length fields correctly. And here you see a, well, first I see it. A more concrete example of how far we go down. I'm going to mark this here. Yeah. Well, I had to mark it first. So this is where we actually go down into the byte code and one of the individual byte codes had an invalid argument which will exploit the flash player but the format verification has caught it and would have caught it before the vulnerability was forwarded. So this is where we actually go down into the code and we're verifying the entire format. So this is what you get. Are you impressed? Now let's see if I can get this back to presentation mode. Awesome. Didn't work at black hat. So now that you know what you get, let me explain how it works. So what is flash in the inside other than Fox? So it's a, as I said, it's a container file format. But it is heavily version dependent. Every data structure in this file format is extremely version dependent and the version is set right in the beginning in the header. So the file declares what version it is. Which influences a lot of things how the flash player behaves. But also how the data structures look like. The problem with flash, or one of the problems with flash is it's all the way backward compatible to version 3 of the file format. So it's a little bit more complicated than that. So as someone said, trying to be backwards compatible is like trying to stay close best friends with all your ex girlfriends. And we know how good that works. So that's your problem. I already mentioned that you can compress flash files. But that really doesn't matter too much. In principle, the file format is composed of tags. And tags are simple type length value data structures like containers. In which then specifically, you can have a lot of data structures. So you can take data structures for this tag type reside. A few examples of tag types. You have control tags. You have essentially like start and end the movie and set labels and bullshit. Then you have things that display objects. And we're going to talk about these more later. You will actually notice that those tag types here, they have something like they have numbers behind them sometimes. So place object and place object two are two different tag types. And place object two actually doesn't place two objects as you would first assume. But it's their second attempt to get the data structure right. By the fact that we have a place object three, you see how well that went. And that's a reoccurring pattern in Adobe's design is like even op codes have second and third versions. We also have bit map data. You see there is a defined bits JPEG two and three. And I don't know like how hard can it be to not fuck up a JPEG data structure. But anyway. And they have a special tag type that is a button which is nothing else than a shape. But it has functionality connected to it. Here's an example of a data structure. So they tend to lend themselves very nicely to buffer overflows and integer overflows. Because they have a shit load of length and counter fields. And there are a lot of things that are all 32 bit long. And they can easily contradict each other by design. Which they, well, if you set in this case, if you set one of the length fields on a negative value as marked out demonstrated in 2007, you can exploit the flash player. One of the many ways you can do that. So what BlitzSupply does is what I call normalization through recreation. So we ensure, we parse everything that we find. In the code that we have, we have the greatest detail we can possibly do. Based on the specification. We're really strict on enforcing that all the cross references and all the relations between length fields, pointers, indexes, all that are really, really completely tested and completely understood. Once we did that, and code makes sense of the porn, we throw away the original file and create new porn based on the information we parsed out. That has the benefit of providing perfect information to the user. So we have the perfectly clean porn to the flash player. So you don't get owned. It also makes writing stable exploits a bitch because all the offsets change all the time. And that's essentially what we do. And that's essentially what I call normalization. How do we do that? So first of all, we're writing yet another parser for flash. So we want to, we don't want to increase your attack surface. We want to decrease it. Right? So we better not write the parser. We don't want to increase your attack surface. So we're writing yet another parser in an unmanaged language. We're using the .NET runtime to ensure that things like out of bounds and integer overflows will be caught by our runtime and not by our code. If we would check for all the possible integer overflows in a file format manually in C code, we A, would fuck it up. Well, I most certainly would. And B, it would be a lot of code. Why would I do that? There is a runtime for that. It also means it runs nicely on Linux and BSD and it targets .NET 2.0. So it's perfectly binary compatible with mono 1.2 which is currently shipping on most Linux platforms. And, you know, Mac users can kiss my silly ass. It was their choice when they bought it. So for all the TLV data structures that we have, not just the tags, but everything that is like type length and then block, we just move it into individual memory streams and operate on those memory streams. And that's what we're going to do with the memory streams. Because then every out of bounds operation will actually throw an exception and it does. The parser only accepts data structures that are documented in the Swift file format specification. Which unfortunately is not very commonly updated. So if there is undocumented opcodes or any other bullshit going on, we're going to reject the file. And the parser also verifies all the version dependence. So you cannot claim to be a Swift version 6 and then use some advanced functionality from version 8. Here's an example on why running on a .NET CLR is so cool. The exploit I mentioned before, 2007-0071 from Mark Dowd. If you're trying to read this into Blitz, this is in the code where the actual exception is triggered for the negative value of the scene count. So the run time caught it right there when we parse it. And that is fantastic. And this is what you get as an output later on. Let me tell you a little bit about Adobe virtual machines within flash. This is fun. And also a history lesson on how to not do stuff. So the flash player actually contains two virtual machines. Completely independent two virtual machines. They're respectively called AVM 1 and 2. AVM 1 is historically grown thingy that they came up with in flash version 4. And something about like 80% of the flash on the Internet are still AVM 1. AVM 2 is a virtual machine for ECMA 262 JavaScript specification. But of course the VM is completely by Adobe's design which is not necessarily good. AVM 1 is programmed in action script 1 and 2. That's what most web designers use. And action script 3 is what is closer to JavaScript. And it's not so widely used in the, you know, I call them RGB caspers. Like people that make blinking web pages. So they struggle to understand OOP. So the whole JavaScript object and event handler idea just escapes them. So they stay with the AVM 1. That's the reason why we have so much code there. So I said a version 4. The data was introduced in version 4 of this web file format. It was already a Turing complete stack machine with variables and stuff. But someone must have left university after the first course. Because all the data, like the only data type it could do was string. So if you would add two numbers, you would actually push two strings onto the stack and then the add instruction would try to make sense of them to a number and then add them and then push back a string. And so that was the reason why I said the Lindaiter. So. In version 5 they realized that's a shitty idea. Introduced type variables and also introduced a constant pool. Someone must have made it through the first 20 pages of the Java specification. And they introduced objects and methods. Which, is that good? Yeah. Which then in version 6 they discovered that objects actually need to be initialized before they run. So they introduced a tag type for that. And I actually since PC is quite common I think introduced versions, they now discovered it would be cool to check the ‑‑ they introduced types and now it would be cool to actually check what type a variable is. So they introduced that. And in version 7, then they added new functionality to their objects. For example, they discovered exceptions. And type casting. And object inheritance. Version 8 never happened. I don't even want to know. And version 9 then brings in the AVM 2 with a complete file format within the file format. So they have a complete new file format that is called ABC file format that goes into one new tag type. And so you have yet another file format in the file format. And then version 10 is what we're currently watching the porn on. Now keep in mind, this is all still supported. Back to the string additions. So where would you actually look for code within a flash file? There's a tag type called do action. Sounds like one. There's the majority of the AVM 1 code is supposed to be there. And then there's the do in action tag which I said is used for the initialization of objects. But can contain pretty much any code you want. Like there's no restrictions that are put into place by the player. Then there is the button. This is the button. This is the button that I already mentioned. So the define button 2 tag contains a button record to data structure that can carry conditional button actions. Which is actually blobs of code. So you have a graphical element in a file format, a vector graphic element and you attach a piece of code to it. Now they obviously really like this idea. Then went back to their fridge with the psychedelic drugs. Took some more. And specified the same behavior for shapes. So you can actually have two shapes like a star and an asshole. And if they overlap, they clip. So clipping is when one of the shapes is not completely shown. For which you do clipping calculations. If those clipping calculations happen, the asshole can actually have code attached to it that is executed when it gets clipped. Isn't that nice? So you actually have to parse the entire vector graphics definition to get to the code that is executed when someone like moves the mouse over it. Many security tools that we found and other tools actually don't parse that part of the code. They only parse the main part that is in the do action tag. So you can totally smuggle code away. The code itself, like the AVM one code, is variable length instructions. We all know how great those are. It has signed branch targets, six 16-bit branch targets, which pose a problem. And then there's the two sickest things I've ever seen. So if you want to define a function, in every other executable format that has the notion of a function, you will have a separate area where you say, this is where I define my functions. This is what name it is. This is where it starts. This is where it ends. In AVM one, it is an instruction for the virtual machine. So function functions are defined by executing them. There is an instruction that says, I'm a function, and the next, like, 20 bytes is code of me. And then the interpreter just, like, the virtual CPU just, like, goes over the 20 bytes, reads them in, and then there's a new function. This, of course, can be nested and, you know, they can be executed in line. So you define a function and it's right away executed. Anonymous functions. So this is just totally off the record sick. Well, they liked it so much that they implement their try catch finally blocks the same way. So there is an instruction that defines try catch finally in line when executing. This is obviously has a lot of design weaknesses. So to verify code, the first thing you want to verify is it doesn't jump in the middle of an instruction. Many of you have probably seen that in x86 code being done for the obfuscation. You can totally do that in flash as well. The funny thing is you can also just jump into the tag right before you in the flat file and execute some code in your MP3 or whatever. Like, hide your code in the nipples of the porn and then jump right there. In the image data, no problem. They do that. The 16 bit branch offset is also an interesting design decision. So I was wondering, when you have 16 bits signed, you can only jump over like 32K, right? Because then your bits run out. And so I was wondering what they do if you have an if statement with a large body. So I took the official flash player development environment, latest version CS4 and made an if statement with a large body. It perfectly, it never complained. It produced a flash file. It is perfectly invalid code because it jumps as far as it gets and then executes the rest of the body. The very curious length fields in the instruction set allow you to hide a lot of data in the tail of the instruction. And that's commonly done in flash code obfuscation software. So and as I said, the order of code execution is highly dependent on where the shape of the asshole currently is. So this is where Blitz Uplighter comes in and disassembles the whole thing and verifies a lot of things. So what we do when we disassemble it, the first thing we do when we disassemble it is we take the code and what we do is we go from byte offsets to instruction indices. So all the disassembly is an array. And if your byte offset actually doesn't resolve into a index in our array, then you're jumping somewhere you shouldn't jump to. And we are verifying the code flow stays within this code block and we verify all kinds of crazy shit about like this function declaration bullshit so they're not overlapping and all of that. And down to things like our all instruction, only part of exactly one function. Stuff like that. We just make sure it's good. Now once we make sure it's good, we still have that problem that remember when I talked about the ad networks and people that receive flash files? For them it's not a mail form flash file but functionality that can be implemented in flash AVM. So how do we actually get functional attacks to not work anymore? So the first thing we do is we take the code and we run static analysis on it. Now we have a nice and tidy swift file. We could run static analysis on it but static analysis provably will not resolve all possible cases. So we will not, it can be shown that we cannot possibly predict what the code is going to do. It's called the halting problem. Look it up. If we try to emulate it, we will run into the problem that our emulator does something and the flash player does something. And if our emulator does something and the flash player does something and the emulator isn't sick enough to be Adobe compliant, then we're actually like going two different ways with the code. So that's also not a good approach. However, when you do run time analysis, like if you have the specimen, what you usually do, run time analysis anywhere in this assembly, you set a break point at the point of execution, let's say the sys call. And no matter how much obfuscation was going on before and how complicated the argument was compiled together, at the point of the sys call, you just set a break point and you see what the argument was. So we want to do the same thing with the flash files. The problem is we're not part of the show anymore when the porn gets played, right? We already produced an output file. We're not debugging the flash player. But what we can do is we can actually patch the AVM code to do the check we wanted to do right at the point of execution. And this is what we do. So here's an example. There is action gating. This is an example of an action gating URL to second attempt at getting the op code right. That actually is the most common function that forwards your browser to a different URL and is used by most of the downloaders, like the flash downloaders that just download like scare wear onto your machine. So when we handle the flash file, for example, we know its origin. We know where it came from. No script passes this on to us. So we can actually patch more strict same origin policy checks. We can actually get the op code into the flash code itself than the player would actually do. And this is how it looks like in a code flow graph. So on the left-hand side, you see a basic block graph of AVM one code. And pretty much in the middle of it, there is a block with the ID 31. And this is where the actual execution of the action get URL happens. And before that, he's pushing the arguments on the stack. In this case, for example, it's pushing arguments out of the console. So this is a constant pull on the stack. So I'm coming back to those cases in a minute. But just notice that there's this one block where the actual action is fired. All op codes start with the word action. So don't feel silly or like a movie producer when you work with this shit. It's totally normal to say action every five minutes. So when we put in the code, we get the code, we patch it. This is what comes out. So you see that the one basic block with the ID 31 was split into three. The upper one, doing the validation and the string comparison, a strict string comparison between where the flash file came from and where it wants to forward to. And then if it's happy with the comparison, it forwards the browser. If it's not happy, it's just cleaning up the stack and not doing it which is what we So just to give you a feeling, there is a complete assembler for AVM 1 and 2. You can write flash assembly and text files and use that as replacement so you have a pretty high level of freedom. So this is the assembly for AVM 1 to how it calls methods and on the right-hand side you see all the instructions you need to execute to even figure out which method of which object is called. So you see it's a lot of code that goes into just finding out what the method of the object was. And if you actually decide to not call the method of the object, that's the amount of code that you need to clean up the stack and do stack unwinding in AVM 1. So this is the assembly for AVM 1. So when you apply this to a piece of malware, example Gnida, you see this is the complete code of Gnida. The one to the left in blue is the original code. The one to the right is the same code and all the red dots and places you see there, this is where we patched in additional checks automatically. You see it's quite a code inflation. So we're looking at 200,000, 200,000, 200,000, 200,000, 200,000, 200,000 250% code inflation just to check that it's not doing something evil. I mean, it's still nice because it totally protects you. Every single call is protected, but it inflated the code way too much and so maybe the porn starts no longer being fluent. And you also run into problems with the signed jump targets because like the stuff you patch in is too big so you can't jump over it anymore. So there's a lot of stuff that you have to deal with. Therefore, we introduce static analysis into it. We can provably not determine every single call argument, especially not the dynamically generated, but we can try to prove the static generated. We can prove staticness for individual arguments. For that, we just need stack tracing. So what we do is we trace the stack back on the individual instructions and if we can tell it's a static argument, then we do the check right there. And then we can compare and don't patch the check code into the flash file. In order to determine the values, we actually need to obtain a code flow graph as well because of course the constant pool is not part of the file format, but it is another instruction. So since the constant pool creation is an instruction, you can actually overwrite your own constant pool in your own code. So we actually have to do complete code flow analysis in order to figure out which constant pool currently is on. On top of that, we're still a bit working on, but it's already part of the code, on higher level verification. So you can essentially say, this is the object, this is the method, and I want to have the following string comparison with the second argument of this method call, no matter if it's AVM one or two. And how that works right now is we have our own virtual machine, actually two, which get executed with individual parts of this question, like give me the second argument to this instruction here. So in those two possible cases, it's a static analysis engine. So it executes this step and tries to figure out the second argument. If it cannot provably figure out what the second argument is, or it can prove that it is a dynamic argument, then it will emit the respective, then it will stop execution. So what is the transaction type? This is the And then we run the same process again, but in a different mode. Instead of trying to prove staticness, it will actually emit the steps that it took in the first run as AVM1 code or AVM2 code. This allows us to have very small pieces in those steps and ensure that our static analysis tests and the tests we do in the actual AVM1 code are functional equivalent. Because otherwise we run into the problem that we test something different here than there, and that's not very useful. So we recently introduced AVM2 into BlitzSuppliter, so both AVMs are now covered. There's an interesting bit about the AVM2 specification, the ABC file format that I said they put complete file format into the file format. So there's an interesting thing here. There was apparently one way. One way. One-eyed guy between all the blind. And he wrote the specs, so he tried really hard to be smart. And he actually had a good trick to prevent all his less talented colleagues at Adobe from having integer overflows. He will actually put, like, all the length fields and counter fields at 30 bits, not 32 bits. So if you're an untalented programmer, you can add four of them and still not have an integer overflow. That is actually pretty smart. However, when you... When you take the official Tamarind, it's the open source implementation of AVM2, and it's pretty much the official thing, so it's Adobe people writing it. When you look into that, how they parse it, this is their C code. Of course they've written it in C. Nothing can possibly go wrong. This is how they parse the 30-bit field, and if I may direct your attention to the third line at the bottom, they're actually parsing 32-bit. So this... This one guy was actually pretty smart, but, yeah, he was pretty alone. Other than that, AVM2 is design-wise a lot closer to its predecessor as it should be. They finally figured out that you should have one constant pool, and they finally figured out that you should not define functions by instructions. I'm very grateful for that. The stack tracing is a little bit harder, but it's... Yeah, so the end goal is to really have it all unified, so for whoever wants to enforce rules in the code, that the definition is high-level enough for them to model their contractual requirements into actual code patches. So what happens when we use our tool? So far, not a single exploit that we have a specimen of. I actually managed to pass through the BlitzUplighter tool. Most exploit code, if you've seen in the demo, doesn't even bother to set the length fields right, so we catch it very early. But even those fixed actually never went through. There's two where I don't have an actual exploit, which pretty recent from this year, that exploit JPEG parsing. So they even managed to fuck up the JPEG parser. This one will, the state right now, still pass through, because we're still not validating media content within the flash file. But all the others were blocked. And all the recent vulnerabilities that came out were automatically blocked, because we don't need fucking signatures. We're using it for a while already. It does play porn. YouTube works, YouPorn works. Yeah. And just in case something doesn't work, you can also, like, turn off individual tech type parsers. So if you find that the tech type parser for funds misbehaves on you, you just turn it off in the configuration. And remember, there's also the complain button. Flash files with code obfuscation employing, like Hulu.com, will get rejected, because we don't know what's going to happen. Because we cannot prove that the code flow doesn't do anything shitty. And this is why you can configure exceptions in no script. Many third parties with generators produce plain utter bullshit. Simply because the flash player doesn't care. We do. So, yeah. If you have third parties with generating code anywhere in your company, I would be grateful if you would try whether it's eaten or not. And if it's eaten, then go beat up the people that create this. At this stage, we really need people reporting compatibility issues. So if the tits are green instead of blue, complain. Because that's something we cannot automatically test for. And there's just so much porn you can watch per day. And it's also highly annoying. So, we only, like, it's HTTP. You can sniff what we lock when you press complain. But it's just, you know, it's not going to work. It's just what you see in the dialogue. But I would ask you, if you're trying out this tool, really complain if shit doesn't work. Otherwise, we can't get it to the perfect state where we want it. If it does this to you, I also want to know. But the complain button will send it to Microsoft. So you actually would have to send me an email or go to the website where you can file bugs against me. Oh, I'm already at conclusions. Great. So, essentially, we're pretty confident that Blitzabliter, by principle, first and foremost, shows that signature-free recreation is a valuable way and alternative to detection paradigm, to AVs. By enforcing, by having secure parsers in managed languages and enforcing a structure that is documented and is tricked, you make it a lot harder for people to use. And you may be able to get through this to the broken parser at the end where you feed it to. We also think that automated code property verification and enforcement would be really, really interesting and useful for people that have that requirement and are also more applicable to other file formats. And we hope that this tool will actually decrease your attack surface and will allow you to not get owned when you use it. surf porn. Here's a couple of people working on this. Robert is one of our interns. He works on this code quite a lot. He hates Adobe as much as everyone else who wrote parsers for their file formats. Dirk is the guy who actually managed to be the free time for me so I can work on it. And Moonby is just generally awesome and actually plays tonight at the freak show so if you want to hear some good electronic music, come by. And that was it and I think I even have time for Q&A. And I have one more. Okay. First question gets it. What's the question? Proxy integration for squid is trivial. It's just command line. It really runs, you know, you can put it into squid, into a filter interface because it takes input and output. That's absolutely trivial but you can also link it into other code. It's a library. Okay. More questions? Did the question over here? Do you plan to talk to the people behind the flash block at all? Flash block is another browser plug-in? Yeah. It's specifically just to block flash. There's a lot of people that find no script. What browser is it for? Well, for firebox. Oh, totally. Like, I'm, you know, well, the point of giving this talk is I want feedback. And people that want to integrate it, that's the whole reason we make it public. And believe me, it's a lot of code. So I would love to have anyone who wants to integrate it anywhere, even in their, you know, I don't know, parking lot. So you think we should actively go out and seek them out? Well, I would say so because just because no script is so noisy, I think only super security people can, like, deal with how much you have to update stuff. Whereas flash block just makes all flash on the page just be placeholders by default. If you want to see the flash, you just click on it. So it's a lot more usable by normal users. So it would be more possible for them to manage this. Okay. Yeah. I'd try it. More questions? Any eagerness for me? Did we have issues with the Adobe documentation of their file format? Did we have issues with the Adobe documentation of their file format? Are you fucking kidding me? Of course we have. Dude, they have, like, the errata for the file format specification for ABC, for AVM2, sits on a fucking Mozilla Viki without being linked to from anywhere. Like, it requires some real Bing voodoo to actually get there. And then it contains things like, oops, those were actually in there. And then it contains things like, oops, and not full strings. Yeah, I noticed, we're trying to parse it, fuckers. Yeah. So that's my biggest thing with Adobe right now. I'm trying to get them to collaborate so we can tell them where our reading from the spec and the reality goes, like, this way. Because for example, on Adobe's site for, you know, on the definite for flash where they should have like a little bit of showcase flash in the samples. Half of the samples violate their own specification by not declaring the exception handlers they call. Does that answer your question? Do you want to go to a Q&A room? Okay. Do we have time for one more? You have time for one more question. Do we have one more question? We're expecting to improve the relationship with Adobe and get more specs. Okay. Thank you. Let's get drunk.