Potential Injection via NSIS Installer


Description

Identifies allocation of RWX memory region from a Nullsoft scriptable installer. Adversaries may abuse NSIS installers to deliver malware for initial access.

Query · eql

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*")]
Raw source Potential Injection via NSIS Installer · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[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"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.