Leanpub Header

Skip to main content

Adversarial Go

A compiled penetration test built entirely in Go — from first packet to final report

Adversarial Go
This book is 100% completeLast updated on 2026-11-19

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.

Minimum price

$10.99

$14.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

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 |

Bundle

Bundles that include this book

Author

About the Author

Andrew Ingram

Andrew Ingram is a cybersecurity professional with years of experience in banking and financial services security. His career has spanned threat analysis, security operations, phishing simulation, and security awareness — the kind of work where you see real attacks hit real infrastructure every day and have to decide, fast, what to do about them.

That day-job exposure to adversary tradecraft is what drives this series. Andrew built every tool in these pages because he wanted to understand exactly what the frameworks were doing under the hood — and because the best way to defend a network is to know how it breaks. When he is not dissecting BEC campaigns or writing detection rules at work, he is standing up lab ranges, chasing flags, and turning offensive techniques into clean, reusable code.

Adversarial Go is the sixth book in the Adversarial Series, following Python, Rust, Bash, PowerShell, and JavaScript. You can find him collecting badges on cybersecurity training platforms and, occasionally, losing arguments with his homelab's DNS.

Contents

Table of Contents

Adversarial Go

  1. About This Book
  2. Who This Book Is For
  3. Conventions
  4. Roadmap
  5. About the Author

Chapter 0 — Rules of Engagement

  1. Briefing
  2. Objective
  3. Concepts
  4. Build
  5. Capture
  6. Debrief

Chapter 1 — Range Build & Inventory

  1. Briefing
  2. Objective
  3. Concepts
  4. Build
  5. Capture
  6. Debrief

Chapter 2 — Passive Recon / OSINT

  1. Briefing
  2. Objective
  3. Concepts
  4. Build
  5. Capture
  6. Debrief

Chapter 3 — Active Recon & Scanning

  1. Briefing
  2. Objective
  3. Concepts
  4. Build
  5. Capture
  6. Debrief

Chapter 4 — Web Attack Surface

  1. Briefing
  2. Objective
  3. Concepts
  4. Range Additions
  5. Build
  6. Capture
  7. Debrief

Chapter 5 — Vulnerability Discovery

  1. Briefing
  2. Objective
  3. Concepts
  4. Range Additions
  5. Build
  6. Capture
  7. Debrief

Chapter 6 — Exploitation: The Foothold

  1. Briefing
  2. Objective
  3. Concepts
  4. Range Additions
  5. Build
  6. Capture
  7. Debrief

Chapter 7 — Exploiting the AI Layer

  1. Briefing
  2. Objective
  3. Concepts
  4. Range Additions
  5. Build
  6. Capture
  7. Debrief

Chapter 8 — Post-Exploitation

  1. Briefing
  2. Objective
  3. Concepts
  4. Build
  5. Capture
  6. Debrief

Chapter 9 — Privilege Escalation

  1. Briefing
  2. Objective
  3. Concepts
  4. Range Addition
  5. Build
  6. Capture
  7. Debrief

Chapter 10 — Cloud & Lateral Movement

  1. Briefing
  2. Objective
  3. Concepts
  4. Range Additions
  5. Build
  6. Capture
  7. Debrief

Chapter 11 — Actions on Objectives

  1. Briefing
  2. Objective
  3. Concepts
  4. Build
  5. Capture
  6. Debrief

Chapter 12 — Reporting

  1. Briefing
  2. Objective
  3. Concepts
  4. Build
  5. Capture
  6. Debrief

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub