Academy
TermTechnique

Hooking

Intercepting and redirecting a function a program calls; this lets malware see or change data while it is being processed.

Flow

  1. 1Enters the process
  2. 2Redirects the function
  3. 3Reads the data
Related families
—
MITRE ATT&CK
T1056.004 · Credential API Hooking
Sources
3 sources
01

Overview

Hooking is a technique legitimate software also uses. Malware applies it to authentication functions, keyboard events or network calls to capture passwords in plain text. MITRE ATT&CK

Because the hook has to run inside the target process, it is usually seen together with process injection. MITRE ATT&CK

02

How it works

  1. 1

    Enters the process

    Code is placed in the memory of the target process. MITRE ATT&CK

  2. 2

    Redirects the function

    The start of the target function is changed to jump to the attacker’s code. MITRE ATT&CK

  3. 3

    Reads the data

    Parameters are recorded as the call passes through, then the original function runs.

03

How to detect it

  • System library code in memory differing from its copy on disk. MITRE ATT&CK
04

What to do

  • Protect processes that handle credentials; keep behavior-blocking rules enabled. MITRE ATT&CK
05

MITRE ATT&CK

06

Related terms

07

Sources

  1. 1Credential API Hooking (T1056.004) · MITRE ATT&CK
  2. 2Process Injection (T1055) · MITRE ATT&CK
  3. 3Behavior Prevention on Endpoint (M1040) · MITRE ATT&CK