Credential API Hooking

T1056.004

Sub-technique of T1056 Input Capture.View on attack.mitre.org

About this technique

Adversaries may hook into Windows application programming interface (API) functions and Linux system functions to collect user credentials. Malicious hooking mechanisms may capture API or function calls that include parameters that reveal user authentication credentials. Unlike Keylogging, this technique focuses specifically on API functions that include parameters that reveal user credentials.

In Windows, hooking involves redirecting calls to these functions and can be implemented via:

* **Hooks procedures**, which intercept and execute designated code in response to events such as messages, keystrokes, and mouse inputs.
* **Import address table (IAT) hooking**, which use modifications to a process’s IAT, where pointers to imported API functions are stored.
* **Inline hooking**, which overwrites the first bytes in an API function to redirect code flow.

In Linux and macOS, adversaries may hook into system functions via the `LD_PRELOAD` (Linux) or `DYLD_INSERT_LIBRARIES` (macOS) environment variables, which enables loading shared libraries into a program’s address space. For example, an adversary may capture credentials by hooking into the `libc read` function leveraged by SSH or SCP.

Detection rules0

Rules on DetectionCode tagged with T1056.004.

Sigma0

No Sigma rules are mapped to this technique yet.

Splunk0

No Splunk rules are mapped to this technique yet.

Groups1

Software11

Campaigns0

None recorded.

Procedure examples12

Groups1

Used byProcedure example
GroupPLATINUM

PLATINUM is capable of using Windows hook interfaces for information gathering such as credential access.

Software11

Used byProcedure example
MalwareCarberp

Carberp has hooked several Windows API functions to steal credentials.

ToolEmpire

Empire contains some modules that leverage API hooking to carry out tasks, such as netripper.

MalwareFinFisher

FinFisher hooks processes by modifying IAT pointers to CreateWindowEx.

MalwareNOKKI

NOKKI uses the Windows call SetWindowsHookEx and begins injecting it into every GUI process running on the victim's machine.

MalwareRDFSNIFFER

RDFSNIFFER hooks several Win32 API functions to hijack elements of the remote system management user-interface.

MalwareTrickBot

TrickBot has the ability to capture RDP credentials by capturing the CredEnumerateA API

MalwareUrsnif

Ursnif has hooked APIs to perform a wide variety of information theft, such as monitoring traffic from browsers.

MalwareVersaMem

VersaMem hooked and overrided Versa's built-in authentication method, `setUserPassword`, to intercept plaintext credentials when submitted to the server.

View all 11 software examples

References7

  1. Adlice Software IAT Hooks Oct 2014 Open source
    Tigzy. (2014, October 15). Userland Rootkits: Part 1, IAT hooks. Retrieved December 12, 2017.
  2. Elastic Process Injection July 2017 Open source
    Hosseini, A. (2017, July 18). Ten Process Injection Techniques: A Technical Survey Of Common And Trending Process Injection Techniques. Retrieved December 7, 2017.
  3. HighTech Bridge Inline Hooking Sept 2011 Open source
    Mariani, B. (2011, September 6). Inline Hooking in Windows. Retrieved November 17, 2024.
  4. Intezer Symbiote 2022 Open source
    Joakim Kennedy and The BlackBerry Threat Research & Intelligence Team. (2022, June 9). Symbiote Deep-Dive: Analysis of a New, Nearly-Impossible-to-Detect Linux Threat. Retrieved March 24, 2025.
  5. MWRInfoSecurity Dynamic Hooking 2015 Open source
    Hillman, M. (2015, August 8). Dynamic Hooking Techniques: User Mode. Retrieved December 20, 2017.
  6. Microsoft Hook Overview Open source
    Microsoft. (n.d.). Hooks Overview. Retrieved December 12, 2017.
  7. Microsoft TrojanSpy:Win32/Ursnif.gen!I Sept 2017 Open source
    Microsoft. (2017, September 15). TrojanSpy:Win32/Ursnif.gen!I. Retrieved December 18, 2017.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.