Detection rules › Elastic

Shellcode Fluctuation via CallBack

Source
github.com/elastic/protections-artifacts

Identifies private (JIT) code memory with fluctuating page protections. This may indicate an attempt to hide injected code from memory scanners.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

[rule]
description = """
Identifies private (JIT) code memory with fluctuating page protections. This may indicate an attempt to hide injected
code from memory scanners.
"""
id = "2909b5bc-c975-4dbe-ac79-4029a2c5763f"
license = "Elastic License v2"
name = "Shellcode Fluctuation via CallBack"
os_list = ["windows"]
version = "1.0.4"

query = '''
api where process.Ext.api.behaviors in ("execute_fluctuation", "write_fluctuation") and 
 process.Ext.api.behaviors == "proxy_call" and
 process.thread.Ext.call_stack_summary in
            ("ntdll.dll|kernelbase.dll|ntdll.dll|kernel32.dll|ntdll.dll", "ntdll.dll|kernelbase.dll|ntdll.dll|Unknown") and
 (process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\ntdll.dll" or
  process.thread.Ext.call_stack_final_user_module.name == "Undetermined")
'''

min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[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.10.0"

Stages and Predicates

Stage 1: api

api where process.Ext.api.behaviors in ("execute_fluctuation", "write_fluctuation") and 
 process.Ext.api.behaviors == "proxy_call" and
 process.thread.Ext.call_stack_summary in
            ("ntdll.dll|kernelbase.dll|ntdll.dll|kernel32.dll|ntdll.dll", "ntdll.dll|kernelbase.dll|ntdll.dll|Unknown") and
 (process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\ntdll.dll" or
  process.thread.Ext.call_stack_final_user_module.name == "Undetermined")

Indicators

These rows show field, operator, and value matches.