Tutorials

Security labs, built from the inside out

Start with a learning path below, each one a sequence built to be worked in order. The complete reference library is still available by topic after them.

Start here

Learning paths (10)

Every multi-part series, ordered with the paths closest to my current research and practice first.

Featured

Tuxscope: Linux Kernel Observability with eBPF

Learn how your Linux kernel works by watching it: eleven cumulative labs that build a single eBPF-powered observability tool in Rust, from syscall tracing to container-level visibility and portable CO-RE.

7 tutorial s

Featured

Embedded Systems & Firmware

Build an embedded security lab with Buildroot and QEMU, audit attack surfaces, reverse-engineer firmware, exploit UART consoles and ARM services, and implement secure boot.

7 tutorial s

Featured

Securing AI Agents

Threat-model and harden autonomous AI agents: reason about the attack surface of agents that run tools, execute shell commands, and act on untrusted input, then design defenses in depth.

4 tutorial s

Linux Exploitation Fundamentals

A progressive path from CPU registers to remote exploitation, covering stack overflows, ROP chains, NX and ASLR bypasses on x86 and x64 Linux.

14 tutorial s

Windows Exploitation

Exploit development on Windows, from classic stack overflows through SEH hijacking and egghunter techniques to DEP and ASLR bypasses, culminating in kernel pool exploitation.

7 tutorial s

Windows Service Internals

Analyze Windows service DLLs, follow local RPC dispatch, reason about impersonation and access tokens, and understand registry authorization across privilege boundaries.

1 tutorial

ML for Security

Apply machine learning to security problems with explicit baselines and constraints: gadget ranking, network anomaly detection, adversarial evasion, binary similarity, temporal validation, and model operations.

9 tutorial s

LLM Red Teaming

A progressive path through prompt injection first principles, indirect injection from untrusted data, jailbreaking, system-prompt extraction, and agentic tool-use exploitation.

6 tutorial s

Transformers & LLMs

Build core transformer components from scratch and work through the full LLM pipeline: from tokenization and attention through fine-tuning, alignment, and evaluation.

8 tutorial s

Local RAG Pipeline

Build a local RAG pipeline, connect it to live CVE data, test retrieval poisoning, apply it to SOC alerts, and improve exact-match retrieval with hybrid search.

8 tutorial s

Complete archive

All tutorials

Jun 5, 2026

intermediate

Evaluating RAG Pipelines with RAGAS and TruLens

Build an eval set and measure faithfulness, context precision, context recall, and answer relevancy with RAGAS and TruLens to know if changes actually help.

Read the tutorial

Jun 4, 2026

intermediate

Run a Private AI Assistant in Your SOC

Build a RAG pipeline over Wazuh alerts that helps analysts triage incidents without sending data to external services.

Read the tutorial

Jun 3, 2026

advanced

Binary Function Similarity with Graph Neural Networks

Represent disassembled functions as control flow graphs, train a graph neural network for similarity embeddings, and apply it to patch diffing.

Read the tutorial

Jun 2, 2026

intermediate

Tuxscope Lab 7: Profiling Disk I/O Latency with eBPF HashMaps

Use eBPF HashMap state to trace the block layer and measure per-request I/O latency from issue to completion.

Read the tutorial

May 14, 2026

advanced

Threat Intelligence Extraction with Named Entity Recognition

Fine-tune a BERT token classifier to extract IOCs, threat actors, and techniques from security reports, then wrap it in a structured extraction function.

Read the tutorial

May 13, 2026

intermediate

Building a Tool-Calling Agent with RAG

Build a RAG pipeline with ChromaDB, implement a ReAct-style tool-calling agent, and measure retrieval with precision, recall, MRR, and nDCG.

Read the tutorial

May 12, 2026

intermediate

RAG Poisoning: How Adversarial Documents Break Retrieval Pipelines

Understand how hidden instructions, topic hijacking, and authority impersonation attacks break RAG pipelines, and build defenses against them.

Read the tutorial

May 11, 2026

intermediate

Tuxscope Lab 6: Observing Memory with Page Fault Tracing

Trace page faults and OOM kills to understand how Linux implements virtual memory through demand paging.

