[rule]
description = """
Identifies allocation of RWX memory region from a Nullsoft scriptable installer. Adversaries may abuse NSIS installers
to deliver malware for initial access.
"""
id = "9cffb077-cf13-4a35-a6b1-152ba499edc0"
license = "Elastic License v2"
name = "Potential Injection via NSIS Installer"
os_list = ["windows"]
reference = [
"https://nsis.sourceforge.io/Features",
"https://www.fortinet.com/blog/threat-research/locky-nsis-based-ransomware-is-embracing-its-new-end-of-summer-shape",
"https://medium.com/csg-govtech/meet-the-final-boss-clearing-each-level-of-multi-stage-malware-8779c5272ec7",
]
version = "1.0.4"
query = '''
sequence by process.entity_id with maxspan=1m
[library where dll.path : "?:\\users\\*\\appdata\\local\\temp\\ns*.tmp\\system.dll" and not process.code_signature.status : "trusted"]
[api where
process.Ext.api.name : ("VirtualAlloc*", "MapViewOfFile*") and process.Ext.api.parameters.protection : "RWX" and process.Ext.api.parameters.size >= 10000 and
process.thread.Ext.call_stack_summary : ("*kernelbase.dll|system.dll*", "*kernelbase.dll|Unknown*", "*kernelbase.dll|Unbacked*")]
'''
min_endpoint_version = "8.8.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 = "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 = "8.8.0"