1 00:00:00,000 --> 00:00:03,760 Welcome. This is physical memory forensics for files and cache. 2 00:00:05,480 --> 00:00:11,140 I'm Justin Murdock and to my right is Jamie Butler. Just a 3 00:00:11,140 --> 00:00:15,560 bit of a background information. Jamie Butler is the director of 4 00:00:15,560 --> 00:00:19,680 research and development at Mandiant. He's focused mainly on 5 00:00:20,000 --> 00:00:24,940 host analysis and operating systems research. I'm a computer 6 00:00:24,940 --> 00:00:29,180 science major at the Rochester Institute of Technology. But I'm 7 00:00:29,180 --> 00:00:34,780 currently on co-op at Mandiant working on their enterprise 8 00:00:34,780 --> 00:00:41,960 product as a software developer. So we're going to speak today 9 00:00:41,960 --> 00:00:47,540 about physical memory forensics. And this is kind of a layout of 10 00:00:47,540 --> 00:00:51,300 the talk. First we're going to go over traditional forensic 11 00:00:51,300 --> 00:00:54,960 methods. Kind of a background information. And then 12 00:00:54,960 --> 00:00:59,160 specifically move on to memory forensics. So I'm going to 13 00:00:59,180 --> 00:01:03,820 talk about memory forensics. And given that background we're 14 00:01:03,820 --> 00:01:09,260 going to speak about the issues that are in existing tools right 15 00:01:09,260 --> 00:01:13,820 now. So a lot of them are missing important information and 16 00:01:14,650 --> 00:01:23,720 often misattributing data to executables. So most memory 17 00:01:23,720 --> 00:01:29,160 forensics also deals with utilizing files. So we're going to speak about the 18 00:01:29,180 --> 00:01:35,900 memory mapped files. Reconstituting binaries and data files. And 19 00:01:36,680 --> 00:01:41,240 specifically the role that cache plays in this process. Then we're 20 00:01:41,240 --> 00:01:44,040 going to talk about possible applications of our new 21 00:01:44,040 --> 00:01:50,620 techniques. And show you guys a couple of demos. And then we're 22 00:01:50,620 --> 00:01:56,140 going to speak about our new tool that we're going to be releasing pretty soon that uses these new 23 00:01:56,140 --> 00:01:59,100 techniques. And speak about rapid 24 00:01:59,180 --> 00:02:03,080 memory forensics. So let's wrap up with just some further work that needs to be done in the area. 25 00:02:05,340 --> 00:02:15,040 So traditional forensics is kind of a broad overview. A host has two large sources of 26 00:02:15,040 --> 00:02:23,880 information for forensics. So the disk and memory. And lately memory has become a great way to 27 00:02:23,880 --> 00:02:29,160 triage a host. Say in a forensics investigation. So the reasons for that is because memory has 28 00:02:35,360 --> 00:02:48,100 so much more capacity in our hands right now. There are a lot of hard drives that are 29 00:02:48,100 --> 00:02:59,000 working in hard drive space. And memory can really help you out to speed up what you're 30 00:02:59,000 --> 00:03:05,080 looking for, it's relatively small comparatively so you can 31 00:03:05,880 --> 00:03:11,720 scan the whole space pretty quickly. Also, for intruders to 32 00:03:11,720 --> 00:03:14,940 get their code running on a system, they have to load it 33 00:03:14,940 --> 00:03:19,980 into memory. And in almost all cases out there, they aren't 34 00:03:20,640 --> 00:03:26,180 covering their tracks, they aren't cloaking their memory 35 00:03:26,180 --> 00:03:31,860 footprint because that's really just too much work in the most 36 00:03:31,860 --> 00:03:36,840 case. So also, many of the artifacts that the kernel needs 37 00:03:37,500 --> 00:03:42,840 to load the program into memory, we can use to gain a lot more 38 00:03:42,840 --> 00:03:48,660 information about the executable. So specifically for 39 00:03:48,660 --> 00:03:52,820 memory forensics, memory is divided really into two basic 40 00:03:52,820 --> 00:03:56,160 sections, user land and kernel memory. So the first one is 41 00:03:56,180 --> 00:04:00,720 going to focus on user land memory. Again, because in most 42 00:04:00,720 --> 00:04:03,960 attacks, most intrusions, they're focusing on user land 43 00:04:03,960 --> 00:04:09,400 memory. It's easier to get execution and it's more 44 00:04:09,400 --> 00:04:13,040 resilient to coding errors. Basically, if you're developing 45 00:04:13,040 --> 00:04:19,320 this attack, then if you've got a couple of bugs in your 46 00:04:19,320 --> 00:04:23,200 program, all of a sudden you have to crash the system because 47 00:04:23,200 --> 00:04:26,160 it's running in the kernel. So it's going to be a little bit 48 00:04:26,180 --> 00:04:27,760 of a challenge. And it becomes very costly to develop these 49 00:04:27,760 --> 00:04:35,420 kind of attacks. So memory forensics traditionally focuses 50 00:04:35,420 --> 00:04:40,300 on recovering all the binaries out of the memory. So all the 51 00:04:40,300 --> 00:04:47,720 executables, DLLs, this is one of the main focuses of any 52 00:04:47,720 --> 00:04:52,180 investigation. And most of these tools rely on virtual 53 00:04:52,180 --> 00:04:56,160 address descriptors or VADs. These are the ones that are 54 00:04:56,180 --> 00:05:01,920 used to describe the processes address space in memory. And 55 00:05:02,380 --> 00:05:08,780 they make up, they're made up of these objects. So as you can 56 00:05:08,780 --> 00:05:13,440 see, it's got a pointer to left and right child. It's usually in 57 00:05:13,440 --> 00:05:19,520 a VAD, in a tree structure. And each VAD also contains the 58 00:05:20,140 --> 00:05:25,180 starting address and the size of the memory along with a pointer 59 00:05:25,180 --> 00:05:26,100 to the control area. 60 00:05:26,900 --> 00:05:33,320 So here's a representation of a typical VAD tree. You can see 61 00:05:33,320 --> 00:05:38,220 it starts with a VAD root. And just each one of those VADs 62 00:05:38,720 --> 00:05:43,220 contains information about the virtual addresses of the 63 00:05:43,220 --> 00:05:51,580 process. So traditionally, you would scan physical memory for 64 00:05:52,160 --> 00:05:55,100 an E process block. And that kind of lets you know that 65 00:05:55,100 --> 00:05:56,160 there's an E process block. And that kind of lets you know that 66 00:05:56,180 --> 00:06:00,960 there's a process at that location. From there, you get 67 00:06:00,960 --> 00:06:07,060 the directory table base or DDB in the E process. And this will 68 00:06:07,060 --> 00:06:13,060 help you translate from virtual to physical addresses. From 69 00:06:13,060 --> 00:06:20,460 there, you locate the root of the VAD tree. And just kind of 70 00:06:20,460 --> 00:06:23,740 step through the tree, translating the virtual 71 00:06:23,740 --> 00:06:26,160 addresses to physical. And you can see that the VAD tree is a 72 00:06:26,180 --> 00:06:30,860 very easy to use. Usually start with the starting address, take 73 00:06:30,860 --> 00:06:37,640 the size and just grab all the data in between there. Some 74 00:06:37,640 --> 00:06:40,380 other tools also utilize information about the PE 75 00:06:40,380 --> 00:06:44,680 headers to reconstruct the executable with their knowledge 76 00:06:44,680 --> 00:06:52,380 about the different sections inside. The ultimate approach is 77 00:06:52,380 --> 00:06:56,160 to just use the DDB to try and get the state of the data on 78 00:06:56,180 --> 00:07:02,780 translate basically brute force the whole address space. And it 79 00:07:02,780 --> 00:07:05,260 kind of just starts at a beginning address and goes all 80 00:07:05,260 --> 00:07:11,860 the way through to the end. And this has its limitations, 81 00:07:11,980 --> 00:07:17,240 really. On a 4 or on a 32-bit system, this pretty much works 82 00:07:17,240 --> 00:07:21,520 because you got an upper bound of about like 4 gigabytes. But 83 00:07:21,520 --> 00:07:27,540 on 64-bit, the size can just be enormous. And this also leads to 84 00:07:27,540 --> 00:07:31,880 some misattribution of the data. Because the virtual 85 00:07:31,880 --> 00:07:37,220 addresses could translate globally not particularly for 86 00:07:37,220 --> 00:07:47,220 that process. And this kind of leads us to problems that are in 87 00:07:47,740 --> 00:07:51,500 existing tools right now being used. So with that, I will 88 00:07:51,520 --> 00:08:00,160 I'm going to hand it off to Jamie Butler. So, as Justin 89 00:08:00,160 --> 00:08:03,680 mentioned, the traditional approach in the current memory 90 00:08:03,680 --> 00:08:08,940 forensic tools is to really take a virtual address, its base and 91 00:08:08,940 --> 00:08:13,000 a size, you know, even if that virtual start is zero and size is 92 00:08:13,000 --> 00:08:17,020 four gig, you're going to brute force across the whole thing and 93 00:08:17,020 --> 00:08:20,080 you're going to do the translation in the context of 94 00:08:20,080 --> 00:08:24,520 the process that you're trying to analyze. So, every process, as 95 00:08:24,520 --> 00:08:28,560 the previous slide showed, has a directory table base and that is 96 00:08:28,560 --> 00:08:32,480 used for the virtual to physical translation and that should tell 97 00:08:32,480 --> 00:08:38,960 you what's in the process context. Well, what we found in 98 00:08:38,960 --> 00:08:41,240 our research is that there's a lot of data that's actually 99 00:08:41,240 --> 00:08:45,720 missing if you do this. For instance, the first thing that 100 00:08:45,720 --> 00:08:49,940 we encountered is when we're trying to reconstruct a 101 00:08:49,940 --> 00:08:50,060 process, we're trying to reconstruct a process that's 102 00:08:50,080 --> 00:08:52,860 in the process. Obviously, like, the attacker is usually 103 00:08:52,860 --> 00:08:56,560 injecting code, you know, in the form of an injected DLL or 104 00:08:56,560 --> 00:09:00,100 whatever into the process address space. So, in order to 105 00:09:00,100 --> 00:09:03,840 analyze that and to detect it, we need to be able to translate 106 00:09:04,340 --> 00:09:08,600 the code for that DLL. Well, the operating system, the Windows 107 00:09:09,260 --> 00:09:14,880 loader, is going to load the DLL as a memory map file. So, memory 108 00:09:14,880 --> 00:09:18,700 map files are stored in a special way because basically the OS 109 00:09:18,700 --> 00:09:20,060 doesn't want to waste data. So, it's going to be able to get 110 00:09:20,060 --> 00:09:23,660 data out of the space. And what do we mean by that? Well, on a 111 00:09:23,660 --> 00:09:28,320 Windows host, you have, let's say, a user mode process or 112 00:09:28,320 --> 00:09:34,020 every user mode process most likely has the DLL, NTDLL.DLL 113 00:09:34,020 --> 00:09:40,940 mapped into its address space. So, if the OS did not use memory 114 00:09:40,940 --> 00:09:45,040 map files or these shared files across the address spaces of all 115 00:09:45,040 --> 00:09:50,040 processes, then that DLL would have to be replicated to the 116 00:09:50,060 --> 00:09:53,640 DLL for every single process that loads. So, obviously, that 117 00:09:53,640 --> 00:09:56,680 would waste a lot of physical memory. And this design was 118 00:09:56,680 --> 00:10:00,940 thought up, you know, back in the probably Windows 16-bit 119 00:10:00,940 --> 00:10:04,140 versions when there wasn't a lot of memory to waste in the first 120 00:10:04,140 --> 00:10:07,160 place. Plus, it's also just more efficient in today's world. 121 00:10:07,460 --> 00:10:13,140 You know, we're greener. So, let's not waste memory. So, 122 00:10:13,200 --> 00:10:15,420 these memory map files are shared across all processes, 123 00:10:15,520 --> 00:10:20,040 even if they're only used once, right? So, you know, it's a 124 00:10:20,060 --> 00:10:23,600 lot of work. Because of this, they may be in your process 125 00:10:23,600 --> 00:10:27,060 address space, but the address that they represent may not 126 00:10:27,060 --> 00:10:33,100 translate in your page table entries. So, I won't go into the 127 00:10:33,100 --> 00:10:36,460 depths of how you do virtual to physical translation. If you 128 00:10:36,460 --> 00:10:40,840 want to learn more about that, there's slides on the Internet 129 00:10:40,840 --> 00:10:45,240 and so forth. You can Google those. But basically, the page 130 00:10:45,240 --> 00:10:49,240 table entry is the very last table structure you'll find when 131 00:10:50,060 --> 00:10:53,300 you do a virtual to physical address translation. When you go 132 00:10:53,300 --> 00:10:57,040 to read it to find out where the physical page is, lo and behold, 133 00:10:57,120 --> 00:11:00,580 it's all zeroes. So, that doesn't tell you anything. That 134 00:11:00,580 --> 00:11:03,720 means typically we just had to ignore that region because we 135 00:11:03,720 --> 00:11:07,180 couldn't get access to it. And here's an example. I've taken 136 00:11:07,180 --> 00:11:12,460 the Honey Net project challenge three. If you're familiar with 137 00:11:12,460 --> 00:11:16,280 that, that was a memory image. Came out about a year and a half 138 00:11:16,280 --> 00:11:20,040 ago. I translated a lot of the information that was in the 139 00:11:20,060 --> 00:11:23,360 file. I acquired these files out of the memory image. And 140 00:11:23,360 --> 00:11:26,800 there I just chose file at random. And you see the file 141 00:11:26,800 --> 00:11:30,160 size there in the first column. And then the bytes acquired with 142 00:11:30,160 --> 00:11:33,460 the traditional approach. So, that's using the VADs. That's a 143 00:11:33,460 --> 00:11:37,760 starting virtual address, ending virtual address, and using the 144 00:11:37,760 --> 00:11:41,680 DTB of the process to acquire it. And that's how much of the 145 00:11:42,200 --> 00:11:46,840 file that we could acquire. And then I used a different technique 146 00:11:46,840 --> 00:11:50,040 that we're going to cover in the last half of this presentation. 147 00:11:50,060 --> 00:11:55,440 Which was using what's called file objects, which represent the 148 00:11:55,440 --> 00:12:01,660 memory map files. So, for instance, with, you know, the 149 00:12:03,140 --> 00:12:09,260 ace.dll, we got 70% of it using the traditional method. But we 150 00:12:09,260 --> 00:12:16,080 were able to increase that to 93% using this more accurate 151 00:12:16,080 --> 00:12:17,380 method of the file objects. 152 00:12:20,060 --> 00:12:22,360 Also, we'll talk about in a moment, like, what you can do, 153 00:12:22,900 --> 00:12:26,540 how this number may go up to actually 100% if you're running 154 00:12:26,540 --> 00:12:29,280 on a live system and not a memory image. Because you have 155 00:12:29,280 --> 00:12:33,280 access to the disk. The second problem that we ran into is 156 00:12:33,280 --> 00:12:39,220 basically, when you're doing, we come from a background where we 157 00:12:39,220 --> 00:12:44,880 build products and tools to do incident response. So, in that 158 00:12:44,880 --> 00:12:47,860 context, and even in probably some of your more traditional 159 00:12:47,860 --> 00:12:49,100 forensic investigations. 160 00:12:50,060 --> 00:12:54,100 Trying to determine exactly which process is infected is 161 00:12:54,100 --> 00:12:58,480 important. So, knowing the whole host is infected is perhaps 162 00:12:58,480 --> 00:13:01,620 interesting. But then the next question your boss is going to 163 00:13:01,620 --> 00:13:05,720 ask you is, well, which process, or which, how do you 164 00:13:05,720 --> 00:13:10,200 know what artifacts within that host are infected? Because they 165 00:13:10,200 --> 00:13:12,960 may lead to things like user accounts have been compromised. 166 00:13:14,760 --> 00:13:19,720 Also, processes have a creation time to tell you, perhaps, 167 00:13:20,060 --> 00:13:23,200 around the time of the infection, if they were creating new 168 00:13:23,200 --> 00:13:29,460 processes and so forth. So, attribution is important to us. 169 00:13:30,520 --> 00:13:33,500 And one of the issues with the traditional approaches, 170 00:13:33,740 --> 00:13:37,220 especially with the brute forcing method, is if you brute 171 00:13:37,220 --> 00:13:41,160 force over the global address space, as Justin alluded to, 172 00:13:43,080 --> 00:13:46,600 there's areas of the address space that are global for every 173 00:13:46,600 --> 00:13:50,040 process. So, basically, when you cross from one address space 174 00:13:50,060 --> 00:13:52,540 to another, you have a virtual address in user land and you go 175 00:13:52,540 --> 00:13:56,140 into virtual addresses there. In kernel land, most kernel 176 00:13:56,140 --> 00:14:00,760 addresses will translate appropriately in every context 177 00:14:00,760 --> 00:14:06,320 address space. And the reason this works and everything, you 178 00:14:06,320 --> 00:14:09,620 can read Mark Rusanovich's Windows internal books and take 179 00:14:09,620 --> 00:14:12,900 those to bed at night and it will keep you warm. But, 180 00:14:13,000 --> 00:14:16,620 basically, if you do that over a couple of years, you'll figure 181 00:14:16,620 --> 00:14:20,040 out that the kernel address space is a virtual address. So, 182 00:14:20,040 --> 00:14:25,220 kernel addresses appear global because Microsoft wanted to save 183 00:14:25,900 --> 00:14:30,380 entries within the cache, within the actual cache that's on the 184 00:14:30,380 --> 00:14:33,940 chip, you know, like your L2 cache. They wanted to save cache 185 00:14:33,940 --> 00:14:38,980 lines so they have these global addresses and save time on the 186 00:14:38,980 --> 00:14:43,920 speed transfer context switching so they didn't have to flush the 187 00:14:43,920 --> 00:14:47,020 cache every time and so on and so forth. So, kernel address is 188 00:14:47,020 --> 00:14:47,560 basically global. 189 00:14:50,040 --> 00:14:54,320 Here is a graphic that someone else stole from the Windows 190 00:14:54,320 --> 00:14:57,980 internals books that we stole from the person off the 191 00:14:57,980 --> 00:15:05,360 internet. Because I don't like to draw. So, this is a virtual 192 00:15:05,360 --> 00:15:11,240 representation of a 32-bit system. And, basically, all I 193 00:15:11,240 --> 00:15:19,140 want to show here is you'll see there at C1000000 is the 194 00:15:19,140 --> 00:15:20,020 beginning of system 1.0. So, this is the beginning of system 1.0. 195 00:15:20,040 --> 00:15:22,720 And, this is the beginning of system cache. So, that is a cache 196 00:15:22,720 --> 00:15:26,140 that the operating system is keeping that's different from 197 00:15:26,140 --> 00:15:31,820 your L1, L2 cache that the CPU is keeping. This cache is, you 198 00:15:31,820 --> 00:15:36,120 know, going to be used for things like file I.O. So, if you 199 00:15:36,120 --> 00:15:39,880 request to read a page of a file, the operating system is 200 00:15:39,880 --> 00:15:43,200 going to assume that you're probably actually going to want 201 00:15:43,200 --> 00:15:48,160 to read more than one page. So, it's going to read ahead. And, 202 00:15:48,280 --> 00:15:50,020 that read ahead is going to cache. For you, it's going to 203 00:15:50,040 --> 00:15:55,120 view. And, it's assuming locality of reference. So, all 204 00:15:55,120 --> 00:16:01,200 your future reads statistically should be relatively close to 205 00:16:01,200 --> 00:16:06,560 where you're currently reading in typical programs. So, those go 206 00:16:06,560 --> 00:16:12,480 into the cache of that virtual address. Well, if we acquire 207 00:16:12,480 --> 00:16:17,480 memory or acquire a process and we're brute forcing, basically 208 00:16:17,480 --> 00:16:20,020 anything in the cache will appear to be a virtual address. 209 00:16:20,040 --> 00:16:23,240 So, it's going to be in every single process. So, that's really 210 00:16:23,240 --> 00:16:29,300 bad for attribution. So, let's talk about ways to make this 211 00:16:29,300 --> 00:16:35,100 process better. So, we're going to utilize file objects. And, 212 00:16:35,280 --> 00:16:39,500 file objects can represent a number of different things. They 213 00:16:39,500 --> 00:16:43,140 can be, for instance, memory map files that we kind of touched on 214 00:16:43,140 --> 00:16:48,020 which would include DLLs and EXEs. They also include data files, 215 00:16:50,040 --> 00:16:53,020 which can be mapped into memory but are in the cache in different 216 00:16:53,020 --> 00:17:00,000 places, like a word or PDF or registry hive. Web history. We've 217 00:17:00,000 --> 00:17:03,700 seen restore points. You know, Windows XP, those nice restore 218 00:17:03,700 --> 00:17:08,100 points. So, we can actually see after the attacker attacked, we 219 00:17:08,100 --> 00:17:10,980 could see what was happening on the system, what they installed 220 00:17:10,980 --> 00:17:15,980 because of the restore points. So, the VADs are still 221 00:17:15,980 --> 00:17:19,860 interesting to us, but we're going to utilize a little bit more data 222 00:17:20,040 --> 00:17:28,440 that they make available. So, VADs describe a range of memory that 223 00:17:28,440 --> 00:17:36,020 the file occupies. And, if it's a memory map file or if it's a file 224 00:17:36,020 --> 00:17:39,680 object represents that region of memory, then the VAD will have 225 00:17:40,800 --> 00:17:45,400 what's called a control area. And, if you're very familiar with 226 00:17:45,400 --> 00:17:49,620 Windybug, you'll be used to these structures that we're talking 227 00:17:49,620 --> 00:17:49,940 about. 228 00:17:49,940 --> 00:17:55,500 Control area would have a pointer back to the file object. 229 00:17:56,160 --> 00:17:59,580 So, we're finding VADs in memory because we found the eProcess 230 00:17:59,580 --> 00:18:04,500 block. Once we find the VAD, we're trying to parse it to see its 231 00:18:04,500 --> 00:18:08,140 control area. Once we get to the control area, we're parsing it to 232 00:18:08,140 --> 00:18:14,280 find its file object. Now, file objects contain some useful data, 233 00:18:15,140 --> 00:18:19,080 including the device name. That would be things like hard disk, 234 00:18:19,080 --> 00:18:23,540 volume one, as you see in this example. You could then translate 235 00:18:23,540 --> 00:18:27,600 that for the OS in question or for your host. That's probably C 236 00:18:27,600 --> 00:18:33,280 colon or whatnot. Also, it will contain the file name itself. And, 237 00:18:33,360 --> 00:18:37,600 then the thing that we're going to talk about today is this table of 238 00:18:37,600 --> 00:18:43,660 three pointers, depending on where the file or where the file data is 239 00:18:43,660 --> 00:18:47,300 actually backed up. So, the three things we're going to look at are 240 00:18:47,300 --> 00:18:48,220 image section objects. 241 00:18:49,080 --> 00:18:55,080 Data section objects and shared cache map. Here's a graphical 242 00:18:55,080 --> 00:19:00,260 representation of a file object. It contains a pointer to that 243 00:19:00,260 --> 00:19:02,880 section. It contains a pointer called section object pointers. 244 00:19:03,360 --> 00:19:08,080 And, section object pointers only has three members. And, 245 00:19:08,100 --> 00:19:14,220 Windybug will tell you all this. Or, Rosanovich might as well. So, 246 00:19:14,280 --> 00:19:18,500 image section objects represent, are very interesting to us in 247 00:19:18,500 --> 00:19:22,600 forensics and IR because they represent binaries that are loaded in 248 00:19:22,600 --> 00:19:27,540 memory. So, if binaries load up, the Windows loader is going to create a 249 00:19:27,540 --> 00:19:34,580 section object for that binary. But, this pointer, this image section 250 00:19:34,580 --> 00:19:38,940 object thing is not actually a pointer to a structure called image 251 00:19:38,940 --> 00:19:42,900 section object. That doesn't exist. It's actually a pointer to a control 252 00:19:42,900 --> 00:19:45,540 area. So, yet another control area. 253 00:19:48,500 --> 00:19:52,280 So, that control area will have a pointer to what's called a segment 254 00:19:52,280 --> 00:19:56,620 object. This segment object can be used for sanity checking. Like, if you 255 00:19:56,620 --> 00:20:01,300 were just scanning through memory, you may find some artifacts that are no 256 00:20:01,300 --> 00:20:05,020 longer in use that aren't actually usable. If you try to parse them in 257 00:20:05,020 --> 00:20:08,720 certain code, you probably crash. So, we'll use this for sanity checking. 258 00:20:09,660 --> 00:20:14,440 That segment object will contain a segment size and the total number of 259 00:20:14,440 --> 00:20:16,120 PTEs represented by that segment. 260 00:20:18,680 --> 00:20:22,720 So, we'll talk about PTEs in a moment. But, basically, for a sanity check, 261 00:20:22,820 --> 00:20:28,140 you can compare the segment size equal, should be equal to the total number of 262 00:20:28,140 --> 00:20:34,740 PTEs times the page size. Page size in Windows, for the most part, you can 263 00:20:34,740 --> 00:20:39,520 just, there is a small alteration on page size. But, for the most part, you 264 00:20:39,520 --> 00:20:48,180 can assume that that's 4K or 1,000 hex. The thing that you're going to want to be 265 00:20:48,500 --> 00:20:48,880 concerned about is the size of that segment. So, the first thing, if you're 266 00:20:48,880 --> 00:20:54,080 trying to dig out the binary data from memory, would be the subsections. 267 00:20:55,740 --> 00:21:00,500 So, subsections represent the individual pieces of a file. How many here has ever 268 00:21:00,500 --> 00:21:06,680 loaded up, like, looked at a PE, a portable executable in PE view or Lord PE 269 00:21:06,680 --> 00:21:14,180 or some other viewer? Basically, what you'll see in there is that the PE file 270 00:21:14,180 --> 00:21:18,480 is broken into a bunch of sections. So, there's, like, a couple of sections. 271 00:21:18,500 --> 00:21:22,080 A code section is usually called .txt. There's a data section. There's a resource 272 00:21:22,080 --> 00:21:29,660 section. There's different things like that, a relocation section. Well, all these 273 00:21:29,660 --> 00:21:35,720 sections have a relative virtual offset, a relative virtual address within the PE, 274 00:21:36,320 --> 00:21:42,060 and then they also have permissions. So, once this thing loads into memory, what 275 00:21:42,060 --> 00:21:47,880 should the permissions on that section be? Well, since each section within the PE file 276 00:21:48,720 --> 00:21:53,900 probably has different permissions, then there has to be a subsection object to 277 00:21:53,900 --> 00:22:03,540 represent every single section within the PE. We couldn't find a pointer that would show us 278 00:22:03,540 --> 00:22:09,380 where the subsection object was. So, with some, if you just stare at the hex for long 279 00:22:09,380 --> 00:22:15,460 enough, the math starts to come out at you. Basically, the subsections all seem to line up 280 00:22:15,460 --> 00:22:18,480 at the very end of the subsection object. So, if you just stare at the hex for long 281 00:22:18,500 --> 00:22:20,980 enough, the math starts to come out at the very end of the control area that we just found. 282 00:22:21,640 --> 00:22:28,780 So, although the segment object was way away in virtual memory, the subsection object 283 00:22:29,400 --> 00:22:35,560 was immediately following the control area. So, that was nice for us. Basically, for every 284 00:22:35,560 --> 00:22:41,480 version of the OS, you can just determine how large the control area is, add that to 285 00:22:41,480 --> 00:22:46,120 where the base of the control area was, and then cast that as a subsection object. 286 00:22:51,520 --> 00:23:00,400 So, these subsections, they'll contain an array of prototype PTEs. This is the crux of the 287 00:23:00,400 --> 00:23:08,320 data that we have to parse in order to get the binary out of memory. So, the prototype PTEs 288 00:23:08,840 --> 00:23:18,360 contain the physical address of each memory page in physical memory, right? So, we'll have a 289 00:23:18,360 --> 00:23:23,540 graphic in a moment. It may be a little bit more useful for you but I'm not sure. Basically, 290 00:23:23,580 --> 00:23:31,760 though, if the prototype PTE contains the virtual address of that subsection object that it's 291 00:23:31,760 --> 00:23:41,640 within, then that means all bets are off. Basically, this page of memory is on disk. And 292 00:23:41,640 --> 00:23:46,020 when I say on disk, I don't mean, you know, probably you've heard arguments back and forth about, 293 00:23:46,160 --> 00:23:48,340 hey, can you acquire the page from this? But that's not the case. What you're really doing is you're 294 00:23:48,340 --> 00:23:51,400 file and use that for memory forensics and stuff too. I 295 00:23:51,400 --> 00:23:55,440 personally believe you can't. You can only use the page file 296 00:23:55,440 --> 00:24:00,940 at runtime. But even if you were to be able to use offline page 297 00:24:00,940 --> 00:24:06,700 files and marry those up with offline memory images, even if 298 00:24:06,700 --> 00:24:10,660 that were possible, you won't be able to access the data that's 299 00:24:10,660 --> 00:24:15,280 represented here because memory mapped files mean exactly that. 300 00:24:15,280 --> 00:24:20,080 They're memory mapped. So if they're paged to disk, they don't 301 00:24:20,080 --> 00:24:24,020 go to the page file. They are represented by themselves on 302 00:24:24,020 --> 00:24:28,960 disk. So if you want to get that data, you have to go to the 303 00:24:28,960 --> 00:24:36,640 location of NTDLL.dll on disk for sector 15 or whatnot and 304 00:24:36,640 --> 00:24:42,240 read the data. So the page file is not useful in this case. 305 00:24:45,340 --> 00:24:50,080 Also, something else that's within this subsection object will 306 00:24:50,080 --> 00:24:56,160 be the number of full sectors and the number of prototype PTEs for 307 00:24:56,160 --> 00:25:01,260 the subsection. So again, going back to disk, when we're looking 308 00:25:01,260 --> 00:25:09,560 at the PE on disk, each the disk sectors are 512 bytes, right? 309 00:25:09,680 --> 00:25:15,260 And the page alignment in the Windows OS is 4K. So if you're 310 00:25:15,280 --> 00:25:18,100 looking at the PE on disk, it's 4K. So there's a little bit of a fix 311 00:25:18,100 --> 00:25:22,220 up that you have to do. So you have to take into account the 312 00:25:22,220 --> 00:25:26,220 total number of PTEs that this subsection represents, but also 313 00:25:26,220 --> 00:25:31,000 the total number of sectors, full sectors that it represents. 314 00:25:31,540 --> 00:25:36,140 And it contains these numbers in the structure. So you use that in 315 00:25:36,140 --> 00:25:39,960 order to parse it correctly. Because if you were just reading 316 00:25:39,960 --> 00:25:45,020 PTEs blindly, you would get more data than is actually within that 317 00:25:45,020 --> 00:25:51,520 subsection, and the file in memory wouldn't line up like it does on 318 00:25:51,520 --> 00:25:55,420 disk. So we're going to use those full sectors to our advantage. 319 00:25:58,420 --> 00:26:03,080 And basically, by keeping track of where we are when we walk these 320 00:26:03,080 --> 00:26:09,360 sectors in memory, you know, 512 bytes at a time, we will know the 321 00:26:09,360 --> 00:26:13,840 offset that we need to read if the file is paged to disk. 322 00:26:15,700 --> 00:26:20,180 So using that, we can get all the data if we're running on a 323 00:26:20,180 --> 00:26:25,080 live system. Another thing of interest is there may be, there's 324 00:26:25,080 --> 00:26:28,140 probably definitely more than one subsection, especially if it's 325 00:26:28,140 --> 00:26:32,380 a PE file. So there will be a pointer to the next subsection, 326 00:26:32,540 --> 00:26:39,940 and you basically just chase the chain, right? So this is just a 327 00:26:40,460 --> 00:26:43,860 nice graphic of what that looks like conceptually in memory. 328 00:26:45,840 --> 00:26:48,160 So we're going to do that with our array for each subsection. 329 00:26:52,000 --> 00:26:57,840 Now data section objects, they represent data files in memory. 330 00:26:58,100 --> 00:27:04,900 I'm not sure what types of files load themselves as a data section 331 00:27:04,900 --> 00:27:12,320 object. I know that PDFs don't, but Word documents do. So if you're 332 00:27:12,320 --> 00:27:15,000 loading up Microsoft Office documents, you're going to see a lot of 333 00:27:15,000 --> 00:27:18,300 them. They're going to look like, in memory, the data section object. 334 00:27:18,960 --> 00:27:25,380 That structure actually is exactly like an image section object, besides a 335 00:27:25,380 --> 00:27:33,500 few Sandy checks don't work in this case. But basically, since they're the 336 00:27:33,500 --> 00:27:37,160 same, you know, a data section object and an image section object, they 337 00:27:37,160 --> 00:27:43,780 point to the same structures, we can surmise that the data access for a Word 338 00:27:45,000 --> 00:27:53,180 document would be just as fast as the access, as any data access or code access in this 339 00:27:53,180 --> 00:27:58,600 case for an image section object. So Word documents are going to perform as 340 00:27:58,600 --> 00:28:04,860 well as EXEs, right? Because their structures are the same. It's a shortcut of where to 341 00:28:04,860 --> 00:28:11,220 get the data. It's not relying upon the cache, which is somewhat subjective. The OS defines 342 00:28:11,220 --> 00:28:14,460 how to load the cache and when, and when to flush it. 343 00:28:15,000 --> 00:28:20,020 Based upon utilization on the system and the number of resources available. Well, if you have a 344 00:28:20,020 --> 00:28:24,860 data section object, that's not the case. All your structures are right there. You have quick, 345 00:28:24,920 --> 00:28:31,020 immediate access to the data. So I thought that was kind of cool. Maybe Adobe should change how 346 00:28:31,020 --> 00:28:37,420 they load their files. So we've covered image section objects, and we've covered data section 347 00:28:37,420 --> 00:28:44,980 objects. The last thing we'll touch on here is the shared cache map. So we're going to talk about 348 00:28:45,000 --> 00:28:51,820 the shared cache map. So the shared cache map is used to represent the file data in the cache. So if 349 00:28:51,820 --> 00:28:56,260 all other bets are off, you know, if you don't have an image section object, you don't have a data 350 00:28:56,260 --> 00:29:04,220 section object, then you should go parse the cache structures in order to get as much data as is 351 00:29:04,220 --> 00:29:11,960 available. Now, again, that may be nothing, or it may be more or less the whole file. It really all 352 00:29:11,960 --> 00:29:14,980 depends. So in the shared cache map, we're going to talk about how we can use the shared cache map 353 00:29:15,000 --> 00:29:22,840 structure. This structure is actually defined by Microsoft and in Windybug. It contains the file 354 00:29:22,840 --> 00:29:29,960 size, the amount of valid data within the file, within the cache. The valid data should never be 355 00:29:29,960 --> 00:29:37,100 larger than the file cache, or the file size, because if that happens, then you're actually 356 00:29:37,100 --> 00:29:44,980 looking at uninitialized data. Also, it contains an array of data. So if you're looking at a 357 00:29:45,000 --> 00:29:54,640 set of pointers to VACBs, so VACBs are virtual address control blocks. This is the structures 358 00:29:54,640 --> 00:30:06,660 that define where the data is in virtual memory in the cache. So if the file is one megabyte or 359 00:30:06,660 --> 00:30:14,440 less, then Microsoft decides to put in some performance improvements by embedding an array of 360 00:30:14,440 --> 00:30:14,980 four. So if you're looking at a file that's one megabyte or less, then Microsoft decides to put in 361 00:30:15,000 --> 00:30:22,040 four VACBs right into the shared cache map itself. So no reason to chase anything. They've just 362 00:30:22,040 --> 00:30:27,900 embedded it right there, which works really nice for them, because often the things in the cache are 363 00:30:27,900 --> 00:30:34,220 less than a meg. Right? You're probably going to have a lot of web images and so forth that are in 364 00:30:34,220 --> 00:30:41,680 the cache. They're going to be less than meg in size. So let's keep it simple. Each VACB, I should 365 00:30:41,680 --> 00:30:44,980 mention, represents 256 kilobytes. That's a lot of data. So if you're looking at a file that's 366 00:30:44,980 --> 00:30:47,840 one megabyte or less, then Microsoft decides to put in four VACBs. So if you have four of those, 367 00:30:48,340 --> 00:30:55,720 obviously you can represent a one meg file. If it's larger than a meg, though, we have to go to an 368 00:30:55,720 --> 00:31:05,840 array of pointers. So what that looks like is it's a nested structure. It can, if it's one level 369 00:31:05,840 --> 00:31:14,020 deep, basically there's one array that points to the VACBs themselves. It can represent 32 370 00:31:14,020 --> 00:31:23,780 megabytes if it's one level deep. I think, I forget the number. I believe each array has 128 371 00:31:24,360 --> 00:31:33,520 entries. So if you read Mark and David Solomon's book on Windows internals, chapter 13, I believe, in 372 00:31:33,520 --> 00:31:38,180 the newest version, it's all about the cache. And they'll tell you how to calculate the depth of this 373 00:31:38,180 --> 00:31:44,000 tree. So arrays of arrays of arrays of arrays. It gets really fun. I recommend it. It's a lot of 374 00:31:44,020 --> 00:31:53,580 recursion. But anyway, the largest file that you can have on Windows OS is 2 to the 63rd power. So 375 00:31:53,580 --> 00:31:59,120 that's the largest you can have. And because of the number of entries in each array and so on and so 376 00:31:59,120 --> 00:32:04,960 forth, and the number of blocks that they can represent, your tree can be no deeper than seven 377 00:32:04,960 --> 00:32:13,200 levels deep. Here's what the shared cache map would look like, kind of conceptually. 378 00:32:19,640 --> 00:32:27,940 This, obviously, the bottom is just two levels deep. And if we parse this, we'll get all the file data 379 00:32:28,520 --> 00:32:34,920 that is present in the cache. So let's talk about some of the applications of this technology. 380 00:32:37,200 --> 00:32:43,400 Well, in the past, most of the tools, I believe all the tools that are out there freely available, 381 00:32:45,460 --> 00:32:52,480 we'll parse the VAD tree in order to do process reconstitution. But we probably, since we care 382 00:32:52,480 --> 00:32:58,880 about some data that's in the file system or in the file cache, we should probably also parse the 383 00:32:58,880 --> 00:33:05,900 handle table. So we're going to parse the handle table. We're going to parse the VAD tree. And 384 00:33:05,900 --> 00:33:12,740 then once we get there, we're going to parse the file objects that we find. Now, the Windows 385 00:33:12,740 --> 00:33:14,000 Registry hives are not the only things that we're going to parse. We're going to parse the VAD tree. 386 00:33:14,000 --> 00:33:19,360 This is a nice example of how you can use this. If you would analyze the system process, 387 00:33:20,220 --> 00:33:26,500 basically, it has a handle to every registry hive that's in memory. So you can get all the data 388 00:33:26,500 --> 00:33:33,180 there. So if you would, let's say you're going to acquire this to your local hard drive or to your 389 00:33:33,180 --> 00:33:40,400 system analyst station so that you can do parsing with your traditional registry forensic tools, 390 00:33:41,200 --> 00:33:43,760 you would want to acquire the system process 391 00:33:43,760 --> 00:33:52,360 out of memory. Once you have that, it will literally write the individual file names to the 392 00:33:52,360 --> 00:34:02,360 local hard drive with the content of those hives. Also, PDFs, as I mentioned, are found in the 393 00:34:02,360 --> 00:34:11,860 cache. We haven't had a ton of time to research all the things we can get out of the cache. If 394 00:34:11,860 --> 00:34:13,740 you're on a Windows XP system, you don't have the time to do any of the research. If you're on a 395 00:34:13,760 --> 00:34:21,220 You can get the restore points because it has a handle to a file that is basically keeping 396 00:34:21,220 --> 00:34:27,220 the data for the restore points, and so you can get that out of memory in some cases. 397 00:34:29,880 --> 00:34:33,680 But the caveat for the cache is it's kind of all bets are off. 398 00:34:33,760 --> 00:34:35,680 It's hit or miss rather than being useful. 399 00:34:40,340 --> 00:34:45,420 The way we're going to use this most likely in some of the free tools that we're releasing 400 00:34:47,060 --> 00:34:48,720 are to do data reduction. 401 00:34:49,560 --> 00:34:50,900 So we have hashing. 402 00:34:51,760 --> 00:34:56,880 We meet up on the AV industry all the time about hashing and how it sucks and that's 403 00:34:56,880 --> 00:34:58,200 nice and I've done it myself. 404 00:34:59,440 --> 00:35:01,200 However hashing can also be useful. 405 00:35:01,420 --> 00:35:04,360 We have over two decades of data. 406 00:35:04,360 --> 00:35:07,820 So let's start to use it to our advantage to make the problem simpler. 407 00:35:09,740 --> 00:35:11,860 Memory forensics is all about data reduction. 408 00:35:12,400 --> 00:35:16,080 So we went from a 250 gigabyte hard drive. 409 00:35:16,960 --> 00:35:21,040 Now we're down to a four gigabyte memory image probably. 410 00:35:21,780 --> 00:35:29,560 Now in that memory image we're going to find roughly on the Windows 7 machine I looked 411 00:35:29,560 --> 00:35:34,280 at we're going to find about over 4,000 files. 412 00:35:34,280 --> 00:35:36,280 In memory, right? 413 00:35:37,300 --> 00:35:42,200 If you don't take into account eliminating duplicates. 414 00:35:43,960 --> 00:35:48,020 So everything's going to have a handle or a VAD to NTDLL. 415 00:35:48,200 --> 00:35:51,840 Everything's going to have a VAD to kernel32.dll and so on and so forth. 416 00:35:52,580 --> 00:35:58,520 So now we went from 250 gigabyte that we care about maybe at first down to 4,000 files. 417 00:35:59,180 --> 00:36:02,160 And then we do a data reduction to get rid of redundancy. 418 00:36:02,660 --> 00:36:04,260 And now we're down to about 50 gigabyte. 419 00:36:04,280 --> 00:36:05,100 And that's 1,500 files. 420 00:36:06,200 --> 00:36:10,420 Well, now the problem's starting to get a little bit more manageable in finite time. 421 00:36:11,880 --> 00:36:19,020 So if we could use white listing and hashing to eliminate the other components of the 422 00:36:19,020 --> 00:36:25,600 operating system that we don't care about, that number would get a lot more manageable. 423 00:36:28,400 --> 00:36:33,020 So there's been some efforts in the past, not my research but others. 424 00:36:33,520 --> 00:36:34,260 Who've done this? 425 00:36:34,280 --> 00:36:41,500 We've done fuzzy hashing and different things like that in order to try to make the hash 426 00:36:41,500 --> 00:36:44,460 that's found in memory match the hash on disk. 427 00:36:45,840 --> 00:36:50,960 The problem with these fuzzy hashing techniques is we don't have the data going back years 428 00:36:52,020 --> 00:36:57,900 because they just take subsections of files and most white listing technologies and so 429 00:36:57,900 --> 00:37:01,500 forth use the full hash of the file. 430 00:37:01,500 --> 00:37:09,860 So, the comparison is difficult to make and it may have benefit in your organization like 431 00:37:09,860 --> 00:37:13,880 if you had a white list, I mean a gold master that you were deploying across the enterprise, 432 00:37:14,600 --> 00:37:17,540 you may be able to use data reduction with fuzzy hashing. 433 00:37:20,440 --> 00:37:26,420 However, we found that most people don't have this and so we went to the section image object 434 00:37:27,160 --> 00:37:31,480 and we parsed it like on a lav system, which means we can get access to the file. 435 00:37:31,480 --> 00:37:34,540 We can get access to the file system as well if there's a page that's not there in memory 436 00:37:35,660 --> 00:37:42,300 and by utilizing this data, we can make the hash that we find in memory match the hash 437 00:37:42,300 --> 00:37:43,480 that's on disk. 438 00:37:44,600 --> 00:37:46,300 So we call this memd5. 439 00:37:47,220 --> 00:37:50,520 It's a cute name of our other co-workers came up with. 440 00:37:51,340 --> 00:37:55,320 That will be released in the free tool that I'll talk about in a moment. 441 00:37:58,020 --> 00:38:00,140 Another application for this. 442 00:38:00,980 --> 00:38:01,460 It's called Memd5. 443 00:38:01,480 --> 00:38:10,500 Better process reconstitution or binary acquisition, what have you, is that there's a lot of tools 444 00:38:10,500 --> 00:38:14,960 out there that are starting to use, you know, like byte patterns of malware and things like 445 00:38:14,960 --> 00:38:15,220 that. 446 00:38:15,960 --> 00:38:22,560 There was a tool developed by Zynamics, which was acquired by Google, unfortunately, and 447 00:38:22,560 --> 00:38:27,800 they killed the project or took it internally, can't buy it anymore, but it's called VX class 448 00:38:27,800 --> 00:38:28,500 and it's kind of cool. 449 00:38:28,840 --> 00:38:31,460 I liked it enough that I convinced my company to buy it. 450 00:38:31,460 --> 00:38:39,300 But VX class would generate byte pattern signatures for classes of malware. 451 00:38:39,560 --> 00:38:40,920 So families of malware. 452 00:38:41,600 --> 00:38:47,640 So what the VX class leveraged was that if you had a malware sample or a lot of malware 453 00:38:47,640 --> 00:38:49,940 samples, they were reusing code. 454 00:38:51,300 --> 00:38:57,380 And if you were doing IR, you probably didn't want to focus, you know, all your ‑‑ you 455 00:38:57,380 --> 00:38:59,460 have a limited amount of resources. 456 00:39:00,200 --> 00:39:01,440 So you probably don't have a lot of resources. 457 00:39:01,460 --> 00:39:03,400 You don't have a large malware team, whatnot. 458 00:39:03,640 --> 00:39:10,200 You don't want to focus all your efforts looking at the last 50 variations of Zeus bot. 459 00:39:10,800 --> 00:39:14,940 You just want to throw it into some automated system and have it spit out, hey, this is 460 00:39:14,940 --> 00:39:16,160 Zeus bot, right? 461 00:39:18,100 --> 00:39:20,360 So that's what they did with their VX class. 462 00:39:20,900 --> 00:39:25,900 And then it would generate ‑‑ they had someone else join the company and one of his 463 00:39:25,900 --> 00:39:31,220 PhD ideas, I think, were around generating the commonality between all these things. 464 00:39:31,460 --> 00:39:32,600 In the byte pattern. 465 00:39:32,840 --> 00:39:41,120 So you have 100 samples, they all say I'm Zeus, well, let's generate one pattern that 466 00:39:41,120 --> 00:39:43,500 matches for all 100 samples. 467 00:39:45,400 --> 00:39:47,980 So we could use this to search memory and it was fine. 468 00:39:48,460 --> 00:39:49,960 But we got some false negatives. 469 00:39:51,000 --> 00:39:57,460 Well by utilizing this ‑‑ the image section objects and so forth, we no longer get the 470 00:39:57,460 --> 00:39:57,960 false negatives. 471 00:39:58,120 --> 00:39:59,140 So it's more useful to us. 472 00:39:59,800 --> 00:40:01,440 Also, how many people have ever used this? 473 00:40:01,460 --> 00:40:02,000 How many people have ever used Clam AV? 474 00:40:03,580 --> 00:40:06,620 So the large number here, they've heard of it, they used it. 475 00:40:06,940 --> 00:40:11,760 Well Clam AV also has this concept of a byte signature match for malware. 476 00:40:12,660 --> 00:40:19,080 So I think in the last time I downloaded Clam AV, they released 40 signatures that 477 00:40:19,080 --> 00:40:21,020 are what they classify as byte pattern. 478 00:40:21,800 --> 00:40:27,840 So I didn't look at what the database is and what those signatures represent, but there 479 00:40:27,840 --> 00:40:31,400 are 40 signatures in there that now we'll be able to use in memory. 480 00:40:31,400 --> 00:40:38,860 So we're trying to use the tools that we already have, apply them in a triage scenario. 481 00:40:44,380 --> 00:40:46,360 So we have a few minutes left here. 482 00:40:46,800 --> 00:40:50,080 I'm just going to cover some demos quickly. 483 00:40:51,440 --> 00:40:55,000 I apologize, my laptop died like right before I came to Black Hat. 484 00:40:55,160 --> 00:40:58,640 So I had a fast machine, now I have a really crappy one. 485 00:40:59,500 --> 00:41:00,280 So anyway. 486 00:41:01,400 --> 00:41:08,380 I won't run the acquisitions on this hard drive because it would take about six minutes 487 00:41:09,580 --> 00:41:10,540 per sample. 488 00:41:12,180 --> 00:41:17,340 But this, if you have memorized, you could do this at home as soon as we release the 489 00:41:17,340 --> 00:41:19,100 new tool, the new version. 490 00:41:20,320 --> 00:41:27,980 Here we're going to run a process of acquisition, pull the binaries out of memory, and then 491 00:41:27,980 --> 00:41:28,960 we're going to look at what we got. 492 00:41:40,180 --> 00:41:42,980 So the first example was the registry hive. 493 00:41:45,320 --> 00:41:58,440 If I acquire the system process, I have a bunch of data here, along with the sizes. 494 00:41:58,520 --> 00:42:01,280 So we're pulling out individual files. 495 00:42:01,400 --> 00:42:03,800 And we're giving them a name. 496 00:42:03,940 --> 00:42:08,160 It's encoded so that we can write it all to the local file. 497 00:42:09,040 --> 00:42:14,140 So you'll see the encoding of C colon slash, things like that. 498 00:42:17,160 --> 00:42:21,640 If we couldn't determine, like, it didn't have a name, it didn't have a control area 499 00:42:21,640 --> 00:42:26,120 associated with it, we'll just give you the range that we found it in and so forth. 500 00:42:26,880 --> 00:42:28,980 But if it did have a name, we'll write that out. 501 00:42:29,580 --> 00:42:30,120 You know. 502 00:42:30,120 --> 00:42:31,900 There's some files we couldn't find any data. 503 00:42:32,500 --> 00:42:34,060 We could find a file object. 504 00:42:34,180 --> 00:42:35,140 We could find its name. 505 00:42:35,660 --> 00:42:38,380 But it just didn't have any data that we could carve out of memory. 506 00:42:38,820 --> 00:42:40,480 So those will be zero in size. 507 00:42:41,860 --> 00:42:47,920 But what I want to show you is loading this into a registry viewer, because, again, this 508 00:42:47,920 --> 00:42:48,900 is a system process. 509 00:42:49,720 --> 00:42:51,640 So we're going to load it up into registry viewer. 510 00:42:55,480 --> 00:43:00,100 And since this was coming from the cache. 511 00:43:00,120 --> 00:43:03,020 There may be some pages that are not there, right? 512 00:43:04,480 --> 00:43:10,360 But if we encounter one of those in the cache example, we'll just write a page basically 513 00:43:10,360 --> 00:43:10,960 with no ops. 514 00:43:11,420 --> 00:43:18,800 Because we need to keep linear, the linear order of things in the file so that it can 515 00:43:18,800 --> 00:43:22,420 be parsed by tools like this is access status registry viewer. 516 00:43:24,120 --> 00:43:26,820 If you see here, you know, I can drill down into things. 517 00:43:27,640 --> 00:43:29,760 I can see when the key was created. 518 00:43:30,120 --> 00:43:33,000 So I can do all my traditional forensics on it. 519 00:43:33,500 --> 00:43:34,640 There's no guesswork. 520 00:43:34,640 --> 00:43:39,200 There's no carving hives out of memory and guessing where they are and stuff like that. 521 00:43:39,220 --> 00:43:39,700 It just works. 522 00:43:43,980 --> 00:43:56,300 Another thing I'll show you is here I'm going to have acquired basically the so from the 523 00:43:56,300 --> 00:43:56,960 Honey Nut Challenge. 524 00:43:57,980 --> 00:43:59,740 The Honey Nut Challenge 3. 525 00:43:59,740 --> 00:44:06,100 There was a memory image that had, it was basically infection through the web. 526 00:44:06,380 --> 00:44:07,700 I think it was Zeus. 527 00:44:09,600 --> 00:44:17,540 And when I acquired the Firefox process, I was able to get the web cache information, 528 00:44:17,640 --> 00:44:19,100 the URL history information. 529 00:44:20,060 --> 00:44:25,900 So I load this up into one of our free tools called Web Historian. 530 00:44:29,040 --> 00:44:29,720 And I'm going to go ahead and do that. 531 00:44:29,720 --> 00:44:34,460 And there wasn't much data here because they were just demonstrating an attack and seeing 532 00:44:34,460 --> 00:44:35,180 what you could find. 533 00:44:35,380 --> 00:44:42,140 But this last entry here contains the exploit codes, pdf.php. 534 00:44:42,900 --> 00:44:44,220 So I can see the URL. 535 00:44:44,320 --> 00:44:49,300 I can see the access time, like when the user clicked to go there and stuff like that. 536 00:44:49,700 --> 00:44:52,360 Because it's all in the web history log that Firefox is keeping. 537 00:44:52,640 --> 00:44:54,680 And I just acquired Firefox out of memory. 538 00:44:54,780 --> 00:44:56,800 So I can use my traditional tools. 539 00:44:57,080 --> 00:44:57,340 Okay. 540 00:45:05,600 --> 00:45:06,400 So I'm going to go ahead and do that. 541 00:45:06,400 --> 00:45:13,200 Also I acquired the Microsoft Word process out of memory. 542 00:45:17,180 --> 00:45:23,920 And this was a memory image that asked my wife if she would load up a Word document 543 00:45:23,920 --> 00:45:24,420 on a sender. 544 00:45:24,540 --> 00:45:27,340 And then take an image of her laptop. 545 00:45:27,840 --> 00:45:29,140 It was around a Windows. 546 00:45:29,140 --> 00:45:31,240 It was a Vista. 547 00:45:34,500 --> 00:45:40,300 Here you see we were able to acquire the Word template and an actual Word document. 548 00:45:41,260 --> 00:45:47,620 So if we try to open that Word document, it's going to complain. 549 00:45:47,920 --> 00:45:51,580 This was the Word document was written in the Word 2010. 550 00:45:52,160 --> 00:45:55,160 This is Microsoft Office 2007. 551 00:45:55,860 --> 00:45:57,820 It's going to complain about the content. 552 00:45:57,820 --> 00:45:59,560 It's a little corrupted. 553 00:45:59,720 --> 00:46:02,560 It's probably also dealing because we're coming from cache. 554 00:46:03,540 --> 00:46:05,800 We're just going to go ahead and say okay. 555 00:46:06,460 --> 00:46:08,240 It's going to say do you really trust this. 556 00:46:08,400 --> 00:46:09,020 We're going to say yes. 557 00:46:12,060 --> 00:46:14,540 And here's the Word document for this presentation. 558 00:46:15,290 --> 00:46:17,240 So there's a 13-page white paper. 559 00:46:18,240 --> 00:46:18,780 . 560 00:46:23,420 --> 00:46:25,380 And it is all there. 561 00:46:26,240 --> 00:46:27,800 So I'm not really sure. 562 00:46:27,800 --> 00:46:31,840 if this has any applicability to IR and forensics, which is my 563 00:46:31,840 --> 00:46:35,860 day job, but I thought it was kind of sexy cool, so what the 564 00:46:35,860 --> 00:46:43,140 hell. I guess for all you e-discovery types, you might 565 00:46:43,140 --> 00:46:49,400 like it. Then the last thing I'll show you before I go is 566 00:46:49,400 --> 00:46:55,260 this is the UI for our memory analysis tool that is also free. 567 00:46:55,260 --> 00:47:01,520 The UI is open source. It's called audit viewer. We're going 568 00:47:01,520 --> 00:47:06,040 to be releasing a new version where you can say filter out the 569 00:47:06,040 --> 00:47:12,460 known MD5s. So if it's going to do the MD5, compare that to a 570 00:47:12,460 --> 00:47:17,460 known set. Here if you had something like bit 9, you could 571 00:47:17,460 --> 00:47:21,040 whitelist, right? You could utilize their service and this 572 00:47:21,040 --> 00:47:24,860 will just fire a bunch of crap at bit 9. I don't know if that's 573 00:47:24,860 --> 00:47:25,240 legal. I don't know if that's legal. I don't know if that's 574 00:47:25,260 --> 00:47:27,900 legal, but if you have a password and a user account, I'm 575 00:47:27,900 --> 00:47:31,700 sure they'll probably let you do it. So we're going to say 576 00:47:31,700 --> 00:47:34,980 cancel because we don't have a bit 9 account for today's 577 00:47:34,980 --> 00:47:48,240 demonstration. It's still running. Okay. Finished. You 578 00:47:48,240 --> 00:47:52,360 could also use the NSLR from NIST and stuff to do your known 579 00:47:52,360 --> 00:47:55,240 whitelist. And then we're going to say filter on the new 580 00:47:55,240 --> 00:48:00,280 system. So we're going to say filter on trust. And there we've 581 00:48:00,280 --> 00:48:03,680 reduced, oh, by the way, this is every single process on the 582 00:48:03,680 --> 00:48:07,980 system because I double clicked the root node here. So this is 583 00:48:07,980 --> 00:48:11,560 every process. These are the things I have to care about now 584 00:48:11,560 --> 00:48:16,420 as an incident responder triaging this host. So we went 585 00:48:16,420 --> 00:48:20,820 from 1500 down to, I don't know, maybe 30 or something 586 00:48:20,820 --> 00:48:24,920 like that. So it's a big time saver. And that's about the 587 00:48:25,240 --> 00:48:31,280 end of my time. There are a few caveats where places we need to 588 00:48:31,280 --> 00:48:36,900 continue the work. Basically dealing with the tool will be 589 00:48:36,900 --> 00:48:40,220 available in the coming weeks. You can check the blog. These 590 00:48:40,220 --> 00:48:42,340 slides will be on the web. The white paper will be on the 591 00:48:42,340 --> 00:48:48,400 black hat site. But dealing with ASLR because it changes the 592 00:48:48,400 --> 00:48:52,740 address space a little bit when programs load. But we have all 593 00:48:52,740 --> 00:48:55,220 the data we need to actually reverse that. So we're going to 594 00:48:55,240 --> 00:49:00,100 reverse that trend. So we can fix it up and just run the fixed 595 00:49:00,100 --> 00:49:05,180 up data through our hash and get the same hash values. Also 596 00:49:05,180 --> 00:49:08,020 there's something called the security directory that's on 597 00:49:08,020 --> 00:49:13,120 some files. It's the certificate info. And that won't be 598 00:49:13,120 --> 00:49:17,180 present. There are no artifacts representing that on Windows 7 599 00:49:17,180 --> 00:49:20,020 and Windows 2008. Previous versions there were the 600 00:49:20,020 --> 00:49:25,020 artifacts. So, again, we have the PE header in memory. So we 601 00:49:25,240 --> 00:49:28,420 can detect that that exists. We can go to the disk. We can run it 602 00:49:28,420 --> 00:49:34,580 through our hash. And memd5 will work again. So that's really the 603 00:49:34,580 --> 00:49:40,280 end. I'll be available at the Q&A room after this. Thank you.