Execution
BAM / DAM (Background Activity Moderator)
BAM and DAM cheat sheet: SYSTEM hive keys per Windows 10 build, per-user SIDs, last execution FILETIME, seven-day retention and investigation tips.
- Location
- SYSTEM\CurrentControlSet\Services\bam\State\UserSettings\<SID>
- Proves
- Which user ran which executable, and when it last ran
- Timestamps
- Last execution time per executable (first 8 bytes of the value data) as FILETIME, UTC; SID key LastWrite
- Retention
- Entries older than about 7 days are removed at boot; earlier activity only survives in shadow-copy SYSTEM hives
- Access
- Administrator; SYSTEM hive locked live: reg query works live, otherwise collect via raw NTFS (KAPE) or VSS
- Evidence of
- ExecutionUser activity
- Type
- Registry
- Windows
- 1011
- KAPE target
- RegistryHivesSystem
- Velociraptor
- Windows.Triage.Targets:RegistryHivesSystem
Tools
Compare all toolsWhat it is
The Background Activity Moderator (BAM) is a Windows service driver, introduced in Windows 10 version 1709, that throttles background applications. The Desktop Activity Moderator (DAM) does a similar job, mainly on devices with modern standby. To do this they track executables per user and store the time each one was last seen running in the SYSTEM hive. The result is one of the few execution artifacts that is attributed to a user SID.
Location
| Windows build | Key (SYSTEM hive) |
|---|---|
| 10 1709 – 1803 | ControlSet00x\Services\bam\UserSettings\<SID> and ControlSet00x\Services\dam\UserSettings\<SID> |
| 10 1809 and later, 11 | ControlSet00x\Services\bam\State\UserSettings\<SID> and ControlSet00x\Services\dam\State\UserSettings\<SID> |
Each value name under a SID key is an executable, written as a device path (\Device\HarddiskVolume3\Windows\System32\cmd.exe) or, for packaged apps, the package family name. Map HarddiskVolumeN to a drive letter with MountedDevices or the volume layout of the image. Map the SID to an account with ProfileList in the SOFTWARE hive (see SAM and user accounts).
Windows 7 and 8 do not have BAM.
What it proves
- Execution by a user: the SID key tells you which account the process ran under.
- Last execution time for each executable.
- It does not give a run count, the first execution time or the command line, and it only keeps recent activity (see retention).
Key fields
| Field | Meaning |
|---|---|
| SID subkey | Security identifier of the user who ran the program |
| Value name | Executable device path or packaged app identifier |
| Value data, bytes 0–7 | Last execution time, FILETIME |
Version, SequenceNumber | Bookkeeping values present under each SID key, not executables |
Timestamps
| Timestamp | Set when | Format | Pitfalls |
|---|---|---|---|
| Value data (first 8 bytes) | Updated while/when the program runs in the user session | FILETIME, UTC | It is the last execution only; a program still running may show a time close to acquisition |
| SID key LastWrite | Any value under the key changes | FILETIME, UTC | Tells you when the most recent update happened, not which value changed |
Retention and clearing
- Entries older than about seven days are removed when the system boots, so BAM mostly covers the week before the last reboot. Earlier activity may survive in shadow-copy SYSTEM hives.
- Deleting a user's SID key or individual values requires SYSTEM-level access to the hive; gaps compared with Prefetch or Amcache deserve a second look.
- Programs executed from removable media still appear, with the removable volume's device path.
Collection
- KAPE target:
RegistryHivesSystem(SYSTEM plus.LOG1/.LOG2); KAPE's--vssoption adds the copies held in shadow copies. - Velociraptor (
Windows.Triage.Targets):RegistryHivesSystem; theWindows.Forensics.Bamartifact parses BAM live. - Built-in:
reg query "HKLM\SYSTEM\CurrentControlSet\Services\bam\State\UserSettings" /s
reg save HKLM\SYSTEM E:\case\SYSTEM.hiv
Parsing tools
- Registry Explorer / RECmd (Eric Zimmerman): browse the keys interactively; the community RECmd batch files (such as
Kroll_Batch.reb) extract BAM/DAM to CSV. - RegRipper:
bamplugin. - Velociraptor:
Windows.Forensics.Bam.
Investigation tips
- Because BAM is per SID, it is the quickest way to answer "who ran it": check for tools under a service account or an unexpected local account.
- Convert device paths carefully:
HarddiskVolumenumbers change between systems and boots of different disks. - Correlate with UserAssist (GUI launches by the same user) and with logon sessions in the event logs.
- For an older incident, parse the SYSTEM hive from every volume shadow copy to recover entries that were pruned.
- Expect every
ControlSet00xto be parsed; offline hives have noCurrentControlSet(control set).
Related artifacts
- Prefetch Files (.pf)Windows Prefetch cheat sheet: .pf location per version, run count, the last eight run times, referenced files, retention limits and how to parse.
- Amcache.hveAmcache.hve cheat sheet: file and program inventory keys, SHA-1 hashes, PE metadata, timestamps and why an entry alone does not prove execution.
- ShimCache (AppCompatCache)ShimCache (AppCompatCache) cheat sheet: SYSTEM hive location, entry limits per Windows version, ordering, timestamp meaning and execution caveats.
- UserAssistUserAssist cheat sheet: NTUSER.DAT GUID keys, ROT13 value names, run count, focus time and last run FILETIME for programs a user launched from Explorer.
- SAM hive and user accountsSAM hive cheat sheet: local accounts, RIDs, last logon and password change times, logon counts, group membership, ProfileList, and account-related event IDs.
Glossary terms
- Evidence of executionArtifacts that show a program actually ran on a Windows system, as opposed to merely existing on disk, and how strongly each one supports that claim.
- Security Identifier (SID)The unique value Windows uses to identify users, groups and computers, such as S-1-5-21-…-1001, found throughout registry, logs and file paths.
- ControlSet and CurrentControlSetThe numbered configuration sets in the SYSTEM hive; CurrentControlSet is a runtime link that does not exist in an offline hive file.
- FILETIMEThe 64-bit Windows timestamp format counting 100-nanosecond intervals since 1 January 1601 UTC, used by NTFS, the registry and many artifacts.