Detection rules › Elastic
Shellcode Fluctuation via CallBack
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
| Tactic | Techniques |
|---|---|
| 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.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.behaviors | eq |
| field:"process.Ext.api.behaviors" kind:eq value:"proxy_call" |
process.Ext.api.behaviors | in |
| field:"process.Ext.api.behaviors" kind:in |
process.thread.Ext.call_stack_final_user_module.name | eq |
| field:"process.thread.Ext.call_stack_final_user_module.name" kind:eq value:"Undetermined" |
process.thread.Ext.call_stack_final_user_module.path | eq |
| field:"process.thread.Ext.call_stack_final_user_module.path" kind:eq value:"c:\windows\system32\ntdll.dll" |
process.thread.Ext.call_stack_summary | in |
| field:"process.thread.Ext.call_stack_summary" kind:in |