Okay. How's everybody doing? All right. Let's give a big hand and welcome our presenters here. Danny Quist and Laurie LeBrock. Thank you very much. So this is Reverse Engineering by Crayon. I'm going to talk a little bit about some hypervisor-based malware analysis and visualization tools that I've developed here. So my name is Danny Quist. I founded Offensive Computing. Also a PhD candidate at New Mexico Tech. I do reverse engineering and I teach reverse engineering. And I'm Laurie LeBrock. I guess I need a mic. I'm Laurie LeBrock. I'm an associate professor and fortunately get to work with Danny, run the scholarship for service program at New Mexico Tech. And Danny's going to present essentially all of this because it's really his work. Okay. Wow. 30 seconds into the talk and there's already booing. Thanks guys. I do have a fire extinguisher here I was told not to use. That makes me want to use it. Okay. So what we're going to talk about is get started talking about the reverse engineering process. Then I'll talk a little bit about hypervisors. And then specifically Xen and Ether, which are pretty awesome. And how we modify the reverse engineering process to work with these. And then I'll show my visualization tool Vera. And then I'll show you some real reversing that I did with this. And then some results of this process. Okay. So let's get started by looking at the reverse engineering process. The first step with this is and this is just my process and the one that I teach and the one that I've had a lot of good luck with. It's by no means everybody's one. But this is just what I use when I'm doing it. So that's the big caveat there. So the first thing that I do is I set up an isolated environment. This is something like VM wearers and virtual PCs. Some sort of dedicated hardware. Then we get into the initial analysis. And this is using the real high level tools like Sysinternals to look for system calls and monitoring any sort of operating system state change. The next one is removing deobfuscation and dearmoring a program. So this is unpacking using debuggers, Saffron or Ether. Then we get into disassembly. So this is with Idapro or Olidebug or Dumpbin if you're so inclined. And then the next part is identifying relevant and interesting features. And so this is where a lot of newbies have trouble with the process and something that I wanted to address. So the two things that we're going to talk about here are specifically going to be addressed is that we're going to look at dearmoring or deobfuscation. And this is using a tool called Ether, which is completely cool. And are Paul and Artem here? Oh, okay. All right. So good. I know Artem embarrasses you. And then identifying the interesting features is the thing that the visualization tool is going to do. Okay. So setting up an isolated runtime environment. The point of this is just to protect yourself from the code. And this is, you know, assuming that it's pretty difficult to actually break out of the VM. It also makes a known good baseline environment to allow you to do backtracking if something bad happens. So execution initial analysis. This is just to get the extremely high-level overview of what code's doing without looking at assembly. And so this is looking for changes on the file system, changes in the behavior of the system, network traffic, and overall performance. Okay. So now removing software armoring. Software armoring are just protections to prevent reverse engineering or make the program smaller or protect it in some manner. And this is done via packers, which are just self-modifying code. And there's a whole lot of research out there on this. Alibone, Saffron, Polyunpack, Renovo, Ether, and Azure. So this research is going to use Ether. Okay. So let's talk a little bit about the packing problem. All a packer is is it's a self-modifying portion of code. It has a small decoder stub that decompresses the main executables and then restores the imports and then allows the program to execute normally. And this just plays tricks with the executable. It does the bare minimum amount of work to get things loaded up and hides imports and that sort of stuff. And it's basically just to trip up any of the tools. So the way this looks is that we'll have a PE file right here and you'll have a normal unpacked file and you apply a packer to it and what happens is that you get the compressed or obfuscated code with a small decoder stub on the right. Okay. There's some other troublesome protections. The first one is virtual machine detection. You can get some of these things that are put out. Also we developed a tool called OCVM detect. But generally detecting that you're inside of a VM is very, very easy. And so there was an excellent paper that if you haven't read it yet, you should. It's called Attacks on Virtual Machine Emulators by Peter Ferry. What this does is it goes through every single VM that was available at the time and he gives roughly 10 assembly instructions about how to detect all of them. It's all for 16-bit mode of a DOS program, but it's pretty easy to translate into the 32-bit equivalent. Debugger detection. This is just looking at the process execution block and checking to see if the is being debugged flag is set. And also the eflags trap flag is going to be set there. Timing attacks deal with the time step counter. And the time step counter, you just take a, you pull it before and then run some instructions and pull it after and then see if things are inordinately large. And so this turns out to be a very effective tool. Okay, so all this is very annoying for the reverser and there's basically two methods for circumvention. The first one is that you can know about all the possible protections and get into the cat and mouse game of trying to remove those or you can make yourself invisible. So the second one is a lot less work. So being a good grad student, I chose the lazy way. So there's been a couple... Sorry? I just have water here, so... Can we get security here? This guy's causing problems. Thanks, honey. Okay, so software-based VMs... I always wanted to be that guy at DEF CON, too. All right, so software-based virtual machines. These are things like Renovo and PolyUnpack and the Dynamics Box Unpacker. The problems with these is that they get into issues where detecting these is actually pretty easy. So the Intel CPU is never really meant to support virtualization and they don't emulate these bug for bug. Okay, so OS integrated debugging. This is Saffron and Olibone. Both of these systems abuse the page fault handler and sets a supervisor bit on running pages so that you can actually get some sort of idea of the execution inside of there. The problems with these and one of the problems I had with Saffron is it destabilized the system. It was very good at unpacking something once, but if you wanted to run the system or do anything else with it, you basically had to reboot and do the process again. So it wasn't very flexible for implementing an automated unpacking system. The other problem with that is that you couldn't actually do any sort of fine grain monitoring. You basically got things on the page boundaries. Okay, so now we get into the awesome. So there's a fully hardware virtualization monitoring system called Ether. It was built by Artem Dynaburg and Paul Royal from Georgia Tech. This is a Zen based hypervisor system. Ether has a couple of things that monitor for system calls, instruction traces, memory writes, and basically all the interaction with the OS is done via the shadow page table inside of the Zen hypervisor. So the problem is, which isn't really a problem, is that it requires dedicated hardware, but what it buys you is that you get an actual VM environment that you can use to restore a lot of this too. So it's actually very flexible. Okay, so back to the reverse engineering process. Disassembly and code analysis, this is one of the most nebulous portions of the process. And when I'm teaching this, this is the one that the students get a little bit frustrated at because this is something that you only get after you've done a lot of reversing. So how do you get a lot of reversing experience? By reversing. And it largely depends on intuition. And you get into this issue where a lot of times you focus too much on the actual assembly code and not the overall view of the program. So fighting analyst fatigue is something I like to address. Get to the meat of the problem before it's so you can avoid the issues. Okay, and finding interesting and relevant portions of the program. So just like the disassembly portion, this requires a lot of experience. Some typical starting points is looking for interesting strings, looking for API calls, and looking at any sort of interaction with the operating system. And so this is a fundamentally imprecise process and beginners typically have problems with this because until you get to where you understand this a little bit, it's hard to know where to start. Okay, so let's talk about hypervisors for a little bit. There's been a lot of hype about this over the last few years and I'm not trying to propel this anymore even though the talk title probably suggests it. But one of the things is that a lot of the new hypervisor-based root kits, like BluePill and that sort of thing, have led a lot of the defensive tools. And just like always, the offensive need to hide yourself from a running process or from any sort of introspection from a piece of code inside the operating system works well in this environment. So that's what we're going to utilize here. And one big feature that we're trying to take advantage of is the detection of hardware-based virtualization is not widely implemented. That's not to say it's impossible, it's just that I don't see too much of that out in the wild. Okay, so there are a couple of hypervisor implementations. VMware ESX server, I've had some good luck running. This is a commercial solution from VMware and it mostly avoids a lot of the VM detection issues. Linux kernel virtual machines, this is what I use as my base environment when I'm basically reverse engineering. And that's just to prevent me from running malware on my home system. Which, not to say that never happens. Or my base system. And then Xen. Xen is really nice because it's got an excellent set of tools for introspection. And a lot of this has really been led by Georgia Tech, so hats off to you guys there. But what's nice about Xen is it uses a standard QEMU image format that's been set up a long time before. And it's an API that's fully controlled via Python. So you can integrate into tools. Okay, so let's talk about Xen and Ether. So Ether is a set of patches to the Xen hypervisor that's used to instrument a Windows system. And so it has a bunch of base modules that allow you to do instruction tracing, API tracing, and unpacking. And so one of the best papers I've read in a couple years is this Ether malware extensions via hardware virtualization extensions. And this was, again, written by Artem and Paul and a couple other people at the ACM CCS conference. So if you haven't read this, it's extremely high quality and very useful. Especially compared to other academic research. So you should definitely check this out. So Ether's event tracing. This is what it's using to detect events on the system. So we talked about system call execution, instruction execution, memory writes, and context switching. But what's nice about it is it also gives you covert monitoring. So there's no modifications to the base system, which means that it's very hard to detect. So instruction tracing inside of Ether is implemented by setting the trap flag inside of the E flags register. And then modifications to that is handled via the push F and pop F instructions. So these are intercepted by the hypervisor and used for watching that. So modifications to the single stepping process to look and see if it's being single stepped is effectively hidden. Okay. Memory and system calls. Memory writes are tracked by manipulating a shadow page table. So this gives you access to all the read to and written memory. System calls. This modifies the sys enter EIP register to point to a non-page address. And when any sort of access is hit to that, Ether logs that. And also logs the instruction to catch the older system calls. Okay. So the this architecture, you start out with a Linux DOM zero management system. This is basically a Linux system that you run all your tools on. This is going to have the VM disk image and Ether management tools. And then it's going to work with the Zen hypervisor, which will have the Ether patches. And then work with an instrumented Windows XP service pack 2. Okay. So I made a couple of extensions to Ether. The first thing is I moved some of the unpacking code from the hypervisor into user space. I put a little bit more user mode analysis in this. And I also repaired the portable executable rebuilding system. And this is just to allow you to actually disassemble it inside of IDA. And then there's a lot of other monitoring for executables that will be released a little bit later. So the user mode unpacking, what this is, is all we're trying to do is watch for and monitor all the memory writes and executions. And so we keep all the memory writes inside of a hash table. Whenever we see a execution inside of one of those memory writes, we assume that it's a candidate original entry point and then take a dump of the image. This isn't perfect, but it's a decent solution. And it certainly helps you to get some unpacked code. The other nice thing about moving this out of the hypervisor was that there's a little bit of scaffolding for future modifications. PE repairs, to implement this, this is, there were a couple issues. First of all, the sections weren't aligned. The address of the entry point was invalid. And it wouldn't load inside of IDA correctly. So basically all I did is I took the code from ollie dump and used that to fix the section offsets and repair the resources as much as possible. And then setting the address of the original entry point to the correct place allowed it to be loaded inside of IDA. Okay? So the results from this is that you get it close to a truly covert analysis system. Ether is nearly invisible. It's still subject to blue pill detection. So we can start playing that game. But I think it's a game that's worth playing. So get started with that. The next thing that we get is fine grain resolution of program execution. And since you get memory monitoring, we can start doing some cool stuff with it. So we can start looking at these files inside of IDA and a lot of other tools. Okay. So I want to give a quick demo of how ether works. Or at least the unpacking portion. Okay. So we're going to start by loading the file up inside of IDA. And just to verify that this is actually a packed executable, we can see that the, we get the standard warning about the import segments being destroyed. And if we allow IDA to continue executing, we can see that it's generally not finding anything. The start function is pretty miserable. It's missing strings. So there's not actually stuff inside of here. And the functions are pretty much nonexistent. And the import address, it just has the suspicious get proc address and load library. So in this case, things are pretty bad. Also, this top visualization bar inside of IDA doesn't have a lot of blue codes. That's a good indication that things are all hosed. Okay. So what we're going to do is actually start running this inside of ether. To do that, this is just going to be a Linux box here. So this is my ether system. And I'm just going to mount the QEMU image. This handy command and the 3G driver for NTFS you can use to copy the file over. So this is pretty straightforward. So we get that copied in. And even though this is a video, you can see how slow I type. Okay. So we're copying this over. Once we get the file copied over, what we want to do is we actually want to start the virtual machine up. So what I'm going to do is use the standard Zen commands to get this started. So this is going to be XM create and then you give it the config file of what you're looking for. Okay. So once I get started, you get this message. And once you've got that, you should be able to open up a VNC image and we can see here that our Windows machine has actually started. Yeah. All right. So Windows. Wait for it. Okay. So once we have that, we actually get the screen and everything's happy and we've got our virus right here. So everything's ready to go. So one thing when you're using Ether that you want to be careful of is you want to be able to load the task manager so that you can actually kill execution of the program when it's running. So this turns out to be a pretty important thing to do unless you like your box rebooting. Okay. So what we're going to do is do an XM list to get the ID out of here. So in this case, it's nine. And then we're going to actually start running the Ether tool. So this will be Ether. Give it the ID that you want. The user mode unpack code. The executable that you want to watch for. And then a local copy of that executable. And so once you've got that up and running, we can see that this is a good sign that Ether's happy. It's at the filter name to be mu under bar net bowl. So whenever it sees a context switch into this process, it's going to pull it out. And at this point, what we're going to go over and do is over on this system, we're going to run the virus. So we're running net bowl. And we can see that net bowl's going to start taking about 100% of the CPU and it gets a little bouncy. Or like it gets a little sluggish inside of there. So in this case, we fixed the dump image to have an RVA of this 421340. So this is a good candidate dump. And we'll allow this to execute a little bit longer until we see the actual icon for the program pop up. So one of the reasons I use net bowl so often is it's pretty benign. But it's still got the malicious component to it so you can watch and see that things are executing. So this actually takes a little bit of time. So I am a little bit of time dilation to go on. All right. So the next thing we get is a fixed dump image to have an OEP of RVA BBO8 or 40BBO8. And so this is actually the original entry point for the program that I verified by manually reversing this. Okay. So it's very important to kill the process inside of Windows before you stop Ether. Otherwise, hilarity ensues. So we've got that going. Then we stop Ether. And then inside of this, we should have a listing of directories. And then for each one of these files, there's the original address. So we've got new net bowl image and then the address that it stopped. And then this dash fixed is the corrected image inside of here. Okay. So now what we can do is we can take this image and load it up inside of IDA pro and we should start seeing some good things here. So what we're going to do is pull the fixed image up. Fixed. Load that up inside of IDA. And then once we start loading it, we can see that things are a little bit happier. So IDA is making noises like it's found the right compiler signatures that it's used to. It's found a lot of the unpacking code and that sort of stuff. So we get actual visualization. The functions exist inside of here. We get our references and everything that we come to expect from this. So we get these functions. Strings, this is a good indication that we've got net bowl unpacked. So in this case, we've got the HRH's net bowl, which I presume is what the AV companies named the virus after and all this other stuff. Okay. So again, we can follow links and that sort of stuff. All of that works and we're all set to go there. Okay. So this is an example of Mew's net bowl. And one person brought up a point like, so what? It's Mew. It's easy to do. But this unpacker is really awesome. It works on pretty much everything. So I ran the media through this and it does a great job. So if we could just like clap for Artem right now. It's pretty cool. Thank you. All right. So with that said, we'll talk a little bit more about what's going on. So there are a couple of open problems. The unpacking process produces a lot of candidate dump files. So this algorithm that we have is a little bit imprecise. So what we want to do is we want a better way to find the original entry point. The other thing is that import rebuilding is still an issue. That's something I'm working on at this point, but I haven't had a chance to integrate it in yet. And so the other thing I'd like to do is do some analysis. So this is going to be the next thing here. So we can integrate this into our process by allowing somebody to figure out to know what to look for inside of here. Because this is the thing that people have trouble with most of the time. So once you have an idea of the execution flow of a program, it's really nice to be able to look at this. So software armoring is pretty much made to be a trivial process and is extremely easy. Okay. So let's get to the visualization portion. One of the goals I set out with when I was doing this visualization is to be able to quickly subvert the software armoring process. So in the case of Netbull, we only had two images that we were trying to detect there, our two candidate dump files. But what I'd like to do are in other samples, especially with more complex packers, you end up getting thousands of them. So we want to make that process a little easier. The other thing is for various portions and phases of the program, I wanted to identify initialization, main loops, and the end of the unpacking code. So figure out where the self-modifying code ends, which is the OEP detection, and figure out some of the dynamic runtime behavior of the program, and also integrate it with some of the tools that we're used to, like IDA. So I made this program called Vero, which is visualization of executables for reversing an analysis. But really it was just a contrived name to name something after Jane's gun in Firefly, and so I was finally glad to have a program that I could do that. So when you're looking at this, it's... the code's pretty simple. It's kind of a Fisher-Price, my first MFC and OpenGL application. But generally, it uses a lot of the OpenGL rendering and integrates with IDA Pro, and it's fast, small, and has a low memory footprint. Okay. So with that, I'll turn it over to Lori. So this is just a graph preview, which on... you know, the fortunate part is there's now a graph in here at the beginning instead of without one. The bad news is it's zoomed out so far you can't see nodes versus edges. But the idea here is that we're going to use a graphical representation so that you can see what the different phases of computation are and where your time is being spent. So the vertices here actually represent addresses. It could be the address of a specific instruction, or it could be, as you see at the bottom, the address of the beginning instruction in a basic block, either one of the two. And the edges represent a... an execution on a path. So you're going from one instruction to the next. What path did you take? That's an execution. The more time some... a transition happens, the heavier the weight on the edge. So that gives you an idea of how... where you're spending your time in the execution. The basic blocks, for any of you who have done the low-level compiler stuff and that sort of thing, you see those are just... it's straight line code. So no transfer of control except from one instruction to the next in the stream. There's no conditionals, none of that stuff. So basic blocks give you a real simple way of getting a hold on a little bit more code at a time than a single instruction. That makes this potentially useful for commercial codes. But as you're going to see, some of the next steps in this will be looking at doing functions and handling function-level sorts of things because you, again, you still get... you saw that... that graph is actually a very small graph compared to what graph theorists look at, but they get kind of big and complex. So the basic blocks give you a way of compressing some of this. The instruction view, where you're looking at every single instruction becomes a node in the graph. Gives real pretty graphs. Danny likes those nice big swoopy graphs, as he calls them. So they may have some aesthetic value because they're pretty to look at, but again, any kind of commercial code and they're just too big to be able to figure out what's going on. So again, those transitions between addresses, they're going to give us more information about where we're spending time in the graph. But there's an assumption here that I just need to point out, and that is the assumption is that during this single execution, so this is for a single execution of the code, during that single execution of the code, the thing you're looking for happened. So if you get something that every 50th time it's executed, it does something, you're not likely to find that using this approach. And so some future work can look at doing more statistical base, where are executions different when you don't change the input file sort of thing. But at the moment, you run it once, you get these graphs, they tell you where things are executed more. So looking at these edges, wherever you see from one node coming out multiple lines, that means there was a decision point there and there are multiple paths you can go to the next instruction. The thing that's really interesting, although somewhat arbitrary, is how the colors are assigned and what they mean. So I'm going to have Danny step back up here and talk about what these different colors in the graph mean when you're trying to find information. Okay, so again, these colors were chosen sort of arbitrarily. And what these represent are the relation of the file that has been dumped from Ether to what's actually on disk. So in this case, we're trying to identify execution into sections where code doesn't exist or that sort of stuff. So what yellow is going to be, this is going to be the standard, normal compiler generated code. Dark green is going to be where the sections are present in the pack version, so this would be something like executing inside of the P header. Light purple is where the memory has been allocated for run time but isn't present in the actual executable. And dark red is one that I wanted to really point out, which is actually the high entropy version of the code. So this would be sort of execution inside of compressed or encoded or encrypted or whatever you want to call it. The other thing that I wanted to point out is light red. These instructions are not in the pack executable at all. And then line green, this is where the operands aren't going to actually match. So this would be any sort of shifting decode frame type attack where you're executing code over and over. Okay, so these colors were chosen arbitrarily. I kind of like that they, I think that they look good, but I did show them to one of my friends, Kazmir, and he looked at it and he says, that's great, Danny, but why are all your colors brown? So it turns out he's red-green color blind. And so I sat down with Kazmir and he was really nice enough to help me go over things and pick out a set that looked okay. But I didn't really like the way they looked. So inside the code there's actually a set of instructions that are available for color blind people and I'm also going to make this available, but for right now it's not compiled by default. So any feedback on this would be really appreciated, so I do want to make sure that it's a useful tool all around. Okay, so the architecture is we've got the ether analysis system, which plugs into a program that takes those trace files and generates the graphs with the OGDF, or Open Graph Display Framework. And Open Graph Display Framework is the thing that makes the decisions about where to actually place the vertices and locate them and that sort of stuff. So this is a really awesome library and if you get a chance to use it, it's, I highly recommend it. It's very similar to GraphViz, but what's nice about this over GraphViz is it works with a large data set. So I've had millions and millions of vertices inside of here and it hasn't choked on it, but it will take all your memory. But that's okay. Finally, we get to Vera, and Vera is the OpenGL component to this program. And so what Vera's going to do is actually display this and allow you to start analyzing it. Okay, so the basic steps are to run an instruction trace with ether, transfer that trace file to the analysis box, then run gen graph on that output, and then those resulting GML files, or the graph language files, are going to be open inside of Vera, and then you can use that to actually correlate instructions. Okay, so let's go ahead and do a demo. Okay, so we start back at our same place with the ether instruction. So the VM's already started, so what I'm going to do is an instruction trace and give it the name of the executable to look for, and then just redirect the output of this to a trace file. So this is going to run, and then over on the VM side, I'm just going to start executing the program, and again, I want to make sure that I have that task manager up so that I can stop this here. Okay, so Netbull gets executed, gets started, and then we wait for a little bit of time to elapse, and so it might not be easy to see, but when you move the mouse around, it gets a little jumpy, so you know that's actually the case where things are going on. But generally, when you get this icon down here, it means it's running. Okay. So now we can stop it from executing. Close this. Stop ether, and then at this point, we can look at the trace file and see how big it is. It's roughly about 250 megs, and so at this point, what we want to do is transfer it to our analysis system. And so this is a good reason to point out that, you know, when you're running a live demo, I know live demos are the way to do it, but I decided to save you all the intrigue of watching 250 megs transfer over the network. So that's why I did this. You're welcome. Okay. So it's copying. It's done. It's the world's fastest network. We run gen graph on the program, so gen graph just handles the graph layout and builds the GML files. So we give it the trace file that we copied over, the original executable, so it can do its analysis, and also the output that we want to put this at. So this, too, takes a little bit of time to run, and in this time, I'm generating two basic implementations. The first one is the instruction base graph, and then the next one is the basic blocks. So once this gets done, what's this? Okay. Yes. It's actually going backwards. So from there, what we want to do is actually load this inside of Vera now. And so this is the actual interface right here. So to navigate and move around and look at this graph, you simply just drag the same way you would with Google maps and use your scroll wheel to go in and out. The initial execution is going to be at this blue address right here. And then any sort of transition is going to move around inside of there. So what we're looking at right now is the basic block view. So we can zoom in, look at these sort of things, and any sort of line, the thicker the line between these, that's going to indicate the loops that are executing. So thin lines mean there's only one transition. And so it turns out that Mew actually has two stages of unpacking. So this initial loop that we were looking at is actually going to be the first one, which was identified via the unpacking process. And then the secondary decoding, which actually brings the rest of the program out, will identify more. And so what we're looking for are transitions in colors. So when we see a color change here, especially from this green to purple, this purple here is going to be representative of the address. So this is the basic block view. This should be the original entry point that we're looking for, but this is pretty close. So the original one was BB08 and this is BB8B. And if you're some kind of math genius, you can calculate that in your head. So then we get over to the actual execution of the program. And inside of here, these are all the transitions that the program makes. So the next thing that we're going to do is I want to show you the all instruction trace. And so this is a little bit more laid out. So one of the comments that we got when we showed this and did a user study is that it was a little bit dense information. So this is the actual instruction base level. So we see that first set of loops inside of here. We come to the central section and inside of this, we can see that there's one function inside of here that's making a lot of the decisions about what the program's doing. So this is this address right here. So if you're looking for the main decision point of a piece of malware or something like that, you can find that. But once we zoom in here, we can see that this address is actually going to be the original entry point that we were looking for. And so we validated it and looked at this. But just by doing a quick glance at this, we can figure out what the OEP is just by looking at this. But as far as the overall functionality of a program, any time we see this sort of long lines of single execution, this is a good indication that this is the initialization phase of the program. And any time that we get these branching operations right here, this is actually going to be the part where it's making a decision or actually doing the branching. But what's nice about Netbull is that it's got these features inside of it that are pretty common. So it's always got that three-way branch at the beginning and the little pigtail up there. This internal side right here, this is the main loop that the Trojan uses to execute and basically control the system. So just moving around inside of here, the next thing that we can do is we can actually zoom in and we can take these instructions right here and then open up IDA and we can use this to start correlating things. So once we find some interesting portion of execution, we can use that to find the address that we're looking for. So in this case it was 403C80 and if we zoom in and just find those addresses, we'll find that there. So you can use that to correlate back and forth with IDA. Eventually there will be an IDA module but I ran into a couple bugs that prevented me from releasing it on time. But you can use this as an initial stopgap solution, stopgap. Okay. So that's Vera. Let's go here. Thank you. Okay. So now I, the next thing that I did is I took a bunch of pictures which were basically the different version or the same version of Netbull packed with a whole bunch of packers. But in this case, this is Netbull and it has the same structure. So we saw this initialization portion here, this branch structure and then this tight knot of execution inside of here. So zooming in, this is the same view that we were looking at in the demo. So now we get into some of the packers. So this is UPX and UPX starts out with some, this red region or the dark red region which is this highly compressed code area. And then we transfer into this light purple or lavender. Okay. I'm not good with colors but... So lavender is actually means it's a size of data zero. So this is where the code is actually unpacking itself and then running the program. We see that the original entry point is immediately after the high entropy code and we get into the size of data zero. Next is ASPAC here. We start out with the blue instruction right here. It goes into these yellow instructions and then it unpacks itself and then we get a transition into this red portion of the program which is where the unpacker was compressing itself. So this is a good way to profile these sort of things. Okay. Same thing with FSG. It's got a smaller or more compressed set of instructions and then we transition to the higher portion of the program. And this graph here looks a little bit different. And the reason it looks different from the other ones is that there's a non-deterministic portion of the OGDF rendering system. But you can still pull out some of the various features here. Okay. Mew. Mew is really nice. This is the one that we looked at right there. It's got a whole bunch of different transitions of colors but the general same format. And then TLock. TLock actually has a long set of instructions and I'm assuming that it uses some shifting decode frame to actually encrypt itself and rerun a lot of these executions. Okay. So one of the things that I did with this is I took a sample from OC's collection and called Mebroot, which is a pretty hardcore virus, and analyzed it inside of Vera. And so when I was initially looking at this, it seemed to be idling for long periods of time. So actually executing this, I knew it was actually executing because my friend and I'm really glad I made friends with him, the network manager at my school said, hey, do you know you've got malware on your box? He's like, yes. But thank you, that validated that. So what Mebroot is, is it's a hybrid user mode and kernel-based malware. So when I initially executed it for maybe 30 seconds and stopped it, I saw that there was this basic execution right here where it just sat inside of this, but it wasn't really doing anything. So essentially it just sits in here for 30 minutes waiting for us to get bored. So I accidentally left it running overnight and tried to look for any sort of unpacking program that it was running after. So once it got through that unpacking program, it transitioned into this main area of execution, which was the top portion of this loop, and got going. So this is the entire graph of execution. We start out with the initialization, this is the 30-minute busy loop, secondary initialization right here, and then there are three main portions of the program. So reverse engineering it, this was the main unpacking loop, and these are two other secondary decoders that I didn't figure out, but this kernel code insertion actually occurs at this point, and that's when the executable stops and your system's then infected. Okay. Okay, so Danny's been teaching these reverse engineering classes using the more traditional approach, not using Vera, but using this traditional, sort of traditional approach, it's his version of it anyway, for quite a while. And recently at one of his classes, after having taught the class for, you know, spending a week on reverse engineering, he took Vera to show these people that were in the class and see what they thought of it. So the first comment in this is it's a very small user study, in part because there's not a lot of really good reverse engineers out there you can get together for a reverse engineering user study, okay. The second thing is this was a training class, so you might say, well, but you're taking all newbies to do this. Well, there were two people in the class that hadn't done reverse engineering before. There were, I think, two people that had a lot of experience, and the other two had quite a reasonable amount. So this is, although a very small sample, it's a pretty good representation of what we would expect in the reverse engineering community. So he had them analyze two different packed versions of NetBull, and I'm just going to go through this very quickly because we're about out of time. Basically trying to see if the things that he's just walked you through doing in the demo, whether new users, whether this helps them or not. They're supposed to find the original entry point, then find these different parts of interest, the packer code, the initialization, the main loops, and if they can, that's great. Especially if it's a little faster. So original entry point, you'll see users 1 and user 3 were the two newbies who had never before this week done any reverse engineering. And one of them, you know, we've got the two different packers, one of them with one packer finds the OEP, the other one doesn't find it with either one. For the initialization, in one case they all recognize it, in one case the two new people can't find the initialization code. Main loops, a little better performance. We have one person with one packer can't find the main loops of the program, which I find hard to believe. Then overall evaluation, they were asked were they likely to use this again, and that's in the light lavender, and would they recommend it to others, and that's in the pink. So both for the new people and for people with a lot more experience, they thought this worked pretty well and they would recommend it. The basic gist that comes out of this is there's more work to be done. Yay PhD students. Talk about the work you need to do yet. Okay. Thank you. So we basically need a better way to identify the beginning and ends of loops. That was a good observation. A lot of these loops became overlapped and were a little bit convoluted, and it would really be nice to be able to search for these memory addresses and see the basic blocks it matched. So the future work that we're going to get into is general GUI and bug fixes. Right now it's pretty unsophisticated, so I want to make that a little bit better. I'd like to start doing some memory access visualization. Ether provides an awesome way to do that, so I definitely want to get there. Integrate system calls, look at the function call boundaries, and then get a little bit of more interactivity with the unpacking process. The other nice thing that would be cool is that it'd be really nice if you could use something like WinDebug or Ali or Ida's debugger inside of the Ether system and all the functionalities there. It's just a matter of making it together. So conclusions. Visualization makes it easy to identify the OEP. There's no actual statistical analysis needed. You can actually identify program phases. The graphs are pretty simple, and the preliminary user study shows that other people don't think we're full of it. Okay, there are some tripping hazards that are right here. Basically, use 64-bit version of Debian Sarge. Follow the instructions that Artem and Paul have worked so hard on to the letter. I was guilty of not doing this, and then I reread it, and it was much easier. So anyway, it has to be a 32-bit Windows XP service pack 2 image, and you have to disable DEP, large pages, multiple CPUs, and for God's sake, whatever you do, kill the program before inside of Windows before stopping Ether. Okay, so closing thoughts, Ether's awesome. Many, many thanks to Artem and Paul. This is some excellent, excellent work. If you get anything out of this, I think that more people should be using Ether because it's just so completely cool. Source code tools and the latest slides are on offensivecomputing.net. I do have an initial version of this out. Source code will be up later. If you use this tool, please give me some feedback, and a more formal treatment of this is going to be at VISSEC 2009. So, again, okay. And then thanks to all these people, they were very instrumental in making this whole thing happen. So, with that, I believe we're going to the Q&A room, which is 106. Goon? Yeah, okay. So, Q&A room 106, and then we'll be available after the talk for a little bit to talk to you. So, thank you very much for coming out. you