Forensic ArtifactWindows: Execution

BAM / DAM — Background Activity Moderator

Background/Desktop Activity Moderator records execution timestamps for background and desktop applications. Available in Windows 10 1709+ as a lightweight execution artifact.

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.

Key Insight

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

ServiceRegistry PathWindows 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
Path Change Warning

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:

Binary Value 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:

PATH MAPPING
# 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:

Attribution Value

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

Critical Warning

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 VersionRegistry PathSurvives Reboot?Notes
1709 – 1803Services\bam\UserSettings\{SID}YesData persists across reboots; highest forensic value
1809Services\bam\State\UserSettings\{SID}No — volatileCleared on reboot; collect before restart
1903 – 22H2Services\bam\State\UserSettings\{SID}No — volatileCleared on reboot; collect before restart
Windows 11 (all)Services\bam\State\UserSettings\{SID}No — volatileCleared on reboot; collect before restart
Collection Imperative

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

Collection Priority

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

CMD / ADMIN
:: 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

CMD / ADMIN
:: 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

BASH / FORENSICS
# 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

ToolAuthorLicenseOutputNotes
Registry ExplorerEric ZimmermanFreeGUIBrowse BAM keys directly; displays FILETIME timestamps in human-readable format
RECmdEric ZimmermanFreeCSVBatch plugin for BAM; outputs all entries across all SIDs in one CSV
RegRipperHarlan CarveyOpen sourceTextbam plugin extracts and formats BAM timestamps
AutopsyBasis TechnologyOpen sourceGUIRegistry Viewer module can navigate to BAM keys
python-registryWill BallenthinOpen sourcePython APIProgrammatic access for custom scripts

Parsing with RECmd

CMD / FORENSICS
:: 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

CMD / FORENSICS
:: 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

PYTHON / BAM ANALYSIS
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

PropertyPre-18091809+/Win11
Survives rebootYesNo — volatile, cleared on reboot
Survives app uninstallYes — entries remainYes — entries remain (until reboot)
Survives user logoffYesYes (until reboot)
Maximum entriesNot explicitly limitedNot explicitly limited; observed up to ~500
Timestamp granularity100 nanoseconds (FILETIME)100 nanoseconds (FILETIME)
Records only last executionYes — overwrites previous timestampYes — overwrites previous timestamp
Single Timestamp Limitation

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.

MethodClears BAM?Explanation
System rebootYes (1809+)On modern builds, BAM data under State is volatile and cleared on every reboot
CCleanerNoDoes not target SYSTEM hive BAM keys
BleachBitNoNo module targets BAM registry paths
Manual registry deletionYesAn administrator can delete BAM subkeys using regedit or reg delete; detectable via last-write timestamps on parent keys
TimestompingPartialRegistry value data can be modified, but the key’s LastWriteTime metadata will reflect the modification
SYSTEM hive deletionYesDestroying the SYSTEM hive destroys BAM; also destroys the system’s ability to boot
Practical Resilience

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:

TechniqueNameBAM Evidence
T1059 T1059Command and Scripting InterpreterExecution of cmd.exe, powershell.exe, wscript.exe, cscript.exe from non-standard paths or by unexpected users
T1204 T1204User ExecutionExecution of unknown binaries from user-writable directories (Desktop, Downloads, %TEMP%)
T1570 T1570Lateral Tool TransferExecution of tools like PsExec, WMIC, or custom payloads appearing simultaneously across multiple hosts
T1003 T1003OS Credential DumpingExecution of mimikatz.exe, procdump.exe, secretsdump.exe from any path
T1036 T1036MasqueradingSystem binaries executed from non-standard paths (e.g., svchost.exe from %TEMP% instead of System32)
T1105 T1105Ingress Tool TransferExecution of newly downloaded tools from Downloads or staging directories

Related Artifacts & Cross-References

Complementary Artifacts

ArtifactRelationship to BAMCross-Correlation Value
PrefetchProvides run count and first/last execution timesPrefetch adds frequency; BAM adds user attribution
ShimcacheRecords file metadata and potential executionBAM confirms execution that Shimcache can only suggest
AmcacheRecords file hashes and detailed metadata for executed programsAmcache provides SHA1 hash; BAM provides per-user timestamp
SRUM.dbRecords per-app resource usageSRUM shows what the app did (network, CPU); BAM shows who ran it
Security.evtx 4688Process creation events with command-line logging4688 provides command-line arguments; BAM provides the execution timestamp when event logs have rolled over
UserAssistRecords GUI program execution per userUserAssist tracks GUI interaction; BAM tracks all execution including CLI tools

References

  1. Eric Zimmerman, “Registry Explorer / RECmd” — https://ericzimmerman.github.io/
  2. Harlan Carvey, “RegRipper — BAM Plugin” — https://github.com/keydet89/RegRipper3.0
  3. SANS Institute, “Windows Forensic Analysis Poster” — https://www.sans.org/posters/windows-forensic-analysis/
  4. 13Cubed, “BAM — Background Activity Moderator” — https://www.13cubed.com
  5. Andrew Rathbun, “BAM Internals and Forensic Analysis” — https://github.com/AndrewRathbun
  6. ForensicArtifacts.com, “BAM Artifact Definition” — https://github.com/ForensicArtifacts/artifacts
  7. 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.

Digital ForensicsIncident ResponseExpert WitnessArtifact AnalysisRegistry ForensicsInsider Threat

mjolnirsecurity.com — 24/7: +1 833 403 5875