Skip to content
AyoKoding

Overview

The best way to stop an attacker is to think like one. This by-example guide teaches offensive security techniques through annotated tool output and attack scenarios — built for software engineers who want to understand what their code looks like from the attacker's side.

Ethical Use Notice: All examples are for authorized penetration testing, CTF competitions, lab environments, and defensive understanding only. Never apply offensive techniques against systems without explicit written authorization.

Why Software Engineers Need This

You write APIs, authentication systems, file upload handlers, and database queries. Each one is a potential attack surface. When you understand how attackers exploit these systems — the exact commands, tool output, and thought process — you write more defensively from day one.

This track uses only legal, lab-based environments (HackTheBox, TryHackMe, local VMs). You do not need a security certification or prior penetration testing experience. You need a terminal, curiosity, and a legal lab environment.

What Is Red Team By-Example Learning?

Red team by-example learning is a technique-first approach where you learn through annotated tool output, scripts, and adversary playbooks rather than abstract theory. Each example shows:

  • What it does — annotated tool output documenting each step of the attack chain
  • Why it works — the vulnerability or misconfiguration being exploited and the underlying mechanism
  • When to use it — which phase of an engagement this technique applies to
  • Detection surface — what artifacts the technique leaves for defenders to catch

Learning Progression

LevelEngineer ContextWhat You Learn
Beginner"I want to understand recon and scanning"Passive OSINT, nmap, service enumeration, basic web scanning
Intermediate"I want to understand exploitation"SQLi, XSS, shell access, privilege escalation, lateral movement
Advanced"I want to understand APT-level techniques"AV evasion, C2, AD attacks, full-chain scenarios

Start at Beginner even if you are an experienced engineer. The recon and enumeration examples build mental models that the exploitation examples depend on.

Coverage

What Is Covered

  • Reconnaissance — passive OSINT, active scanning, service enumeration, network mapping
  • Initial access — exploitation of common vulnerabilities, phishing simulation, credential attacks
  • Execution and persistence — shell payloads, scheduled tasks, startup persistence mechanisms
  • Privilege escalation — local privilege escalation on Linux and Windows
  • Lateral movement — credential reuse, pass-the-hash, pivoting techniques
  • Exfiltration simulation — data staging, covert channel basics
  • Post-exploitation — situational awareness, credential dumping, living-off-the-land binaries

What Is Not Covered

Prerequisites

  • Comfort with a Linux terminal (you can run commands and read output)
  • Basic understanding of HTTP, TCP ports, and DNS (you know what a web server is)
  • Access to a legal lab: HackTheBox, TryHackMe, or a local VM

No security certification or prior penetration testing experience required.

Structure of Each Example

Every example follows a consistent five-part format:

  1. What This Covers — the technique and its place in the attack chain (2-3 sentences)
  2. Scenario — lab environment, authorized engagement context, and assumed access level
  3. Annotated Tool Output or Script — commands and output with inline comments explaining each step, what it reveals, and what a defender would see
  4. Key Takeaway — the core offensive insight and its defensive implication (1-2 sentences)
  5. Why It Matters — production relevance for attackers and defenders (50-100 words)

Examples by Level

Beginner (Examples 1–28)

Intermediate (Examples 29–57)

Advanced (Examples 58–85)

Last updated May 20, 2026

Command Palette

Search for a command to run...