Read the tutorial

May 8, 2026

intermediate

System Prompt Extraction and Defense Hardening

Techniques for extracting hidden system prompts from LLM applications, and how to harden your prompts against extraction attacks.

Read the tutorial

Apr 29, 2026

advanced

DNS Exfiltration Detection with Sequence Models

Build an LSTM that detects DNS tunneling and data exfiltration by analyzing sequences of DNS queries, and compare against a per-query feature baseline.

Read the tutorial

Apr 28, 2026

advanced

Secure Boot and Firmware Integrity Verification

Implement a verified boot chain on embedded Linux with U-Boot FIT image signing, then attack it: downgrade attacks, unsigned image rejection, and bypasses.

Read the tutorial

Apr 27, 2026

intermediate

Tool Use and Agentic Exploitation

Attack LLM agents through confused deputy problems, tool argument injection, and data exfiltration via tool chains, with hands-on Ollama exercises.

Read the tutorial

Apr 18, 2026

intermediate

Add a Chat Interface to Your Local RAG Pipeline

Wrap your local RAG pipeline in a Streamlit chat UI with conversation history, streaming responses, and source citations that show where every answer came from.

Read the tutorial

Apr 17, 2026

intermediate

Chain-of-Thought and Reasoning Evaluation

Compare direct and chain-of-thought prompting on math, implement self-consistency via majority voting, and evaluate code generation with Pass@K.

Read the tutorial

Apr 13, 2026

advanced

Phishing URL Detection with Fine-Tuned Transformers

Fine-tune a DistilBERT model to classify phishing vs legitimate URLs, compare against a TF-IDF baseline, and explore tokenization challenges with URL strings.

Read the tutorial

Apr 11, 2026

advanced

Exploiting an Embedded Service: Buffer Overflow on ARM

Cross-compile a vulnerable network daemon for ARM, exploit a stack buffer overflow with ARM-specific techniques, and build ARM ROP chains in a QEMU/GDB lab.

Read the tutorial

Apr 10, 2026

intermediate

Tuxscope Lab 5: Tracing Process Lifecycle with eBPF

Trace fork, exec, and exit events in real time to understand how Linux creates, transforms, and destroys processes.

Read the tutorial

Apr 7, 2026

intermediate

Network Intrusion Detection with Autoencoders

Build a PyTorch autoencoder trained only on normal network flows to detect intrusions as high-reconstruction-error outliers, and compare with Isolation Forest.

Read the tutorial

Mar 23, 2026

advanced

Preference Tuning with DPO

Implement the third stage of LLM training: train a reward model on preference pairs, run DPO to align without reinforcement learning, and compare to best-of-N.

Read the tutorial

Mar 23, 2026

intermediate

Tuxscope Lab 4: Network Monitoring

Monitor TCP connections in real time by probing tcp_v4_connect and inet_csk_accept, capture source and destination IPs, ports, and connection direction.

Read the tutorial

Mar 20, 2026

intermediate

Indirect Prompt Injection Through Untrusted Data

Explore how adversarial content in retrieved documents, emails, and web pages can hijack LLM behavior, from RAG poisoning to cross-plugin attacks.

Read the tutorial

Mar 20, 2026

intermediate

Tuxscope Lab 3: File I/O Observation

Probe the VFS layer with kprobes on vfs_read and vfs_write to observe per-process file I/O volume in real time.

Read the tutorial

Mar 19, 2026

intermediate

Efficient Fine-Tuning with LoRA and Quantization

Fine-tune a language model with LoRA on a fraction of its parameters, compare FP32/FP16/INT8/NF4 inference, and weigh Flash Attention's tradeoffs.

Read the tutorial

Mar 18, 2026

intermediate

UART and Serial Console Exploitation

Identify and interact with UART interfaces on embedded devices using QEMU, extract boot logs, interrupt U-Boot for a root shell, and dump flash over serial.

Read the tutorial

Mar 17, 2026

intermediate

Tuxscope Lab 1: Hello eBPF

Build your first eBPF program in Rust, trace write syscalls and stream events from kernel space to userspace with PerfEventArray.

Read the tutorial

