1 00:00:00,760 --> 00:00:05,100 The title of this talk is quite long. I wanted to get the longest talk of the entire conference, 2 00:00:05,220 --> 00:00:08,700 but unfortunately there was somebody else who had a talk titled that was five lines 3 00:00:08,700 --> 00:00:15,140 instead of four. So here we are. It's anti-forensics and anti-anti-forensics. There is no uncle 4 00:00:15,140 --> 00:00:22,040 forensics. All right. This talk is going to talk about techniques that can complicate 5 00:00:22,040 --> 00:00:26,240 digital investigations and things that investigators can do to mitigate these techniques so that 6 00:00:26,240 --> 00:00:31,840 they can retain the upper hand in the investigation. And just digital complications in general. 7 00:00:32,120 --> 00:00:36,020 So if you're interested in that stuff, you've come to the right place. My name is Michael 8 00:00:36,020 --> 00:00:41,280 Perklin. My day job, I'm a corporate investigator. I'm a digital forensic examiner, a computer 9 00:00:41,280 --> 00:00:46,200 programmer. In the past I've been an e-discovery consultant. Basically I'm a computer geek 10 00:00:46,200 --> 00:00:53,160 and legal support hybrid together at last, merged together. So that's me. The stuff 11 00:00:53,160 --> 00:00:56,060 I'm going to be talking about today is not that... 12 00:00:56,760 --> 00:01:02,060 Difficult. Actually, the majority of them are not sophisticated at all. Although a 13 00:01:02,060 --> 00:01:07,300 couple of them are a little bit sophisticated, but they're fairly easy to understand. Every 14 00:01:07,300 --> 00:01:11,580 single one of them can be defeated by an investigator who has either experience or 15 00:01:11,580 --> 00:01:18,180 training or knowledge in computers and understands what's going on. So if you're here looking 16 00:01:18,180 --> 00:01:24,980 for something that's brand new to break an investigation or to really beat an investigator, 17 00:01:25,200 --> 00:01:26,220 you're in the wrong place. So if you're here looking for something that's brand new to break an 18 00:01:26,240 --> 00:01:29,100 investigation, I'm sure you're in the wrong spot. But all the stuff here definitely does 19 00:01:29,100 --> 00:01:35,440 add a lot of man hours and a lot of money that will make the investigation take a lot longer. 20 00:01:35,560 --> 00:01:40,940 It will make it go overbudget. This will increase the chances that the investigation will 21 00:01:40,940 --> 00:01:45,900 be thrown out... The case will be thrown out and maybe a settlement will be reached miss 22 00:01:45,900 --> 00:01:52,420 instead. So everything that we'll be talking about today is not designed to, I guess, break 23 00:01:53,260 --> 00:01:56,220 the investigation process. It's to lengthen the zg that's going on that's going to beMeet 24 00:01:56,220 --> 00:02:03,680 in the investigation process and to make it cost a lot more money. There's three typical 25 00:02:03,680 --> 00:02:11,680 methodologies that are employed by a variety of different forensic labs. One is the copy first 26 00:02:11,680 --> 00:02:16,400 and ask questions later methodology. This is typically employed by law enforcement personnel. 27 00:02:16,640 --> 00:02:22,500 They go in there, they grab every single piece of digital evidence that the guy has or the girl, 28 00:02:22,500 --> 00:02:30,720 I'm sorry, and they can do this, they can take it all back without any impunity. The next one is to 29 00:02:30,720 --> 00:02:38,120 assess relevance first. This photograph you see here on screen is a logic cube talent. It's a 30 00:02:38,120 --> 00:02:43,880 forensic duplicator that has the ability to do a keyword search. So what some investigators will 31 00:02:43,880 --> 00:02:49,340 do, they'll draft a list of keywords that they know will appear somewhere in the files that 32 00:02:49,340 --> 00:02:52,480 they're looking for and they'll search the entire hard drive for any of the keywords that they 33 00:02:52,480 --> 00:02:58,840 know. If they're found, then that hard drive looks like it's relevant to the case and at that 34 00:02:58,840 --> 00:03:03,020 point they'll start to acquire it. So instead of grabbing everything, they only grab the stuff 35 00:03:03,020 --> 00:03:09,080 where certain keywords appear. This can be used by any type of investigator, whether it's law 36 00:03:09,080 --> 00:03:17,640 enforcement personnel, a private consultancy firm or an enterprise firm. The third methodology is 37 00:03:17,640 --> 00:03:22,120 remote analysis of a live system. Basically this is an administrator user. 38 00:03:22,480 --> 00:03:28,140 Who can connect over a network to another machine, scan the hard drive for certain things, for 39 00:03:28,140 --> 00:03:32,560 certain files, read the log files, and whenever they find something that's relevant, they'll copy it 40 00:03:32,560 --> 00:03:40,500 back. This is deployed in large organizations such as Intel or AT&T. If they have 10,000 or more 41 00:03:40,500 --> 00:03:47,120 employees, it's because it's a lot easier to go at it this way than it is to image every single 42 00:03:47,120 --> 00:03:52,460 computer in such a large organization. Private firms can also use this technology to do a lot of 43 00:03:52,480 --> 00:03:56,680 things. They can also use this methodology as well if they have assistance from the firm that 44 00:03:56,680 --> 00:04:02,280 they're dealing with. In a lot of cases, a large firm, let's say Intel, may contract out a 45 00:04:03,120 --> 00:04:07,800 consultancy firm, a forensic consultancy firm, to come in and do all the imaging. They'll share 46 00:04:07,800 --> 00:04:12,260 the administrator password so that the investigators can still go in and grab all the stuff 47 00:04:12,260 --> 00:04:17,380 they need. Now regardless of which type of forensic lab you're running in, whether it's law 48 00:04:17,380 --> 00:04:22,460 enforcement or it's a private consultancy firm or it's an enterprise firm, there's a lot of 49 00:04:22,480 --> 00:04:26,620 different ways to do this. You're going to do essentially the same workflow. There are six 50 00:04:26,620 --> 00:04:32,900 stages that all forensic investigators run through. Number one is creating a working copy. This 51 00:04:32,900 --> 00:04:38,680 is either imaging the file or creating some kind of a forensic container that has digital 52 00:04:38,680 --> 00:04:44,340 hashes to preserve the evidence as it existed on the target system. Once it's preserved, you can 53 00:04:44,340 --> 00:04:49,220 process it for analysis. When you're processing, you're doing things like calculating MD5 hashes 54 00:04:49,220 --> 00:04:52,460 or SHA-1 hashes or SHA-256 hashes, and then you're going to process it for analysis. You're 55 00:04:52,480 --> 00:04:57,860 also identifying the file types, making sure all the extensions on each of the files match the 56 00:04:57,860 --> 00:05:01,700 format of the file itself, and doing some other processing, getting it ready for your analysis. 57 00:05:02,720 --> 00:05:08,240 Next, you separate the wheat from the chaff. I came up with that term. It's essentially 58 00:05:08,680 --> 00:05:13,120 sifting through the data to narrow down what you need to look at when you start your analysis, 59 00:05:13,380 --> 00:05:16,120 because you're not going to want to analyze every single file on the hard drive. You're going to 60 00:05:16,120 --> 00:05:21,480 only want to analyze the stuff that is ‑‑ that you think may be relevant to your case. 61 00:05:22,560 --> 00:05:27,640 Once you've got that stuff narrowed down, you can analyze it to see if it's relevant to your case at 62 00:05:27,640 --> 00:05:33,600 all. This can be done with a variety of tools that you're comfortable with as an investigator. Once 63 00:05:33,600 --> 00:05:37,500 you're finished your analysis, you then write a report on your findings. This report ‑‑ if 64 00:05:37,500 --> 00:05:42,780 you're a private consultancy firm, you can write this report for your client. If you're an 65 00:05:42,780 --> 00:05:46,780 enterprise firm, you can write it for your boss, or if you're law enforcement, you can write the 66 00:05:46,780 --> 00:05:52,000 report as an affidavit to go to court. Either way, you prepare some kind of report of your 67 00:05:52,000 --> 00:05:52,260 findings. 68 00:05:53,440 --> 00:05:58,700 Finally, you archive the data for the future. You never know if this case is going to be settled 69 00:05:58,700 --> 00:06:03,860 today or tomorrow, or if it's going to go on for years. And once a determination is made by a 70 00:06:03,860 --> 00:06:11,560 judge or an arbiter, it may be challenged, and it may be overturned. It could go for another 10 71 00:06:11,560 --> 00:06:16,260 years or 20 years. Who knows? As an interesting point, in Canada at least ‑‑ sorry, I'm 72 00:06:16,260 --> 00:06:21,700 Canadian. I don't know if the law is the same in the United States, but in Canada, if there's a 73 00:06:22,520 --> 00:06:28,060 case involving a murder, the data needs to be persisted forever. So archiving data for the 74 00:06:28,060 --> 00:06:33,920 future is a pretty important step in the process. So those are ‑‑ that's a typical workflow that 75 00:06:33,920 --> 00:06:38,240 any investigator will have to run through, regardless of which class of investigator they 76 00:06:38,240 --> 00:06:44,720 are. Now, there's three classical anti‑forensic techniques that I'm sure all of you are familiar 77 00:06:44,720 --> 00:06:50,020 with or have at least heard of. One is HDD scrubbing or file wiping. This is essentially going 78 00:06:50,020 --> 00:06:51,680 over ‑‑ as far as I can remember, this is the first time I've ever heard of this. This is a 79 00:06:51,700 --> 00:06:57,840 certain area of the hard drive with either zeroes or random data, one time, seven times, 15 80 00:06:57,840 --> 00:07:01,300 times. There's a variety of different standards of how many times you go over it. But it 81 00:07:01,300 --> 00:07:06,860 destroys the evidence permanently. The second classical anti‑forensic technique is encryption, 82 00:07:07,120 --> 00:07:14,000 using something as TrueCrypt or PGP. This makes the data unreadable to anybody else except for 83 00:07:14,000 --> 00:07:19,720 you who has the key. And the third one is physical destruction, basically smash the crap out 84 00:07:19,720 --> 00:07:21,680 of something. Destroy a USB key, destroy a USB key, destroy a USB key, destroy a USB key, destroy a 85 00:07:21,700 --> 00:07:28,020 hard drive, make it so that nobody can read anything off that thing. Now, all three of these 86 00:07:28,020 --> 00:07:33,980 classical techniques I'm not going to be covering today. The reason is, in the case of HDD 87 00:07:33,980 --> 00:07:38,320 scrubbing or physical destruction, once the data is destroyed, as an investigator, you can't do 88 00:07:38,320 --> 00:07:44,540 anything about it. So there's no reason for me to even talk about it. In the case of 89 00:07:44,540 --> 00:07:50,740 encryption, yes, you can still get the data back, but you can get it pretty easily either by 90 00:07:52,080 --> 00:07:59,440 coercing the target to give you the encryption key or by getting a court order, maybe a subpoena or 91 00:07:59,440 --> 00:08:04,960 something like that, to compel him to disclose the key. There's ways you can get it. And, of 92 00:08:04,960 --> 00:08:11,320 course, there's brute force, but it doesn't necessarily work that well because it takes so 93 00:08:11,320 --> 00:08:17,520 much time. But still, with all three of these, two of them, as an investigator, you don't care 94 00:08:17,520 --> 00:08:20,720 about. And the third one, there's ways around it. There's ways around it. There's ways around it. 95 00:08:21,460 --> 00:08:28,740 Coercion is very effective, especially if you plan to either get them fired if they're an 96 00:08:28,740 --> 00:08:33,560 enterprise employee or get them in jail or you can dangle quite a lot of carrots in front of them to 97 00:08:33,560 --> 00:08:37,120 get them to divulge the key. So because of that, I'm not going to be talking about either of 98 00:08:37,120 --> 00:08:44,420 these three. On each of the slides, you're going to see running tallies at the bottom. Excuse 99 00:08:44,420 --> 00:08:50,720 me. The total number of hours wasted by the investigator and the total cost of the investigation, 100 00:08:53,260 --> 00:08:58,040 I'm going to assume that the digital investigator is running at a rate of $300 an hour. That's a 101 00:08:58,040 --> 00:09:02,100 fairly average rate. Sure, there's investigators that are cheaper and sure, there's definitely 102 00:09:02,100 --> 00:09:07,080 investigators that charge more per hour. But I'm going to adopt the rough average of about $300 an 103 00:09:07,080 --> 00:09:14,080 hour for the purposes of my calculations. The tallies are going to be green for running tallies 104 00:09:14,080 --> 00:09:19,200 and for each individual technique that I'm going to show you, the tallies will be red. So you can 105 00:09:19,200 --> 00:09:20,720 see that this one technique costs $300 an hour. The tallies are going to be green for running 106 00:09:21,340 --> 00:09:28,760 tallies. The green tallies will show you the overall cost. So without further ado, let's get 107 00:09:28,760 --> 00:09:34,440 started. The first stage of the process is creating a working copy. Now, remember, this is 108 00:09:34,440 --> 00:09:39,600 where you copy the entire device either by forensic imaging or by creating some kind of a 109 00:09:39,600 --> 00:09:44,900 forensic container of the logical files or some other form of persisting the data for your 110 00:09:44,900 --> 00:09:50,700 analysis. The first technique is quite simple. Just own a lot of media. Just own a lot of media. 111 00:09:50,720 --> 00:09:57,240 As a suspect, you can keep every single piece of digital media that you've ever had, every cell 112 00:09:57,240 --> 00:10:02,980 phone, every USB key, every burned CD and DVD, every hard drive, every laptop, anything that 113 00:10:02,980 --> 00:10:08,940 you've ever had. As a bonus, if you can use these frequently, then the investigator won't know 114 00:10:08,940 --> 00:10:14,340 if the data he's looking for is on this hard drive or that hard drive, because as far as he can 115 00:10:14,340 --> 00:10:18,220 tell, all of them have been used within the last few months. So he will have to look through 116 00:10:18,220 --> 00:10:20,700 everything. And this will add quite a lot of value to the data that he's looking for. So he's going 117 00:10:20,720 --> 00:10:24,260 to spend a lot of time and quite a lot of money to the investigation. I estimated about eight 118 00:10:24,260 --> 00:10:29,420 hours. That's one workday's worth of work. It could actually be quite a lot more depending on how 119 00:10:29,420 --> 00:10:37,300 many devices you have kept. So as a dead simple technique, keep absolutely everything. In order to 120 00:10:37,300 --> 00:10:41,200 mitigate this technique, you can ‑‑ there's two techniques you can use. Number one, you can 121 00:10:41,200 --> 00:10:46,880 parallelize the acquisition process. A lot of labs use forensic duplicators like the Talon that I 122 00:10:46,880 --> 00:10:50,700 showed in an earlier slide. These devices take the data that they've been using for the 123 00:10:50,720 --> 00:10:55,160 first time, they take the source drive of your suspect, and they take a blank drive of your own, 124 00:10:55,220 --> 00:11:01,100 and it just copies, byte for byte, over to the next one. The more drive duplicators you have, the 125 00:11:01,100 --> 00:11:06,300 more of these hard drives you can grab at the same time. So the limit here is essentially your 126 00:11:06,300 --> 00:11:11,080 budget. However many of these forensic duplicators you can afford, and you can keep running at the 127 00:11:11,080 --> 00:11:16,840 same time, the more hard drives you can go through in an hour. The next one is using their hardware 128 00:11:16,840 --> 00:11:20,700 against them. If you were to use their laptop or their desktop, you would have to have a lot of 129 00:11:20,720 --> 00:11:26,080 hard drives in your laptop and boot from your own Linux live CD or your own operating system. Once 130 00:11:26,080 --> 00:11:32,820 it's booted, you plug in your external hard drive by USB, and once it's plugged in, you can copy all 131 00:11:32,820 --> 00:11:37,840 the data directly to your USB hard drive, and you've got all the data there using their own 132 00:11:37,840 --> 00:11:44,460 hardware. The limit here is not cost. The limit here is how many computers they have, that your 133 00:11:44,460 --> 00:11:50,500 suspect has. So this could actually be the same limit that you have in your investigation. 134 00:11:50,720 --> 00:11:55,300 You know you need to copy 100 machines. They've got 100 machines. One for one, you're good. 135 00:11:55,720 --> 00:12:02,840 Here's a slide showing nine machines here. Each of them has a USB hard drive attached. They're all 136 00:12:02,840 --> 00:12:08,840 booted with a Linux live CD, and they're all copying to the USB hard drive. I have to thank my 137 00:12:08,840 --> 00:12:14,480 friend Joel, who's also a forensic investigator. He took this photo. This is him at his work, and 138 00:12:14,480 --> 00:12:19,380 it very beautifully illustrates this technique. Excuse me. 139 00:12:25,220 --> 00:12:33,420 Priorities. Okay. The second technique is using non-standard RAID. For those of you who aren't 140 00:12:33,420 --> 00:12:41,840 necessarily techies, RAID is a way of taking two or more disks and spanning them together to 141 00:12:42,250 --> 00:12:48,000 hold more than one disk will hold. Now, a lot of these RAID controllers use common settings, 142 00:12:48,140 --> 00:12:50,700 such as block size, order, and so on and so forth. So you can see here, you can see the 143 00:12:50,720 --> 00:12:53,780 To run it, you're going to need to update the RAID controller and things like that. If you use a 144 00:12:53,780 --> 00:12:58,860 controller that has different settings and different parameters, the investigator may not be 145 00:12:58,860 --> 00:13:06,160 able to combine the RAID array properly back at his lab. Also, a lot of controllers, when you 146 00:13:06,160 --> 00:13:12,560 update the firmware, it will include backwards compatibility for more standardized types of 147 00:13:12,560 --> 00:13:18,860 RAID, so simply don't update the BIOS of your RAID controller. By doing this, you'll only be 148 00:13:18,860 --> 00:13:20,700 running the controller with the same passwords. You'll need to update the BIOS of the RAID 149 00:13:20,700 --> 00:13:23,940 the stock stuff that the manufacturer put there, which 150 00:13:23,940 --> 00:13:26,880 only works the way that they wrote it for their first crack 151 00:13:26,880 --> 00:13:30,960 at it, and there will be no backwards compatibility. Some 152 00:13:31,340 --> 00:13:38,400 more information, I guess, about these RAID parameters. One is 153 00:13:38,400 --> 00:13:42,460 the disk order. If you got four disks or five disks inside of a 154 00:13:42,460 --> 00:13:46,460 machine, which order were they put in? Also, was the stripe 155 00:13:46,460 --> 00:13:48,520 ordering set up as left synchronous or right 156 00:13:48,520 --> 00:13:51,080 synchronous? Or is it left asynchronous and right 157 00:13:51,080 --> 00:13:54,860 asynchronous? Are the blocks stored in big Indian or little 158 00:13:54,860 --> 00:13:58,340 Indian format? Also, what is the block size? If any of you saw 159 00:13:58,340 --> 00:14:03,160 the DEF CON 17 talk by Scott Moulton on using porn to fix 160 00:14:03,160 --> 00:14:07,120 RAID, it explains the problem beautifully. I really recommend 161 00:14:07,120 --> 00:14:09,920 you guys go to YouTube and look up Scott Moulton's DEF CON 17 162 00:14:09,920 --> 00:14:16,280 talk. Is Scott Moulton in the audience? Nice. A round of 163 00:14:16,280 --> 00:14:18,440 applause. That was one of the best talks that I've ever 164 00:14:18,440 --> 00:14:24,620 seen at DEF CON. It explained things so well. And kudos. I've 165 00:14:24,620 --> 00:14:28,560 used that presentation in my investigations and I know that 166 00:14:28,560 --> 00:14:31,120 some of my forensic friends have used it as well. And it 167 00:14:31,120 --> 00:14:36,940 really helped cut through the chaff to recombine things. Now, 168 00:14:36,980 --> 00:14:40,460 in order to mitigate it, the problem is recombining the RAID. 169 00:14:40,560 --> 00:14:44,400 Which way did they stripe it? Which type did they stripe it? 170 00:14:44,600 --> 00:14:48,380 So an easy way to mitigate it is to simply de-RAID the volume on 171 00:14:48,440 --> 00:14:51,160 their own hardware. Again, you're using the suspect's 172 00:14:51,160 --> 00:14:55,100 hardware for your own purposes. If you use a boot disk on their 173 00:14:55,100 --> 00:15:00,060 server to boot it up, this is software that you control, you 174 00:15:00,060 --> 00:15:03,140 can use their RAID controller, which has all the parameters to 175 00:15:03,140 --> 00:15:07,240 read their RAID array properly, and you can then copy everything 176 00:15:07,240 --> 00:15:11,180 to an external USB hard drive or you can even slap in your own 2 177 00:15:11,180 --> 00:15:15,720 gig, 4 gig, sorry, 2 terabyte or 4 terabyte SATA drive right into 178 00:15:15,720 --> 00:15:18,420 the server and dump things directly to the server. That's 179 00:15:18,440 --> 00:15:22,320 how you do it. You don't have to worry about recombining the RAID 180 00:15:22,320 --> 00:15:27,040 because their hardware is doing it for you. I estimated, I don't 181 00:15:27,040 --> 00:15:30,460 remember how many hours it was for this technique. I should 182 00:15:30,460 --> 00:15:35,340 probably drink for that, sorry. But I do know that the running 183 00:15:35,340 --> 00:15:40,000 total is about 16 hours and we're at about $4,800 so far 184 00:15:40,000 --> 00:15:44,480 added to the investigation with really not doing much. The 185 00:15:45,280 --> 00:15:48,280 second stage of the workflow is processing data for analysis. 186 00:15:48,440 --> 00:15:53,420 Again, this is where you take hashes, this is where you do file 187 00:15:53,420 --> 00:15:57,560 signature analysis to see if the extension matches the file 188 00:15:57,560 --> 00:16:03,200 format and other processes similar to this. This here, I 189 00:16:03,200 --> 00:16:05,560 realize it probably isn't showing that well to the 190 00:16:05,560 --> 00:16:09,260 audience, but this is the internals of a JPEG file. I've 191 00:16:09,260 --> 00:16:12,720 highlighted the first 4 bytes of the JPEG file. The byte values 192 00:16:12,720 --> 00:16:18,400 are FF, D8, FF, E0. It looks like yo-ya but that's not a Y or 193 00:16:18,440 --> 00:16:22,620 an O or a Y or an A. It's a different ASCII character. But 194 00:16:22,620 --> 00:16:27,700 these 4 characters denote a JPEG file. Whenever a picture viewer 195 00:16:27,700 --> 00:16:30,460 tries to open a file, it'll make sure that these 4 bytes are 196 00:16:30,460 --> 00:16:35,280 there so it knows you are trying to open up a JPEG file. So file 197 00:16:35,280 --> 00:16:38,600 signature analysis relies on these header bytes to figure out 198 00:16:38,600 --> 00:16:41,980 is this actually a JPEG or is this an executable file or is 199 00:16:41,980 --> 00:16:46,540 this a zip file or a PDF file or any other file format. So the 200 00:16:46,540 --> 00:16:48,420 next, the third anti-forensic technique is to look at the 201 00:16:48,440 --> 00:16:50,520 file signature masking. It's pretty simple. We'll get to the 202 00:16:50,520 --> 00:16:54,480 tougher ones later. File signature masking. Basically you 203 00:16:54,480 --> 00:16:57,960 hollow out the middle of the file, put whatever data you want 204 00:16:57,960 --> 00:17:00,840 in there, maybe it's an encrypted drive of your own or 205 00:17:01,400 --> 00:17:07,060 it's a simple text file, and whenever the file processor goes 206 00:17:07,060 --> 00:17:09,780 over that file, it'll read the first few bytes, it'll see, oh, 207 00:17:09,820 --> 00:17:12,600 this is a JPEG file, and it'll classify it as a JPEG file 208 00:17:12,600 --> 00:17:15,240 without realizing that embedded inside it, you've got a bunch of 209 00:17:16,120 --> 00:17:18,420 text. There's a technique that I'm going to show you in just a 210 00:17:18,440 --> 00:17:20,840 few minutes. You can use the tool in the anti-forensic 211 00:17:20,840 --> 00:17:23,960 framework, the mafia framework called transmogrify. This does 212 00:17:23,960 --> 00:17:27,800 this for you. You can point transmogrify at a file that 213 00:17:27,800 --> 00:17:31,820 you've created and it'll modify the headers of it so that it 214 00:17:31,820 --> 00:17:36,860 looks like any file type that you want. Excuse me. Here's an 215 00:17:36,860 --> 00:17:40,640 example of that. This is a standard notepad window. You can 216 00:17:40,640 --> 00:17:44,260 see the first two characters in notepad are a capital M and a 217 00:17:44,260 --> 00:17:48,260 capital Z. Those two characters, MZ, are the file header for 218 00:17:48,440 --> 00:17:53,560 executable files, EXE files. So the text that's written in that 219 00:17:53,560 --> 00:17:57,420 window is in the file, but it's recognized by a lot of these 220 00:17:57,420 --> 00:18:01,400 forensic tools as an executable. Here's a slide shot of NCASE 221 00:18:01,400 --> 00:18:03,820 doing just that. I don't know how well it's showing up for you 222 00:18:03,820 --> 00:18:07,180 guys, but the red arrow shows that after file signature 223 00:18:07,180 --> 00:18:10,900 analysis, NCASE has identified this text file as an executable, 224 00:18:11,540 --> 00:18:15,720 even though it's clearly not an executable because I just wrote 225 00:18:15,720 --> 00:18:18,420 this in notepad. So it's a damn good example of what you can do 226 00:18:18,440 --> 00:18:20,160 with a file like that. It's pretty damn easy to make one 227 00:18:20,160 --> 00:18:23,420 file look like another. In order to mitigate this, there's a 228 00:18:23,420 --> 00:18:26,300 couple things you can do. One of them is using fuzzy hashing. 229 00:18:26,680 --> 00:18:30,500 Fuzzy hashing is similar to doing a cryptographic hash, but 230 00:18:30,500 --> 00:18:34,920 it's a little bit looser. It can compare different parts of 231 00:18:34,920 --> 00:18:37,980 files to other different parts of files, so you can see how 232 00:18:37,980 --> 00:18:41,520 similar files are rather than are they equal or are they 233 00:18:41,520 --> 00:18:45,960 completely not equal, like a traditional hash. So the chances 234 00:18:45,960 --> 00:18:48,420 are, if your attacker has used a cryptographic hash, you can 235 00:18:48,440 --> 00:18:50,960 use this technique. They have copied another file from their 236 00:18:50,960 --> 00:18:54,520 file system somewhere else, and they've modified that copy, 237 00:18:54,640 --> 00:18:56,960 they've hollowed out the center of it to put their stuff inside. 238 00:18:57,260 --> 00:19:00,580 That means that the header and the footer and a lot of parts of 239 00:19:00,580 --> 00:19:04,120 the file will match the original file that they copied. A simple 240 00:19:04,120 --> 00:19:08,000 question you can ask is why does this file have a 90% match with 241 00:19:08,000 --> 00:19:14,580 notepad.exe or some other file? Another way you can mitigate 242 00:19:14,580 --> 00:19:18,260 this is by analyzing all the recent entries in common 243 00:19:18,440 --> 00:19:25,040 applications. Excuse me again. I've enjoyed DEF CON a lot, so 244 00:19:25,040 --> 00:19:32,540 excuse my coughing. Let's say WordPad. If WordPad is used to 245 00:19:32,540 --> 00:19:35,920 open up a DLL file, that doesn't make sense. WordPad opens up 246 00:19:35,920 --> 00:19:41,880 RTFs and TXTs and docs, so why is the recent list showing a DLL 247 00:19:41,880 --> 00:19:45,920 file as being recently opened? These types of questions would 248 00:19:45,920 --> 00:19:48,340 help lead the investigator to zero in on some of these 249 00:19:48,440 --> 00:19:53,060 files to analyze them in more depth. All right. So that's two 250 00:19:53,560 --> 00:19:56,280 steps of the workflow. We've got four to go. We're now on the 251 00:19:56,280 --> 00:19:59,040 third, separating wheat from the chaff. Again, this is the 252 00:19:59,680 --> 00:20:04,380 process where the data is whittled down to a sizable 253 00:20:04,920 --> 00:20:07,300 volume so that the investigator can only look at a couple of 254 00:20:07,300 --> 00:20:09,820 things. He's not going to look at everything. Some techniques 255 00:20:09,820 --> 00:20:13,420 involve date filtering. All files created on this, within 256 00:20:13,420 --> 00:20:18,080 this date range, or maybe it's by custodian, all files 257 00:20:18,080 --> 00:20:18,420 created within this date range. All files created within this 258 00:20:18,440 --> 00:20:20,620 date range. All files created by this user ID. There's a 259 00:20:20,620 --> 00:20:25,740 variety of other techniques. One of them is using the NSRL, or 260 00:20:25,740 --> 00:20:29,320 the National Software Reference Library. This is a library of 261 00:20:29,320 --> 00:20:32,200 hashes that's published by the National Institute of Standards 262 00:20:32,200 --> 00:20:36,480 and Technology, or NIST. It's a huge database of every single 263 00:20:36,480 --> 00:20:39,700 file that's installed on a machine by commercial 264 00:20:40,560 --> 00:20:44,000 installers. Every file in Microsoft Word, every EXE file, 265 00:20:44,140 --> 00:20:47,780 every DLL file, every help file, every text file, everything, 266 00:20:47,780 --> 00:20:50,380 everything is hashed and these values are stored in this 267 00:20:50,380 --> 00:20:54,220 database so that investigators can use this to see is this 268 00:20:54,220 --> 00:20:57,620 something that's very common that's installed by millions of 269 00:20:57,620 --> 00:21:00,240 people around the world, or is this something that a user has 270 00:21:00,240 --> 00:21:04,120 created on their own. The process is something sometimes 271 00:21:04,120 --> 00:21:08,940 called de-NISTing. Basically the investigator will take this 272 00:21:08,940 --> 00:21:14,480 hash library, apply it to all of your files on your hard drive. 273 00:21:14,620 --> 00:21:17,320 It will suppress them from you so that the only thing he's looking 274 00:21:17,320 --> 00:21:21,680 at are things that don't match the NISTed files. Things that the 275 00:21:21,680 --> 00:21:24,380 user has created, things that the user has modified from the 276 00:21:24,380 --> 00:21:31,700 original. So this next technique is basically using this against 277 00:21:31,700 --> 00:21:35,440 the investigator, NSRL scrubbing. Basically if you were 278 00:21:35,440 --> 00:21:39,340 to modify every single file on your file system to be subtly 279 00:21:39,340 --> 00:21:42,080 different, even just one byte off, if you were to take a 280 00:21:42,080 --> 00:21:45,380 string that's in the file and change it, the hash of that file 281 00:21:45,380 --> 00:21:47,300 will not match anything that's in the NSRL. So if you were to 282 00:21:47,320 --> 00:21:51,780 try to suppress all of these common files, so he's only 283 00:21:51,780 --> 00:21:55,960 looking at your stuff, all of the files for Office and Windows 284 00:21:55,960 --> 00:21:59,220 and everything else will still be there. This is easy for text 285 00:21:59,220 --> 00:22:03,820 files and Word documents, but if you were to try to modify EXEs 286 00:22:03,820 --> 00:22:07,140 or DLLs or other executable files, they will break and they 287 00:22:07,140 --> 00:22:10,020 will not work. That's because inside of these DLLs and 288 00:22:10,020 --> 00:22:14,560 executables, there's a CRC value that matches the contents of the 289 00:22:14,560 --> 00:22:17,020 file, and now that you've changed it, that CRC won't match 290 00:22:17,320 --> 00:22:20,700 anything. So it simply will not run. That's easy to overcome 291 00:22:20,700 --> 00:22:24,960 for a sophisticated attacker, like I'm sure most of you guys at 292 00:22:24,960 --> 00:22:28,580 DEF CON. Recalculate the CRCs, update the CRC value in that 293 00:22:28,580 --> 00:22:32,100 file to match the new contents that you've changed, and now the 294 00:22:32,100 --> 00:22:35,320 program will run just fine. If you're going to do this with 295 00:22:35,320 --> 00:22:40,480 Windows files, like run DLL and stuff like that, you'll have to 296 00:22:40,480 --> 00:22:44,560 turn off data execution prevention, or DEP. This is a 297 00:22:44,560 --> 00:22:47,300 feature in Windows that, that, you know, you don't want to run 298 00:22:47,320 --> 00:22:49,520 anything that makes sure that Windows itself hasn't been 299 00:22:49,520 --> 00:22:52,840 modified. It's designed to stop viruses and malicious code from 300 00:22:52,840 --> 00:22:56,360 running, but this will also stop your modified versions of EXEs 301 00:22:56,360 --> 00:22:59,760 and DLLs from running at all. It's fairly easy to turn off. You 302 00:22:59,760 --> 00:23:02,640 can see in the screen shot here, it's grayed out or disabled. 303 00:23:03,200 --> 00:23:08,700 That's because in the boot INI, I've set the policy level of no 304 00:23:08,700 --> 00:23:12,540 execute to be always off. It's a fairly simple change you can 305 00:23:12,540 --> 00:23:15,800 make in your boot INI file. The next time you boot, DEP will be 306 00:23:15,800 --> 00:23:17,300 off, and Windows will not be able to run it. It's a fairly 307 00:23:17,300 --> 00:23:17,400 simple change. This should be a little more complicated. But 308 00:23:17,400 --> 00:23:17,420 what I would suggest to a front-end browser is not to try 309 00:23:17,420 --> 00:23:21,840 to verify any of the files that it's running. So, your modified 310 00:23:21,840 --> 00:23:26,700 files will work. Wow. We've wasted 28 hours of the 311 00:23:26,700 --> 00:23:30,440 investigator's time, $8,400, and again, I haven't mentioned it in 312 00:23:30,440 --> 00:23:38,440 each of the slides. Deserves another drink. I'm sorry. I 313 00:23:38,440 --> 00:23:41,900 keep ignoring the green text. Okay. So in order to mitigate 314 00:23:41,900 --> 00:23:46,680 this, there's really only one strategy. Rather than adopting a 315 00:23:46,680 --> 00:23:50,360 white list approach, adopt a black list approach. Don't 316 00:23:50,360 --> 00:23:53,180 suppress all the stuff that you don't want to look at, leaving 317 00:23:53,180 --> 00:23:56,780 only the stuff you want to look at in your view. Instead, try to 318 00:23:56,780 --> 00:23:59,520 target the stuff that you do want to look at. You can use 319 00:23:59,520 --> 00:24:05,920 strategies like keyword searching, date filtering, and 320 00:24:06,880 --> 00:24:10,380 file signature analysis, basically anything to zero in on 321 00:24:10,380 --> 00:24:12,920 the files that you do want to look at. It's a slightly 322 00:24:12,920 --> 00:24:20,020 different approach, but it's just as effective. For the next 323 00:24:20,020 --> 00:24:23,980 technique, I'm going to talk a little bit about histograms. I 324 00:24:23,980 --> 00:24:28,100 had meant to get a photograph of a histogram on the screen here, 325 00:24:28,200 --> 00:24:31,760 but unfortunately I got to drinking a little bit too much. 326 00:24:34,080 --> 00:24:40,340 A histogram, I'm sorry? I guess. It was fortunate for me. It may 327 00:24:40,340 --> 00:24:42,560 be a little bit unfortunate for you guys, but if any of you 328 00:24:42,560 --> 00:24:42,900 remember, this is the first time I've ever done this. I 329 00:24:42,920 --> 00:24:46,680 remember grade 9 or grade 10, or I guess for you Americans, 9th 330 00:24:46,680 --> 00:24:50,160 grade or 10th grade, you'll remember a histogram, and it's 331 00:24:50,160 --> 00:24:53,580 basically a bar graph showing how many occurrences of 332 00:24:53,580 --> 00:24:56,900 something in that date range have occurred. You'll see 333 00:24:56,900 --> 00:25:00,900 something like September 1st is a very short bar, September 2nd, 334 00:25:00,900 --> 00:25:03,840 very tall bar because there's 10 things that occurred on that 335 00:25:03,840 --> 00:25:06,380 day, then September 3rd will be another short bar because only 336 00:25:06,380 --> 00:25:09,520 two things occurred on that day. It's a bar graph by day or by 337 00:25:09,520 --> 00:25:12,900 month or by some kind of date range that will allow you to 338 00:25:12,900 --> 00:25:17,820 see which specific days or which specific time spans have had a 339 00:25:17,820 --> 00:25:23,380 lot of stuff happening. This is useful when reviewing VPN logs, 340 00:25:23,600 --> 00:25:26,000 how many times the user has logged in. If you see a big 341 00:25:26,000 --> 00:25:28,640 spike on a certain day, you know you should zero in on that day. 342 00:25:29,300 --> 00:25:32,620 Firewall alerts or even file created times. How many files 343 00:25:32,620 --> 00:25:36,560 were created on this day? That could be indicative that an 344 00:25:36,560 --> 00:25:39,560 entire folder of a thousand files have been copied on a 345 00:25:39,560 --> 00:25:41,080 specific day because they were created. 346 00:25:43,300 --> 00:25:47,480 The next technique is, again, a little bit old hat. I promise 347 00:25:47,480 --> 00:25:49,820 we're going to get to some of the more technical ones later on, 348 00:25:49,900 --> 00:25:54,100 but scrambling MACE times. MACE times, CE, that stands for 349 00:25:54,100 --> 00:25:58,720 modified, accessed, created, and entry modified. Each of these 350 00:25:58,720 --> 00:26:02,500 four time stamps exist on an NTFS volume for every single 351 00:26:02,500 --> 00:26:08,700 file that's there. And if you use a tool like Timestomp, this 352 00:26:08,700 --> 00:26:11,140 is another tool in the Metasploit anti-forensic 353 00:26:11,140 --> 00:26:12,200 framework, the mafia framework. 354 00:26:13,540 --> 00:26:17,920 It will allow you to set the time value on any file for any of 355 00:26:17,920 --> 00:26:23,180 these four values. You can scrub your entire hard drive of every 356 00:26:23,180 --> 00:26:26,120 single file time by modifying every single modified, created, 357 00:26:26,220 --> 00:26:32,980 accessed, and entry date so that the histogram will not show 358 00:26:32,980 --> 00:26:37,180 anything. The histogram will be essentially uniform because all 359 00:26:37,180 --> 00:26:42,560 files will have randomized values. In order to ‑‑ oh, 360 00:26:42,900 --> 00:26:47,240 sorry. Two other things you can add on to this. One of them is 361 00:26:47,240 --> 00:26:51,820 to also randomize the BIOS time. If you have a system service or a 362 00:26:51,820 --> 00:26:54,760 daemon running in the background, it can set the BIOS 363 00:26:54,760 --> 00:26:57,280 time every ten minutes, every half an hour, or every random 364 00:26:57,280 --> 00:27:00,620 interval so that the current time of the system is 365 00:27:00,620 --> 00:27:05,040 completely different than the real time. And also you can 366 00:27:05,040 --> 00:27:09,400 disable the last access update in the Windows registry. This 367 00:27:09,400 --> 00:27:12,880 will prevent Windows from recording the data that you're 368 00:27:12,900 --> 00:27:15,120 using or the time that the file is accessed whenever you open it 369 00:27:15,120 --> 00:27:19,100 or whenever you read it. You can disable the last access time in 370 00:27:19,100 --> 00:27:22,500 two ways. One of them is a registry hack. If you go to this 371 00:27:22,500 --> 00:27:28,700 key and you set the value of NTFS disable last access update to 372 00:27:28,700 --> 00:27:32,800 one, that will prevent Windows from modifying these access 373 00:27:32,800 --> 00:27:36,880 times. And if you ‑‑ the other way is if you open the 374 00:27:36,880 --> 00:27:39,620 command prompt as an administrator and you run this 375 00:27:39,620 --> 00:27:42,880 command, FSU till behavior set disable last access, it will 376 00:27:43,860 --> 00:27:47,300 do the exact same thing. Windows will no longer record the last 377 00:27:47,300 --> 00:27:50,860 time that you opened the file or the last time you touched it in 378 00:27:50,860 --> 00:27:55,560 the explorer. To mitigate against an attacker that's 379 00:27:55,560 --> 00:28:00,260 doing this ‑‑ wow, hold on. This will take 16 hours of an 380 00:28:00,260 --> 00:28:03,340 investigator's time because he'll need to figure out what's 381 00:28:03,340 --> 00:28:08,980 going on, and this will cost $4,800. Nice. I remembered it. To 382 00:28:08,980 --> 00:28:12,700 mitigate this, you can ‑‑ first of all, you should ignore 383 00:28:12,700 --> 00:28:12,880 all of the files that are in the explorer. If you have an 384 00:28:12,900 --> 00:28:13,820 attacker, you should ignore all the times that you see there. 385 00:28:13,940 --> 00:28:16,880 You know that they're all scrambled by the attacker, so 386 00:28:16,880 --> 00:28:20,700 you know you shouldn't read into them. Instead, look for log 387 00:28:20,700 --> 00:28:25,020 files where time values are stored as a strings or as text. 388 00:28:25,360 --> 00:28:29,620 These log files are written sequentially. Every time an 389 00:28:29,620 --> 00:28:32,340 event occurs, a log entry is put in with the current date of the 390 00:28:32,340 --> 00:28:36,620 system. This will allow you to see a set of times that are 391 00:28:36,620 --> 00:28:40,660 roughly similar. And if you have this ‑‑ if the attacker has 392 00:28:40,660 --> 00:28:42,880 this system service running constantly, it will allow you to 393 00:28:42,880 --> 00:28:47,280 change the bias time. A sequential log will show which 394 00:28:48,100 --> 00:28:52,180 time values came before which. This slide here explains it in a 395 00:28:52,180 --> 00:28:55,980 little bit more detail. You can see that the first block of time 396 00:28:55,980 --> 00:29:00,420 stamps, it's a year of 2026. And the second block, it's 397 00:29:00,420 --> 00:29:03,440 different. And the third block is different still. You can now 398 00:29:03,440 --> 00:29:08,960 infer that all the values of 2026 have occurred sequentially. 399 00:29:09,140 --> 00:29:12,860 And right after that, the bias time was changed to 1983. So 400 00:29:16,500 --> 00:29:20,300 now that you know which block of time comes before and after 401 00:29:20,300 --> 00:29:23,300 which other block of time, you can use these time values that 402 00:29:23,300 --> 00:29:27,220 you've learned from the sequential log file to scan for 403 00:29:27,220 --> 00:29:31,640 other files on the system that have similar dates. It will 404 00:29:32,080 --> 00:29:36,460 show you ‑‑ it will give you a rough timeline of what's 405 00:29:36,460 --> 00:29:39,860 happened. You're still wasting a lot of time doing this. So in 406 00:29:39,860 --> 00:29:42,840 essence, the attacker is still winning. But it will at least 407 00:29:42,860 --> 00:29:45,440 allow the investigator to get through it and figure out what's 408 00:29:45,440 --> 00:29:50,500 going on. Also, I should mention that the attacker doesn't need 409 00:29:50,500 --> 00:29:53,940 to change the time stamps on every single file. He can only do 410 00:29:53,940 --> 00:29:57,020 it for one file. And if he does this, I'm sorry, investigators, 411 00:29:57,060 --> 00:30:00,220 you're a little bit screwed. Whenever a report is written by 412 00:30:00,220 --> 00:30:02,920 an investigator, he can't say that this occurred on this time. 413 00:30:03,220 --> 00:30:07,080 Reason being, as we all know from time stomp, you can change 414 00:30:07,080 --> 00:30:10,760 the time values on any file. So we don't know necessarily that 415 00:30:10,760 --> 00:30:12,840 this really did occur at this time. Or that this really did 416 00:30:12,860 --> 00:30:14,960 occur at this time. So the attacker has updated the time on 417 00:30:14,960 --> 00:30:18,300 that file to make it appear like it occurred on that time. The 418 00:30:18,300 --> 00:30:21,620 best we can do as investigators in our reports is write that the 419 00:30:21,620 --> 00:30:26,740 time in this log is consistent with the MAC times in this file 420 00:30:26,740 --> 00:30:30,400 and it's also consistent with that other log file. Consistency 421 00:30:30,400 --> 00:30:34,240 is the key. So if an attacker updates the time values to make 422 00:30:34,240 --> 00:30:37,600 it consistent, as an investigator, you really have no 423 00:30:37,600 --> 00:30:42,800 clue that he's done that or not. All right. We're ‑‑ 424 00:30:42,860 --> 00:30:47,000 we're on step four of six now of this typical workflow. We're 425 00:30:47,000 --> 00:30:51,160 going to look at techniques that can confound the analyzing data 426 00:30:51,820 --> 00:30:56,440 portion. So far we've racked up 44 hours of the investigator's 427 00:30:56,440 --> 00:31:01,300 time. That's $13,200. Already we're probably at the point 428 00:31:01,300 --> 00:31:05,940 where somebody who's running the budget may say maybe we should 429 00:31:05,940 --> 00:31:08,680 settle instead of continuing with this investigation. But 430 00:31:09,260 --> 00:31:12,780 we're going to move on. Now, confounding the file analysis, 431 00:31:12,860 --> 00:31:17,500 when you're doing data analysis, sure, there's a lot of 432 00:31:17,500 --> 00:31:21,660 forensic suites like NKs or FTK that allow you to see inside the 433 00:31:21,660 --> 00:31:25,240 tool what the file is like. But that doesn't show you the whole 434 00:31:25,240 --> 00:31:28,280 story. A lot of times you'll need to export the file from 435 00:31:28,280 --> 00:31:31,960 these tools to your own analysis machine and run it with the 436 00:31:31,960 --> 00:31:35,320 native application. Open up the doc file in Word itself or open 437 00:31:35,320 --> 00:31:40,120 up the PDF file in Acrobat itself. Now, when you do this, 438 00:31:40,220 --> 00:31:42,840 there can be some problems. Sure, there's virus in the 439 00:31:42,860 --> 00:31:45,480 files and things like that. But putting those obvious ones 440 00:31:45,480 --> 00:31:49,100 aside, one of them is restricted file names. A lot of people 441 00:31:49,100 --> 00:31:52,240 don't know this, but Windows 7 still has a lot of holdovers 442 00:31:52,240 --> 00:31:58,460 from the old DOS days. File names like CON, PRN, COM1, COM2, 443 00:31:59,020 --> 00:32:02,880 LPT1, I'm sure the older members of the audience will 444 00:32:02,880 --> 00:32:06,440 remember these as system devices for printers and modems and 445 00:32:06,440 --> 00:32:09,720 other things. If you attempt to name a file with one of these 446 00:32:09,720 --> 00:32:12,740 restricted file names, Windows will bark at you and say, no, 447 00:32:12,860 --> 00:32:17,320 you can't do that. Now, you can still hack the file system to 448 00:32:17,320 --> 00:32:20,440 have one of these files named with one of these names. And if 449 00:32:20,440 --> 00:32:23,380 you do that, if you try to read the file, Windows again will 450 00:32:23,380 --> 00:32:26,560 bark at you, no, you can't do that. It will give you error 451 00:32:26,560 --> 00:32:29,940 messages because it's instead trying to access a system device 452 00:32:29,940 --> 00:32:35,120 rather than that file itself. So as a suspect, use these file 453 00:32:35,120 --> 00:32:38,900 names anywhere that you can. Now, I estimate this is only 454 00:32:38,900 --> 00:32:41,820 going to take about one hour of the investigator's time because 455 00:32:42,860 --> 00:32:45,420 he realizes, oh, well, it's probably just the file name. He 456 00:32:45,420 --> 00:32:49,360 could change it or export it with a different name. It's 457 00:32:49,360 --> 00:32:52,380 really not going to cause too much problems for the 458 00:32:52,380 --> 00:32:58,620 investigator, but it will still hinder him a little bit. In 459 00:32:58,620 --> 00:33:01,020 order to create some of these restricted file names on an 460 00:33:01,020 --> 00:33:04,540 NTFS volume, there's three techniques you can use. One is 461 00:33:04,540 --> 00:33:08,320 to access it using UNC paths. If you go to double backslash 462 00:33:08,320 --> 00:33:12,660 your computer name slash C$ to access your C drive, you can 463 00:33:12,860 --> 00:33:16,580 navigate down to the folder and rename the file there. Windows 464 00:33:16,580 --> 00:33:20,240 will let you do this. Another way is to do it programmatically if 465 00:33:20,240 --> 00:33:23,740 you're a programmer. In the kernel 32 lib, there's a function 466 00:33:23,740 --> 00:33:26,720 called move file. This allows you to move the file 467 00:33:26,720 --> 00:33:29,880 programmatically rather than relying on Windows itself. And 468 00:33:29,880 --> 00:33:34,080 the third way is to basically boot it off of Linux. As long as 469 00:33:34,080 --> 00:33:37,880 your Linux distribution has support for NTFS, you'll be able 470 00:33:37,880 --> 00:33:42,200 to rename the file no problem and now you've got a file with one of 471 00:33:42,200 --> 00:33:42,840 these restricted names. And that's it. Thank you. 472 00:33:44,200 --> 00:33:48,520 To mitigate against this, as an investigator, never use their 473 00:33:48,520 --> 00:33:53,180 file names. You own your own analysis machine. You are the 474 00:33:53,180 --> 00:33:56,020 one who should dictate which file names you get. If you're 475 00:33:56,020 --> 00:33:58,980 exporting something from a forensic image, export it using 476 00:33:58,980 --> 00:34:02,040 a name that you choose, maybe 1.JPEG or something like that. 477 00:34:02,500 --> 00:34:06,560 FTK4 has a feature that allows you to automatically name a 478 00:34:06,560 --> 00:34:10,400 file, something that will always be guaranteed to be okay. I 479 00:34:10,400 --> 00:34:11,160 recommend using this. 480 00:34:13,100 --> 00:34:18,280 The next technique is kind of a fun one. I did some research in 481 00:34:18,280 --> 00:34:21,860 this and I really like this technique. Basically using 482 00:34:21,860 --> 00:34:25,160 circular references. If you're a Linux user or a Unix user, 483 00:34:25,260 --> 00:34:28,420 you're familiar with sim links. But if you're a Windows user, 484 00:34:28,600 --> 00:34:32,920 this may be a little bit foreign to you. Folder names typically 485 00:34:32,920 --> 00:34:38,340 have a limit of 255 characters. You can't have a path that is 486 00:34:38,340 --> 00:34:41,720 longer than that. You can use one of two features in the 487 00:34:41,720 --> 00:34:42,840 Windows operating systems. One of the features is that you can 488 00:34:42,860 --> 00:34:44,960 link to a folder. One is called junctions, which is 489 00:34:44,960 --> 00:34:47,500 introduced in Windows 2000 and one is called symbolic links, 490 00:34:47,620 --> 00:34:50,820 which is introduced in Windows XP. Either of these will allow 491 00:34:50,820 --> 00:34:55,940 you to link a folder to another folder so that as you click on 492 00:34:55,940 --> 00:34:57,820 that folder, you're really jumping across the file system 493 00:34:57,820 --> 00:35:01,980 to somewhere else. Now, if you use this feature to link to a 494 00:35:01,980 --> 00:35:04,980 parent, you've now created a circular reference and you go 495 00:35:04,980 --> 00:35:07,620 parent to child to parent to child to parent to child. This 496 00:35:07,620 --> 00:35:10,260 will break anything that recurses through a file system. 497 00:35:12,860 --> 00:35:16,140 You can see that the attacker creates some of these sim links 498 00:35:16,140 --> 00:35:19,560 and junctions so that if the investigator tries to scan 499 00:35:19,560 --> 00:35:22,220 through all these files, their system gets bogged up because 500 00:35:22,220 --> 00:35:24,500 it's now going recursively. Eventually one of two things 501 00:35:24,500 --> 00:35:28,000 will happen. Either it will run out of memory because of a 502 00:35:28,560 --> 00:35:33,080 recursion error or it will get a path too long error message 503 00:35:33,080 --> 00:35:36,980 because 255 is the maximum length. Once you've got too many 504 00:35:36,980 --> 00:35:38,780 parents and childs, parents and childs, you're going to run 505 00:35:38,780 --> 00:35:42,560 over that length. This will take about four hours of the 506 00:35:43,220 --> 00:35:45,280 investigator's time, I estimate, which equates to about 507 00:35:45,280 --> 00:35:49,200 $1,200. Now, again, the investigator can mitigate this 508 00:35:49,200 --> 00:35:52,040 pretty easily, but it's going to take some of his time to 509 00:35:52,040 --> 00:35:56,440 figure out why his processing engine is not stopping. Why is 510 00:35:56,440 --> 00:36:00,740 this going forever? And why is, you know, three megabytes worth 511 00:36:00,740 --> 00:36:03,500 of files taking an hour to export? What the hell is going 512 00:36:03,500 --> 00:36:10,840 on? This technique will definitely hinder anything that 513 00:36:11,400 --> 00:36:12,840 recurses through the file system, but it's going to take 514 00:36:12,860 --> 00:36:13,180 some time to figure out why the file system is not stopping. 515 00:36:13,180 --> 00:36:16,120 is not stopping, but it won't touch anything that a forensic 516 00:36:16,120 --> 00:36:20,880 image was used. If you create a forensic image of the drive 517 00:36:20,880 --> 00:36:24,640 and you're analyzing an N case or FDK, these will recognize that 518 00:36:24,640 --> 00:36:28,180 it's a SIM link, they won't bat an eye, and there's no problem 519 00:36:28,180 --> 00:36:32,000 for the investigator at all. This means that in enterprise 520 00:36:33,460 --> 00:36:36,340 areas, if the administrator connects to a machine remotely 521 00:36:36,340 --> 00:36:39,040 and is scanning for a specific file name or searching through 522 00:36:39,040 --> 00:36:42,840 the files, live access to the system will definitely be 523 00:36:42,840 --> 00:36:47,360 hindered by this. But again, forensic images won't. So to 524 00:36:47,360 --> 00:36:50,600 mitigate this is fairly simple. Always work from an image and be 525 00:36:50,600 --> 00:36:53,580 mindful of this attack, simply knowing that it's possible to 526 00:36:53,580 --> 00:36:56,780 create these circular references. When you run into something that's 527 00:36:56,780 --> 00:36:58,800 taking a lot longer than it really should, you'll be able to 528 00:36:58,800 --> 00:37:05,100 recognize it fairly easily. Next technique is breaking log files. 529 00:37:05,360 --> 00:37:09,420 As I mentioned earlier, investigators process logs to 530 00:37:09,420 --> 00:37:12,020 figure out time lines and for a variety of other reasons. 531 00:37:12,340 --> 00:37:12,820 This is something that we're going to talk about in a 532 00:37:12,840 --> 00:37:16,440 little bit. If you use weird ASCII characters in these logs, 533 00:37:16,580 --> 00:37:19,300 you can sometimes break the parser, depending on the program 534 00:37:19,300 --> 00:37:22,340 that's being used to analyze these logs. Another thing you 535 00:37:22,340 --> 00:37:26,080 can do is to add delimiters within the text messages of the 536 00:37:26,080 --> 00:37:30,560 error messages. If you can customize some of these event 537 00:37:30,560 --> 00:37:33,840 messages, you can add commas, you can add quotes, you can add 538 00:37:33,840 --> 00:37:38,280 pipes, and parsing will be very difficult. If the parser is 539 00:37:38,280 --> 00:37:42,240 trying to parse each record by a comma, it won't work. Or any of 540 00:37:42,240 --> 00:37:42,820 these other things, it won't work. If you're trying to 541 00:37:42,840 --> 00:37:45,820 parse each of your delimiters. As a bonus, if you're using 542 00:37:45,820 --> 00:37:48,520 Windows event logs and you're parsing Windows event logs, if 543 00:37:48,520 --> 00:37:54,040 you as an attacker can add a Windows event record with the 544 00:37:54,040 --> 00:37:57,960 text ELFL right in the middle of the record, these four bytes 545 00:37:57,960 --> 00:38:04,920 are the they denote the start of an event record. Whenever a 546 00:38:04,920 --> 00:38:07,100 parser goes through each of the records, it will look for these 547 00:38:07,100 --> 00:38:09,140 four bytes and it knows, okay, this is the beginning of a 548 00:38:09,140 --> 00:38:12,740 record. If you start throwing these start record bytes right 549 00:38:12,740 --> 00:38:16,240 in the middle of a record, you could break some parsers into 550 00:38:16,240 --> 00:38:18,800 thinking that a new record has started when it's not even done 551 00:38:19,480 --> 00:38:22,920 parsing the first record. I estimate this will take about six 552 00:38:22,920 --> 00:38:27,340 hours of the investigator's time or $1800. To mitigate against 553 00:38:27,340 --> 00:38:31,140 this, ask yourself, do you even need that log? Maybe you can 554 00:38:31,700 --> 00:38:35,300 figure out a way to prove your case without this log file. If 555 00:38:35,300 --> 00:38:37,480 you do need the log, do you need the whole log or do you only 556 00:38:37,480 --> 00:38:40,660 need a couple of records? If you could zero in with manual analysis 557 00:38:40,660 --> 00:38:44,120 of the log file and copy paste just the few records that you need, 558 00:38:44,200 --> 00:38:46,480 you don't need to worry about parsing it programmatically at 559 00:38:46,480 --> 00:39:03,260 all. Excuse me. Again, priorities. Okay. At worst, the 560 00:39:03,260 --> 00:39:06,320 investigator will need to write a quick script or a quick program to 561 00:39:06,320 --> 00:39:10,640 go through everything and account for all the weird characters in 562 00:39:10,660 --> 00:39:15,880 the background like the attacker has thrown in. But there, the 563 00:39:15,880 --> 00:39:22,260 attacker is still winning. The next one, whoops, sorry. The next 564 00:39:22,260 --> 00:39:24,720 technique I didn't necessarily want to throw in, but I realized every 565 00:39:24,720 --> 00:39:28,620 time I've run into this thing, it has caused so much problems, it 566 00:39:28,620 --> 00:39:32,200 has added so much time to the investigation. This technique is 567 00:39:32,200 --> 00:39:35,380 dead simple. If you are writing e mail, use lotus notes. 568 00:39:37,080 --> 00:39:40,260 Lotus notes have got to be one of the worst programs I've ever used, 569 00:39:40,420 --> 00:39:40,640 and if you get a lot more than a hundred times as much as a hundred 570 00:39:40,660 --> 00:39:45,580 investigator, you will agree Lotus Notes will add so many hours to your investigation. They 571 00:39:45,580 --> 00:39:54,080 use NSF files instead of PST files. And these NSF files can be encrypted with an ID file that 572 00:39:54,080 --> 00:39:59,340 has the user's ID and an encryption key in it that's locked with a password. It's such a 573 00:39:59,340 --> 00:40:03,200 convoluted system. Sure, it may be a little bit more secure than PSTs, but you're going to 574 00:40:03,200 --> 00:40:08,820 add hours to your investigation. There are a lot of tools that can convert an NSF into a PST 575 00:40:08,820 --> 00:40:13,360 and convert every one of the e-mails inside, but every one of these has a problem. The main 576 00:40:13,360 --> 00:40:19,160 reason is all these tools are, or the majority of these tools, I should say, are built on IBM's 577 00:40:19,160 --> 00:40:28,480 own Lotus Notes API. Lotus Notes' API, sure, it works, but it's kind of convoluted. These 578 00:40:28,480 --> 00:40:33,940 third-party developers, when they're trying to use this API, they don't necessarily do it 579 00:40:33,940 --> 00:40:38,780 properly. This password dialogue that you see here comes up every time you try to 580 00:40:38,780 --> 00:40:44,360 open up an NSF that's encrypted. It always comes up in the interactive context so the e-discovery 581 00:40:44,360 --> 00:40:49,220 operator or the investigator needs to type in the password manually for every single access of 582 00:40:49,220 --> 00:40:55,480 this NSF. It is quite a pain in the ass. I like the title of this slide, mitigating Lotus 583 00:40:55,480 --> 00:41:02,220 Notes. Train yourself on Lotus Notes itself. Don't try to convert it to something else. Just use 584 00:41:02,220 --> 00:41:08,480 Lotus Notes as it is. It has a search feature so you can find the specific e-mails you're looking 585 00:41:08,480 --> 00:41:12,780 for. When you find it, print it to PDF, attach it to your report. You don't need to worry about 586 00:41:12,780 --> 00:41:17,680 any conversion. You'll save so much time by using Lotus Notes itself rather than trying to 587 00:41:17,680 --> 00:41:21,680 convert it into something else. I don't know why investigators don't do this to begin with. 588 00:41:23,540 --> 00:41:30,280 Two more stages and then we're done. Reporting on your findings. I didn't think there were any 589 00:41:30,280 --> 00:41:35,700 hacks you could do on writing a report. But then I realized, well, there sort of is. And that 590 00:41:35,700 --> 00:41:43,380 is hash collisions. When an investigator writes a report and he puts a file that is notable, he'll 591 00:41:43,380 --> 00:41:51,140 put down the hash value of that file. Well, if you have a good file and a bad file, which both 592 00:41:51,140 --> 00:41:57,520 calculate out to the same hash value, it could confound some of the lesser known, some of the 593 00:41:57,520 --> 00:42:02,800 less technical people that are reading the report. Also, if you're searching by a hash value, 594 00:42:03,000 --> 00:42:05,680 you're not only going to find the files that you're looking for, you're going to find the 595 00:42:05,700 --> 00:42:11,720 other files that you weren't looking for who happen to have the same hash value. This will 596 00:42:11,720 --> 00:42:17,760 probably add about two hours to the investigation. Now, this will only really be useful in a select 597 00:42:17,760 --> 00:42:25,640 few cases. Let's say an employee took data from company A as he quit his job and he took it to 598 00:42:25,640 --> 00:42:30,560 company B and he put it on their file server. An investigator may search for those files by the 599 00:42:30,560 --> 00:42:35,220 hash value on company B's file server and if he finds them, well, hey, there they are. I got 600 00:42:35,220 --> 00:42:35,380 them. 601 00:42:36,400 --> 00:42:40,280 But if there's other files that also come up in that search, he'll have to include them in his 602 00:42:40,280 --> 00:42:46,760 report or he'll have to omit them. Either way, the defense can say, well, why did you not include 603 00:42:46,760 --> 00:42:52,620 them in your report? Or if you did include them, why are two files hashing to the same value? 604 00:42:52,680 --> 00:42:57,000 I thought you said it was a unique fingerprint. You'll have to explain to a judge or to an arbiter 605 00:42:57,000 --> 00:43:04,040 or to some non-technical lawyer what a hash value is, what a hash collision is and all the technical 606 00:43:04,460 --> 00:43:05,140 stuff around that. 607 00:43:05,140 --> 00:43:11,460 And this confusion in a non-technical person may add just the right amount of reasonable doubt so 608 00:43:11,460 --> 00:43:18,340 that they acquit or that they let the guy off scot-free. So hash collisions really do work. 609 00:43:18,820 --> 00:43:24,900 Now, a lot of work has been done on this already. Mark Stevens wrote a thesis on this in 2008 610 00:43:24,900 --> 00:43:33,860 which sort of kick-started the whole MD5 is broken thing. I recommend you do a Google search if 611 00:43:33,860 --> 00:43:35,120 you're interested in creating your own hash collision. If you're interested in creating your own hash collision, 612 00:43:35,120 --> 00:43:35,800 find out what you're doing. And in fact, I've done some work on this, 613 00:43:35,800 --> 00:43:37,800 but for me it's a legal thing to do. And if you're using files that have similar hashes, because 614 00:43:37,800 --> 00:43:42,240 there are definitely tools out there that can do this, to mitigate this is again fairly simple, 615 00:43:42,380 --> 00:43:47,860 don't use a broken hash algorithm. It's been broken since 2008, people. There's no need to use 616 00:43:47,860 --> 00:43:54,600 one of these broken algorithms. Use Shaw 456 or Whirlpool or something else that doesn't have any 617 00:43:54,600 --> 00:44:01,240 known collisions. Also double-check your work. If you found something by hash, open it up, don't just include it in your report 618 00:44:01,240 --> 00:44:05,100 because, boy, would your face be red if you included it in a file that was broken. So the main rule is don't use a broken hash algorithm. 619 00:44:05,100 --> 00:44:10,800 wasn't actually the file you're looking for. The final technique in this talk is using a dummy 620 00:44:10,800 --> 00:44:17,120 hard drive. A dummy hard drive is essentially a hard drive that's not used by the operator of 621 00:44:17,120 --> 00:44:23,060 the machine. If an attacker has a hard drive that's in the machine but he doesn't use it and 622 00:44:23,060 --> 00:44:29,020 he instead boots off of a USB key, he can use the machine without touching that hard drive. 623 00:44:29,020 --> 00:44:36,500 He can also mimic regular usage of that hard drive by making rights to the hard drive from a 624 00:44:36,940 --> 00:44:43,600 daemon or system service. This daemon or system service can retrieve news articles, it can sync 625 00:44:43,600 --> 00:44:50,820 e-mail with an account that is guaranteed to have legitimate e-mail. Basically mimic regular 626 00:44:50,820 --> 00:44:54,640 usage of the hard drive. As an investigator, when you pop the hard drive out of the machine and 627 00:44:54,640 --> 00:44:59,000 you start analyzing it, oh, yeah, look, it was used recently. This is buddy guy's hard drive. 628 00:44:59,000 --> 00:45:04,420 I got his machine. You'll be clueless to the fact that all the real data is stored either on 629 00:45:04,420 --> 00:45:09,160 that USB key or stored in the cloud somewhere or on some remote server where he was accessing 630 00:45:09,160 --> 00:45:16,040 everything remotely. To mitigate this, again, is fairly simple. Always look for USB keys. They 631 00:45:16,040 --> 00:45:22,560 can be super small these days. Check the back of the machine in all the USB ports. Also check the 632 00:45:22,560 --> 00:45:28,080 motherboard. There are risers on the motherboard where you can plug in a USB port that goes to the 633 00:45:28,080 --> 00:45:28,980 front of your case. If you plug in a USB port that goes to the front of your case, you can 634 00:45:29,000 --> 00:45:31,940 plug in a USB port that goes to the back of your case. So what if the guy took those four pins on 635 00:45:31,940 --> 00:45:36,280 this USB key that you see here on the screen and he soldered them right onto the motherboard so 636 00:45:36,280 --> 00:45:41,460 there's a small little chip on the motherboard? To an untrained investigator, he'll have no idea 637 00:45:41,460 --> 00:45:46,480 that there's a whole other device right there. If you're booting from a Linux live CD, you may 638 00:45:46,480 --> 00:45:52,000 see the device come up in the device listing. But if you just pop the hard drive out to plug 639 00:45:52,000 --> 00:45:57,800 into his forensic duplicator, he'll have no idea that there's a whole other device there. Also, 640 00:45:57,800 --> 00:46:05,520 to detect network traffic, use Wireshark or something to see which IP addresses that machine is 641 00:46:05,520 --> 00:46:11,980 talking to. That may disclose the location of his remote server or the cloud that he's storing all 642 00:46:11,980 --> 00:46:19,100 of his real data on. Now for the final stage of the workflow, archiving the data for the future. 643 00:46:19,260 --> 00:46:26,140 I mentioned earlier that investigators always keep the data that they've worked with just in case the 644 00:46:26,140 --> 00:46:32,160 case comes back, maybe somebody's challenging the results of the original decision, things like 645 00:46:32,160 --> 00:46:38,200 that. You'll need to keep the data for sure. This technique is the same as the first technique. 646 00:46:38,420 --> 00:46:44,720 Data saturation. The more data that the investigator needs to keep, the more data, the more 647 00:46:44,720 --> 00:46:50,160 money he'll need to spend. I estimate that this is going to cost about $20 per month per hard 648 00:46:50,160 --> 00:46:56,120 drive. So if you've got, you know, five hard drives worth of data, that's a hell of a lot of 649 00:46:56,140 --> 00:47:05,780 money. I'm too drunk to even calculate that right now. So we've come full circle. Keep as much 650 00:47:05,780 --> 00:47:15,400 data as you can, and you'll make the cost go up. We've taken up roughly 63 hours. I didn't update 651 00:47:15,400 --> 00:47:24,740 that slide. That deserves a drink. We've taken up 63 hours of an investigator's time. That's more 652 00:47:24,740 --> 00:47:26,120 than eight work days. We've taken up more than a quarter of an hour of work. We've taken up more 653 00:47:26,120 --> 00:47:28,620 than a half hour of online�al depends if it is without over time. Sure, maybe they'll do Over 654 00:47:28,620 --> 00:47:32,100 Time, but you're paying time and a half and you are costing even more money on the investigation. 655 00:47:32,620 --> 00:47:39,640 All of this extra time wasn't spent analyzing the data or looking at the stuff to see if the guy 656 00:47:39,640 --> 00:47:45,040 did it or not. All of this stuff, time was spent on menial tasks. Things like copying files, 657 00:47:45,900 --> 00:47:53,200 trying to image drives and reading email. These things should not take a lot of time. The 658 00:47:53,200 --> 00:47:56,100 investigator still has to do all of this, his regular work. Yeah. We appreciate you. Not 659 00:47:56,120 --> 00:48:01,780 this will increase the likelihood that the opposing council will decide to settle or your 660 00:48:01,780 --> 00:48:05,540 client will say, you know what, forget the investigation. Let's not investigate anymore 661 00:48:05,540 --> 00:48:10,820 because this is costing a hell of a lot more than we budgeted for this. So just stop it 662 00:48:10,820 --> 00:48:19,680 right now. And that's my talk. If you have run into these problems or any problems in your 663 00:48:19,680 --> 00:48:23,360 investigations, I would love to hear from you in the Q&A room. I'll be in the track one room. 664 00:48:23,360 --> 00:48:27,200 How did you deal with it? I would love to hear about it, or if you have any questions about 665 00:48:27,200 --> 00:48:34,740 investigations in general, I'll be there as long as people are there. And thanks for letting me 666 00:48:34,740 --> 00:48:45,280 speak. The slides on your CD are really outdated. I submitted them maybe three weeks ago and 667 00:48:45,280 --> 00:48:50,960 I've updated this talk a lot since then. So go to this website. I'll be uploading it later today. 668 00:48:51,100 --> 00:48:53,340 If you try to go to it now, it won't be there. But if you watch my other videos, you'll have 669 00:48:53,360 --> 00:48:58,820 but Perklin.ca, that's my name, slash Tildi DEF CON 20 slash 670 00:48:58,820 --> 00:49:01,680 Perklin underscore anti forensics. Copy this down. It 671 00:49:01,680 --> 00:49:03,840 will be up for the next few minutes. You can get the updated 672 00:49:03,840 --> 00:49:04,420 slides there.