Import Table Analysis

24 minIn Progress

Import Table Analysis

The import directory -- the descriptors and name thunks, which tooling usually shows together as the imports -- names every DLL and API a binary expects to call, and the Import Address Table (IAT) is where the loader writes the resolved addresses at load time. By examining imports, you can quickly understand capabilities -- network communication, file manipulation, process injection, cryptographic operations, and anti-analysis techniques -- all without running a single instruction.


1. How the Import Table Works

When Windows loads a PE file, the loader reads the Import Table to determine which DLLs are needed, loads each DLL, resolves function addresses, and writes them into the IAT. The Import Table is essentially a capability manifest.


2. Suspicious API Reference

Process Manipulation (T1055 - Process Injection)

APIPurposeMalware Use
OpenProcessOpen handle to target processFirst step of injection
VirtualAllocExAllocate memory in remote processSpace for injected code
WriteProcessMemoryWrite to remote processWrite shellcode/DLL path
CreateRemoteThreadExecute thread in remote processTrigger injected code
NtUnmapViewOfSectionUnmap memoryProcess hollowing
QueueUserAPCQueue APC to remote threadAPC injection

File Operations (T1005 only when the data is actually collected)

APIMalware Use
CreateFile / WriteFileDrop payloads, write configs
DeleteFileSelf-deletion, anti-forensics
CopyFile / MoveFileInstall to persistent location
FindFirstFile / FindNextFileSearch for docs to steal/encrypt

Registry Operations (T1547.001)

APIMalware Use
RegSetValueExPersistence via Run keys
RegCreateKeyExCreate persistence locations
RegDeleteKeyRemove traces

Network Operations (T1071)

APIDLLMalware Use
InternetOpen / InternetConnectwininet.dllHTTP C2 setup
HttpSendRequestwininet.dllSend beacons, exfiltrate
URLDownloadToFileurlmon.dllDirect file download -- very suspicious
WSAStartup / connect / sendws2_32.dllRaw socket communication

Cryptographic Operations (T1027 / T1486)

APIMalware Use
CryptEncrypt / CryptDecryptRansomware, config protection
CryptDeriveKeyKey generation
CryptAcquireContextInitialize crypto

Anti-Analysis / Evasion (T1497 / T1622)

APIMalware Use
IsDebuggerPresentAnti-debugging
CheckRemoteDebuggerPresentAnti-debugging
GetTickCount / QueryPerformanceCounterTiming-based anti-debug
SleepDelay execution. Only evasion when the delay is long or checked against a clock -- every program sleeps
VirtualProtectUnpack code at runtime
PEStudio imports tab with suspicious API calls flagged
PEStudio imports tab with suspicious API calls flagged

3. Dynamic Imports: When the Import Table Lies

Sophisticated malware may have a minimal or empty import table and resolve functions at runtime:

LoadLibrary("ws2_32.dll") + GetProcAddress("connect")

If you see only LoadLibrary and GetProcAddress in imports, the malware is hiding its true capabilities.

What to do:

  • Note LoadLibrary/GetProcAddress as a red flag
  • Use FLOSS or strings to find DLL/API names referenced as strings
  • Use dynamic analysis to observe which APIs are actually called
  • CAPA can detect dynamic import resolution patterns

4. Tools for Import Analysis

PEStudio

Automatically flags suspicious imports with red indicators, groups by DLL.

pefile (Python)

import pefile
pe = pefile.PE("suspicious.exe")

print("=== Import Table ===")
for entry in pe.DIRECTORY_ENTRY_IMPORT:
    dll_name = entry.dll.decode()
    print(f"\n[{dll_name}]")
    for imp in entry.imports:
        name = imp.name.decode() if imp.name else f"Ordinal {imp.ordinal}"
        print(f"  {name}")

print(f"\nImphash: {pe.get_imphash()}")

CAPA (Mandiant)

$ capa suspicious.exe
# Maps imports to capabilities:
# - "inject code into remote process"
# - "persist via Run registry key"
# - "communicate via HTTP"

Dependency Walker (Windows)

Visual tree of DLL dependencies showing the full chain of imported modules.


5. Import Analysis Workflow

  1. Open in PEStudio -- scan for flagged imports
  2. Count imports -- very few suggests packing or dynamic resolution
  3. Check for LoadLibrary/GetProcAddress -- dynamic resolution indicator
  4. Categorize imports: process, file, network, registry, crypto, evasion
  5. Compute imphash -- search VirusTotal for related samples
  6. Run CAPA -- automated capability mapping
  7. Form hypotheses -- which ATT&CK techniques does this binary support?
  8. Plan dynamic analysis -- focus monitoring on suggested behaviors

Common Pitfall: An import being present does not guarantee the function is called. Imports tell you what a binary can do, not what it will do.

MITRE ATT&CK: Import analysis supports identification across nearly all ATT&CK tactics, from Execution (T1106) to Defense Evasion (T1055) to C2 (T1071).

Try it in the shell
Practise this lesson's tooling on its sample in an emulated analyst shell. Output is pre-recorded — nothing executes.

Suggested triage steps

  1. 1

    Inspect the import table

    Locate the KERNEL32 functions that justify file-enumeration and copy hypotheses.

  2. 2

    Focus the capability imports

    Filter the table to FindFirstFileA, FindNextFileA, and CopyFileA.

  3. 3

    Corroborate the mappings

    Compare the import hypotheses with the two recorded ATT&CK results.

analyst@lab:~emulated · nothing executes

MAA analyst shell — emulated. Nothing executes.

Type 'help', or click a step on the left.

$