T1197 Splunk · SPL

Detect BITS Jobs in Splunk

Adversaries may abuse Windows Background Intelligent Transfer Service (BITS) jobs to persistently execute code and perform background tasks such as downloading malicious payloads, executing arbitrary programs on job completion or error, and cleaning up artifacts. BITS is a COM-based file transfer mechanism built into Windows, commonly used by Windows Update and software installers. Adversaries exploit it via bitsadmin.exe or PowerShell BITS cmdlets to download tools from external infrastructure, achieve persistence using /SetNotifyCmdLine to invoke arbitrary executables when a job completes or errors (including after reboots), and exfiltrate data. BITS jobs are stored in a binary database (%ALLUSERSPROFILE%\Microsoft\Network\Downloader\) rather than in registry or filesystem, making them resistant to many persistence-focused detections. Active threat groups including APT39, APT41, Leviathan, Patchwork, and Wizard Spider have leveraged BITS for payload delivery and persistence.

MITRE ATT&CK

Tactic
Defense Evasion Persistence
Technique
T1197 BITS Jobs
Canonical reference
https://attack.mitre.org/techniques/T1197/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog
(
  (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
   (Image="*\\bitsadmin.exe" OR Image="*\\powershell.exe" OR Image="*\\pwsh.exe"))
  OR
  (sourcetype="WinEventLog:Microsoft-Windows-Bits-Client" (EventCode=59 OR EventCode=3 OR EventCode=16))
)
| eval CommandLine=coalesce(CommandLine, ProcessCommandLine, "")
| eval Image=coalesce(Image, "")
| eval IsBitsAdmin=if(match(Image, "(?i)bitsadmin\.exe$"), 1, 0)
| eval IsPowerShell=if(match(Image, "(?i)(powershell|pwsh)\.exe$"), 1, 0)
| eval HasNotify=if(match(lower(CommandLine), "(/setnotifycmdline|/setnotifyflags)"), 1, 0)
| eval HasTransfer=if(match(lower(CommandLine), "(/transfer|/addfile|start-bitstransfer|new-bitstransfer|add-bitsfile)"), 1, 0)
| eval HasReset=if(match(lower(CommandLine), "/reset"), 1, 0)
| eval SuspiciousDest=if(match(lower(CommandLine), "(\\\\appdata\\\\|\\\\users\\\\public\\\\|\\\\programdata\\\\|\\\\windows\\\\temp\\\\|c:\\\\temp\\\\)"), 1, 0)
| eval SuspiciousExt=if(match(lower(CommandLine), "\.(exe|dll|ps1|bat|cmd|vbs|js|hta)(\s|$|'|\")"), 1, 0)
| eval ExternalDownload=if(match(CommandLine, "https?://(?!(.*\.microsoft\.com|.*\.windowsupdate\.com|.*\.windows\.com))"), 1, 0)
| eval SuspicionScore=HasNotify + HasTransfer + SuspiciousDest + SuspiciousExt + ExternalDownload
| where (IsBitsAdmin=1 OR IsPowerShell=1) AND SuspicionScore >= 1
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine,
        HasNotify, HasTransfer, HasReset, SuspiciousDest, SuspiciousExt, ExternalDownload, SuspicionScore
| sort - SuspicionScore, - _time
high severity high confidence

Detects BITS job abuse using Sysmon Event ID 1 (Process Creation) and Microsoft-Windows-Bits-Client operational events (59=job transferred, 3=job created, 16=job completed). Evaluates bitsadmin.exe and PowerShell processes for suspicious indicators: /SetNotifyCmdLine persistence, file transfers to writable locations, suspicious executable extensions in download paths, and external non-Microsoft download URLs. Assigns a suspicion score to help prioritize analyst review — score of 2+ is high confidence.

Data Sources

Process: Process CreationCommand: Command ExecutionSysmon Event ID 1Microsoft-Windows-Bits-Client EventID 59, 3, 16

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/OperationalWinEventLog:Microsoft-Windows-Bits-Client

False Positives & Tuning

  • Windows Update infrastructure downloading patches via BITS — origin account is SYSTEM or NT AUTHORITY\NETWORK SERVICE downloading from *.windowsupdate.com or *.delivery.mp.microsoft.com
  • SCCM/ConfigMgr content distribution using BITS — parent is CcmExec.exe with destination in %WINDIR%\ccmcache\
  • Third-party antivirus or endpoint agents using BITS for signature or definition updates
  • Legitimate IT scripts using Start-BitsTransfer for scheduled large-file backups or software distribution
  • Developer tools or package managers invoking BITS as a transport mechanism for binary downloads from known-good registries
Download portable Sigma rule (.yml)

Other platforms for T1197


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1BITSAdmin Download from External URL

    Expected signal: Sysmon Event ID 1: Process Create with Image=bitsadmin.exe, CommandLine containing '/transfer' and 'http://127.0.0.1:8080/test.exe' and '%TEMP%\df00tech-test.exe'. Microsoft-Windows-Bits-Client EventID 3 (job created with name 'df00tech-test'). EventID 60 (job error, since no HTTP server is listening at 127.0.0.1:8080 — but job creation telemetry still fires). Security Event ID 4688 (if command line auditing enabled).

  2. Test 2BITS Persistence via SetNotifyCmdLine

    Expected signal: Sysmon Event ID 1: Four separate bitsadmin.exe Process Create events — for /create, /addfile, /SetNotifyCmdLine (CommandLine contains 'cmd.exe /c calc.exe'), and /SetNotifyFlags. Microsoft-Windows-Bits-Client EventID 3 (job creation). If the job errors (no HTTP server), the notify command fires: Sysmon EventID 1 for cmd.exe spawned by svchost.exe (BITS service) with ParentCommandLine containing BITS service context.

  3. Test 3PowerShell Start-BitsTransfer to Suspicious Location

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Start-BitsTransfer' and '$env:APPDATA' and 'payload.exe'. Microsoft-Windows-Bits-Client EventID 3 (job created programmatically). PowerShell ScriptBlock Log EventID 4104 with full Start-BitsTransfer cmdlet parameters. Sysmon EventID 3: Network connection attempt from svchost.exe (BITS service) to 127.0.0.1:8080.

  4. Test 4BITSAdmin Upload for Exfiltration Simulation

    Expected signal: Sysmon Event ID 1: bitsadmin.exe Process Create with '/upload' in CommandLine. Microsoft-Windows-Bits-Client EventID 3 (job created with upload type). Sysmon EventID 3: Outbound network connection from svchost.exe to 127.0.0.1:8080. EventID 60 (job error, connection refused) with upload direction noted in event data.

Unlock Pro Content

Get the full detection package for T1197 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections