GET /api/techniques/124/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 124,
    "key": "inline-hooking",
    "unprotect_id": "U1211, F0015.002",
    "name": "Inline Hooking",
    "description": "Inline hooking is a technique used to intercept calls to target functions. It is commonly used by antiviruses, sandboxes, and malware to perform a variety of tasks, such as checking parameters, shimming, logging, spoofing returned data, and filtering calls.\r\n\r\nThe process of inline hooking involves directly modifying the code within the target function, usually by overwriting the first few bytes with a jump instruction to redirect execution to a different function. This allows processing to be performed before or after the target function executes. Rootkits often use hooks to modify data returned from system calls to hide their presence, while security software uses them to prevent or monitor potentially malicious operations.\r\n\r\nThe hooks are placed by directly modifying code within the target function (inline modification), usually by overwriting the first few bytes with a jump; this allows execution to be redirected before the function does any processing. Most hooking engines use a 32-bit relative jump (opcode 0xE9), which takes up five bytes of space.\r\n\r\nHere is a general outline of the process of implementing an inline hook:\r\n\r\n1. Determine the address of the target function and the code that needs to be replaced.\r\n\r\n2. Create a trampoline function that will be used to execute the original code from the target function after the hook has been applied.\r\n\r\n3. Calculate the relative address of the trampoline function and store it in a jump instruction.\r\n\r\n4. Overwrite the first few bytes of the target function with the jump instruction.\r\n\r\n5. Modify the hook function to transfer control back to the trampoline function after performing the desired processing.",
    "resources": "http://www.binaryguard.com/bgc/malware/sandbox/2015/11/09/dissecting_inline_hooks.html",
    "creation_date": "2019-03-23T17:39:46Z",
    "tags": "Inline hooking,\r\nIntercept calls,\r\nTarget functions,\r\nCheck parameters,\r\nShim,\r\nLog,\r\nSpoof returned data,\r\nFilter calls,\r\nRootkits,",
    "modification_date": "2023-10-04T10:44:59.702000Z",
    "category": [
        4
    ],
    "rules": [],
    "attachments": [],
    "featured_api": [
        340,
        425
    ],
    "contributors": []
}