Latest / CyberCode Academy / Course 21 - Digital Forensics: Windows Shellbags | Episode 1: Windows Shellbags: Forensic Fundamentals and Deep Dive Analysis
Transcript
- 0:00Speaker 1: Welcome back to the deep Dive. I want you to
- 0:02Speaker 1: just for a second, picture a scenario with me. It's
- 0:05Speaker 1: something super mundane, something I guarantee every single person listening
- 0:09Speaker 1: has done, probably I don't know, a dozen times. Just today.
- 0:13Speaker 1: You're at your computer, you open a folder. Maybe it's
- 0:16Speaker 1: a bit cluttered, so you drag the corner, make the
- 0:18Speaker 1: window a little bigger, maybe you switch the view from
- 0:21Speaker 1: details to large icons so you can actually see the files.
- 0:25Speaker 1: Then you find what you need, you do your thing,
- 0:27Speaker 1: you close it. That whole action just it feels like
- 0:31Speaker 1: a throwaway moment, right it's gone.
- 0:33Speaker 2: It definitely feels that way to the user, it's completely temporary.
- 0:37Speaker 2: But in the world of digital forensics and well really
- 0:40Speaker 2: in how the operating system itself is built, that simple
- 0:43Speaker 2: little action is like walking through what cement. You think
- 0:46Speaker 2: the moment's gone because you close the window, but you've
- 0:48Speaker 2: just left a permanent, a permanent digital footprint, and that
- 0:51Speaker 2: footprint can tell a surprisingly detailed story about what you
- 0:54Speaker 2: were doing and when you were doing it.
- 0:56Speaker 1: That is exactly what we are unpacking today. We're looking
- 0:59Speaker 1: at a feature that my Microsoft designed just to be helpful,
- 1:02Speaker 1: to make your life easier but in doing so, they
- 1:05Speaker 1: accidentally created one of the most well devastating tools for
- 1:10Speaker 1: forensic investigators. We are talking about Windows shell bags.
- 1:14Speaker 2: I love this topic. It's just the perfect example of
- 1:17Speaker 2: unintended consequences in technology. Shell Bags were never meant to
- 1:21Speaker 2: be a spy tool. They were built so your computer
- 1:23Speaker 2: would be less annoying, basically. But for people in our field,
- 1:27Speaker 2: in cybersecurity, or really anyone studying how operating systems actually work,
- 1:31Speaker 2: shall bags are a gold mine. They're often the smoking
- 1:33Speaker 2: gun in a case where the actual evidence, like the
- 1:36Speaker 2: USB drive itself, is long gone.
- 1:39Speaker 1: So our mission for this deep dive is to turn you,
- 1:41Speaker 1: our listener, into a bit of a digital detective. We're
- 1:44Speaker 1: going to show you how experts can prove a user
- 1:46Speaker 1: accessed files that might not even exist on their computer anymore.
- 1:49Speaker 1: But first we have to talk about that name shell bags.
- 1:53Speaker 1: Sounds kind of weird.
- 1:54Speaker 2: It does have a funny ring to it, but no
- 1:57Speaker 2: seashells are involved, unfortunately, we say shell bags. What we're
- 2:01Speaker 2: really talking about is a specific and pretty complex set
- 2:04Speaker 2: of keys inside the Windows registry.
- 2:07Speaker 1: Ah, the registry like the central nervous system of Windows.
- 2:11Speaker 2: That's a great analogy Actually, the registry holds the configuration
- 2:15Speaker 2: for everything. So think back to that user experience you
- 2:18Speaker 2: just described. Windows wants to be helpful. If you open
- 2:23Speaker 2: a folder, let's call it Budget twenty twenty four, and
- 2:26Speaker 2: you set it to extra large icons and you drag
- 2:29Speaker 2: the window to the top right of your screen, Windows
- 2:31Speaker 2: wants to remember that.
- 2:32Speaker 1: For you, right, because it would be super frustrating if
- 2:35Speaker 1: every single time I open that folder it just reset
- 2:38Speaker 1: itself to some default view in the middle of the screen.
- 2:41Speaker 2: Precisely, it's a usability feature. So to save you that trouble,
- 2:44Speaker 2: the operating system creates a record. It basically says, okay,
- 2:46Speaker 2: this user open this folder, they like it in thumbnail view,
- 2:49Speaker 2: they want the window to be eight hundred by six
- 2:51Speaker 2: hundred pixels, and so on. It stuffs all that preference
- 2:54Speaker 2: data into a bag in the registry.
- 2:56Speaker 1: Okay, so it's purely for my convenience, a memory of my mind.
- 3:00Speaker 1: I guess my esthetic choice.
- 3:02Speaker 2: Is for that folder, truly for convenience. But now let's
- 3:05Speaker 2: put on our forensic hats. Think about what that record
- 3:08Speaker 2: actually implies. The OS is recording the folder's position, its size,
- 3:13Speaker 2: the icon view. Now does a forensic investigator really care
- 3:17Speaker 2: that you prefer listview over thumbnail view.
- 3:20Speaker 1: I'm gonna guess no, unless you're secretly judging my messy desktop.
- 3:25Speaker 2: We really don't. But we care a great deal about
- 3:27Speaker 2: the implication of that record because that record proves knowledge,
- 3:31Speaker 2: it proves access. You can't have a preference for how
- 3:34Speaker 2: a folder window looks if you never open the window
- 3:36Speaker 2: in the first place.
- 3:37Speaker 1: That is the key distinction. It's not just some background
- 3:40Speaker 1: process like a virus scan touching the file. This implies
- 3:43Speaker 1: a human being logged into a specific account opened it.
- 3:47Speaker 2: It proves a specific user viewed a specific folder, and
- 3:51Speaker 2: user is the keyword there. Shell bags are users.
- 3:53Speaker 1: Specific, meaning if I share a computer with my family,
- 3:56Speaker 1: my shell bags are completely different from theirs.
- 3:58Speaker 2: Totally separate. If you have five users on a PC,
- 4:02Speaker 2: you have five distinct sets of shell bags. This lets
- 4:05Speaker 2: us attribute actions to a person, not just a machine.
- 4:08Speaker 2: If User A navigates to a folder of stolen plans,
- 4:12Speaker 2: we find that trace in user as registry hive. Userb's
- 4:16Speaker 2: hive will be completely clean. It's huge for attribution.
- 4:19Speaker 1: So let's talk about the persistence of this. This is
- 4:21Speaker 1: the part that I think is so incredible. Because if
- 4:24Speaker 1: I copy a file to my desktop, Sure there are
- 4:26Speaker 1: traces everywhere. That's obvious. But what if I just plug
- 4:28Speaker 1: in a USB drive, look at some files on it,
- 4:31Speaker 1: and then poof, I unplug it and it's gone.
- 4:34Speaker 2: That is the aha moment. This is why shell bags
- 4:37Speaker 2: are so powerful in data theft or say malware investigation.
- 4:41Speaker 1: Because the bag stays behind on my computer, the.
- 4:43Speaker 2: Bag stays behind. Remember, the shell bag data is stored
- 4:47Speaker 2: in the registry on the local system, on the laptop
- 4:49Speaker 2: or desktop itself. It is not stored in the folder
- 4:52Speaker 2: you were looking at.
- 4:52Speaker 1: Okay, let's walk through a scenario, just to make this
- 4:54Speaker 1: really concrete. Let's say I'm a disgrunpled employee. I'm going
- 4:57Speaker 1: to steal some secret schematics for a new.
- 5:00Speaker 2: Okay, you're committing a digital heist. Walk me through it.
- 5:03Speaker 1: Right. I plug in my personal USB drive, let's call
- 5:06Speaker 1: it my stuff. I navigate to a folder on that
- 5:09Speaker 1: USB drive called secret blueprints. I open it, I make
- 5:13Speaker 1: sure the files are there. Maybe I switched to icon
- 5:15Speaker 1: view to see the thumbnails. Then I unplug the USB
- 5:18Speaker 1: drive and I don't know, I throw it in the ocean.
- 5:20Speaker 1: As far as I'm concerned, that evidence is gone forever.
- 5:24Speaker 2: The drive is gone, the files are gone, but your
- 5:26Speaker 2: work computer it's sitting there with a permanent record in
- 5:29Speaker 2: your user's registry. It essentially says, on this date, at
- 5:33Speaker 2: this time, you navigated to a folder named secret Blueprints
- 5:36Speaker 2: on a device labeled my Stuff, which was mounted as
- 5:38Speaker 2: the g drive, and you viewed it as icons.
- 5:41Speaker 1: Wow. So the folder never even technically lived on the
- 5:43Speaker 1: computer's hard drive, but the memory of the window.
- 5:46Speaker 2: Used to UIs does precisely. And this also applies to
- 5:49Speaker 2: network shares. If you access a sensitive folder on a
- 5:52Speaker 2: company server, say server hr records, and then you delete
- 5:55Speaker 2: that folder to cover your tracks, your local machine, your
- 5:58Speaker 2: laptop still remembers you were there.
- 6:00Speaker 1: This feels like it solves two of the biggest problems
- 6:02Speaker 1: in forensics. We talked about exfiltration taking data out, but
- 6:07Speaker 1: it works for infiltration too, right bringing things in.
- 6:10Speaker 2: It does think about malware. An attacker gets into a
- 6:13Speaker 2: building plugs in an infected USB drive. They have to
- 6:17Speaker 2: navigate through the folders on that drive to find where
- 6:20Speaker 2: they're going to drop their malicious payload. Shell bags can
- 6:23Speaker 2: show us that navigation. We can see them exploring the
- 6:26Speaker 2: directory structure of their own infected drive right before they
- 6:30Speaker 2: launched the attack.
- 6:31Speaker 1: It builds the narrative, It proves intent. It shows you
- 6:34Speaker 1: didn't just accidentally plug in a drive, you actively explored it.
- 6:38Speaker 2: It completely defeats the I didn't know that was on
- 6:40Speaker 2: their defense.
- 6:41Speaker 1: Okay, we've established the concept. It's powerful. But let's get
- 6:44Speaker 1: a bit more technical. For the students and professionals listening.
- 6:46Speaker 1: You can't just say it's somewhere in the registry. The
- 6:49Speaker 1: registry is enormous. If I'm a forensic analyst, where am
- 6:52Speaker 1: I actually looking?
- 6:53Speaker 2: Okay, let's get under the hood. For anyone studying this,
- 6:56Speaker 2: this is the part to really focus on. We're dealing
- 6:58Speaker 2: with specific user registry hives. You need to grab two
- 7:01Speaker 2: main files to get the whole picture.
- 7:03Speaker 1: The first one is the classic ntucer dot debt.
- 7:07Speaker 2: Correct NTU cr e TAT is located right in the
- 7:10Speaker 2: user's home folder. So C users your name N two
- 7:13Speaker 2: c e ece E SA debt. This file stores the
- 7:17Speaker 2: registry keys for the current logged in user.
- 7:20Speaker 1: Yeah. The second one.
- 7:21Speaker 2: The second one is a bit more hidden, but it's
- 7:23Speaker 2: often where the most valuable data is. On modern Windows systems,
- 7:27Speaker 2: it's called ESR class dot debt debt. You'll find that
- 7:30Speaker 2: one very deep inside the app data folder.
- 7:33Speaker 1: Okay, so you grab both of those files from the
- 7:35Speaker 1: system you're analyzing. No, what I want to try a
- 7:37Speaker 1: sort of screen free visualization. Can you walk through what
- 7:41Speaker 1: we would see if we loaded one of these files
- 7:43Speaker 1: into a registry viewer.
- 7:45Speaker 2: Okay, let's do it. Imagine you have a file tree
- 7:47Speaker 2: on the left side of your screen, just like in
- 7:49Speaker 2: Windows Explorer. You're navigating down this stree. You go into
- 7:52Speaker 2: a key, then a subkey, and eventually you get to
- 7:54Speaker 2: a key named bag mru, bag.
- 7:57Speaker 1: Mru mru as in most recently use.
- 7:59Speaker 2: That's the one. This key tracks the order folders were accessed.
- 8:02Speaker 2: Now you click the little plus sign to expand it.
- 8:04Speaker 2: You don't see folder names. You just see numbers keys
- 8:07Speaker 2: labeled zero, one, two, three.
- 8:09Speaker 1: It's all encoded.
- 8:09Speaker 2: It's a hierarchy. The numbers represent the file system structure.
- 8:13Speaker 2: Let's decode one. Imagine you click on the key labeled one.
- 8:18Speaker 2: On the right side of the screen is the raw
- 8:20Speaker 2: data the hexview. It looks like gibberish, but in the
- 8:23Speaker 2: decoded text column you can see something readable. Let's say
- 8:27Speaker 2: it says e.
- 8:28Speaker 1: Edrive Okay, so key one represents the E drive. That's
- 8:31Speaker 1: our starting point exactly.
- 8:33Speaker 2: Now back to the tree on the left. Underneath key one,
- 8:35Speaker 2: there's a subkey. Let's say it's labeled zero. We click that,
- 8:38Speaker 2: we look at the data again, and the text reveals
- 8:41Speaker 2: new folder.
- 8:42Speaker 1: So you're walking the path. Key one was E key
- 8:45Speaker 1: zero into that is new folder. So the full path
- 8:47Speaker 1: is E new folder You've got.
- 8:48Speaker 2: It's like a set of nesting dolls. Every time you
- 8:50Speaker 2: go deeper into a folder, the registry creates another numbered
- 8:53Speaker 2: subkey inside the previous one. You can literally trace the
- 8:56Speaker 2: user's path click by click by following these numbered keys.
- 9:00Speaker 1: Okay, that's the structure, but what about the preferences. We
- 9:02Speaker 1: talked about the window size, the icon view. Where is that? Ah?
- 9:07Speaker 2: Good question. So we just looked at bagam aru. That's
- 9:09Speaker 2: the map the structure, but there is a sibling key
- 9:12Speaker 2: right next to it called simply.
- 9:14Speaker 1: Bags, bagm are you and bags right.
- 9:17Speaker 2: Bagm are you is the pointer. It tells you the
- 9:19Speaker 2: structure and the order. Bags contains the actual payload the
- 9:23Speaker 2: preference data. So bagam are you proves the folder was accessed.
- 9:27Speaker 2: Bags proves that the user set the view to icons
- 9:30Speaker 2: and the window size to eight hundred by six hundred icee.
- 9:33Speaker 1: Bagam areu is the skeleton and bags is the flesh
- 9:36Speaker 1: on the bones.
- 9:36Speaker 2: That's a great way to put it. And here's why
- 9:38Speaker 2: understanding this manually is so important. Yes, there are fantastic
- 9:42Speaker 2: automated tools out there that will parse all of this
- 9:44Speaker 2: for you in seconds and give you a nice, clean report,
- 9:47Speaker 2: and we use them all the time.
- 9:49Speaker 1: But I feel a butt coming on.
- 9:50Speaker 2: But if you end up in court and a lawyer
- 9:53Speaker 2: challenges your findings, you can't just say, well, the tool
- 9:55Speaker 2: said so. You have to be able to show them
- 9:57Speaker 2: the raw hex data. You need to be able to
- 9:59Speaker 2: say your honor right here in the bagam r ukey
- 10:02Speaker 2: under this specific subkey is the raw text for the
- 10:05Speaker 2: folder secret blueprints.
- 10:07Speaker 1: That's the difference between being a tool operator and a
- 10:09Speaker 1: true expert. The expert can validate the tool's output exactly.
- 10:13Speaker 2: Tools can have bugs, they can misinterpret things. Understanding the
- 10:16Speaker 2: raw structure gives you total confidence in your evidence.
- 10:19Speaker 1: So to synthesize this a bit, the workflow is you
- 10:24Speaker 1: acquire the USR class dot dat or anti search dot
- 10:28Speaker 1: dbat files. You load them into a tool or registry editor,
- 10:31Speaker 1: and you start walking those bag mrukeys to reconstruct the paths.
- 10:35Speaker 2: That's the core of it. And while you're doing that,
- 10:37Speaker 2: you're also checking the bag's key to see the specific
- 10:39Speaker 2: view settings, which adds even more context.
- 10:41Speaker 1: I want to circle back to reliability. You mentioned the
- 10:44Speaker 1: never say never rule in forensics. Could a virus or
- 10:47Speaker 1: some glitch create a shell bag entry?
- 10:50Speaker 2: It's highly unlikely. In all my practical experience and what's
- 10:52Speaker 2: generally accepted in the field, shell bag creation is almost
- 10:55Speaker 2: exclusively user driven. A human has to interact with the
- 10:59Speaker 2: Windows explorer. There aren't really any automated processes that would
- 11:03Speaker 2: create a bag in or U structure that looks like
- 11:05Speaker 2: a person clicking through folders.
- 11:06Speaker 1: This is highly reliable evidence.
- 11:08Speaker 2: It is, but as good investigators we always want to corroborate.
- 11:12Speaker 2: We never want to hang an entire case on just
- 11:15Speaker 2: one artifact. If we can help it, we look for
- 11:17Speaker 2: its friends. Did we also find a shortcut file, a
- 11:20Speaker 2: LNK file pointing to a document in that same folder?
- 11:24Speaker 2: Is there a jumplest entry? When you layer all these
- 11:27Speaker 2: artifacts together, shell bags plus jump lists plus LNK files,
- 11:31Speaker 2: the case becomes rock solid.
- 11:33Speaker 1: It's like finding a muddy boot print. You didn't see
- 11:35Speaker 1: the person, but the print is there. It matches their shoe,
- 11:38Speaker 1: and you also found their wet umbrella by the door.
- 11:41Speaker 2: Perfect analogy. It builds a story that's very, very hard
- 11:44Speaker 2: to refute.
- 11:44Speaker 1: Okay, before we wrap up, let's do a little review
- 11:46Speaker 1: exercise for everyone listening to test this new knowledge.
- 11:50Speaker 2: Let's do it. Okay, Imagine you are investigating a suspect.
- 11:53Speaker 2: They are accused of leaking confidential photos. You analyze their
- 11:57Speaker 2: USR class dot DT file. You find a shell bag
- 11:59Speaker 2: and in the bag mrukey.
- 12:01Speaker 1: Okay. Setting the scene, I'm looking at the data.
- 12:03Speaker 2: That entry points to a folder named confidential photos on
- 12:07Speaker 2: what was the G drive. But when you examine the
- 12:09Speaker 2: suspect's computer, there is no G drive connected. You check
- 12:13Speaker 2: all the partitions, no G drive anywhere. The suspect looks
- 12:16Speaker 2: you right in the eye and says, I have no
- 12:18Speaker 2: idea what you're talking about. I never had those photos.
- 12:20Speaker 2: That drive doesn't exist.
- 12:21Speaker 1: The classic denial. It wasn't me, it was the computer.
- 12:25Speaker 1: So the question for you, the listener, is based on
- 12:28Speaker 1: what we've just discussed. Can you confirm the suspect definitely
- 12:32Speaker 1: viewed that folder?
- 12:33Speaker 2: Think about the mechanism. The answer is yes, absolutely, because
- 12:37Speaker 2: the shell bag is a local record of a viewing preference.
- 12:41Speaker 2: That preference first, a thumbnail view could not exist unless
- 12:45Speaker 2: that folder was actually rendered in an Explorer window by
- 12:48Speaker 2: that specific user. The absence of the drive now doesn't
- 12:51Speaker 2: change the fact that the record was created then busted.
- 12:53Speaker 1: The registry remembers what the user wants to forget.
- 12:56Speaker 2: That's the lesson and it really has been fascinating. It
- 12:59Speaker 2: changed is how you look at your own computer. Every click,
- 13:02Speaker 2: every resize, you're writing a little biography of your actions
- 13:06Speaker 2: in the registry.
- 13:07Speaker 1: You really are. So here's the final thought to leave
- 13:09Speaker 1: you with today. We've talked about how windows remembers your
- 13:12Speaker 1: folder views to be helpful. What does your registry say
- 13:16Speaker 1: about what you were looking at today? If someone were
- 13:20Speaker 1: to walk your bag mrukeys right now, what story would
- 13:23Speaker 1: it tell?
- 13:24Speaker 2: And remember, being curious is a good thing. Just be
- 13:27Speaker 2: aware of the footprints or leaving behind while you explore.
- 13:31Speaker 1: Thanks for joining us on this deep dive into shell bags.
- 13:33Speaker 1: Keep learning, stay curious, and maybe think twice before you
- 13:38Speaker 1: resize that window.
- 13:39Speaker 2: You're just you know, don't do anything you need
- 13:41Speaker 1: To hide in the first place, catch you on the
- 13:42Speaker 1: next deep dive