Detection rules › Elastic
Unusual Network Connection via RunDLL32
Identifies unusual instances of rundll32.exe making outbound network connections. This may be indicative of adversarial command and control activity.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies unusual instances of rundll32.exe making outbound network connections. This may be indicative of adversarial
command and control activity.
"""
id = "2e708541-c6e8-4ded-923f-78a6c160987e"
license = "Elastic License v2"
name = "Unusual Network Connection via RunDLL32"
os_list = ["windows"]
version = "1.0.35"
query = '''
sequence by process.entity_id with maxspan=5m
[process where event.action == "start" and process.name : "rundll32.exe" and process.args_count == 1 and
not (process.code_signature.subject_name == "Teramind Inc." and
process.code_signature.trusted == true and process.Ext.token.integrity_level_name == "system" and
process.args == "/update" and process.parent.name == "tmagentsvc.exe") and
not process.args : "C:\\Windows\\system32\\rundll32.exe *,*"]
[network where event.action == "connection_attempted" and process.name : "rundll32.exe"]
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"
[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 within 5m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and process.name : "rundll32.exe" and process.args_count == 1 and
not (process.code_signature.subject_name == "Teramind Inc." and
process.code_signature.trusted == true and process.Ext.token.integrity_level_name == "system" and
process.args == "/update" and process.parent.name == "tmagentsvc.exe") and
not process.args : "C:\\Windows\\system32\\rundll32.exe *,*"]
Stage 2: network
[network where event.action == "connection_attempted" and process.name : "rundll32.exe"]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.token.integrity_level_name | eq | system | excludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"system" |
process.args | eq | /update | excludes:process.args field:"process.args" value:"/update" |
process.code_signature.subject_name | eq | Teramind Inc. | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Teramind Inc." |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.parent.name | eq | tmagentsvc.exe | excludes:process.parent.name field:"process.parent.name" value:"tmagentsvc.exe" |
process.args | wildcard | C:\Windows\system32\rundll32.exe *,* | excludes:process.args field:"process.args" value:"C:\Windows\system32\rundll32.exe *,*" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.name | wildcard |
| field:"process_name" kind:wildcard value:"rundll32.exe" |