API Call via Timer Callback Event


Description

Identifies API calls via timeSetEvent callback function. This may indicate an attempt to proxy API call via callback.

Query · eql

api where
  process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "WriteProcessMemory", "VirtualProtectEx", "VirtualAllocEx",
                             "MapViewOfFile", "MapViewOfFile2", "SetThreadContext", "SuspendThread", "ReadProcessMemory", "connect") and
  process.thread.Ext.call_stack_final_user_module.name == "winmm.dll" and
  _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "*winmm.dll!timeSetEvent*") and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.symbol_info: ("*winmm.dll!mciExecute*", "*winmm.dll!timeGetTime*", "*winmm.dll!PlaySoundW*", "*winmm.dll+0x*", "*ntdll.dll!RtlInitializeExceptionChain*")) and
  not (process.executable : "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\WakeOnLan.exe" and
       process.parent.executable : "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\dcwol.exe") and
  not (process.Ext.api.name == "connect" and
       process.executable : "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\meaap.exe" and
       process.parent.executable : "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\dcconfig.exe")
Raw source API Call via Timer Callback Event · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = "Identifies API calls via timeSetEvent callback function. This may indicate an attempt to proxy API call via callback."
id = "2842dbe3-4ce7-4e4d-b18b-c5eefdaf1fae"
license = "Elastic License v2"
name = "API Call via Timer Callback Event"
os_list = ["windows"]
reference = ["https://learn.microsoft.com/en-us/previous-versions/dd757634(v=vs.85)"]
version = "1.0.4"

query = '''
api where
  process.Ext.api.name in ("VirtualAlloc", "VirtualProtect", "WriteProcessMemory", "VirtualProtectEx", "VirtualAllocEx",
                             "MapViewOfFile", "MapViewOfFile2", "SetThreadContext", "SuspendThread", "ReadProcessMemory", "connect") and
  process.thread.Ext.call_stack_final_user_module.name == "winmm.dll" and
  _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "*winmm.dll!timeSetEvent*") and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.symbol_info: ("*winmm.dll!mciExecute*", "*winmm.dll!timeGetTime*", "*winmm.dll!PlaySoundW*", "*winmm.dll+0x*", "*ntdll.dll!RtlInitializeExceptionChain*")) and
  not (process.executable : "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\WakeOnLan.exe" and
       process.parent.executable : "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\dcwol.exe") and
  not (process.Ext.api.name == "connect" and
       process.executable : "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\meaap.exe" and
       process.parent.executable : "C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\dcconfig.exe")
'''

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

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

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.