MalDev Study
Core Module 52intermediate

IAT Hiding & Obfuscation - Introduction

Introduction to Import Address Table hiding.

Jump to Section (4)

Learning Objectives

0/1 done

IAT Hiding & Obfuscation - Introduction

Introduction

The Import Address Table (IAT) contains information regarding a PE file, such as the functions used and the DLLs exporting them. This type of information can be used to signature and detect the binary.

For example, the image below shows the import address table of the binary from the Process Injection - Shellcode module. The PE file imports functions which are considered highly suspicious. Security solutions can then use this information to flag the implementation.

image

Note that the majority of the remaining functions were added by the compiler and will be dealt with in future modules.

IAT Hiding & Obfuscation - Method 1

To hide functions from the IAT, it's possible to use GetProcAddress, GetModuleHandle or LoadLibrary to load these functions dynamically during runtime. The snippet below will load VirtualAllocEx dynamically and therefore it will not appear in the IAT when inspected.

CPP
typedef LPVOID (WINAPI* fnVirtualAllocEx)(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);

//...
fnVirtualAllocEx pVirtualAllocEx = GetProcAddress(GetModuleHandleA("KERNEL32.DLL"), "VirtualAllocEx");
pVirtualAllocEx(...);

Although this may appear to be an elegant solution, it's not a very good one for several reasons:

  • First, the VirtualAllocEx string exists in the binary which can be used to detect the usage of the function.

  • GetProcAddress and GetModuleHandleA will appear in the IAT, which in itself is used as a signature.

IAT Hiding & Obfuscation - Method 2

A more elegant solution is to create custom functions that perform the same actions as GetProcAddress and GetModuleHandle WinAPIs. This way, it becomes possible to dynamically load functions without having these two functions appear in the IAT. The next modules will discuss this solution more in depth.

Diagram

Search all modules and companion code

No matching modules or source files found for “”.
    Covers all 91 Core + 38 Advanced modules + source archives

    Reader Settings & Progress

    Color Theme

    Reading Font Size

    Study Progress & Cross-Device Backup

    0/129
    Completed
    0
    Bookmarked
    0
    Module Notes

    Progress is saved locally in your browser. Export a JSON backup to move your progress between laptop and phone.