Latest / CyberCode Academy / Course 21 - Digital Forensics: Windows Shellbags | Episode 4: Shellbag Forensics: Tracking USB Device History and Artifact Validation
Transcript
- 0:00Speaker 1: Welcome back to the Deep Dive. Today we are going
- 0:03Speaker 1: to play detective. But I want you to forget the
- 0:06Speaker 1: magnifying glass, forget the trench coat, and definitely forget dusty archives.
- 0:12Speaker 2: Could be back. Yeah, we're talking about a different kind
- 0:14Speaker 2: of detective work.
- 0:15Speaker 1: We are the kind that happens in the glow of
- 0:17Speaker 1: a monitor. And you know, we always think the smoking
- 0:20Speaker 1: gun is on the hard drive, right, That's where everything
- 0:22Speaker 1: important lives.
- 0:23Speaker 2: That's the common assumption. Sure, yeah, the main treasure chest.
- 0:26Speaker 1: But I was reading through our stack for today, and
- 0:28Speaker 1: it turns out sometimes the most damning evidence is the
- 0:31Speaker 1: stuff that well, the stuff that walked out the door
- 0:34Speaker 1: in someone's pocket.
- 0:35Speaker 2: You're talking about USB thumb.
- 0:36Speaker 1: Drives exactly, the Humble flash drive.
- 0:40Speaker 2: It's everywhere. It's the easiest way to exfiltrate data, to
- 0:44Speaker 2: steal it, or on the flip side, to inject malware
- 0:48Speaker 2: into a supposedly secure system.
- 0:49Speaker 1: But here's the catch, and this is really the hook
- 0:52Speaker 1: for today's deep dive. What if you don't have the
- 0:54Speaker 1: USB drive.
- 0:55Speaker 2: The suspect got rid of it.
- 0:57Speaker 1: Yeah, they threw it in a river, flushed it. Whatever
- 0:59Speaker 1: is it on forever? Can we still figure out what
- 1:01Speaker 1: was on it just by looking at the computer it
- 1:03Speaker 1: was plugged into.
- 1:04Speaker 2: We absolutely can. Yeah, and that is where we enter
- 1:07Speaker 2: the world of shell bags.
- 1:08Speaker 1: Shell bags, I have to say, when I first read that,
- 1:11Speaker 1: I pictured something you'd buy at a beach gift shop.
- 1:14Speaker 2: It does have that kind of sound, doesn't it. But no,
- 1:16Speaker 2: a shell bag is definitely not a souvenir. It's essentially
- 1:20Speaker 2: a set of registry keys. Think of them as digital footprints.
- 1:24Speaker 1: Okay, so why is Windows leaving these footprints? Is it
- 1:28Speaker 1: like spying on us?
- 1:30Speaker 2: Not for surveillance, No, It's all about user experience.
- 1:33Speaker 1: Yeah.
- 1:33Speaker 2: Windows just wants to remember how you, the user, viewed
- 1:37Speaker 2: a folder.
- 1:38Speaker 1: You mean, like whether I liked big icons or a list.
- 1:42Speaker 2: View precisely, whether the size of the window, or how
- 1:44Speaker 2: you sorted the files. It saves those preferences in a
- 1:47Speaker 2: bag in the registry.
- 1:48Speaker 1: So the next time I open that folder, it looks
- 1:50Speaker 1: exactly how I left it.
- 1:52Speaker 2: It's seamless, but that act of remembering creates a record.
- 1:56Speaker 1: So because it remembers the preference.
- 1:58Speaker 2: It proves the folder was there, even if the folder
- 2:01Speaker 2: or the whole drive is long gone.
- 2:03Speaker 1: That's incredible. It's like a ghost of the file system it.
- 2:06Speaker 2: Is, and today we're going to mentally reconstruct a digital
- 2:09Speaker 2: forensics investigation to see just how this works. But I
- 2:13Speaker 2: have to add a word of caution here. It is
- 2:16Speaker 2: not as simple as the folder is in the registry.
- 2:20Speaker 2: Therefore they're guilty. We're going to see how Windows can
- 2:22Speaker 2: actually it can trick you if you're not careful.
- 2:26Speaker 1: I love a good plot twist. So our mission is
- 2:27Speaker 1: to decode these shell bags, and we have to.
- 2:30Speaker 2: Pay very close attention to the filesystem for this whole scenario.
- 2:33Speaker 2: We're assuming the USB drive is formatted with fat sixteen.
- 2:37Speaker 1: Fat sixteen. That sounds really old, like nineties old.
- 2:41Speaker 2: It is old school, but it's still out there on
- 2:43Speaker 2: smaller drives or legacy equipment. And more importantly, it has
- 2:47Speaker 2: some technical quirks that can trip up an investigator.
- 2:49Speaker 1: Okay, let's get into it then, Section one, the initial artifacts.
- 2:53Speaker 1: Let's set the scene.
- 2:54Speaker 2: We have a clean USB drive, well mostly clean. The
- 2:57Speaker 2: notes for this mentioned it had Maccuti's.
- 3:00Speaker 1: Huh, very technical term.
- 3:01Speaker 2: It just means there was some metadata from a Mac
- 3:03Speaker 2: on it, like the desour files. The point is the
- 3:06Speaker 2: drive was otherwise empty before we started.
- 3:09Speaker 1: Okay, so it's two point one nine pm. We take
- 3:12Speaker 1: a folder named test files and we just drag it
- 3:15Speaker 1: onto this USB drive.
- 3:16Speaker 2: Simple action. But now we pretend the USB drive is gone.
- 3:20Speaker 2: We only have the computer, so we use our tools
- 3:22Speaker 2: something like ftk imager to get the registry hives and
- 3:25Speaker 2: Shellbag Explorer to read them.
- 3:27Speaker 1: And we're looking in a specific file, the usrclass dot
- 3:30Speaker 1: dat file.
- 3:31Speaker 2: That's the one that's where Windows stores these user specific settings.
- 3:34Speaker 1: So we open it up and there it is an
- 3:37Speaker 1: entry for the E drive and inside that our test
- 3:39Speaker 1: files folder.
- 3:40Speaker 2: Right, but the name isn't the real evidence. The timestamp
- 3:44Speaker 2: is the last right time correct, and in our scenario,
- 3:47Speaker 2: the last right time in that shell bag entry converts
- 3:49Speaker 2: perfectly to two point one to nine pm local time.
- 3:52Speaker 1: It matches the activity, so that confirms it the user
- 3:55Speaker 1: was interacting with that folder at that exact time. But
- 3:57Speaker 1: then we see something strange.
- 3:59Speaker 2: Ah, yeah, the anomaly.
- 4:01Speaker 1: The last access time. The date is right, but the
- 4:04Speaker 1: time is just zero. It's like midnight. It's a flat number,
- 4:08Speaker 1: not two point one nine pm. Did the cool break?
- 4:11Speaker 2: No, the tool's working perfectly. This is that fat sixteen
- 4:14Speaker 2: quirk I mentioned.
- 4:14Speaker 1: Okay, so explain this. Why is the time just missing.
- 4:17Speaker 2: Well, modern file systems like NTFS track time down to
- 4:20Speaker 2: the nanosecond. Yeah. Fat sixteen is from an era where
- 4:24Speaker 2: every bit of storage was precious, So to save space,
- 4:28Speaker 2: the designers decided that for last access the date was important,
- 4:33Speaker 2: but not the time, but not the specific time. There
- 4:36Speaker 2: literally isn't a field in the file record to store
- 4:39Speaker 2: the hours and minutes for that attribute.
- 4:41Speaker 1: That's wild. So if I'm an investigator and I see
- 4:43Speaker 1: a timestamp of zero zero zero zero zero zero zero
- 4:47Speaker 1: zero zero zero zero, I shouldn't think someone's tampered with
- 4:50Speaker 1: the logs exactly.
- 4:51Speaker 2: You should actually expect to see that on a Fat
- 4:54Speaker 2: sixteen drive. It's a system limitation. Knowing that is critical.
- 4:58Speaker 1: That is a great little nugget. Okay, what up created
- 5:00Speaker 1: versus modified dates? That always confuses me.
- 5:03Speaker 2: It trips a lot of people up.
- 5:04Speaker 1: So we move the files. My intuition says, the created
- 5:06Speaker 1: date should be old from when I first made the file,
- 5:08Speaker 1: and the modified date should be now because I just
- 5:10Speaker 1: moved it.
- 5:11Speaker 2: That's a common thought, but it's the reverse. When you
- 5:13Speaker 2: copy across drives, really think of the sorry modified refers
- 5:17Speaker 2: to the content. Did you change the text in the document.
- 5:20Speaker 1: No, I just dragged it over exactly.
- 5:23Speaker 2: The content is unchanged, so the modified date stays the same.
- 5:27Speaker 2: It preserves the original history of the file itself.
- 5:29Speaker 1: Okay, that makes sense.
- 5:30Speaker 2: But the created date refers to the file's entry on
- 5:33Speaker 2: this specific drive. When you drag it to the USB,
- 5:37Speaker 2: you're creating a new entry on the E drive.
- 5:39Speaker 1: So the created date updates to right now, to two
- 5:43Speaker 1: point one nine pm.
- 5:44Speaker 2: Precisely, the created timestamp is actually newer than the modified one.
- 5:49Speaker 1: That feels like time travel, it does.
- 5:51Speaker 2: But that pattern is a classic sign of a file copy.
- 5:54Speaker 2: It helps us establish what a normal baseline looks like.
- 5:56Speaker 1: All right, so we've got our baseline. We know what
- 5:58Speaker 1: normal looks like. You ready to break it?
- 6:00Speaker 2: Let's break it?
- 6:00Speaker 1: Okay. Section two the ghost folders.
- 6:03Speaker 2: This is where it gets weird and dangerous for an
- 6:05Speaker 2: investigator who's not paying attention.
- 6:08Speaker 1: So in our scenario, we take the USB drive out,
- 6:11Speaker 1: we format it, completely.
- 6:13Speaker 2: Wipe it, and we rename it no Peaking Nice, and
- 6:16Speaker 2: then we put a completely new folder on it, this
- 6:18Speaker 2: time called malware.
- 6:19Speaker 1: So, just to be clear, the test files folder is
- 6:22Speaker 1: physically gone. The drive now only contains one folder called malware.
- 6:26Speaker 2: Correct. And we plug it back into the same computer
- 6:28Speaker 2: at two point four to six pm.
- 6:30Speaker 1: Okay, different time, different folder, but it's the same physical
- 6:34Speaker 1: USB stick and it gets the same drive letter E.
- 6:38Speaker 2: That part's key. So we open the malware folder, click around,
- 6:42Speaker 2: pull the drive. Now we go back to our forensics tool.
- 6:46Speaker 2: What do we see for the E drive?
- 6:48Speaker 1: This is the part that blew my mind. When we
- 6:50Speaker 1: look in shell Bag Explorer, it shows the malware folder,
- 6:54Speaker 1: but it also still shows the old test.
- 6:57Speaker 2: Files folder, and this is the danger zone.
- 7:00Speaker 1: We wipe the drive. Why does Windows think the old
- 7:03Speaker 1: files are still there?
- 7:04Speaker 2: It's the ghost in the machine. Windows is just trying
- 7:06Speaker 2: to be helpful. It's trying to remember your preferences for
- 7:09Speaker 2: the E drive. Okay, so when it sees the E
- 7:11Speaker 2: drive again, it says, oh, you're back. I remember you
- 7:14Speaker 2: had test files on here, and hey, now you have
- 7:16Speaker 2: malware too. I'll just keep track of both for you.
- 7:18Speaker 1: It merges the history, It merges them.
- 7:20Speaker 2: It creates a composite view of everything it's ever seen
- 7:22Speaker 2: in that location.
- 7:23Speaker 1: That is terrifying from an investigative standpoint.
- 7:26Speaker 2: It is incredibly risky because if you just look at
- 7:29Speaker 2: that directory tree, what are you going to report.
- 7:31Speaker 1: I'm going to write the suspects drive contained both malware
- 7:34Speaker 1: and test files at two point four to six pm.
- 7:37Speaker 2: Which would be completely false. They never existed on that
- 7:41Speaker 2: drive at the same time.
- 7:42Speaker 1: So how do we avoid that mistake? How do we
- 7:44Speaker 1: catch the lie?
- 7:45Speaker 2: You have to ignore the pretty tree structure and drill
- 7:48Speaker 2: down into the timestamps for each specific folder. Drilled down exactly.
- 7:52Speaker 2: If you check the test files folder in that merged view,
- 7:55Speaker 2: it's last right time in the shell bag will still
- 7:58Speaker 2: be the original time two point one.
- 8:00Speaker 1: Three BM, the first session right.
- 8:03Speaker 2: But if you look at the malware folder, its last
- 8:05Speaker 2: right time will be the new time two point four
- 8:08Speaker 2: to six pm.
- 8:09Speaker 1: So the timeline tells the real story, even when the
- 8:12Speaker 1: visual list is lying.
- 8:13Speaker 2: The timeline is everything. You have to use the timestamps
- 8:16Speaker 2: to reconstruct the sequence of events. If you see that
- 8:19Speaker 2: time gap, you have to recognize that Windows has merged
- 8:22Speaker 2: the records.
- 8:23Speaker 1: Don't trust the directory tree blindly. It's a scrap book,
- 8:26Speaker 1: not a live photo.
- 8:27Speaker 2: That's a perfect analogy. It's a scrapbook.
- 8:29Speaker 1: Okay, that makes so much sense. But there's one more
- 8:31Speaker 1: variable drive.
- 8:32Speaker 2: Letter roulette, right, because drive letters aren't permanent Windows just
- 8:35Speaker 2: assigns the next one available.
- 8:37Speaker 1: So new experiment. We plug in some random innocent USB stick.
- 8:41Speaker 1: First it becomes the E drive.
- 8:44Speaker 2: Then we plug in our malware.
- 8:46Speaker 1: USB and since E's taken, Windows gives it the letter F.
- 8:50Speaker 1: So now we're analyzing a new shell bag entry for.
- 8:53Speaker 2: The F drive. Correct And again we look at the
- 8:55Speaker 2: time stamps.
- 8:56Speaker 1: This was really interesting. The timestamp on the drive letter
- 8:59Speaker 1: itself on was eight point zero three pm UTC.
- 9:03Speaker 2: Which was exactly when the device was plugged in and
- 9:05Speaker 2: mounted by the system, so that's.
- 9:07Speaker 1: The connection time. But the malware folder inside it had
- 9:10Speaker 1: a slightly later timestamp, and.
- 9:11Speaker 2: That indicates when the user actually opened that specific.
- 9:15Speaker 1: Folder, So we can potentially tell the difference between plugged
- 9:17Speaker 1: in and actually open the bad stuff.
- 9:20Speaker 2: Usually yes, yeah, but and there's always a button. Forensics,
- 9:24Speaker 2: we have to remember what shell bags.
- 9:25Speaker 1: Actually are right viewing preference.
- 9:27Speaker 2: They're not just access logs. So if you open that
- 9:29Speaker 2: folder and then decide to change the view from list
- 9:32Speaker 2: to large icons, that updates the shellbag it does it
- 9:35Speaker 2: updates the last right time for that entry, so that
- 9:38Speaker 2: timestamp might just reflect the last time you change the
- 9:41Speaker 2: view settings, not the first time you opened.
- 9:43Speaker 1: It, so you have to be careful with your wording.
- 9:45Speaker 1: It's not they opened the file at eight point zero five.
- 9:48Speaker 1: It's shell bag data was updated at eight point zero
- 9:51Speaker 1: five exactly.
- 9:52Speaker 2: It's a subtle but critical distinction. It all comes back
- 9:54Speaker 2: to validation. You can't just run a tool and trust
- 9:57Speaker 2: the output.
- 9:57Speaker 1: Blindly the scientific method It really you have to experiment.
- 10:01Speaker 2: If you're not sure if your tool is merging data,
- 10:03Speaker 2: test it, recreate the ghost folder yourself. Don't guess. Test.
- 10:08Speaker 1: It's amazing how much complexity is hidden inside something as
- 10:11Speaker 1: simple as plugging in a thumb drive.
- 10:13Speaker 2: It is these systems are constantly recording and merging data
- 10:16Speaker 2: in ways that aren't always intuitive.
- 10:18Speaker 1: So let's bring it all home. Why does this matter?
- 10:21Speaker 1: Why should our listener care about this stuff?
- 10:23Speaker 2: Because accuracy is everything in a court case or an
- 10:26Speaker 2: incident report. If you report that two folders existed at
- 10:30Speaker 2: the same time because you misinterpreted a merged shell bag,
- 10:33Speaker 2: your credibility is gone.
- 10:35Speaker 1: You could ruin an investigation.
- 10:37Speaker 2: Or wrongfully accuse someone. Understanding the why behind the data
- 10:42Speaker 2: is so much more important than just knowing which button
- 10:44Speaker 2: to click in a program.
- 10:46Speaker 1: Well, I definitely feel smarter and a little more paranoid
- 10:49Speaker 1: about my USB drives.
- 10:51Speaker 2: As you should be.
- 10:52Speaker 1: Okay, before we wrap up, we like to do a
- 10:53Speaker 1: little challenge, a review question for everyone listening.
- 10:56Speaker 2: Let's test that FA sixteen knowledge.
- 10:57Speaker 1: All right, The question is analyzing a USB drive formatted
- 11:02Speaker 1: with FAT sixteen. You see a last access timestamp with
- 11:06Speaker 1: the correct date, but the time is all zeros. Why
- 11:09Speaker 1: should you not panic?
- 11:11Speaker 2: Take a second think about that system limitation we talked about?
- 11:13Speaker 1: Got it? The answer is because FAT sixteen, as a
- 11:17Speaker 1: file system, only records the date for last access, not
- 11:20Speaker 1: the time. Seeing a default time is normal.
- 11:23Speaker 2: Spot on. It's not a bug, it's a feature, or
- 11:26Speaker 2: I guess a lack of one.
- 11:27Speaker 1: Now, we've talked a lot about USB drives today, but
- 11:29Speaker 1: that's not the only way to move files.
- 11:31Speaker 2: Not at all.
- 11:32Speaker 1: Yeah.
- 11:32Speaker 2: If you think USB shellbags are tricky, yeah, just wait
- 11:35Speaker 2: until you get into network drives. How does Windows handle
- 11:38Speaker 2: a folder that lives on a server? Does it merge
- 11:40Speaker 2: the history? Does it even track it? That's a whole other.
- 11:44Speaker 1: Rabbit hole, A teaser for another time. I love it. Hey,
- 11:47Speaker 1: thank you for walking us through this. It really is
- 11:50Speaker 1: like putting a puzzle together with invisible pieces.
- 11:52Speaker 2: My pleasure. It's always fun hunting for the ghosts in the.
- 11:55Speaker 1: Machine and to you, the listener. Keep digging, keep validating
- 11:58Speaker 1: your data, and stay here, urieous. We'll catch you on
- 12:01Speaker 1: the next deep dive.