Detection rules › Elastic
Network Connection via Process with Unusual Arguments
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
| Tactic | Techniques |
|---|---|
| Stealth |
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"]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Program Files\Microsoft Visual Studio\*\MSBuild.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files\Microsoft Visual Studio\*\MSBuild.exe" |
process.parent.executable | wildcard | ?:\Program Files\Microsoft Visual Studio\*\devenv.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files\Microsoft Visual Studio\*\devenv.exe" |
process.name | eq | gpupdate.exe | excludes:process.name field:"process.name" value:"gpupdate.exe" |
process.parent.executable | eq | C:\Windows\system32\cscript.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\system32\cscript.exe" |
user.id | eq | S-1-5-18 | excludes:user.id field:"user.id" value:"S-1-5-18" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.action | wildcard |
| field:"EventType" kind:wildcard value:"end" |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.name | wildcard |
| field:"process_name" kind:wildcard |