Latest / CyberCode Academy / Course 36 - Windows Forensics and Tools | Episode 13: Decoding Registry Artifacts and Connection History
Transcript
- 0:00Speaker 1: Picture this. You're at your desk, right and a coworker
- 0:03Speaker 1: hands you a flash drive with a presentation on it.
- 0:06Speaker 2: It happens all the time, exactly.
- 0:07Speaker 1: So you plug it into your computer, you hear that
- 0:09Speaker 1: familiar little hardware shain got them, Yeah, that exact sent
- 0:12Speaker 1: and then you drag the file onto your desktop. You
- 0:16Speaker 1: pull the drive out and hand it back. It feels
- 0:18Speaker 1: totally like ephemeral, like a quick digital handshake, right in
- 0:23Speaker 1: and out. The drive is unmounted, the transaction is over,
- 0:26Speaker 1: and your system resources just go back to whatever they
- 0:28Speaker 1: were doing. But here's the thing. That brief connection wasn't temporary.
- 0:34Speaker 2: At all, not even a little bit.
- 0:36Speaker 1: The absolute second you interface that drive with your system,
- 0:39Speaker 1: the operating system generated this permanent, highly detailed footprint very
- 0:45Speaker 1: deep inside its configuration files.
- 0:47Speaker 2: And it's all driven by caching and you know optimization.
- 0:50Speaker 2: I mean, the operating system doesn't want to reinstall the
- 0:52Speaker 2: whole driver stack from scratch the very next time you
- 0:55Speaker 2: plug that exact piece of hardware.
- 0:57Speaker 1: It wants to save time exactly.
- 0:58Speaker 2: It wants to minimize latent, so it saves the hardware profile.
- 1:02Speaker 2: And the byproduct of that efficiency is this massive persistent
- 1:06Speaker 2: log of literally every external device that has ever touched
- 1:10Speaker 2: the machine.
- 1:11Speaker 1: So today, our mission for this deep dive is to
- 1:13Speaker 1: follow those exact footprints. We're going to uncover the hidden
- 1:17Speaker 1: history of external devices mounted on a Windows machine. Will
- 1:21Speaker 1: explore the actual digital breadcrumbs left behind, the mechanics of
- 1:25Speaker 1: you know, why they exist in the first place, and
- 1:28Speaker 1: how forensic investigators use them to basically solve mysteries.
- 1:31Speaker 2: And what's fascinating here is the why behind the forensic
- 1:35Speaker 2: side of things. Right in an investigation, say a cybersecurity
- 1:39Speaker 2: incident or something, the actual data on a drive might
- 1:42Speaker 2: be gone, the physical drive itself might be at the
- 1:44Speaker 2: bottom of a lake somewhere literally gone. Yeah, but estalaghing
- 1:47Speaker 2: just the sheer presence of that hardware on a specific
- 1:50Speaker 2: computer at a given time that allows investigators to link
- 1:53Speaker 2: a specific USB drive found at a crime scene directly
- 1:57Speaker 2: back to a suspects machine.
- 1:58Speaker 1: The machine remembers, it.
- 2:00Speaker 2: Retains the ghost of the hardware, and that is often
- 2:03Speaker 2: enough to completely crack a timeline wide open.
- 2:05Speaker 1: Okay, let's untack this because to track these artifacts, we
- 2:09Speaker 1: have to understand what exactly is leaving them. We need
- 2:12Speaker 1: to look at how Windows actually categorizes these devices when
- 2:16Speaker 1: they get plugged in, right.
- 2:17Speaker 2: Because not all USBs are treated the same by the
- 2:19Speaker 2: system exactly.
- 2:20Speaker 1: When we're evaluating these endpoints, we're basically looking at three
- 2:24Speaker 1: main types. You've got your standard USB mass storage devices,
- 2:28Speaker 1: removable storage, and then MTP, which stands for Media Transfer
- 2:32Speaker 1: Protocol devices, right.
- 2:33Speaker 2: And MTP devices are usually things like your digital cameras
- 2:37Speaker 2: or your smartphones.
- 2:37Speaker 1: And the specific type of device dictates exactly which driver's
- 2:41Speaker 1: windows and stalls. It's almost like, well, think of it
- 2:45Speaker 1: like different vehicles pulling into a secure facility like that. Yeah, so,
- 2:49Speaker 1: like a massive delivery truck which would be your mass
- 2:52Speaker 1: storage device, gets a totally different level of logging and
- 2:55Speaker 1: a different driver assigned to handle it than say a
- 2:59Speaker 1: visitor rolling up up on a bicycle, which would be
- 3:01Speaker 1: the MTP device.
- 3:02Speaker 2: That's a great analogy because of those different drivers acting
- 3:05Speaker 2: as escorts. The evidence isn't just dropped in one neat
- 3:08Speaker 2: little folder. Examiners actually have to collect details from multiple
- 3:11Speaker 2: scattered locations across a Windows machine to piece together the
- 3:15Speaker 2: full story.
- 3:16Speaker 1: Which logically brings up the big question, Yeah, so where
- 3:19Speaker 1: exactly is this information hiding?
- 3:22Speaker 2: Mostly we were talking about the Windows registry.
- 3:24Speaker 1: The registry the system's hidden guestbook exactly.
- 3:28Speaker 2: It tracks mounted volumes, it assigns drive letters. It literally
- 3:32Speaker 2: records everything USB, CD rahms, memory cards, cameras.
- 3:36Speaker 1: So let's do a step by step walkthrough of those
- 3:39Speaker 1: for you listening, because it gets pretty granular. Let's start
- 3:42Speaker 1: with the master ledger, which is the USD store key.
- 3:45Speaker 1: That's usdstr the anchor point right the moment a storage
- 3:50Speaker 1: device connects. A subkey is created here. It tracks the vendor,
- 3:53Speaker 1: the brand, and critically the unique serial number of the device.
- 3:57Speaker 2: And inside that serial number key, Windows records the very
- 4:01Speaker 2: first time that specific device was attached and the very
- 4:04Speaker 2: last time it was.
- 4:04Speaker 1: Attached, which is huge for building a timeline. But wait,
- 4:08Speaker 1: if I plug in ten different USB sticks over the
- 4:11Speaker 1: course of a month, won't the system get confused about
- 4:14Speaker 1: which one was like drive E or whatever.
- 4:16Speaker 2: Well, that transitions us to the next key, which is
- 4:18Speaker 2: mounted devices, And you just hit on a very real
- 4:21Speaker 2: forensic hurdle. Oh really, yeah, The mounted device is key
- 4:25Speaker 2: is what allows investigators to match that serial number we
- 4:28Speaker 2: just found to the specific drive letter the system assigned it, so.
- 4:31Speaker 1: It links the serial number to E.
- 4:34Speaker 2: Or f exactly. But to answer your question, yes, the
- 4:38Speaker 2: system reuses drive letters, so the mapped drive letter in
- 4:41Speaker 2: mounted devices will only display the serial number for the
- 4:45Speaker 2: most recently mounted device.
- 4:47Speaker 1: Ah, so it overwrites the older ones to save space.
- 4:50Speaker 2: It does drops the historical allocations, so if you had
- 4:52Speaker 2: ten drives, use e, you're only seeing the last one there.
- 4:55Speaker 1: Okay, so you have the hardware d the serial number,
- 4:58Speaker 1: the drive letter, but none of that tells me who
- 5:00Speaker 1: was actually sitting at the keyboard, Like what if it's
- 5:02Speaker 1: a shared family computer or a shared server.
- 5:04Speaker 2: And that is why we have the mount points two
- 5:07Speaker 2: key mountpoint Yes, this one is crucial. The other keys
- 5:11Speaker 2: are global, right, but mountpoints two is stored in the
- 5:14Speaker 2: individual nt user dot dot hive. For each user.
- 5:18Speaker 1: Profile ntusor dot dat Right, it.
- 5:22Speaker 2: Lists the device IDs connected by a particular user. So
- 5:25Speaker 2: an investigator might have to dig through every single user
- 5:27Speaker 2: profile on that machine to figure out exactly who was
- 5:30Speaker 2: logged in and active when that drive was plugged in. Wow.
- 5:33Speaker 1: Okay, so it's a multi stage process. And then I
- 5:36Speaker 1: think there's one more piece to the puzzle, right, the
- 5:38Speaker 1: system hive.
- 5:38Speaker 2: Yes, the system hive provides the vendor and product ID,
- 5:42Speaker 2: and investigators use its last right time on the serial
- 5:45Speaker 2: number key to definitively confirm the last connected time.
- 5:48Speaker 1: Okay, So for anyone wanting to know exactly where this
- 5:50Speaker 1: master driver file lives on their machine, I'll spell out
- 5:52Speaker 1: the path slowly. You go to your C drive, so
- 5:55Speaker 1: C call in backslash, then the Windows folder backslash, thirty
- 6:00Speaker 1: two backslash drivers backslash, and finally us gerstore dot access.
- 6:05Speaker 1: That's the one but, and this is a massive but
- 6:08Speaker 1: for anyone thinking about looking into this on a live machine,
- 6:10Speaker 1: there is a huge practical caveat here.
- 6:12Speaker 2: Like absolutely the observer effect.
- 6:14Speaker 1: Yes, explain what happens if an investigator just walks up
- 6:18Speaker 1: to a suspect's laptop and plugs in their own USB
- 6:21Speaker 1: drive full of diagnostic tools.
- 6:23Speaker 2: It is a rookie mistake because the very act of
- 6:27Speaker 2: inserting the investigators USB overwrites the environment they're trying to investigate.
- 6:31Speaker 1: The system treats the diagnostic drive just like any other
- 6:34Speaker 1: drive exactly.
- 6:35Speaker 2: It generates a new USB store entry, updates the last
- 6:39Speaker 2: connected timestamps in the system hive, and potentially overwrites that
- 6:43Speaker 2: mounted device. Is key we just talked about by seizing
- 6:45Speaker 2: a drive.
- 6:46Speaker 1: Letter, you literally destroy the evidence by trying to read it.
- 6:49Speaker 2: You do, which is why you can't just run tools
- 6:51Speaker 2: from a USB on a live system. If you care
- 6:53Speaker 2: about forensic integrity, you have to safely extract the raw
- 6:56Speaker 2: registry hives and analyze them offline.
- 6:59Speaker 1: Okay, So on that risk of altering evidence, let's talk
- 7:02Speaker 1: about how we actually view this data safely without like
- 7:05Speaker 1: manually digging through thousands of lines of raw registry code.
- 7:08Speaker 2: Nobody wants to do that manually.
- 7:09Speaker 1: No way, and that brings us to a specific super
- 7:12Speaker 1: popular utility called usbdview.
- 7:14Speaker 2: Ah usbdview created by Nearsoft. It's a lifesaver.
- 7:18Speaker 1: Yeah. So for you listening picture this, you download it
- 7:21Speaker 1: through a browser like Chrome on Windows ten and just
- 7:25Speaker 1: unzipit with seven zip or Winner.
- 7:27Speaker 2: And the beauty of it is that it requires absolutely
- 7:30Speaker 2: zero installation, right, it has.
- 7:32Speaker 1: No installation footprint at all. You just run the executable
- 7:35Speaker 1: and boom, this incredibly detailed color coded list appears.
- 7:39Speaker 2: And that color coding system is what accelerates the whole
- 7:42Speaker 2: triage process.
- 7:43Speaker 1: Let's walk through the colors. You don't even need to
- 7:45Speaker 1: see the screen to get this. First, you have the gray.
- 7:48Speaker 2: Lines the ghosts of the past.
- 7:50Speaker 1: Right, devices that were connected previously but they are not
- 7:53Speaker 1: currently plugged into the machine.
- 7:54Speaker 2: Then you have green that means the device is currently
- 7:56Speaker 2: plugged in and actively mounted. Basically, it's safe to physically
- 8:00Speaker 2: unplug without digital disconnecting.
- 8:02Speaker 1: And finally, red lines those represent disabled devices stuff the
- 8:07Speaker 1: operating system has explicitly shut off. It's so intuitive, it
- 8:10Speaker 1: really is, and it's not just colors. By virtually double
- 8:14Speaker 1: clicking any device on that list, you get the actionable
- 8:17Speaker 1: data the last plug and unplugged dates, which is vital
- 8:21Speaker 1: for building a crime timeline, the drive letter, and the
- 8:24Speaker 1: serial number. It aggregates everything from USB store and mounted
- 8:28Speaker 1: devices into one clean matrix.
- 8:31Speaker 2: But and if we connect this to the bigger picture,
- 8:34Speaker 2: parsing tools are only as reliable as your understanding of
- 8:37Speaker 2: the quirks of the operating system.
- 8:39Speaker 1: Yeah, you mentioned there's a trap here with the created
- 8:42Speaker 1: date metric.
- 8:42Speaker 2: It is a massive trap for a rookie investigator. So
- 8:46Speaker 2: the created date usually means the exact time you first
- 8:49Speaker 2: plug the device into a USB port.
- 8:51Speaker 1: Right, makes sense the first time the system sees it.
- 8:53Speaker 2: Right, But on a legacy architecture, specifically a Window seven machine,
- 8:57Speaker 2: which believe it or not, is still everywhere in legacy
- 9:00Speaker 2: the enterprise environments. That created date value is completely reinitialized
- 9:04Speaker 2: with the current date and time every single time the
- 9:07Speaker 2: system reboots.
- 9:08Speaker 1: Wait, really every time it restarts.
- 9:09Speaker 2: Every single time, the kernel basically rebuilds the device tree
- 9:13Speaker 2: if the hardware isn't actively communicating.
- 9:15Speaker 1: Oh man, So an investigator could look at usbdview see
- 9:20Speaker 1: a created date of this morning and assume the USB
- 9:23Speaker 1: was just plugged in today.
- 9:25Speaker 2: Exactly, completely missing the fact that the actual initial intrusion
- 9:28Speaker 2: happened like six months ago.
- 9:31Speaker 1: That is wild. You really have to know the underlying
- 9:34Speaker 1: OS behavior. But here's where it gets really interesting with
- 9:37Speaker 1: usbdview because it's not just a passive read only tool
- 9:41Speaker 1: for looking at forensic data.
- 9:43Speaker 2: Right. It has active capabilities.
- 9:44Speaker 1: Yeah, you can actually use it to uninstall, disconnect, or
- 9:48Speaker 1: completely disable devices directly from the interface. It gives you
- 9:51Speaker 1: administrative control over the system's hardware state.
- 9:54Speaker 2: Which is super useful for system admins. Yea, if you
- 9:56Speaker 2: have stale driver knows causing conflicts, you can just forcefully
- 10:00Speaker 2: prune the registry of historical devices. It forces the OS
- 10:03Speaker 2: to treat a known device as brand new the next
- 10:05Speaker 2: time you plug it in.
- 10:06Speaker 1: So it's both a microscope and a scalpel. Okay, we
- 10:09Speaker 1: have covered a massive amount of ground today. We've traced
- 10:11Speaker 1: the entire life cycle of a physical connection, from the
- 10:14Speaker 1: hardware categories down to the registry keys and the tools
- 10:17Speaker 1: used to aggregate the data safely.
- 10:19Speaker 2: The architecture is dense, yeah, but it leaves a highly
- 10:22Speaker 2: reliable audit trail if you know where to look exactly.
- 10:26Speaker 1: So let's be a quick review session to test what
- 10:28Speaker 1: you've learned today. Think of it as an auditory pop quiz.
- 10:31Speaker 2: Let's do it.
- 10:31Speaker 1: Okay, listener, here's your scenario. You are analyzing an offline
- 10:35Speaker 1: registry hive. You've already found the unique serial number of
- 10:39Speaker 1: a suspicious USB drive. Now which registry key allows investigators
- 10:44Speaker 1: to match that device serial number to the specific drive
- 10:47Speaker 1: letter or volume that was mounted when the USB was inserted?
- 10:50Speaker 2: A mounted devices, B mounted drives, C mount points two
- 10:56Speaker 2: or D mount disks two.
- 10:57Speaker 1: Think about which key handles the volume manager's routing table.
- 11:01Speaker 2: What's the answer.
- 11:01Speaker 1: The answer is A, the mounted device is key.
- 11:04Speaker 2: Right, and just remind you why B and D don't
- 11:06Speaker 2: even exist.
- 11:07Speaker 1: We just made those up right, They are completely fabricated
- 11:10Speaker 1: and see mount points too. That's the one stored in
- 11:12Speaker 1: the NTUS or dot data hive that tells you which
- 11:15Speaker 1: specific user was logged in. It establishes the who, but
- 11:19Speaker 1: it doesn't give you the system wide drive letter mapping.
- 11:22Speaker 2: You have to correlate the hardware configuration with the user
- 11:24Speaker 2: session to actually prove intent exactly.
- 11:27Speaker 1: To sum it all up, knowing exactly which drives were
- 11:30Speaker 1: connected to a specific machine is the key to linking
- 11:34Speaker 1: a physical device found at a crime scene to a
- 11:36Speaker 1: digital footprint. You can solve the case even when the
- 11:40Speaker 1: local machine has absolutely zero actual file data left on it.
- 11:44Speaker 1: The structure of the operating system itself is the ledger.
- 11:47Speaker 2: It really is. So only be you with a final
- 11:50Speaker 2: provocative thought, something to really moll over. Oh this is
- 11:53Speaker 2: good one. We talked entirely about local registries today, but
- 11:56Speaker 2: think about how deeply integrated modern Windows operating systems are
- 12:00Speaker 2: with the cloud. Now. Windows ten and eleven aggressively sync configuration, data, preferences,
- 12:05Speaker 2: and system states to Azure and linked Microsoft accounts.
- 12:09Speaker 1: All the time for seamless cross device experiences.
- 12:12Speaker 2: Exactly so, if your local registry highs are continuously being
- 12:15Speaker 2: backed up and synchronized, to the cloud. Does the forensic
- 12:18Speaker 2: footprint of that brief USB connection actually remain confined to
- 12:22Speaker 2: your local hardware?
- 12:23Speaker 1: Probably not right?
- 12:24Speaker 2: Or is your localized hardware history now permanently etched into
- 12:28Speaker 2: a remote, distributed cloud ledger sitting on a server somewhere
- 12:32Speaker 2: totally accessible long after you've thrown that physical laptop into
- 12:35Speaker 2: a recycler. Next time you borrow friends flash drive, plug
- 12:38Speaker 2: your phone into a public library computer, or snap a
- 12:41Speaker 2: camera into a work laptop, just remember your digital fingerprint
- 12:45Speaker 2: might be a lot bigger and a lot more permanent
- 12:47Speaker 2: than you think who might be looking for it