Mar 17, 2026

beginner

Tuxscope Lab 2: Syscall Tracing

Trace all system calls in real time, capture syscall IDs from raw_syscalls/sys_enter, resolve them to names, and switch from PerfEventArray to RingBuf.

Read the tutorial

Mar 16, 2026

intermediate

Jailbreaking: Bypassing LLM Alignment Controls

A taxonomy of jailbreak techniques: persona attacks, encoding tricks, few-shot poisoning, and multi-turn escalation, with a rubric for scoring bypasses.

Read the tutorial

Mar 16, 2026

intermediate

LLM Decoding and Prompt Strategies

Compare greedy, beam search, top-k, and nucleus decoding on GPT-2, visualize MoE routing, and test zero-shot, few-shot, and chain-of-thought prompting.

Read the tutorial

Mar 10, 2026

intermediate

BERT Fine-Tuning and Position Embeddings

Explore encoder-only transformers through BERT: inspect masked-LM predictions, fine-tune on sentiment, compare position embeddings, and benchmark distillation.

Read the tutorial

Mar 10, 2026

beginner

Tokenization and Attention from Scratch

Build the four foundational transformer components from scratch in NumPy: tokenization, word embeddings, self-attention, and positional encoding.

Read the tutorial

Mar 10, 2026

beginner

Transformers & LLMs: Series Introduction and Environment Setup

An overview of the Transformers and LLMs series: what it covers, who it is for, how the companion code is structured, and how to set up your environment.

Read the tutorial

Mar 6, 2026

beginner

Prompt Injection from First Principles

Build a vulnerable LLM chatbot with Ollama, exploit it with direct and indirect prompt injection, then layer defenses to see why it is fundamentally hard.

Read the tutorial

Mar 4, 2026

beginner

Ollama: Run LLMs Locally

Install and manage local LLMs with Ollama: CLI usage, model management, Modelfiles, the REST API, tool-calling models, Open WebUI, and coding-tool integration.

Read the tutorial

Feb 27, 2026

beginner

LLM Tokens, Context Windows, and the Attack Surface

How LLMs process text through tokenization, manage context windows, and where these mechanics create exploitable attack surface for red teamers.

Read the tutorial

Feb 20, 2026

intermediate

WebMCP Attack Surfaces

Build a web app that exposes tools to AI agents via WebMCP, then demonstrate tool poisoning, schema mismatch, response injection, and cross-tool exfiltration.

Read the tutorial

Jan 9, 2026

intermediate

Embedded Linux Attack Surface Analysis

Build a stripped embedded Linux image with Buildroot, then audit open ports, syscalls, suid binaries, kernel modules, and writable paths, and harden it.

Read the tutorial

Jan 8, 2026

advanced

Firmware RE with Binwalk and Ghidra

Extract firmware from an IoT update file, unpack the filesystem, identify interesting binaries, and reverse engineer them in Ghidra to find bugs.

Read the tutorial

Dec 18, 2025

intermediate

Cross-Compiling with Buildroot and QEMU

Set up an embedded Linux dev environment: build a custom ARM image with Buildroot, boot it in QEMU, and remotely debug binaries with GDB. No hardware required.

Read the tutorial

Dec 11, 2025

intermediate

Anomaly Detection on Linux Audit Logs

Build a lightweight anomaly detection pipeline that flags suspicious Linux sessions using auditd logs, feature engineering, and scikit-learn; no GPU required.

Read the tutorial

Dec 4, 2025

intermediate

Build a Local RAG Pipeline with Ollama and ChromaDB

A hands-on guide to building a retrieval-augmented generation pipeline that runs entirely on your machine, using security advisories as the knowledge base.

Read the tutorial

Aug 8, 2025

beginner

The Stack: Memory Layout and Function Frames

How the stack works in x86 and x64 Linux: memory layout, push/pop mechanics, function prologues and epilogues, and why overflows overwrite the return address.

Read the tutorial

Aug 7, 2025

beginner

x86 and x64 Registers and Calling Conventions

A practical guide to CPU registers, partial register access, flags, and how function arguments are passed on x86 and x64 Linux.

Read the tutorial