Detection rules › Elastic

Suspicious Microsoft IIS Worker Descendant

Source
github.com/elastic/protections-artifacts

Identifies suspicious child processes of Microsoft IIS Worker process which may suggest a vulnerability and remote webshell access.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies suspicious child processes of Microsoft IIS Worker process which may suggest a vulnerability and remote
webshell access.
"""
id = "89c9c5a0-a136-41e9-8cc8-f21ef5ad894b"
license = "Elastic License v2"
name = "Suspicious Microsoft IIS Worker Descendant"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry",
]
version = "1.0.36"

query = '''
process where event.action == "start" and
(
  (
    process.parent.name : "w3wp.exe" and
    (
      (process.pe.original_file_name in ("Cmd.Exe", "PowerShell.EXE") and
        (process.command_line : ("*/c powershell*", "*&cd&echo*", "*certutil*", "*bitsadmin*", "*/c cd /d *",
                                "*http*", "*.replace*", "*Reflection.Assembly*", "*$*$*$*$*$*", "*^*^*^*^*^*^*",
                                "*set *set *set *", "* wget*") or
        process.args : ("?:\\Users\\Public\\*", "?:\\Windows\\Tasks\\*", "?:\\Windows\\Temp\\*", "?:\\windows\\help\\*"))) or

      (process.pe.original_file_name == "PowerShell.EXE" and length(process.parent.command_line) >= 150 and
        process.parent.command_line : ("* -enc*", "* -e *", "* bypass*")) or

      (process.parent.args : ("MSExchange*", "SharePoint*") and
        process.pe.original_file_name in ("Cmd.Exe", "PowerShell.EXE", "CertUtil.exe", "CertReq.exe", "curl.exe", "RUNDLL32.EXE", "REGSVR32.EXE")) or

      (process.pe.original_file_name == "Cmd.Exe" and process.args_count ==1)
    )
  ) or

  (descendant of [process where process.name : "w3wp.exe"] and
  (
    (process.name : ("net.exe", "net1.exe") and process.command_line : ("*administrators*", "*remote desktop*", "*use \\* /user*")) or
    (process.pe.original_file_name in ("CertUtil.exe", "CertReq.exe", "curl.exe", "bitsadmin.exe"))
   )
  ) or

  (descendant of [process where process.parent.name : "w3wp.exe" and
    process.pe.original_file_name == "Cmd.Exe" and process.command_line : ("*/c powershell*", "*&cd&echo*")]
  )
)
/* False Positives */
and not (process.name : "cmd.exe" and process.parent.args : "Icims" and process.command_line : "*vault.azure.net*" and process.parent.name : "w3wp.exe") and
not (process.name : "powershell.exe" and process.command_line : "\"powershell.exe\" netsh http show servicestate | ?{$_.Tostring().Contains(*") and
process.hash.sha256 != "fe1d2ad2781879dc05039d87bd12259f3bcf411c66c925d31827d6a757d33ec4" and
not (process.name : "cmd.exe" and process.parent.name:"w3wp.exe" and
     process.args:"'HttpsPortDesktopAgent'),"  and process.args : "echo" and process.parent.args : "DefaultAppPool") and
not (process.name == "conhost.exe" and process.parent.name == "cmd.exe") and
not (process.name : "curl.exe" and process.args : "https*.lansweeper.com" and process.parent.name : "w3wp.exe" and process.parent.args : "Lansweeper AppPool")
'''

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 = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"


[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"

[[threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
(
  (
    process.parent.name : "w3wp.exe" and
    (
      (process.pe.original_file_name in ("Cmd.Exe", "PowerShell.EXE") and
        (process.command_line : ("*/c powershell*", "*&cd&echo*", "*certutil*", "*bitsadmin*", "*/c cd /d *",
                                "*http*", "*.replace*", "*Reflection.Assembly*", "*$*$*$*$*$*", "*^*^*^*^*^*^*",
                                "*set *set *set *", "* wget*") or
        process.args : ("?:\\Users\\Public\\*", "?:\\Windows\\Tasks\\*", "?:\\Windows\\Temp\\*", "?:\\windows\\help\\*"))) or
      (process.pe.original_file_name == "PowerShell.EXE" and length(process.parent.command_line) >= 150 and
        process.parent.command_line : ("* -enc*", "* -e *", "* bypass*")) or
      (process.parent.args : ("MSExchange*", "SharePoint*") and
        process.pe.original_file_name in ("Cmd.Exe", "PowerShell.EXE", "CertUtil.exe", "CertReq.exe", "curl.exe", "RUNDLL32.EXE", "REGSVR32.EXE")) or
      (process.pe.original_file_name == "Cmd.Exe" and process.args_count ==1)
    )
  ) or
  (descendant of [process where process.name : "w3wp.exe"] and
  (
    (process.name : ("net.exe", "net1.exe") and process.command_line : ("*administrators*", "*remote desktop*", "*use \\* /user*")) or
    (process.pe.original_file_name in ("CertUtil.exe", "CertReq.exe", "curl.exe", "bitsadmin.exe"))
   )
  ) or
  (descendant of [process where process.parent.name : "w3wp.exe" and
    process.pe.original_file_name == "Cmd.Exe" and process.command_line : ("*/c powershell*", "*&cd&echo*")]
  )
)
and not (process.name : "cmd.exe" and process.parent.args : "Icims" and process.command_line : "*vault.azure.net*" and process.parent.name : "w3wp.exe") and
not (process.name : "powershell.exe" and process.command_line : "\"powershell.exe\" netsh http show servicestate | ?{$_.Tostring().Contains(*") and
process.hash.sha256 != "fe1d2ad2781879dc05039d87bd12259f3bcf411c66c925d31827d6a757d33ec4" and
not (process.name : "cmd.exe" and process.parent.name:"w3wp.exe" and
     process.args:"'HttpsPortDesktopAgent'),"  and process.args : "echo" and process.parent.args : "DefaultAppPool") and
not (process.name == "conhost.exe" and process.parent.name == "cmd.exe") and
not (process.name : "curl.exe" and process.args : "https*.lansweeper.com" and process.parent.name : "w3wp.exe" and process.parent.args : "Lansweeper AppPool")

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • ?:\Users\Public\*
  • ?:\Windows\Tasks\*
  • ?:\Windows\Temp\*
  • ?:\windows\help\*
field:"process.args" kind:wildcard
process.args_counteq
  • 1 transforms: number corpus 49 (elastic 49)
field:"process.args_count" kind:eq value:"1"
process.command_linewildcard
  • * wget*
  • *$*$*$*$*$*
  • *&cd&echo* corpus 2 (sigma 2)
  • *.replace*
  • */c cd /d *
  • */c powershell* corpus 3 (sigma 3)
  • *Reflection.Assembly* corpus 2 (elastic 2)
  • *^*^*^*^*^*^*
  • *administrators*
  • *bitsadmin* corpus 10 (sigma 10)
  • *certutil* corpus 12 (sigma 10, kusto 2)
  • *http* corpus 52 (sigma 34, elastic 15, chronicle 2, splunk 1)
  • *remote desktop*
  • *set *set *set * corpus 4 (elastic 4)
  • *use \* /user*
field:"CommandLine" kind:wildcard
process.hash.sha256ne
  • fe1d2ad2781879dc05039d87bd12259f3bcf411c66c925d31827d6a757d33ec4
field:"Hashes" kind:ne value:"fe1d2ad2781879dc05039d87bd12259f3bcf411c66c925d31827d6a757d33ec4"
process.namewildcard
  • net.exe corpus 28 (elastic 26, splunk 2)
  • net1.exe corpus 39 (elastic 20, splunk 19)
field:"process_name" kind:wildcard
process.parent.argswildcard
  • MSExchange*
  • SharePoint*
field:"process.parent.args" kind:wildcard
process.parent.command_linewildcard
  • * -e *
  • * -enc*
  • * bypass*
field:"ParentCommandLine" kind:wildcard
process.parent.namewildcard
  • w3wp.exe corpus 8 (elastic 8)
field:"parent_process_name" kind:wildcard value:"w3wp.exe"
process.pe.original_file_nameeq
  • Cmd.Exe corpus 81 (sigma 43, elastic 21, splunk 17)
  • PowerShell.EXE corpus 138 (sigma 84, splunk 30, elastic 24)
field:"OriginalFileName" kind:eq
process.pe.original_file_namein
  • CertReq.exe corpus 5 (elastic 4, sigma 1)
  • CertUtil.exe corpus 30 (sigma 14, elastic 10, splunk 6)
  • Cmd.Exe corpus 81 (sigma 43, elastic 21, splunk 17)
  • PowerShell.EXE corpus 138 (sigma 84, splunk 30, elastic 24)
  • REGSVR32.EXE corpus 37 (sigma 17, elastic 15, splunk 5)
  • RUNDLL32.EXE corpus 78 (sigma 35, elastic 22, splunk 21)
  • bitsadmin.exe corpus 20 (sigma 9, elastic 8, splunk 2, kusto 1)
  • curl.exe corpus 24 (sigma 13, elastic 8, splunk 3)
field:"OriginalFileName" kind:in