Detection rules › Elastic
Suspicious Windows LUA Script Execution
Identifies the execution of Lua Windows Standalone Interpreter modules from suspicious locations. Attackers may abuse Lua for Windows to execute malicious Lua script and bypass signature-based detection.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies the execution of Lua Windows Standalone Interpreter modules from suspicious locations. Attackers may abuse
Lua for Windows to execute malicious Lua script and bypass signature-based detection.
"""
id = "8f237d98-1825-4c27-a5cd-e38bde70882a"
license = "Elastic License v2"
name = "Suspicious Windows LUA Script Execution"
os_list = ["windows"]
version = "1.0.32"
query = '''
sequence by process.entity_id with maxspan=1m
[library where dll.name : ("luacom.dll", "lua?.?.dll", "lua??.dll") and not user.id : "S-1-5-18" and
not dll.code_signature.trusted == true and
dll.path : ("?:\\Programdata\\*", "?:\\Users\\*", "?:\\Windows\\Temp\\*", "?:\\windows\\System32\\Tasks\\*", "?:\\Windows\\Tasks\\*") and
not (process.code_signature.subject_name : ("Beijing Xiaowei Cloud Inc.", "Leslie Newell") and process.code_signature.trusted == true)]
[network where event.action == "connection_attempted" and
not destination.address : ("127.0.0.1", "0.0.0.0", "::", "10.*", "172.*", "192.168.*")]
'''
min_endpoint_version = "8.1.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 = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.003"
name = "Rename Legitimate Utilities"
reference = "https://attack.mitre.org/techniques/T1036/003/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.1.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: library
[library where dll.name : ("luacom.dll", "lua?.?.dll", "lua??.dll") and not user.id : "S-1-5-18" and
not dll.code_signature.trusted == true and
dll.path : ("?:\\Programdata\\*", "?:\\Users\\*", "?:\\Windows\\Temp\\*", "?:\\windows\\System32\\Tasks\\*", "?:\\Windows\\Tasks\\*") and
not (process.code_signature.subject_name : ("Beijing Xiaowei Cloud Inc.", "Leslie Newell") and process.code_signature.trusted == true)]
Stage 2: network
[network where event.action == "connection_attempted" and
not destination.address : ("127.0.0.1", "0.0.0.0", "::", "10.*", "172.*", "192.168.*")]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | eq | Beijing Xiaowei Cloud Inc., Leslie Newell | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Beijing Xiaowei Cloud Inc." field:"process.code_signature.subject_name" value:"Leslie Newell" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
dll.code_signature.trusted | eq | true | excludes:dll.code_signature.trusted field:"dll.code_signature.trusted" value:"true" |
user.id | eq | S-1-5-18 | excludes:user.id field:"user.id" value:"S-1-5-18" |
destination.address | wildcard | 127.0.0.1, 0.0.0.0, ::, 10.*, 172.*, 192.168.* | excludes:destination.address |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.name | wildcard |
| field:"dll.name" kind:wildcard |
dll.path | wildcard |
| field:"ImageLoaded" kind:wildcard |
event.action | eq |
| field:"EventType" kind:eq value:"connection_attempted" |