1 00:00:00,000 --> 00:00:03,200 Welcome to this presentation on time-stopping, which is going to be dubbed, 2 00:00:03,300 --> 00:00:04,540 Whose Time Is It Anyway? 3 00:00:06,280 --> 00:00:10,100 For those of us who are visiting from across the pond, please allow me to translate. 4 00:00:10,240 --> 00:00:13,680 This is the presentation on time-stopping called Whose Time Is It Anyway? 5 00:00:14,240 --> 00:00:16,840 It doesn't make the presentation any better to speak like this. 6 00:00:16,980 --> 00:00:20,820 It just makes you want to drink warm amounts of beer and do funny things to Kate Middleton. 7 00:00:22,240 --> 00:00:24,700 So, let's talk about time-stopping for a few minutes. 8 00:00:25,600 --> 00:00:28,480 Time-stopping is a critical thing for forensic analysts. 9 00:00:28,480 --> 00:00:32,360 Because forensic analysts love building timelines. It's great. 10 00:00:32,880 --> 00:00:39,040 They can figure out what happened on the computer, and they can reconstruct the events with a certain degree of accuracy. 11 00:00:39,520 --> 00:00:40,440 And that's nice. 12 00:00:42,000 --> 00:00:46,700 And in order to hide that, some unscrupulous people, as they could be called, 13 00:00:47,220 --> 00:00:50,860 used to change the certain time values, and they would go in and change the clock on the system. 14 00:00:51,100 --> 00:00:53,140 But doing that has a certain amount of problems. 15 00:00:53,320 --> 00:00:57,880 First, you need to have access to the system clock, or you have to have rights. 16 00:00:58,000 --> 00:00:58,400 And the second, 17 00:00:58,480 --> 00:01:03,880 the second thing is, newer versions of the operating systems are now recording these events in the system log files. 18 00:01:04,180 --> 00:01:09,680 So, Windows 7 and Windows Vista now record event ID number 1 at level 4 to show the times change. 19 00:01:09,940 --> 00:01:13,180 And you'll notice at the bottom of the screen there, it has old time and new time. 20 00:01:13,540 --> 00:01:18,280 So, that's not really the best way that we're going to hide our activities, our fun things. 21 00:01:18,580 --> 00:01:20,420 So, what happened in 2005? 22 00:01:20,740 --> 00:01:27,060 There was a wonderful demonstration exhibit of timestomp.exe, and that was since pulled into Metasploit. 23 00:01:27,160 --> 00:01:27,860 And that was great. 24 00:01:27,860 --> 00:01:28,960 People loved it. 25 00:01:29,460 --> 00:01:39,660 And now there's a GUI available that you can download from SourceForge, where you can change the four timestamps that are part of NTFS or three timestamps that are used in FAT file systems. 26 00:01:40,120 --> 00:01:47,320 There are a number of other tools that are also out there, free for download, under trial versions, such as Attribute Magic. 27 00:01:47,720 --> 00:01:50,240 They go through and they change timestamps as well. 28 00:01:50,920 --> 00:01:55,520 Little problem with Attribute Magic, though, it only changes three of the four NTFS timestamps. 29 00:01:55,620 --> 00:01:57,840 It doesn't do the MFT timestamp. 30 00:01:57,860 --> 00:01:59,560 Which is interesting. 31 00:01:59,720 --> 00:02:02,260 So, all these wonderful tools are out there to go timestomp. 32 00:02:02,540 --> 00:02:04,600 And it's fairly efficient. 33 00:02:04,860 --> 00:02:11,740 And if you're not paying attention or if you're an unscrupulous or, you know, a poor sap of a user, well, you're going to miss what happened there. 34 00:02:12,540 --> 00:02:13,740 But here's the rub. 35 00:02:15,080 --> 00:02:16,100 They don't work real well. 36 00:02:17,200 --> 00:02:18,340 They don't do a good job. 37 00:02:18,820 --> 00:02:19,300 All right? 38 00:02:19,500 --> 00:02:22,120 And the other thing is they usually only hit one file at a time. 39 00:02:22,980 --> 00:02:27,180 Now, if you think back five or six slides, what did I say forensic analysts like to do? 40 00:02:27,240 --> 00:02:27,840 They like to recapitulate. 41 00:02:27,840 --> 00:02:28,600 They like to construct a timeline. 42 00:02:28,940 --> 00:02:32,100 And when they build their timelines, they are built in context. 43 00:02:32,640 --> 00:02:34,200 They don't look at individual files. 44 00:02:34,440 --> 00:02:36,120 They look at what's happening on an entire machine. 45 00:02:36,500 --> 00:02:37,020 All right? 46 00:02:37,080 --> 00:02:41,600 For example, there aren't four timestamps on NTFS systems. 47 00:02:42,060 --> 00:02:44,780 There are eight timestamps on NTFS systems. 48 00:02:45,040 --> 00:02:45,620 All right? 49 00:02:45,700 --> 00:02:51,060 There are four timestamps under the standard information attribute, which we'll take a look at in just a second. 50 00:02:51,240 --> 00:02:53,040 It's identified by hex number 10. 51 00:02:53,380 --> 00:02:54,020 All right? 52 00:02:54,020 --> 00:03:00,740 Those are the ones that are picked up by forensic tools, and those are the ones that timestamp hits and magic attribute hits. 53 00:03:01,900 --> 00:03:09,260 There's another set of timestamps under attribute number 30, under file name, and those four match exactly what's in standard information. 54 00:03:09,800 --> 00:03:13,880 The problem is when you stamp something or timestamp something, it doesn't modify these as well. 55 00:03:15,600 --> 00:03:18,900 So, whoops, there's a seam in the story here. 56 00:03:19,880 --> 00:03:23,740 Now, what's supposed to happen on a Windows-based system is you modify files. 57 00:03:23,740 --> 00:03:24,740 And standard information. 58 00:03:24,980 --> 00:03:33,060 And when you make another change, all of those records, those four data values are supposed to swing over and change the file name attributes. 59 00:03:35,880 --> 00:03:37,680 That's if you've modified the system correctly. 60 00:03:37,920 --> 00:03:41,020 And sometimes when you use timestamping tools, you're not going through the Windows API. 61 00:03:41,320 --> 00:03:44,320 So, therefore, Windows doesn't always update. 62 00:03:44,460 --> 00:03:46,060 So, therefore, we have things that aren't in sync. 63 00:03:46,260 --> 00:03:46,900 Let's take a look. 64 00:03:47,900 --> 00:03:49,800 I have a hex editor here opened up in front of you. 65 00:03:50,420 --> 00:03:52,860 You'll see a nice blue box right up here. 66 00:03:53,960 --> 00:03:55,260 Attribute ID number 10. 67 00:03:55,420 --> 00:03:56,720 Attribute ID number 30. 68 00:03:56,820 --> 00:04:00,480 Count specific number of bytes later. 69 00:04:00,700 --> 00:04:01,720 And you'll see four timestamps. 70 00:04:02,080 --> 00:04:02,400 Right? 71 00:04:02,480 --> 00:04:04,160 You'll see create it, which is the first one. 72 00:04:04,720 --> 00:04:05,880 What's after create it? 73 00:04:05,940 --> 00:04:08,260 We have last modified. 74 00:04:08,680 --> 00:04:09,920 We have MFT entry. 75 00:04:10,120 --> 00:04:11,560 And then the last one is last accessed. 76 00:04:11,840 --> 00:04:18,560 Don't forget on Windows 7-based systems and on Vista, the last accessed timestamp is no longer forcibly updated. 77 00:04:18,740 --> 00:04:21,860 It is only updated when the file is modified or created. 78 00:04:22,320 --> 00:04:22,880 All right? 79 00:04:23,740 --> 00:04:25,740 And these four timestamps here match. 80 00:04:26,800 --> 00:04:27,520 This is great. 81 00:04:27,560 --> 00:04:28,680 This is the way it's supposed to work. 82 00:04:30,260 --> 00:04:35,420 But if an examiner sees something that looks kind of funny, they're going to start digging. 83 00:04:35,560 --> 00:04:36,700 They're tenacious that way. 84 00:04:37,580 --> 00:04:40,920 And when they see obvious signs of timestamping, they start sniffing around. 85 00:04:41,800 --> 00:04:44,260 Take a look at this timestamping that showed up right here. 86 00:04:44,380 --> 00:04:47,520 Anyone here see a problem with the timestamping that was done? 87 00:04:48,440 --> 00:04:51,840 I mean, oh, yeah, there are no dates. 88 00:04:51,940 --> 00:04:53,180 That could be a problem. 89 00:04:53,740 --> 00:04:53,840 All right? 90 00:04:53,840 --> 00:04:59,320 And the moment that starts happening, you have an examiner starting to sniff pretty curiously in that area. 91 00:05:00,100 --> 00:05:00,660 All right? 92 00:05:01,200 --> 00:05:02,940 But what about things that aren't as obvious? 93 00:05:04,280 --> 00:05:05,060 Let's take a look. 94 00:05:05,160 --> 00:05:06,780 This is a screen capture from NCASE. 95 00:05:07,060 --> 00:05:09,880 It grabbed four timestamps for this unknown EXE. 96 00:05:10,520 --> 00:05:13,580 You'll see a create it, an accessed, a last written, and an entry modified. 97 00:05:14,360 --> 00:05:16,700 And you'll notice that the entry modified is off. 98 00:05:16,900 --> 00:05:20,180 Not by a lot, but by a few minutes and a few seconds. 99 00:05:21,260 --> 00:05:30,200 If I take a look at that, those values, directly in the MFT with a hex editor, I get the eight stamps that are shown on your screen right now. 100 00:05:31,560 --> 00:05:33,420 You'll notice they both have their create it dates. 101 00:05:33,540 --> 00:05:36,800 They both have the last accessed, the last modified, and the MFT entry. 102 00:05:37,000 --> 00:05:40,960 And the one that's pictured in gold, right, is the one that was off. 103 00:05:42,480 --> 00:05:45,320 So as an examiner, someone might go in and say, well, wait a second, that's off. 104 00:05:45,380 --> 00:05:46,280 Let me look a little closer. 105 00:05:46,280 --> 00:05:49,480 And when you look a little closer, what do you notice about the leftmost bits? 106 00:05:51,060 --> 00:05:52,040 They're not off by a little. 107 00:05:52,100 --> 00:05:52,720 They're off by a lot. 108 00:05:54,540 --> 00:05:55,900 So I hate to do this to you. 109 00:05:55,980 --> 00:05:57,340 I'm going to back up in the presentation. 110 00:06:00,540 --> 00:06:01,400 What do you notice here? 111 00:06:02,400 --> 00:06:04,920 The creation date, the last accessed date, and the last written date. 112 00:06:05,000 --> 00:06:05,640 Are they all the same? 113 00:06:07,760 --> 00:06:08,720 They look the same to me. 114 00:06:09,100 --> 00:06:11,360 The problem is NCASE only goes down to the second. 115 00:06:13,320 --> 00:06:16,260 Timestamps, well, they go down to the nanosecond. 116 00:06:16,280 --> 00:06:18,080 So there are changes here. 117 00:06:18,220 --> 00:06:20,980 So clearly there's evidence of timestamping that's been done here. 118 00:06:21,700 --> 00:06:26,480 And through the Windows API, Windows Explorer, NCASE, FTK, you wouldn't notice it. 119 00:06:26,780 --> 00:06:29,060 You'd actually have to go down and look at it at the hex level. 120 00:06:30,660 --> 00:06:33,680 Now some really good timestamping has been done recently. 121 00:06:34,480 --> 00:06:39,040 Where people wind up grabbing the date of the Windows install files. 122 00:06:39,380 --> 00:06:41,400 And they apply them and they copy them. 123 00:06:41,740 --> 00:06:46,260 The problem is it's pretty easy to identify what files are part of a standard Windows install file. 124 00:06:46,280 --> 00:06:47,320 And which ones aren't. 125 00:06:47,540 --> 00:06:50,000 This situation that you see on the screen, too good to be true. 126 00:06:51,160 --> 00:06:52,000 Unknown.exe. 127 00:06:52,020 --> 00:06:59,320 The file creation date, the last written date, and the last modified date match exactly what happened on this Windows installation. 128 00:06:59,940 --> 00:07:00,060 Hmm. 129 00:07:00,880 --> 00:07:03,500 Funny that last access date is the only one that's off. 130 00:07:04,720 --> 00:07:08,980 So we've got to remember that files when they're analyzed for timestamps, they are done in context. 131 00:07:09,440 --> 00:07:10,020 All right? 132 00:07:11,200 --> 00:07:14,360 Which means if we're going to be running executables on someone's system, 133 00:07:16,280 --> 00:07:17,060 we're going to start leaving a trail. 134 00:07:18,780 --> 00:07:20,240 Timestamping doesn't fix the trail. 135 00:07:20,600 --> 00:07:21,020 All right? 136 00:07:21,180 --> 00:07:25,340 We have problems with things like the MRU and we have problems with the Windows prefetch. 137 00:07:25,500 --> 00:07:25,980 All right? 138 00:07:27,380 --> 00:07:29,920 So let's talk about the Windows prefetch for just a second. 139 00:07:30,820 --> 00:07:36,140 Every time you launch an executable on a Windows-based system starting with XP or Vista or 7, 140 00:07:36,300 --> 00:07:40,280 you have the Windows prefetch or Superboost or Superprefetch. 141 00:07:41,160 --> 00:07:41,680 And that's great. 142 00:07:41,780 --> 00:07:43,940 But all of a sudden we notice that there's an extra file there. 143 00:07:44,580 --> 00:07:46,060 That file is going to have, 144 00:07:46,980 --> 00:07:48,320 eight timestamps as well, right? 145 00:07:48,420 --> 00:07:51,760 So if we're going to run an executable on a system and we don't want someone to know about it, 146 00:07:52,200 --> 00:07:55,400 not only do we have to timestamp the executable itself, 147 00:07:56,340 --> 00:07:57,960 and fix those eight timestamps, 148 00:07:58,360 --> 00:08:00,460 we've got to go timestamp the prefetch. 149 00:08:02,860 --> 00:08:04,240 Inside the prefetch, 150 00:08:05,120 --> 00:08:06,960 at offset hex 78, 151 00:08:07,440 --> 00:08:09,620 there is an embedded timestamp as well. 152 00:08:10,620 --> 00:08:11,720 Timestamp doesn't fix that. 153 00:08:12,640 --> 00:08:13,860 So if I'm going to go check, 154 00:08:14,040 --> 00:08:15,360 or an examiner is going to go check, 155 00:08:16,280 --> 00:08:18,760 to find out whether or not an executable has been run on a system, 156 00:08:19,480 --> 00:08:22,000 crack open a prefetch file with a hex editor, 157 00:08:22,240 --> 00:08:24,340 go down to offset 78, 158 00:08:24,560 --> 00:08:25,940 and take a look at the time-date stamp. 159 00:08:27,900 --> 00:08:30,040 Does that match the same time-date stamp 160 00:08:30,040 --> 00:08:31,320 that shows up for the file itself? 161 00:08:32,840 --> 00:08:33,700 Probably not. 162 00:08:35,420 --> 00:08:37,220 So a wise person told me, 163 00:08:38,020 --> 00:08:39,480 when they were reviewing the presentation, 164 00:08:40,460 --> 00:08:41,880 I believe his comment was, 165 00:08:43,100 --> 00:08:43,540 quote, 166 00:08:44,600 --> 00:08:45,280 screw that, 167 00:08:45,580 --> 00:08:47,560 I'm just going to delete the prefetch file completely. 168 00:08:47,920 --> 00:08:48,600 So you have an option, 169 00:08:48,660 --> 00:08:49,860 if you're going to run an executable, 170 00:08:50,300 --> 00:08:52,100 you can either delete the prefetch, 171 00:08:52,180 --> 00:08:53,280 or you can go timestamp it 172 00:08:53,280 --> 00:08:54,680 and then go worry about the stuff inside it. 173 00:08:55,760 --> 00:08:56,900 The Windows registry, 174 00:08:57,700 --> 00:09:00,120 that wonderful collection of files, 175 00:09:00,680 --> 00:09:01,020 anyway, 176 00:09:02,400 --> 00:09:04,300 there are embedded timestamps in there as well. 177 00:09:05,280 --> 00:09:06,520 Most recently opened files, 178 00:09:07,100 --> 00:09:08,540 hey, they're all sitting in the Windows registry. 179 00:09:08,720 --> 00:09:09,560 So if you've opened a file, 180 00:09:09,700 --> 00:09:12,680 if you decide to snoop on someone, and you didn't mean to, or you wanted to, 181 00:09:13,540 --> 00:09:14,040 go ahead and cover your tracks. 182 00:09:14,200 --> 00:09:15,920 Don't forget, you've got to worry about what's inside the registry. 183 00:09:16,700 --> 00:09:17,940 Not fixed by timestamp. 184 00:09:19,240 --> 00:09:21,020 The Windows registry also records 185 00:09:21,020 --> 00:09:22,480 whether or not applications were run. 186 00:09:23,040 --> 00:09:25,200 And sometimes there are timestamps there as well. 187 00:09:25,520 --> 00:09:26,840 Also not fixed by 188 00:09:27,800 --> 00:09:28,200 timestamp. 189 00:09:28,880 --> 00:09:31,020 Now a lot of the registry entries are stored in 190 00:09:31,020 --> 00:09:33,280 which obscures what happens, 191 00:09:33,420 --> 00:09:34,620 which means reading them is a problem. 192 00:09:35,880 --> 00:09:36,620 Data files, 193 00:09:37,980 --> 00:09:39,780 now they have timestamps as well. 194 00:09:40,120 --> 00:09:41,380 Alright, so we've got a problem, 195 00:09:41,520 --> 00:09:42,600 we've been running into a system, 196 00:09:43,540 --> 00:09:43,920 we've been trying to look at it, 197 00:09:44,100 --> 00:09:46,060 we pulled out our utility timestamp, 198 00:09:46,160 --> 00:09:47,420 we broke out Metasploit, 199 00:09:47,520 --> 00:09:49,120 we're timestamping it all over the place, 200 00:09:49,200 --> 00:09:51,400 and now we've got to worry about what's inside the file. 201 00:09:53,540 --> 00:09:55,500 So what happens when we create 202 00:09:55,500 --> 00:09:56,380 or open a file? 203 00:09:57,620 --> 00:09:59,760 Well, there aren't four timestamps, 204 00:09:59,920 --> 00:10:00,940 there aren't eight timestamps, 205 00:10:01,100 --> 00:10:03,060 there are 33 timestamps. 206 00:10:04,060 --> 00:10:04,740 Holy Hannah. 207 00:10:05,180 --> 00:10:06,340 That's a lot to go fix. 208 00:10:06,660 --> 00:10:08,600 So whenever we open or create a file 209 00:10:08,600 --> 00:10:09,780 on a Windows based system, 210 00:10:09,920 --> 00:10:12,260 the file itself is going to have eight stamps, right? 211 00:10:13,540 --> 00:10:13,840 Standard information, 212 00:10:14,160 --> 00:10:14,860 foreign file name, 213 00:10:15,800 --> 00:10:18,740 the shortcut that gets caught in the 214 00:10:18,740 --> 00:10:19,700 my recent documents, 215 00:10:20,480 --> 00:10:22,060 well that's going to have eight timestamps. 216 00:10:22,440 --> 00:10:25,040 If it's an office file you've decided to snoop and go open, 217 00:10:25,180 --> 00:10:26,900 something that belonged to your boss, your co-worker, 218 00:10:27,040 --> 00:10:28,720 your friend, your spouse, your neighbor, your pets, 219 00:10:28,880 --> 00:10:29,420 whatever, 220 00:10:30,860 --> 00:10:33,280 if that's an office file, that's going to have eight timestamps. 221 00:10:33,640 --> 00:10:35,420 Oh yeah, then there's going to be registry entries, 222 00:10:35,640 --> 00:10:36,940 and yeah, don't forget about the prefetch, 223 00:10:37,020 --> 00:10:38,520 that's going to have nine timestamps, 224 00:10:38,600 --> 00:10:41,480 so now we have to worry about 33 timestamps. 225 00:10:42,500 --> 00:10:42,860 Wow. 226 00:10:45,440 --> 00:10:46,320 Adobe Acrobat. 227 00:10:47,080 --> 00:10:49,240 Oh yeah, that stores its most recent documents 228 00:10:49,240 --> 00:10:50,160 and files that are opened 229 00:10:51,560 --> 00:10:53,080 inside the registry as well. 230 00:10:53,500 --> 00:10:54,960 So you'll have to fix what's happening 231 00:10:54,960 --> 00:10:55,920 with the registry being read. 232 00:10:56,280 --> 00:10:57,840 All right, so let's take a quick look at something. 233 00:10:58,240 --> 00:10:59,380 We have an Excel spreadsheet. 234 00:10:59,620 --> 00:11:03,300 It was created on July 31st, 2011, 235 00:11:04,460 --> 00:11:06,620 at about 8.52 in the evening. 236 00:11:07,240 --> 00:11:08,380 All right, working late, 237 00:11:08,960 --> 00:11:09,840 working on a spreadsheet, 238 00:11:09,980 --> 00:11:10,540 accounting files. 239 00:11:11,460 --> 00:11:13,120 I time stomped it because I don't want someone 240 00:11:13,120 --> 00:11:13,520 to know I was not working late. 241 00:11:13,540 --> 00:11:13,940 Just looking at it. 242 00:11:15,200 --> 00:11:16,760 When's the last time you opened up 243 00:11:17,720 --> 00:11:19,760 an office file using an XML editor? 244 00:11:22,240 --> 00:11:22,640 Oops. 245 00:11:23,000 --> 00:11:23,800 Hey, wait a second. 246 00:11:23,840 --> 00:11:24,460 Look at that right there. 247 00:11:25,300 --> 00:11:25,700 Created. 248 00:11:26,500 --> 00:11:28,080 2011, 7, 30. 249 00:11:28,660 --> 00:11:30,760 Does that timestamp match the one that's in the MFT? 250 00:11:32,460 --> 00:11:33,800 No, probably not. 251 00:11:34,000 --> 00:11:34,480 So great. 252 00:11:34,580 --> 00:11:35,780 Now I've got to go fix something else. 253 00:11:36,440 --> 00:11:37,000 All right. 254 00:11:38,340 --> 00:11:40,320 And this is something we talked about previously. 255 00:11:41,460 --> 00:11:43,200 There's a certain degree of granularity. 256 00:11:43,780 --> 00:11:45,680 Timestamps on Windows-based systems 257 00:11:45,680 --> 00:11:48,360 are stored in 64-bit values. 258 00:11:48,720 --> 00:11:49,320 All right. 259 00:11:50,040 --> 00:11:51,460 Those 64-bit values 260 00:11:51,460 --> 00:11:53,340 cover time that's elapsed 261 00:11:53,340 --> 00:11:55,000 since January 1, 262 00:11:55,960 --> 00:11:56,440 1601, 263 00:11:56,620 --> 00:11:58,520 in 100-nanosecond increments. 264 00:11:59,560 --> 00:12:01,160 Timestomp, EXE, magic attribute, 265 00:12:01,300 --> 00:12:02,880 and the other tools that you can download from the net 266 00:12:02,880 --> 00:12:04,400 only go down to the nearest second. 267 00:12:06,800 --> 00:12:08,480 Well, if they only go down to the nearest second, 268 00:12:09,120 --> 00:12:10,680 and I break open the hex editor, 269 00:12:10,880 --> 00:12:13,360 I'm going to notice that someone did timestomping. 270 00:12:14,500 --> 00:12:15,840 So what would be better 271 00:12:15,840 --> 00:12:17,880 than actually timestomping it? 272 00:12:17,980 --> 00:12:19,380 It would be copying the value, 273 00:12:19,520 --> 00:12:20,820 the whole 64-bit value 274 00:12:21,380 --> 00:12:22,300 from another file. 275 00:12:22,680 --> 00:12:24,040 Take a look at the file right here. 276 00:12:26,140 --> 00:12:27,600 What do you notice about the stuff 277 00:12:27,600 --> 00:12:28,880 that's highlighted in red? 278 00:12:30,420 --> 00:12:31,360 Do they all match 279 00:12:31,360 --> 00:12:32,140 like they're supposed to? 280 00:12:32,800 --> 00:12:33,280 No. 281 00:12:34,500 --> 00:12:36,060 What happened to the leftmost bits? 282 00:12:37,060 --> 00:12:37,740 They're off. 283 00:12:38,840 --> 00:12:39,800 Someone timestomped. 284 00:12:39,800 --> 00:12:41,020 You wouldn't notice this 285 00:12:41,020 --> 00:12:42,900 looking at it through a forensic tool. 286 00:12:43,020 --> 00:12:44,500 You'd only notice it through a hex editor. 287 00:12:44,860 --> 00:12:45,960 You can compare it. 288 00:12:47,480 --> 00:12:49,200 The values that you see here on the screen 289 00:12:49,200 --> 00:12:50,080 for the created stamp, 290 00:12:50,240 --> 00:12:51,760 round it to the nearest second. 291 00:12:52,740 --> 00:12:54,620 Don't forget, we're going to be reading 292 00:12:54,620 --> 00:12:55,440 from right to left. 293 00:12:57,600 --> 00:12:59,220 What about malware 294 00:12:59,220 --> 00:13:00,740 that shows up on a machine? 295 00:13:02,200 --> 00:13:03,460 You know those unscrupulous 296 00:13:03,460 --> 00:13:05,640 malware developers, pushing out their code, 297 00:13:05,720 --> 00:13:06,540 trying to steal your data. 298 00:13:06,620 --> 00:13:07,180 How dare they? 299 00:13:10,200 --> 00:13:12,080 So what happens if you crack that open? 300 00:13:13,080 --> 00:13:13,480 Well, 301 00:13:13,560 --> 00:13:16,040 here's the same unknown.exe 302 00:13:16,040 --> 00:13:17,220 that I showed you earlier, 303 00:13:18,020 --> 00:13:19,860 and you'll notice that the signature at the top 304 00:13:19,860 --> 00:13:21,740 has that trusty 4D5A, 305 00:13:21,760 --> 00:13:22,140 the MZ, 306 00:13:22,940 --> 00:13:25,820 and I can move over to the start of the PE header, 307 00:13:25,940 --> 00:13:27,300 points all the way down the EO, 308 00:13:27,460 --> 00:13:29,200 and I can jump all the way down the EO, 309 00:13:29,220 --> 00:13:31,840 and then I get my file signature for my PE header, 310 00:13:31,940 --> 00:13:33,540 and then I move over a certain number of bytes, 311 00:13:33,680 --> 00:13:34,320 and hey, look! 312 00:13:35,580 --> 00:13:36,580 There's another timestamp. 313 00:13:37,700 --> 00:13:39,640 The date the EXE 314 00:13:39,800 --> 00:13:39,980 was compiled. 315 00:13:40,500 --> 00:13:41,800 Embed it right there in the executable. 316 00:13:42,040 --> 00:13:43,900 Now, that's not the date that it was run. 317 00:13:45,000 --> 00:13:47,420 However, what happens if the compiled date 318 00:13:49,160 --> 00:13:49,960 is later 319 00:13:51,240 --> 00:13:52,320 than the timestamp date? 320 00:13:54,900 --> 00:13:55,600 Something's going to be up. 321 00:13:56,080 --> 00:13:57,180 And someone's going to start looking. 322 00:13:57,500 --> 00:13:58,040 That's great. 323 00:13:58,340 --> 00:14:00,140 And then there's the issue of external media. 324 00:14:01,140 --> 00:14:03,500 God, I have a bunch of wonderful people in my office. 325 00:14:03,600 --> 00:14:04,740 They always secure their machine 326 00:14:05,200 --> 00:14:06,320 with their name and their password 327 00:14:06,320 --> 00:14:07,960 whenever they get up and they walk away. 328 00:14:09,800 --> 00:14:11,180 There's a few jobs back 329 00:14:11,180 --> 00:14:12,200 where they never did that, 330 00:14:12,340 --> 00:14:15,100 so it's amazing what people would run around 331 00:14:15,100 --> 00:14:16,840 and do and take flash drives and put them everywhere. 332 00:14:17,280 --> 00:14:19,280 But what about the timestamping on external media? 333 00:14:21,060 --> 00:14:23,440 Flash drives, by default, 334 00:14:23,480 --> 00:14:24,980 use FAT32 because they're compatible 335 00:14:24,980 --> 00:14:27,000 and they can move across different file systems. 336 00:14:27,860 --> 00:14:29,220 Well, they don't store time 337 00:14:29,220 --> 00:14:31,440 in the same way that NTFS does. 338 00:14:31,560 --> 00:14:33,420 Here, there's a certain number of bits 339 00:14:33,420 --> 00:14:34,320 in the root directory, 340 00:14:34,460 --> 00:14:36,420 only stored in one location, not two, 341 00:14:37,180 --> 00:14:38,340 where it breaks down time. 342 00:14:40,580 --> 00:14:41,860 You'll notice that the first set of bits 343 00:14:41,860 --> 00:14:44,720 only handle stuff in 10-millisecond increments. 344 00:14:44,860 --> 00:14:46,300 We don't have to worry about nanoseconds. 345 00:14:46,860 --> 00:14:48,420 We'll notice that the next two bytes 346 00:14:48,420 --> 00:14:49,760 handle what creation time 347 00:14:49,760 --> 00:14:50,900 down to the hour, minute, second. 348 00:14:51,200 --> 00:14:52,460 Then we have a creation date 349 00:14:52,460 --> 00:14:53,740 and we have a last access date. 350 00:14:54,720 --> 00:14:55,760 We'll skip two bytes. 351 00:14:56,140 --> 00:14:57,920 We'll go all the way up to the last modified time. 352 00:14:59,020 --> 00:15:01,220 So we can timestamp that with any of our tools. 353 00:15:02,520 --> 00:15:03,420 But is it worth it? 354 00:15:04,780 --> 00:15:06,120 If I take a file 355 00:15:07,640 --> 00:15:09,100 and I run over to someone's computer 356 00:15:09,100 --> 00:15:09,780 and say, 357 00:15:09,800 --> 00:15:10,820 plug my thumb drive in 358 00:15:10,820 --> 00:15:11,900 and I copy the file over 359 00:15:12,340 --> 00:15:13,720 directly from mine to theirs, 360 00:15:14,860 --> 00:15:16,180 what happens with the timestamps? 361 00:15:17,500 --> 00:15:19,020 Well, the moment I copy the file over, 362 00:15:19,860 --> 00:15:21,340 that new instance of the file, 363 00:15:21,840 --> 00:15:23,540 whether I've copied it or moved it, 364 00:15:23,640 --> 00:15:25,040 is going to give me a new creation date. 365 00:15:26,020 --> 00:15:28,380 The date on which I copied the file. 366 00:15:28,640 --> 00:15:29,800 The last access date 367 00:15:29,800 --> 00:15:31,260 will be the date I copied the file over. 368 00:15:31,640 --> 00:15:33,420 The MFT entry will be the last, 369 00:15:33,520 --> 00:15:34,980 you know, the date I moved the file over. 370 00:15:35,120 --> 00:15:37,780 But what happens with the last modified timestamp? 371 00:15:39,220 --> 00:15:39,580 Oops. 372 00:15:41,140 --> 00:15:41,940 Now, don't forget. 373 00:15:42,400 --> 00:15:43,740 Some people might sit there and say, 374 00:15:43,800 --> 00:15:45,060 well, yeah, it's not really worth it. 375 00:15:45,100 --> 00:15:45,780 No one's going to really know. 376 00:15:45,980 --> 00:15:48,620 Hey, the last modified timestamp 377 00:15:48,620 --> 00:15:49,800 is kind of like a fingerprint. 378 00:15:50,720 --> 00:15:52,260 Remember, it goes all the way down 379 00:15:52,260 --> 00:15:53,660 to the 100 nanosecond level? 380 00:15:53,800 --> 00:15:55,840 And what are the odds of two files 381 00:15:55,840 --> 00:15:58,760 having the exact same last modified date? 382 00:16:00,320 --> 00:16:01,120 Pretty thin. 383 00:16:01,780 --> 00:16:02,180 Right? 384 00:16:02,220 --> 00:16:03,200 So you'll want to stomp that, too. 385 00:16:04,080 --> 00:16:05,780 So what's the bottom line to all this? 386 00:16:07,420 --> 00:16:08,940 It's damn near impossible 387 00:16:09,800 --> 00:16:10,780 to timestamp things effectively 388 00:16:10,780 --> 00:16:11,800 with the tools that are out there. 389 00:16:11,860 --> 00:16:12,700 It just doesn't work. 390 00:16:14,280 --> 00:16:15,660 And since it doesn't work, 391 00:16:15,820 --> 00:16:19,120 if someone is going to do something that they shouldn't, 392 00:16:19,120 --> 00:16:20,580 not that I would ever advocate that, 393 00:16:21,860 --> 00:16:23,580 the idea is to timestamp enough 394 00:16:23,580 --> 00:16:25,100 to get rid of enough data, 395 00:16:25,180 --> 00:16:26,180 to get rid of the prefetch, 396 00:16:26,240 --> 00:16:27,040 to hide enough keys 397 00:16:27,780 --> 00:16:30,360 so someone doesn't go looking at things with a hex editor. 398 00:16:30,620 --> 00:16:32,860 Because it's a trade-off. 399 00:16:33,380 --> 00:16:35,280 The forensic examiner, that's work for them. 400 00:16:35,380 --> 00:16:36,360 That's extra effort. 401 00:16:37,840 --> 00:16:39,160 They're not going to go down that path 402 00:16:39,800 --> 00:16:40,860 unless they have a reason to do that. 403 00:16:43,360 --> 00:16:45,080 If you want a copy of this presentation, 404 00:16:45,300 --> 00:16:46,780 send me an email to that address. 405 00:16:47,140 --> 00:16:49,120 Give me the presentation at gmail.com. 406 00:16:50,880 --> 00:16:52,840 I have lots of time left for questions. 407 00:16:53,200 --> 00:16:54,740 Any questions from you? 408 00:16:57,720 --> 00:16:58,140 No? 409 00:17:01,640 --> 00:17:02,080 That's it. 410 00:17:04,560 --> 00:17:05,740 Yeah, HFS Plus. 411 00:17:06,840 --> 00:17:08,520 You know, I'm not the greatest Mac expert 412 00:17:08,520 --> 00:17:09,620 and I'll be the first to admit it. 413 00:17:09,800 --> 00:17:11,460 So how does this work on a Mac? 414 00:17:11,560 --> 00:17:12,820 Most of it is stored in inodes, 415 00:17:12,960 --> 00:17:13,340 is that right? 416 00:17:13,920 --> 00:17:16,300 Timestamps? Inodes? Trees? 417 00:17:16,460 --> 00:17:17,620 People looking, they're not telling me. 418 00:17:17,660 --> 00:17:17,760 Yeah? 419 00:17:23,060 --> 00:17:24,060 It doesn't get easier 420 00:17:24,060 --> 00:17:25,340 because it's not stored in the same spot. 421 00:17:25,480 --> 00:17:26,580 It stores it in different inodes. 422 00:17:28,200 --> 00:17:29,400 He wants to know how well 423 00:17:29,400 --> 00:17:31,420 this same process works on EXT. 424 00:17:31,580 --> 00:17:33,380 The question before was how well does it work 425 00:17:33,380 --> 00:17:34,360 on HFS Plus. 426 00:17:34,740 --> 00:17:37,220 And the idea is not as well 427 00:17:37,220 --> 00:17:39,780 and it's pretty hard to go in to manually manipulate that. 428 00:17:39,800 --> 00:17:40,220 So we're going to look at the inode files. 429 00:17:55,320 --> 00:17:57,020 The tools that are out there to go analyze, 430 00:17:57,220 --> 00:17:59,240 the question was how well can someone efficiently 431 00:17:59,240 --> 00:18:01,600 analyze timestamps to see if something's been 432 00:18:01,600 --> 00:18:02,680 rounded to the second or not. 433 00:18:02,940 --> 00:18:05,180 There are some end scripts out there to go out 434 00:18:05,180 --> 00:18:07,040 and compare the timestamps that will go down 435 00:18:07,040 --> 00:18:08,740 and check to determine whether or not 436 00:18:08,740 --> 00:18:09,440 something's been modified. 437 00:18:10,880 --> 00:18:11,580 So there you have it. 438 00:18:12,440 --> 00:18:14,580 Thanks very much. Have a great time. Enjoy the con.