Detection rules › Elastic

Network Connection via Process with Unusual Arguments

Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies suspicious network connections from Windows processes that typically have more than one command line argument. This may be indicative of a masquerading attempt to evade detections that monitor for suspicious parent-child process relationships.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies suspicious network connections from Windows processes that typically have more than one command line
argument. This may be indicative of a masquerading attempt to evade detections that monitor for suspicious parent-child
process relationships.
"""
id = "95601d8b-b969-4189-9744-090140ae29e6"
license = "Elastic License v2"
name = "Network Connection via Process with Unusual Arguments"
os_list = ["windows"]
version = "1.0.35"

query = '''
sequence by process.entity_id
  [process where event.action == "start" and process.args_count == 1 and
   process.name :
     ("AddInProcess.exe",
      "AddInProcess32.exe",
      "AddInUtil.exe",
      "AppLaunch.exe",
      "aspnet_compiler.exe",
      "aspnet_regbrowsers.exe",
      "aspnet_regiis.exe",
      "aspnet_regsql.exe",
      "aspnet_state.exe",
      "aspnet_wp.exe",
      "CasPol.exe",
      "ComSvcConfig.exe",
      "csc.exe",
      "cvtres.exe",
      "DataSvcUtil.exe",
      "EdmGen.exe",
      "ilasm.exe",
      "InstallUtil.exe",
      "jsc.exe",
      "Microsoft.Workflow.Compiler.exe",
      "MSBuild.exe",
      "mscorsvw.exe",
      "ngen.exe",
      "ngentask.exe",
      "RegAsm.exe",
      "RegSvcs.exe",
      "ServiceModelReg.exe",
      "vbc.exe",
      "WsatConfig.exe",
      "dllhost.exe",
      "regsvr32.exe",
      "GPUpdate.exe",
      "SearchProtocolHost.exe",
      /* Issue #639 - added msiexec */
      "msiexec.exe") and
   not (user.id == "S-1-5-18" and process.name : "gpupdate.exe" and process.parent.executable : "C:\\Windows\\system32\\cscript.exe") and
   not (process.executable : "?:\\Program Files\\Microsoft Visual Studio\\*\\MSBuild.exe" and process.parent.executable : "?:\\Program Files\\Microsoft Visual Studio\\*\\devenv.exe")
   ]
  [network where event.action == "connection_attempted"]
  until [process where event.action:"end"]
'''

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

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

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

[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Ordered sequence: each step below must occur in order, correlated by process.entity_id.

Stage 1: process

[process where event.action == "start" and process.args_count == 1 and
   process.name :
     ("AddInProcess.exe",
      "AddInProcess32.exe",
      "AddInUtil.exe",
      "AppLaunch.exe",
      "aspnet_compiler.exe",
      "aspnet_regbrowsers.exe",
      "aspnet_regiis.exe",
      "aspnet_regsql.exe",
      "aspnet_state.exe",
      "aspnet_wp.exe",
      "CasPol.exe",
      "ComSvcConfig.exe",
      "csc.exe",
      "cvtres.exe",
      "DataSvcUtil.exe",
      "EdmGen.exe",
      "ilasm.exe",
      "InstallUtil.exe",
      "jsc.exe",
      "Microsoft.Workflow.Compiler.exe",
      "MSBuild.exe",
      "mscorsvw.exe",
      "ngen.exe",
      "ngentask.exe",
      "RegAsm.exe",
      "RegSvcs.exe",
      "ServiceModelReg.exe",
      "vbc.exe",
      "WsatConfig.exe",
      "dllhost.exe",
      "regsvr32.exe",
      "GPUpdate.exe",
      "SearchProtocolHost.exe",
      "msiexec.exe") and
   not (user.id == "S-1-5-18" and process.name : "gpupdate.exe" and process.parent.executable : "C:\\Windows\\system32\\cscript.exe") and
   not (process.executable : "?:\\Program Files\\Microsoft Visual Studio\\*\\MSBuild.exe" and process.parent.executable : "?:\\Program Files\\Microsoft Visual Studio\\*\\devenv.exe")
   ]

Stage 2: network

[network where event.action == "connection_attempted"]

Until: process

until [process where event.action:"end"]

Ends the sequence: the steps above must complete before an event matching this clause occurs.

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • connection_attempted corpus 73 (elastic 73)
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq
event.actionwildcard
  • end corpus 18 (elastic 18)
field:"EventType" kind:wildcard value:"end"
process.args_counteq
  • 1 transforms: number corpus 49 (elastic 49)
field:"process.args_count" kind:eq value:"1"
process.namewildcard
  • AddInProcess.exe corpus 4 (elastic 4)
  • AddInProcess32.exe corpus 2 (elastic 2)
  • AddInUtil.exe corpus 2 (elastic 2)
  • AppLaunch.exe corpus 2 (elastic 2)
  • CasPol.exe
  • ComSvcConfig.exe
  • DataSvcUtil.exe
  • EdmGen.exe
  • GPUpdate.exe corpus 4 (elastic 2, splunk 2)
  • InstallUtil.exe corpus 37 (elastic 32, splunk 5)
  • MSBuild.exe corpus 39 (elastic 36, splunk 3)
  • Microsoft.Workflow.Compiler.exe corpus 12 (elastic 11, splunk 1)
  • RegAsm.exe corpus 26 (elastic 24, splunk 2)
  • RegSvcs.exe corpus 23 (elastic 21, splunk 2)
  • SearchProtocolHost.exe corpus 6 (elastic 4, splunk 2)
  • ServiceModelReg.exe
  • WsatConfig.exe
  • aspnet_compiler.exe corpus 3 (elastic 3)
  • aspnet_regbrowsers.exe
  • aspnet_regiis.exe corpus 2 (elastic 2)
  • aspnet_regsql.exe
  • aspnet_state.exe
  • aspnet_wp.exe
  • csc.exe corpus 12 (elastic 11, splunk 1)
  • cvtres.exe
  • dllhost.exe corpus 19 (elastic 17, splunk 2)
  • ilasm.exe
  • jsc.exe
  • mscorsvw.exe
  • msiexec.exe corpus 46 (elastic 41, splunk 5)
  • ngen.exe
  • ngentask.exe
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • vbc.exe corpus 9 (elastic 8, splunk 1)
field:"process_name" kind:wildcard