My name's Simon, I'm from New Zealand. All the Kiwis in the audience, put your horns up. Yes. Okay, I'm from Mintz Research. I was looking through the DEF CON program and I saw these people like founder of XYZ company, so I thought founder of XYZ company and so I thought, I can be a founder of a company too, so I'm founder of Mintz Research. Okay, so the original concept for the contest came about when I was drinking beer at DeepSec with a dude called Rich. We're talking about the PDF mail-to vulnerability, which had came out and we got the sample and ran it through VirusTotal, it was all detected. Then we modified it a little bit, ran it through VirusTotal again and then you got like two or three, maybe four engines detecting it, so we thought, hmm, this isn't very good. The signatures for this kind of stuff are a bit shabby. Shit. Then, so we released the idea for the contest that we're going to be running a race to zero at DEF CON and the media got a hold of it and they went mad. Some good, some bad and a lot of sensationalist reporting. So we got the guys from Offensive Computing, they say a golden opportunity for the antivirus industry. Then Trend Micro came along, it'll do more harm than good and Kapersky, my favourite, what about a live bank robbing contest to test bank security systems? Maybe a drug distribution trial ends at school to test narcotics police. I think that's a good idea, Eugene. Then SoFast rocked up and they're like, do you want to be a victim of this game? Cheers to the Von Dev guys there. You might have seen these t-shirts around. So, our motivations for the contest. We wanted to highlight the shortcomings in blacklisting technologies. We wanted to see which vendors were doing a good job and observe the real world difficulty of avoiding detection by the different AV products. And also look at the costs and the time spent on each of the samples to get them through the different engines and how much skill was required. And also, I was a Pearl Zealot from way back and everyone's like, Pearl sucks, Pearl sucks, you've got to get into Python. So, we're all right then, I'll learn Python. And so the whole engine and interface stuff was written in Python. So, what's the main problem with antivirus? We all know that signature or pattern-based blacklisting is dead. But things are starting to get better in the AV industry. Particularly in the home versions of software. They're starting to incorporate the behavioural-based technologies. Yet, things are slowly getting better. But there's still problems with your browser. Like, your browser's almost like a little mini operating system nowadays. And there's still all the file-based exploits as well. However, AV in the enterprise is still a big problem and it's still lagging behind the desktop versions of the software. So, with the desktop version, they've got the behavioural-based technologies in there, but that's sort of like the sounding board before it goes into the enterprise. And this is... F-Secure have got lots of honeypots all around the world and they collect... Like, they look at boxes that are sending out malware and they log their IP address and load it into Google KML or the key markup language and then plot it on Google Maps. And you can zoom around and you can see all the infected hosts on the net. And here we see there's a navy.mil box that's infected. It's probably running antivirus. The antivirus might be out of date or it's probably... It probably just hasn't got any behavioural-based detection in there. Just before I came over to Vegas, I was involved in an incident at a corporate in New Zealand, 3,000 seats, which is big in New Zealand. Like, it's nothing over here, I suppose. But they had got that antivirus on the desktop and the users had gone to their web mail via HTTPS and downloaded postcard.exe, which is that hallmark virus that got released recently, and clicked on it, and then it just went all through the organisation. It was copying itself to Samba shares and other people were clicking on it and it was just a mess. And they wondered, well, we've got antivirus. Why isn't this picking it up? And it's because there's no signature for it yet. Okay, so the real problem is, and this is a quote from a mate of mine, because they've finally realised, and they meaning the antivirus industry, that you have to assume your users have the mental capacity of a two-year-old, they're more likely to smear shit on the keyboard than actually use a product correctly. So, even if they've got this behavioural-based technology, we have to make it as simple to use as possible for them, because they're just going to be clicking next, next, next. Oh, postcard.exe wants to connect to the internet. Must be downloading some more postcards for me. Next, next, next. So, even when you've got these products that have got the behavioural technologies in them, that normally when you install them, it'll be an extra option, it'll be like the advanced feature set, or the expert level, or in McAfee's case here, the maximum protection. But normally the users, when they're installing a product, they're clicking next, next, next, next, next, and they don't see that there. They just, oh, maximum protection? I'll just go with standard, thanks. So, if there's one positive message that comes out of this contest, after all the negative shit, is mum or mom and dad at home need to enable their behavioural-based detection. And if the AV doesn't have it, or it's out of date, or it's an average product, go out and buy the upgraded version, and then turn it on. And there's also the whitelisting technologies like CoreTrace, which are sort of the alternative to AV, but then you still need to include AV with those products to detect the exploits for unpatched software. There's mum and dad at home, and mum and dad don't patch their boxes, so they need to have detection for the JPEG exploits, and ANI, WMF. Okay, so we'll get on to the engine. I developed this on Xen, so each of the VMs down the bottom there were, so where it says AV, that's a copy of Windows XP running in a Xen VM. And so all 10 of them were running on this laptop, so it's pretty, with a 256 mega RAM each. At the top, the Cherry PY would accept connections. It would auth the user, and then they'd upload their sample. The sample would get archived, and then dropped on the CIFS share, and then the session scheduler would connect to each of the AV instances and say, hey, go and check on the CIFS share, I've got a new file for you to scan. The results would then get stored in the database, and then I could look at them and analyze them after the contest. Oh, sorry, when we did it in production out in the contest area, it was two VMware ESXi boxes, and they each had five VMs each on them. Okay, so the engines I used, Clam AV, Nod32, Fprop, Virus Buster, all the common ones. Symantec weren't in there because the way that I integrated the engines was via the command line scanner. So I'd wrap that up with all the different parameters, like slash heuristic and slash archive, and all the ones that they had available for each of the engines. Some of them were quite minimalist, and that probably wasn't a good indication of how well that antivirus product may perform in the wild. But most of them were pretty good. And this is an example here of after someone has uploaded the file, it'll scan it through, and this is the stoned virus, which is a very old DOS one, just showing all the detections. So it's 10 out of 10 detection rate. The samples that I gave the contestants, there was 10 levels. So the first one was the old DOS stoned virus. And then we went through a few Trojans, Netsky, Bagel, Sasa, all the common ones there. And then level eight was MS Word vulnerability. I think it was MS07014. Then the ANI exploit, and finally was the, was Slammer exploit. Which is the SQL. So I think this is probably what my girlfriend thinks about me when I'm doing this kind of shit. You've probably all seen this on XKCD. Okay, so were malware or exploits, harder to bypass through the engines. With the blacklisting technologies, the malware was, once the teams had worked out the first malware sample, or after stoned, stoned was probably quite hard, and I shouldn't have included it as level one. But it sort of weeded out the real players. Once they got past that, and then they got the Trojans, all they needed to do was work out their packer, and get it working, and then they'd fly through all the virus samples. Then they'd get onto the exploits, and then that's where people slowed down again, and took a bit more time. I enabled heuristics where available, as I said before. And the exploit signatures for some of the engines were really tight, and that's where those products were winning. Okay, so techniques that the teams use. Team 4919 used a custom Trojan dropper to get through all the virus samples. Protected and executable with T, and decrypts and executes it at runtime. MGM used git tick count, so they were just spinning the CPU for a long time, and the AV engines would just eventually time out. And with the way I was doing the scanning, if the engine didn't return a result within 60 seconds, it was task killed, and then it would just return a clean. So, I didn't want it locking up. But then they can get past it with tricky techniques like this. Team Retim also did a custom Trojan dropper, and they included a Mandelbrot fractal generator inside their dropper, so that when you executed the code, it popped up the fractal. It was pretty cool. But the problem with the droppers was that the file that they dropped was exactly the same as the sample I'd given them. So when the user sees the CXE on the desktop and they go to run it, the antivirus is going to pick it up anyway. But for the concept of the contest, they got through the engines all right, but I probably should have stipulated more that they should actually be modifying the samples more, not just repacking them. And if they did pack them and drop them, then modify them so they're not the same. Okay, so some techniques for the exploit stuff. Team 4919, within the original Slammer payload, there's a loop for reserving space on the stack. And Team 4919 replaced this with three push-AD instructions, saving three bytes. And they did some other obfuscation mechanisms there. And they also replaced the RNG loop with a single RDTSC instruction. There are only four teams to complete the contest out of a total of 10. And the teams that didn't complete the contest, they pretty much couldn't get past level one. So this graph here shows the number of detections for the particular engines. And we can see there that McAfee pretty, like, got 90. I think there was over 200 samples and McAfee there detected about 90 of them, 90 of the 200. So just under 50%. Okay, here's level one with the stone virus. You can see there that F-Prop, like I remember when I used to run DOS, F-Prop was the virus scanner. So it's not surprising that they can detect multiple variants of stone there. Even when people have obfuscated them and re-upload them, F-Prop was still kicking ass. Netsky.p, again, samples would be uploaded, the engines would scan them. This is the results for level two Netsky.p. Trend Micro there did pretty well. Now it gets a bit more interesting when you get into the exploit samples because if the AB company have written a really tight detection for that sample, then it's going to be bloody hard to get it through all the engines. So if they are targeting the actual exploit, like in the text field, if the, like, a line here is longer than 255 characters, it's going to be a virus or it's going to be malicious because we know it's never going to be any longer than that. So you can see there Kapersky did really well on MS07-014 exploit. And no, one team did get past this, but the problem was with Bitdefender, the Trojan included an executable and the Bitdefender engine was looking for the MZ header within the Word doc. So team 4919 couldn't get past that bit. The Kapersky engine had the actual targeted code for the exploit. So here we looked at the Chicago street sweepers that XOR encoded the executable within the Word document, so they bypassed the Bitdefender check that team 4919 was missing. But then they were hit with the roadblock of Kapersky and the they couldn't get past that until they thought well maybe Kapersky's checking the version of the Word doc and also for this and matching that against the check basically, the length check which was exploitable. So they then modified the versioning number and got the sample through. But I haven't tested it fully to see if it would work because I didn't have a vulnerable version of Office. The teams didn't have a vulnerable version of Office to test it on so it made it quite hard. Now with the Slammer exploit this was the hardest level, level 10, and a lot of teams took quite a while to get this one sorted. NC there McAfee was pretty good on detecting all the variants that they were uploading through the portal. Cool. Okay. Can I have Scott Lewis from Wargames up here please? Okay. So the results. So only four teams managed to complete all the levels. Honourable mention for reteam in 2 hours and 20 minutes and he didn't use IDA to do any of the reverse engineering or anything. So reteam up here please. Yep. And they also had the dirtiest hack because with the Word exploit they just packed it up in an EXE and then called Office when running. So one of the things I just wanted to mention why I was interested in being involved. For those of you who were here last night you know that I was the model for David Lightman in the movie Wargames. And for those of you who subscribed to Wired it's also in this month's current issue. So that was really kind of my interest looking at this because I think we all know signature based detection methods really suck. And we have to go to heuristics, behavioural based modelling, but even we talked about it last night at the Wargames Q&A. About the adolescence of P1 if you've never read that. Using agent based systems, genetic programming, learning systems. Even before John Cosa really formalized this at Stanford. So really the AV companies really have to move to the next generation and can't rely on any of these signature based detection systems. That's really what excited me about all this. And the Mercury, I'm sorry VentureBeat is going to be having a little story about this as well. Okay the team most deserving of a beer was the team that included a loop in the dropper looking for the string beer. So can that team please come forward? I can't remember who you guys are. But yep, choice. Cool. And the winner is, and the winner gets a handcuff key and an electronic lock picking kit because you're probably going to jail. The Chicago Street Sweepers.