Every chapter of this book advances a single, continuous engagement against one fictional target that lives entirely in your homelab: **Obsidian Grid**, a critical-infrastructure monitoring company that sells a SCADA/ICS visibility platform to energy utilities, water treatment facilities, and manufacturing plants. Obsidian runs Go end to end — a fleet of Go microservices connected by gRPC and Protocol Buffers, a PostgreSQL database for asset inventory, an etcd cluster for configuration, a NATS messaging bus for real-time telemetry, an MQTT broker that talks to field sensors, Prometheus for metrics, and a custom TLS PKI that issues certificates to every component. One target carries every phase of the pentest: the external web dashboard, an API gateway, an operational-technology bridge, an AI-powered anomaly-detection engine, and the infrastructure underneath.
You don't just run tools against Obsidian Grid. You **build** the tools, in Go, one phase at a time: your own recon harness, your own scanner, your own exploits, your own implants, and finally your own report generator. Every tool compiles to a single static binary that you can cross-compile for any OS and drop on any target without dependencies. Each phase ends with a captured flag — `OBSIDIAN{...}` — and those flags become the evidence trail for the deliverable you assemble in the final chapter.
Nothing in this book touches a system you do not own. The entire range is yours: stood up locally with one command, attacked, and torn down when you are done.
## Who This Book Is For
You already write Go and you have seen a pentest before. This book pushes past tutorial territory into the patterns that make offensive tooling fast and reliable: goroutines and channels for concurrent scanning, `net` and `net/http` for raw socket work and HTTP manipulation, `crypto/tls` and `crypto/x509` for certificate abuse, `os/exec` and `syscall` for post-exploitation, `google.golang.org/grpc` for attacking gRPC services, and `encoding/binary` for protocol parsing. If you have never written Go beyond a "Hello World," start elsewhere and come back. If you want to understand what your tools actually do — and build better ones that compile to a single, dependency-free binary — you are in the right place.
## Conventions
**Flags.** Each chapter plants at least one flag in the range, in the format `OBSIDIAN{...}`. You capture it by running the tool you just built, not by reading it out of a config file. Flags are cumulative; keep them.
**The chapter rhythm.** Every chapter follows the same beat:
| Beat | What it is |
| --- | --- |
| Briefing | The story moves one step forward in the engagement |
| Objective | The concrete goal and the flag to capture |
| Concepts | The Go ideas the chapter introduces |
| Build | Complete, working tooling you type and run |
| Capture | Running your tool against the range to take the flag |
| Debrief | The blue-team view: what this looks like to a defender |
Some chapters add an **AI Corner** — an optional sidebar that uses or attacks an LLM. It is never required to finish a chapter.
**Lab safety.** The range is self-contained and offline-capable. Treat every technique here as lab-only. The same code pointed at infrastructure you are not authorized to test is a crime; authorization is the only thing separating this book from one.
## Roadmap
| Ch | Phase | What you build in Go |
| --- | --- | --- |
| 0 | Rules of engagement | Workstation preflight check |
| 1 | Range build & inventory | `range_control.go` — Docker orchestrator + asset inventory |
| 2 | Passive recon / OSINT | Concurrent DNS resolver, certificate transparency, dossier builder |
| 3 | Active recon & scanning | SYN scanner with goroutine pool + service fingerprinter |
| 4 | Web attack surface | Concurrent directory bruter, API fuzzer, gRPC reflection enumerator |
| 5 | Vulnerability discovery | SSTI / command injection / gRPC auth-bypass scanner |
| 6 | Exploitation — the foothold | Deserialization + command injection chain; your first shell |
| 7 | Exploiting the AI layer | Prompt-injection fuzzer; model poisoning; tool-call hijack |
| 8 | Post-exploitation | Static-binary implant, encrypted C2, credential harvesting |
| 9 | Privilege escalation | Container escape, etcd secret extraction, PKI certificate abuse |
| 10 | Cloud & lateral movement | gRPC service hopping, NATS message interception, MQTT pivot |
| 11 | Actions on objectives | Data exfiltration over DNS and covert gRPC channels |
| 12 | Reporting | Parse every flag + finding into a scored deliverable |