What BITS keeps
The Background Intelligent Transfer Service (BITS) downloads and uploads files in the background for Windows and for applications: Edge, Chrome, Office and OneDrive use it every day. Each transfer is a job: a name, an owner, one or more files (a URL and a local path), a state, retry settings and, optionally, a command line that BITS runs when the job reaches the transferred or error state.
BITS keeps its queue on disk so that jobs survive reboots. That queue is the evidence: it says what was set to download or upload, by which account, from where, to where, and what was set to run. Attackers use it to fetch tools and to persist through the notify command line (MITRE ATT&CK T1197), in a place that registry and scheduled-task checks do not cover.
Where it is
- Windows 10 and 11: C:\ProgramData\Microsoft\Network\Downloader\qmgr.db, an ESE database, with its transaction logs (edb.log, edb00001.log…) and checkpoint file (edb.chk) in the same folder. Two tables, Jobs and Files, each with an Id (a GUID) and a Blob that holds the record. A job record lists the IDs of its files; a file record does not name its job.
- Windows XP to 8.1 (and early Windows 10 builds): qmgr0.dat and qmgr1.dat in the same folder, a format of their own in which each job holds its files.
- The Microsoft-Windows-Bits-Client/Operational event log: 3 job created (with the creating program on Windows 10 and later), 16403 RemoteName and LocalName of a job's file, 59 transfer started and 60 transfer stopped (with the URL and a status code), 61 stopped with an error, 4 job completed, 5 job cancelled, 6 notify command line set, 63 and 64 the notify program failed or could not start.
- The BITS policy values, if any, in HKLM\SOFTWARE\Policies\Microsoft\Windows\BITS (JobInactivityTimeout, MaxDownloadTime…).
What a job proves, and what it does not
- A job record shows that its owner asked BITS to transfer those files with those settings, and when: the creation and modification times are FILETIMEs in UTC. Its state says how far it got: suspended, queued, transferring, transient error, error, transferred.
- A notify command line shows that a program was set to run, not that it ran. BITS runs it when the job enters the transferred or error state, as the user who set it, and runs it again after the minimum retry delay while it fails and the job stays; Microsoft documents that it runs none for jobs of service accounts. Look for the program in Prefetch, Amcache or process events.
- A transferred download is not yet at its destination: BITS keeps it as a BIT*.tmp file until the job is completed, and Complete renames it. A file found at the destination may come from somewhere else.
- Complete and Cancel remove a job from the queue, and BITS cancels jobs left alone for 90 days (JobInactivityTimeout). Copies of removed records often remain in the database for a while; the last state they hold is the one before the job was removed.
- Most jobs are ordinary updaters, and a name proves nothing: any program can name a job "Edge Component Updater".
How the tool reads it
- Everything runs in your browser, in a Web Worker. The files are never uploaded.
- qmgr.db is read with an ESE reader: the catalog, the Jobs and Files tables (rows flagged deleted included), the long values that hold the records, and the long values no row points to any more. The whole file is then searched for the records' signatures, as Mandiant's BitsParser and Velociraptor do, to recover copies left in free space. A copy that repeats a record is dropped; a copy that differs is kept in the job's history.
- Job and file records are decoded with the layout that ANSSI's bits_parser, Mandiant's BitsParser, SafeBreach's BITSInject template and Velociraptor's Windows.Forensics.BITS describe. What no source decodes is kept as bytes, with the strings found in it.
- qmgr0.dat and qmgr1.dat are read as ANSSI's bits_parser lays them out; transaction logs are searched for records by signature. The Bits-Client log is read with EVTX Parser's WebAssembly reader.
- Records join by job ID. Files join a job through the file IDs it lists, events by job ID. Owners are named from the SOFTWARE hive's ProfileList, the SAM, or event 3.
Limits
- Microsoft documents none of these formats. The tool was checked against a real Windows 11 qmgr.db (the one in Velociraptor's tests) and a real Windows 7 queue (in SafeBreach's BITSInject repository); other builds may differ, and every value is shown as written.
- Three of the five times in a job record are not documented. The tool calls the last one the expiration, as Velociraptor and SafeBreach do (90 days after the modification time on the real records), and shows the other two as written.
- Transaction logs are searched for records, not replayed: a database copied while BITS had it open may miss its newest changes.
- On Windows 10 and later a file record does not name its job: a recovered file joins a job only when that job lists its ID, or when a joined copy has the same destination and URL.
- A flag is a reason to look, not a verdict.
Questions
Are my files uploaded?
No. The page reads the files in your browser, in a Web Worker; nothing is sent to a server. You can disconnect from the network once the page has loaded.
Where is the BITS database?
In C:\ProgramData\Microsoft\Network\Downloader: qmgr.db on Windows 10 and 11, qmgr0.dat and qmgr1.dat on Windows XP to 8.1. Collect the whole folder: the edb logs next to qmgr.db can hold copies of records too.
Why can't I copy qmgr.db?
The BITS service opens it without sharing while it runs, so a plain copy, even robocopy /B, fails. Copy it from a shadow copy, with KAPE or Velociraptor (they read the disk raw), or from a disk image.
What is a notify command line?
A program and its arguments set with SetNotifyCmdLine (bitsadmin /SetNotifyCmdLine). BITS runs it when the job reaches the transferred or error state, as the user who set it, and runs it again after the minimum retry delay if it fails and the job is still there. That is BITS persistence (MITRE ATT&CK T1197).
Why does a job appear several times, or after it was removed?
ESE keeps old copies of records until their space is reused. The tool keeps every copy that differs, oldest first, so you can see a job go from suspended to queued to transferred, and lists jobs that are gone from the queue when only their copies remain.
Does a transferred job mean the file ran?
No. It means BITS finished downloading the file into a BIT*.tmp file. The notify command, if any, was due to run then; whether it did must come from other evidence (Prefetch, Amcache, process events).
Can it read a disk image?
Export the Downloader folder, the Bits-Client log and the SOFTWARE and SAM hives with Disk Image Parser or another forensic tool and drop them here. The page also accepts files handed over by Disk Image Parser, tab to tab, without a server.