MITRE ATT&CKsub-technique
T1574.013 KernelCallbackTable
- Domain
- enterprise
- Tactics
- Stealth, Execution
- Platforms
- Windows
- Version
- 2.0
- Created
- 2022-02-25
Description
Adversaries may abuse the KernelCallbackTable of a process to hijack its execution flow in order to run their own payloads. The KernelCallbackTable can be found in the Process Environment Block (PEB) and is initialized to an array of graphic functions available to a GUI process once user32.dll is loaded.
An adversary may hijack the execution flow of a process using the KernelCallbackTable by replacing an original callback function with a malicious payload. Modifying callback functions can be achieved in various ways involving related behaviors such as Reflective Code Loading or Process Injection into another process.
A pointer to the memory address of the KernelCallbackTable can be obtained by locating the PEB (ex: via a call to the NtQueryInformationProcess() Native API function). Once the pointer is located, the KernelCallbackTable can be duplicated, and a function in the table (e.g., fnCOPYDATA) set to the address of a malicious payload (ex: via WriteProcessMemory()). The PEB is then updated with the new address of the table. Once the tampered function is invoked, the malicious payload will be triggered.
The tampered function is typically invoked using a Windows message. After the process is hijacked and malicious code is executed, the KernelCallbackTable may also be restored to its original state by the rest of the malicious payload. Use of the KernelCallbackTable to hijack execution flow may evade detection from security products since the execution can be masked under a legitimate process.
Related
Subtechnique of · MITRE ATT&CK (1)
- T1574 Hijack Execution Flow technique
Referenced by MITRE ATT&CK · mitigates (1)
- M1040 Behavior Prevention on Endpoint mitigation
Referenced by CAPEC · att&ck technique (1)
- CAPEC-640 Inclusion of Code in Existing Process attack pattern
Referenced by Compliance · mitigates (8)
- CIS-13.7 Deploy a Host-Based Intrusion Prevention Solution CIS Safeguard v8.1
- NIST-CA-7 Continuous Monitoring NIST 800-53 control
- NIST-CM-2 Baseline Configuration NIST 800-53 control
- NIST-SI-10 Information Input Validation NIST 800-53 control
- NIST-SI-2 Flaw Remediation NIST 800-53 control
- NIST-SI-3 Malicious Code Protection NIST 800-53 control
- NIST-SI-4 System Monitoring NIST 800-53 control
- NIST-SI-7 Software, Firmware, and Information Integrity NIST 800-53 control
References
- https://www.microsoft.com/security/blog/2018/03/01/finfisher-exposed-a-researchers-tale-of-defeating-traps-tricks-and-complex-virtual-machines/ FinFisher exposed
- https://docs.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntqueryinformationprocess NtQueryInformationProcess
- https://modexp.wordpress.com/2019/05/25/windows-injection-finspy/ Windows Process Injection KernelCallbackTable
- https://blog.malwarebytes.com/threat-intelligence/2022/01/north-koreas-lazarus-apt-leverages-windows-update-client-github-in-latest-campaign/ Lazarus APT January 2022