Detection rules › Elastic

Suspicious Bitsadmin Activity

Source
github.com/elastic/protections-artifacts

Identifies downloads, transfers, or job creations using Windows Background Intelligent Transfer Service (BITS) Admin Tool. This tactic may be indicative of malicious activity where malware is downloading second stage payloads using obscure methods.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

[rule]
description = """
Identifies downloads, transfers, or job creations using Windows Background Intelligent Transfer Service (BITS) Admin
Tool. This tactic may be indicative of malicious activity where malware is downloading second stage payloads using
obscure methods.
"""
id = "676ac66c-4899-498f-ae21-ed5620af5477"
license = "Elastic License v2"
name = "Suspicious Bitsadmin Activity"
os_list = ["windows"]
reference = ["https://www.elastic.co/blog/hunting-for-persistence-using-elastic-security-part-2"]
version = "1.0.35"

query = '''
process where event.action == "start" and
  (process.name : "bitsadmin.exe" or process.pe.original_file_name : "bitsadmin.exe") and
  process.command_line : ("*download*", "*transfer*", "*create*", "*addfile*", "*SetNotifyCmdLine*") and
  (process.parent.name : (
      "winword.exe",
      "excel.exe",
      "outlook.exe",
      "powerpnt.exe",
      "eqnedt32.exe",
      "fltldr.exe",
      "mspub.exe",
      "msaccess.exe",
      "acrord32.exe",
      "rdrcef.exe",
      "foxitphantomPDF.exe",
      "foxitreader.exe",
      "firefox.exe",
      "chrome.exe",
      "iexplore.exe",
      "opera.exe",
      "plugin-container.exe",
      "safari.exe",
      "microsoftedge.exe",
      "w3wp.exe",
      "httpd.exe",
      "nginx.exe",
      "php.exe",
      "php-cgi.exe",
      "tomcat.exe",
      "wscript.exe",
      "cscript.exe",
      "powershell.exe",
      "pwsh.exe",
      "cmd.exe",
      "mshta.exe"
      ) or
  descendant of [process where event.action == "start" and
    process.parent.name : (
      "winword.exe",
      "excel.exe",
      "outlook.exe",
      "powerpnt.exe",
      "eqnedt32.exe",
      "fltldr.exe",
      "mspub.exe",
      "msaccess.exe",
      "acrord32.exe",
      "rdrcef.exe",
      "foxitphantomPDF.exe",
      "foxitreader.exe",
      "firefox.exe",
      "chrome.exe",
      "iexplore.exe",
      "opera.exe",
      "plugin-container.exe",
      "safari.exe",
      "microsoftedge.exe",
      "w3wp.exe",
      "httpd.exe",
      "nginx.exe",
      "php.exe",
      "php-cgi.exe",
      "tomcat.exe",
      "wscript.exe",
      "cscript.exe",
      "powershell.exe",
      "pwsh.exe",
      "cmd.exe",
      "mshta.exe"
    )]) and
    not (process.args : "https://dl.duosecurity.com/*" and process.parent.args : "?:\\ProgramData\\NinjaRMMAgent\\scripting\\*") and
    not process.command_line : "bitsadmin  /RawReturn /GetBytesTransferred mingw" and
    not process.args :
             ("https://opalrtwebsitedata.blob.core.windows.net/software/mingw/*",
              "C:\\EMES\\workspace\\1.9\\sim.properties",
              "C:\\EMES\\rsd\\run.bat",
              "C:\\EMES\\rsd\\sim.properties",
              "C:\\EMES\\tmp\\restart_rsd.bat") and
    not process.executable : "?:\\Program Files (x86)\\Bosch\\DownloadManager\\bin\\Bitsadmin*.exe" and
    not (process.parent.name : "cmd.exe" and
         process.parent.command_line : (
            "C:\\WINDOWS\\system32\\cmd.exe /c \"\"C:\\Program Files\\ATERA Networks\\AteraAgent\\Packages\\AgentPackageSystemTools\\*.bat\"\"",
            "C:\\Windows\\SYSTEM32\\cmd.exe /c \"\"C:\\Program files\\vuls-saas\\vuls-saas.bat\"\""
        ))
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1197"
name = "BITS Jobs"
reference = "https://attack.mitre.org/techniques/T1197/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  (process.name : "bitsadmin.exe" or process.pe.original_file_name : "bitsadmin.exe") and
  process.command_line : ("*download*", "*transfer*", "*create*", "*addfile*", "*SetNotifyCmdLine*") and
  (process.parent.name : (
      "winword.exe",
      "excel.exe",
      "outlook.exe",
      "powerpnt.exe",
      "eqnedt32.exe",
      "fltldr.exe",
      "mspub.exe",
      "msaccess.exe",
      "acrord32.exe",
      "rdrcef.exe",
      "foxitphantomPDF.exe",
      "foxitreader.exe",
      "firefox.exe",
      "chrome.exe",
      "iexplore.exe",
      "opera.exe",
      "plugin-container.exe",
      "safari.exe",
      "microsoftedge.exe",
      "w3wp.exe",
      "httpd.exe",
      "nginx.exe",
      "php.exe",
      "php-cgi.exe",
      "tomcat.exe",
      "wscript.exe",
      "cscript.exe",
      "powershell.exe",
      "pwsh.exe",
      "cmd.exe",
      "mshta.exe"
      ) or
  descendant of [process where event.action == "start" and
    process.parent.name : (
      "winword.exe",
      "excel.exe",
      "outlook.exe",
      "powerpnt.exe",
      "eqnedt32.exe",
      "fltldr.exe",
      "mspub.exe",
      "msaccess.exe",
      "acrord32.exe",
      "rdrcef.exe",
      "foxitphantomPDF.exe",
      "foxitreader.exe",
      "firefox.exe",
      "chrome.exe",
      "iexplore.exe",
      "opera.exe",
      "plugin-container.exe",
      "safari.exe",
      "microsoftedge.exe",
      "w3wp.exe",
      "httpd.exe",
      "nginx.exe",
      "php.exe",
      "php-cgi.exe",
      "tomcat.exe",
      "wscript.exe",
      "cscript.exe",
      "powershell.exe",
      "pwsh.exe",
      "cmd.exe",
      "mshta.exe"
    )]) and
    not (process.args : "https://dl.duosecurity.com/*" and process.parent.args : "?:\\ProgramData\\NinjaRMMAgent\\scripting\\*") and
    not process.command_line : "bitsadmin  /RawReturn /GetBytesTransferred mingw" and
    not process.args :
             ("https://opalrtwebsitedata.blob.core.windows.net/software/mingw/*",
              "C:\\EMES\\workspace\\1.9\\sim.properties",
              "C:\\EMES\\rsd\\run.bat",
              "C:\\EMES\\rsd\\sim.properties",
              "C:\\EMES\\tmp\\restart_rsd.bat") and
    not process.executable : "?:\\Program Files (x86)\\Bosch\\DownloadManager\\bin\\Bitsadmin*.exe" and
    not (process.parent.name : "cmd.exe" and
         process.parent.command_line : (
            "C:\\WINDOWS\\system32\\cmd.exe /c \"\"C:\\Program Files\\ATERA Networks\\AteraAgent\\Packages\\AgentPackageSystemTools\\*.bat\"\"",
            "C:\\Windows\\SYSTEM32\\cmd.exe /c \"\"C:\\Program files\\vuls-saas\\vuls-saas.bat\"\""
        ))

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argsstarts_withhttps://dl.duosecurity.com/excludes:process.args field:"process.args" value:"https://dl.duosecurity.com/"
process.parent.argsstarts_with?:\ProgramData\NinjaRMMAgent\scripting\excludes:process.parent.args field:"process.parent.args" value:"?:\ProgramData\NinjaRMMAgent\scripting\"
process.parent.command_linewildcardC:\WINDOWS\system32\cmd.exe /c ""C:\Program Files\ATERA Networks\AteraAgent\Packages\AgentPackageSystemTools\*.bat"", C:\Windows\SYSTEM32\cmd.exe /c ""C:\Program files\vuls-saas\vuls-saas.bat""excludes:process.parent.command_line
process.parent.nameeqcmd.exeexcludes:process.parent.name field:"process.parent.name" value:"cmd.exe"
process.argswildcardhttps://opalrtwebsitedata.blob.core.windows.net/software/mingw/*, C:\EMES\workspace\1.9\sim.properties, C:\EMES\rsd\run.bat, C:\EMES\rsd\sim.properties, C:\EMES\tmp\restart_rsd.batexcludes:process.args
process.command_lineeqbitsadmin /RawReturn /GetBytesTransferred mingwexcludes:process.command_line field:"process.command_line" value:"bitsadmin /RawReturn /GetBytesTransferred mingw"
process.executablewildcard?:\Program Files (x86)\Bosch\DownloadManager\bin\Bitsadmin*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Bosch\DownloadManager\bin\Bitsadmin*.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.command_linewildcard
  • *SetNotifyCmdLine* corpus 2 (elastic 2)
  • *addfile* corpus 2 (elastic 2)
  • *create* corpus 29 (sigma 17, splunk 7, elastic 5)
  • *download* corpus 4 (elastic 3, sigma 1)
  • *transfer* corpus 3 (elastic 3)
field:"CommandLine" kind:wildcard
process.namewildcard
  • bitsadmin.exe corpus 23 (elastic 21, splunk 2)
field:"process_name" kind:wildcard value:"bitsadmin.exe"
process.parent.namewildcard
  • acrord32.exe corpus 3 (elastic 3)
  • chrome.exe corpus 9 (elastic 9)
  • cmd.exe corpus 36 (elastic 31, splunk 4, kusto 1)
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • eqnedt32.exe corpus 9 (elastic 9)
  • excel.exe corpus 28 (elastic 27, splunk 1)
  • firefox.exe corpus 9 (elastic 9)
  • fltldr.exe corpus 7 (elastic 7)
  • foxitphantomPDF.exe corpus 3 (elastic 3)
  • foxitreader.exe corpus 3 (elastic 3)
  • httpd.exe corpus 2 (elastic 2)
  • iexplore.exe corpus 8 (elastic 8)
  • microsoftedge.exe corpus 2 (elastic 2)
  • msaccess.exe corpus 12 (elastic 12)
  • mshta.exe corpus 24 (elastic 22, splunk 2)
  • mspub.exe corpus 11 (elastic 11)
  • nginx.exe corpus 2 (elastic 2)
  • opera.exe corpus 4 (elastic 4)
  • outlook.exe corpus 10 (elastic 10)
  • php-cgi.exe corpus 2 (elastic 2)
  • php.exe corpus 2 (elastic 2)
  • plugin-container.exe corpus 2 (elastic 2)
  • powerpnt.exe corpus 23 (elastic 23)
  • powershell.exe corpus 39 (elastic 36, kusto 2, splunk 1)
  • pwsh.exe corpus 5 (elastic 5)
  • rdrcef.exe corpus 2 (elastic 2)
  • safari.exe corpus 3 (elastic 3)
  • tomcat.exe corpus 2 (elastic 2)
  • w3wp.exe corpus 8 (elastic 8)
  • winword.exe corpus 26 (elastic 26)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_name" kind:wildcard
process.pe.original_file_namewildcard
  • bitsadmin.exe corpus 20 (sigma 9, elastic 8, splunk 2, kusto 1)
field:"OriginalFileName" kind:wildcard value:"bitsadmin.exe"