Payload Obfuscation for Red Teams

Instructor: Duncan Ogilvie
Duration: 2 days
Format: On-site training with lectures and guided exercises.
Price: TBD
Registration: training@ogilvie.pl

Description

Payload obfuscation can move sensitive logic out of native instruction streams and into a virtual execution environment. This training teaches participants how VM-based obfuscation works, how to compile payload logic to RISC-V, and how to execute that code inside a compact interpreter embedded in a host process.

The course starts from first principles with a small custom VM. Participants reverse a bytecode program, identify opcode handlers, write bytecode by hand, inspect interpreter dispatch, and compare a simple switch-based VM with a direct-threaded variant. This gives participants a concrete model for why virtualization raises reverse-engineering cost and why writing bytecode manually does not scale.

The second part introduces RISC-V as a practical VM instruction set. Participants learn the RV64 register model, common instructions, calling convention, position-independent shellcode constraints, linker scripts, ELF containers, raw binary extraction, tracing, and disassembly workflow. They compile small C payloads to rv64im, run them in riscvm, and debug failures with traces and instruction references.

The final part builds useful payloads and hardens the VM. Participants study the host/guest memory model, ecall-based syscalls, import resolution, host_call, the LLVM transpiler, the minimal runtime, relocation handling, payload packaging, opcode shuffling, instruction encryption, direct dispatch, C2 integration, and interpreter obfuscation tradeoffs.

Teaching

The training is exercise-driven. Each lecture block introduces a mechanism that is applied immediately in a lab task. Participants work inside a prepared development environment and build a complete pipeline from C source code to obfuscated RISC-V payload bytes executed by a host VM.

The course goal is pipeline literacy. Participants learn how to inspect each stage, diagnose broken payloads, reason about VM feature mismatches, read the generated RISC-V, and evaluate which obfuscation layers increase analyst effort.

The material is designed for authorized red teams, security researchers, and reverse engineers who need to understand code virtualization from both the builder and analyst perspective.

Learning Objectives


Outline


Requirements and Recommendations

Prerequisites

Participants should be familiar with:

Helpful but optional:

Workstation Requirements

Each participant needs their own workstation. The prepared environment requires:

The exercises can also be run after the training with Docker. A Windows VM or host is useful for follow-up testing, but the prepared Codespaces environment uses Wine and NoVNC for the workshop labs.

Classroom Requirements

The training is delivered on-site only. A dedicated classroom with a projector is required. The training uses a collaborative format with frequent questions, live troubleshooting, and shared exercise discussion.

Register


Instructor

Duncan Ogilvie is the creator of x64dbg and co-author of RISC-Y Business: Raging against the reduced machine. He has professional experience in DRM, mobile security, reverse engineering, and binary tooling. The course materials focus on practical VM internals, transparent build pipelines, and the tradeoffs between obfuscation strength, debuggability, and analyst effort.