The Background Activity Moderator is one of the quietest execution artifacts in Windows forensics — a handful of registry values that record the last execution time of every program launched by each user. When Prefetch is disabled, Shimcache is ambiguous, and Amcache has been tampered with, BAM frequently provides the only surviving proof that a specific executable ran under a specific user account.
What Is BAM/DAM?
The Background Activity Moderator (BAM) and Desktop Activity Moderator (DAM) are Windows services introduced in Windows 10 version 1709 (Fall Creators Update, October 2017). BAM tracks execution of background applications, while DAM monitors desktop (foreground) applications. Both services write binary timestamp values to the SYSTEM registry hive under their respective service keys, recording the last execution time of each executable path for each user SID on the system.
Microsoft designed BAM/DAM as part of the Modern Standby power management framework. The operating system uses these timestamps to determine which applications have recently executed and whether they should be allowed to continue running during low-power states. From a forensic perspective, the side effect is invaluable: Windows silently records a per-user, per-executable timestamp every time a program runs — and it does so in the SYSTEM hive, which is typically collected as part of standard forensic triage.
Each registry value under the BAM/DAM key represents one executable. The value name is the full NT device path of the executable (e.g., \Device\HarddiskVolume3\Users\jdoe\Desktop\mimikatz.exe), and the value data is a binary blob containing a Windows FILETIME timestamp representing the last time that executable was run by the user identified in the parent key’s SID.
BAM/DAM records the full NT device path of every executed binary, per user SID. This means it can prove not just that mimikatz.exe ran, but that it ran under a specific user account — a level of attribution that Prefetch alone cannot provide.
Location & Format
Registry Paths
| Service | Registry Path | Windows Version |
|---|---|---|
| BAM (1709–1809) | SYSTEM\CurrentControlSet\Services\bam\UserSettings\{SID} | Windows 10 1709 – 1809 |
| BAM (1903+) | SYSTEM\CurrentControlSet\Services\bam\State\UserSettings\{SID} | Windows 10 1903+ / Windows 11 |
| DAM (1709–1809) | SYSTEM\CurrentControlSet\Services\dam\UserSettings\{SID} | Windows 10 1709 – 1809 |
| DAM (1903+) | SYSTEM\CurrentControlSet\Services\dam\State\UserSettings\{SID} | Windows 10 1903+ / Windows 11 |
In Windows 10 1903, Microsoft moved the BAM/DAM data from Services\bam\UserSettings to Services\bam\State\UserSettings. The addition of the State subkey is critical — if you parse the old path on a 1903+ system, you will find nothing. Always check both paths during analysis.
Value Format
Each value under a user’s SID key follows this structure:
Value Name: Full NT device path of the executable
Example: \Device\HarddiskVolume3\Windows\System32\cmd.exe
Value Data: Binary blob, typically 24 bytes. The first 8 bytes contain a Windows FILETIME timestamp (64-bit little-endian, 100-nanosecond intervals since January 1, 1601 UTC). The remaining bytes contain additional metadata whose purpose is not fully documented.
NT Device Path Resolution
BAM records paths using NT device notation rather than drive letters. The mapping between NT device paths and logical drives is stored in the SYSTEM\MountedDevices registry key. Common mappings include:
# Common NT device path to drive letter mappings \Device\HarddiskVolume1 = C:\ (System Reserved / EFI) \Device\HarddiskVolume2 = C:\ (OS partition, single-partition systems) \Device\HarddiskVolume3 = C:\ (OS partition, multi-partition systems) \Device\HarddiskVolume4 = D:\ (Data or secondary partition) # Example BAM entry decoded: \Device\HarddiskVolume3\Users\jdoe\AppData\Local\Temp\nc.exe = C:\Users\jdoe\AppData\Local\Temp\nc.exe
What It Reveals
BAM/DAM answers a targeted set of forensic questions with high confidence:
- Did a specific executable run? — If a BAM entry exists for the path, the binary executed. BAM does not record file existence, only execution.
- When was the last execution? — The FILETIME timestamp records the most recent execution time with 100-nanosecond precision.
- Which user account ran it? — Each BAM entry is stored under a specific user SID, providing direct user attribution.
- What was the full path of the executable? — The NT device path reveals whether the tool was in
System32,%TEMP%, a USB drive, or a user’s Desktop. - Did a tool run from a non-standard location? —
cmd.exerunning from\Device\HarddiskVolume3\Users\jdoe\Desktop\cmd.exe(a copied binary) versus\Device\HarddiskVolume3\Windows\System32\cmd.exeis immediately visible. - Did execution occur from a removable device? — Paths beginning with
\Device\HarddiskVolume5or similar high-numbered volumes often indicate USB drives, providing evidence of portable tool execution.
Unlike Prefetch (which is system-wide and not per-user) or Shimcache (which records file presence, not necessarily execution), BAM ties execution directly to a user SID. In shared workstation environments, this distinction is critical for attributing malicious activity to a specific individual.
Forensic Use Cases
1. Lateral Movement Tool Detection
An attacker moves laterally using PsExec, dropping PSEXESVC.exe on a target host. BAM on the target records \Device\HarddiskVolume3\Windows\PSEXESVC.exe under the compromised service account SID. Even if the attacker deletes PSEXESVC.exe after use, the BAM entry persists until the next reboot — and if the SYSTEM hive is collected before reboot, the execution is proven.
2. Credential Dumping Attribution
An administrator account runs mimikatz.exe from a USB drive. BAM records \Device\HarddiskVolume5\tools\mimikatz.exe under the administrator’s SID. The NT device path proves the tool was on a removable volume (Volume5), not the system drive. Combined with USB device connection artifacts from SYSTEM\Enum\USBSTOR, the investigator can identify the specific USB device used.
3. Insider Threat — Unauthorized Tool Execution
Corporate policy prohibits the use of cloud sync clients. An employee downloads and runs rclone.exe from %APPDATA%. BAM records the execution with the employee’s SID. Even though the employee later deletes the binary, the BAM entry proves execution occurred, and the FILETIME timestamp pins it to a specific date and time.
4. Ransomware Execution Timeline
During a ransomware investigation, BAM entries on the patient-zero host show the ransomware payload executed from \Device\HarddiskVolume3\ProgramData\svchost32.exe at 02:47:23 UTC. This timestamp, combined with the user SID, identifies which compromised account was used to trigger the encryption. Earlier BAM entries for reconnaissance tools (net.exe, nltest.exe, AdFind.exe) provide the pre-encryption activity timeline.
5. Validating Shimcache Entries
Shimcache records the presence of a suspicious executable but does not confirm execution (in Windows 10, Shimcache entries can be created by file copy operations). A corresponding BAM entry for the same path confirms actual execution, resolving the ambiguity. BAM serves as the execution confirmation that Shimcache lacks.
Volatility & Reboot Behavior
In Windows 10 version 1809 and later (including all Windows 11 builds), BAM/DAM data stored under the State subkey is volatile — it is cleared on every reboot. This fundamentally changes the artifact’s forensic value. If the system has rebooted since the incident, BAM data from the incident window is gone.
| Windows Version | Registry Path | Survives Reboot? | Notes |
|---|---|---|---|
| 1709 – 1803 | Services\bam\UserSettings\{SID} | Yes | Data persists across reboots; highest forensic value |
| 1809 | Services\bam\State\UserSettings\{SID} | No — volatile | Cleared on reboot; collect before restart |
| 1903 – 22H2 | Services\bam\State\UserSettings\{SID} | No — volatile | Cleared on reboot; collect before restart |
| Windows 11 (all) | Services\bam\State\UserSettings\{SID} | No — volatile | Cleared on reboot; collect before restart |
On any system running Windows 10 1809 or later, BAM data must be collected before the system reboots. If an incident responder arrives after a reboot, BAM entries from the incident window will be empty. This makes live-system triage collection of the SYSTEM hive an absolute priority in the first minutes of response.
Acquisition Methods
Because BAM is volatile on modern Windows builds, collection priority is immediate. Do not reboot the system. Do not allow the user to shut down. Collect the SYSTEM hive as the first triage action.
Live System — Registry Export
:: Export the BAM key directly from a live system (1903+ path) reg export "HKLM\SYSTEM\CurrentControlSet\Services\bam\State\UserSettings" C:\Evidence\bam_export.reg :: For pre-1903 systems, use the older path reg export "HKLM\SYSTEM\CurrentControlSet\Services\bam\UserSettings" C:\Evidence\bam_export.reg :: Also export the DAM key reg export "HKLM\SYSTEM\CurrentControlSet\Services\dam\State\UserSettings" C:\Evidence\dam_export.reg
Live System — SYSTEM Hive Copy
:: Save a copy of the SYSTEM hive (contains BAM/DAM data) reg save HKLM\SYSTEM C:\Evidence\SYSTEM_hive :: Using KAPE for automated collection kape.exe --tsource C: --tdest C:\Evidence\KAPE_Output --target RegistryHives :: Using Velociraptor :: Artifact: Windows.Registry.BAM :: Or: Windows.KapeFiles.Targets with target "RegistryHives"
Forensic Image — Direct Extraction
# Mount forensic image read-only mount -o ro,noexec,nodev /dev/sdb1 /mnt/evidence # Copy the SYSTEM hive cp /mnt/evidence/Windows/System32/config/SYSTEM /analysis/registry/ # Also collect the SAM hive for SID-to-username resolution cp /mnt/evidence/Windows/System32/config/SAM /analysis/registry/
Parsing Tools & Analysis
| Tool | Author | License | Output | Notes |
|---|---|---|---|---|
| Registry Explorer | Eric Zimmerman | Free | GUI | Browse BAM keys directly; displays FILETIME timestamps in human-readable format |
| RECmd | Eric Zimmerman | Free | CSV | Batch plugin for BAM; outputs all entries across all SIDs in one CSV |
| RegRipper | Harlan Carvey | Open source | Text | bam plugin extracts and formats BAM timestamps |
| Autopsy | Basis Technology | Open source | GUI | Registry Viewer module can navigate to BAM keys |
| python-registry | Will Ballenthin | Open source | Python API | Programmatic access for custom scripts |
Parsing with RECmd
:: Parse BAM entries using RECmd with the BAM batch plugin RECmd.exe -f C:\Evidence\SYSTEM_hive --bn BatchExamples\BAM.reb --csv C:\Analysis\BAM_Output :: Output: CSV with columns: :: LastWriteTimestamp, HivePath, Description, Category, :: ValueName (exe path), ValueData (timestamp), Comment
Parsing with RegRipper
:: Run the bam plugin against the SYSTEM hive rip.exe -r C:\Evidence\SYSTEM_hive -p bam :: Sample output: :: bam v.20200518 :: S-1-5-21-3456789012-1234567890-987654321-1001 :: \Device\HarddiskVolume3\Windows\System32\cmd.exe :: 2026-03-15 14:32:07 UTC :: :: \Device\HarddiskVolume3\Users\jdoe\Desktop\mimikatz.exe :: 2026-03-15 14:28:51 UTC
Custom Python Parser
from Registry import Registry import struct, datetime reg = Registry.Registry('/analysis/registry/SYSTEM') # Determine current ControlSet select = reg.open('Select') current = select.value('Current').value() cs = f'ControlSet00{current}' # Navigate to BAM State (1903+ path) try: bam = reg.open(f'{cs}\\Services\\bam\\State\\UserSettings') except: bam = reg.open(f'{cs}\\Services\\bam\\UserSettings') # pre-1903 for sid_key in bam.subkeys(): print(f'\n=== {sid_key.name()} ===') for val in sid_key.values(): if val.name() == 'Version' or val.name() == 'SequenceNumber': continue ts_bytes = val.value()[:8] ts = struct.unpack('<Q', ts_bytes)[0] dt = datetime.datetime(1601,1,1) + datetime.timedelta(microseconds=ts//10) print(f' {dt} UTC {val.name()}')
Retention & Persistence
| Property | Pre-1809 | 1809+/Win11 |
|---|---|---|
| Survives reboot | Yes | No — volatile, cleared on reboot |
| Survives app uninstall | Yes — entries remain | Yes — entries remain (until reboot) |
| Survives user logoff | Yes | Yes (until reboot) |
| Maximum entries | Not explicitly limited | Not explicitly limited; observed up to ~500 |
| Timestamp granularity | 100 nanoseconds (FILETIME) | 100 nanoseconds (FILETIME) |
| Records only last execution | Yes — overwrites previous timestamp | Yes — overwrites previous timestamp |
BAM records only the most recent execution timestamp for each executable path. If mimikatz.exe was run five times, BAM shows only the last execution. For execution frequency data, cross-reference with Prefetch (which includes a run count) or Amcache (which records multiple timestamps in some versions).
Anti-Forensics Resilience
BAM/DAM has a mixed anti-forensics profile. Its greatest vulnerability is its volatile nature on modern Windows builds.
| Method | Clears BAM? | Explanation |
|---|---|---|
| System reboot | Yes (1809+) | On modern builds, BAM data under State is volatile and cleared on every reboot |
| CCleaner | No | Does not target SYSTEM hive BAM keys |
| BleachBit | No | No module targets BAM registry paths |
| Manual registry deletion | Yes | An administrator can delete BAM subkeys using regedit or reg delete; detectable via last-write timestamps on parent keys |
| Timestomping | Partial | Registry value data can be modified, but the key’s LastWriteTime metadata will reflect the modification |
| SYSTEM hive deletion | Yes | Destroying the SYSTEM hive destroys BAM; also destroys the system’s ability to boot |
The biggest threat to BAM evidence is not sophisticated anti-forensics — it is a simple reboot. On Windows 10 1809+ and Windows 11, every restart erases all BAM entries. Well-meaning IT staff who “restart the computer to fix the problem” before calling incident response will destroy this artifact entirely. First-responder training must emphasize: do not reboot the system.
MITRE ATT&CK Detection Mapping
BAM/DAM entries provide evidentiary support for detecting the following MITRE ATT&CK techniques:
| Technique | Name | BAM Evidence |
|---|---|---|
T1059 T1059 | Command and Scripting Interpreter | Execution of cmd.exe, powershell.exe, wscript.exe, cscript.exe from non-standard paths or by unexpected users |
T1204 T1204 | User Execution | Execution of unknown binaries from user-writable directories (Desktop, Downloads, %TEMP%) |
T1570 T1570 | Lateral Tool Transfer | Execution of tools like PsExec, WMIC, or custom payloads appearing simultaneously across multiple hosts |
T1003 T1003 | OS Credential Dumping | Execution of mimikatz.exe, procdump.exe, secretsdump.exe from any path |
T1036 T1036 | Masquerading | System binaries executed from non-standard paths (e.g., svchost.exe from %TEMP% instead of System32) |
T1105 T1105 | Ingress Tool Transfer | Execution of newly downloaded tools from Downloads or staging directories |
Related Artifacts & Cross-References
Complementary Artifacts
| Artifact | Relationship to BAM | Cross-Correlation Value |
|---|---|---|
| Prefetch | Provides run count and first/last execution times | Prefetch adds frequency; BAM adds user attribution |
| Shimcache | Records file metadata and potential execution | BAM confirms execution that Shimcache can only suggest |
| Amcache | Records file hashes and detailed metadata for executed programs | Amcache provides SHA1 hash; BAM provides per-user timestamp |
| SRUM.db | Records per-app resource usage | SRUM shows what the app did (network, CPU); BAM shows who ran it |
| Security.evtx 4688 | Process creation events with command-line logging | 4688 provides command-line arguments; BAM provides the execution timestamp when event logs have rolled over |
| UserAssist | Records GUI program execution per user | UserAssist tracks GUI interaction; BAM tracks all execution including CLI tools |
References
- Eric Zimmerman, “Registry Explorer / RECmd” — https://ericzimmerman.github.io/
- Harlan Carvey, “RegRipper — BAM Plugin” — https://github.com/keydet89/RegRipper3.0
- SANS Institute, “Windows Forensic Analysis Poster” — https://www.sans.org/posters/windows-forensic-analysis/
- 13Cubed, “BAM — Background Activity Moderator” — https://www.13cubed.com
- Andrew Rathbun, “BAM Internals and Forensic Analysis” — https://github.com/AndrewRathbun
- ForensicArtifacts.com, “BAM Artifact Definition” — https://github.com/ForensicArtifacts/artifacts
- Microsoft, “Modern Standby” — https://learn.microsoft.com
Mjolnir Security — Digital Forensics & Incident Response
Mjolnir Security provides 24/7 incident response, digital forensics, and expert witness testimony. Our DFIR team specializes in registry artifact analysis, execution timeline reconstruction, and volatile evidence collection on live systems.
mjolnirsecurity.com — 24/7: +1 833 403 5875