Thread Environment Block
Also called TEB, TIB.
Per-thread struct holding stack bounds and thread-local state.
What it is
A per-thread user-mode structure that records a thread's stack base and limit, thread-local storage, last-error value, and a pointer back to its process's environment block. Each thread in a process has its own.
Why it matters
TEBs let an examiner enumerate a process's threads and locate each thread's stack in memory, which is where call history, arguments, and remnants of executed code can be recovered. Stack ranges from the TEB also help validate whether a thread's start address falls in a legitimate module.
In practice
Using a thread's TEB to find its stack, then carving recently used strings and call frames that reveal what the thread was doing at capture time.
What to look for
- Threads whose start address is not inside a loaded module.
- Stack bounds that point to unusual memory.
- Threads created remotely in another process.
Common mistake
Ignoring threads. Injected code runs on a thread, and its start address often gives it away.
Practice it nearby
CyberKit has no tool for this term itself. These are the closest places to practice it.
- Collection Plan
Build a host collection command list, ordered by volatility.
- Windows Host Case
An alert on a live Windows workstation: read the event logs and the Registry, rebuild the timeline, then decide what to collect.
In the field
Well-known tools where this shows up on the job. They are listed to show the landscape, not as a recommendation.
-
Volatility 3 Open source
A widely used open source framework for analyzing memory images with plugins. Our notes.
-
Velociraptor Open source
Can collect memory and query live process memory across many hosts. Our notes.
-
CrowdStrike Falcon Commercial
EDR agents watch memory activity on the host, such as injection and unbacked code.
Read next
- Process Environment Block: User-mode struct holding a process's image path, modules, and parameters.
- EPROCESS: The kernel structure describing a running Windows process.
- Shellcode: Compact, self-contained machine code that runs from an injected buffer.