hacking track
week 11 · day 1

The Hacker's Mindset, Ethics & Lab

How attackers think, and building a safe place to practice

Easy 30 min 180 xp
After this you can
  • Describe the attacker's methodology as a repeatable loop
  • State the legal and ethical line, and why it is absolute
  • Stand up an isolated lab you can attack freely
  • Know the deliberately-vulnerable targets to train on

Hacking is a way of seeing

A hacker is not someone who memorizes tricks. A hacker is someone who refuses to accept the intended interface as the only interface. The developer built a login form to accept a username. You ask: what if I put a quote in it? A billion characters? SQL? The system was designed for the *happy path*; your entire craft is exploring every unhappy path the designer never imagined.

Everything you've learned so far feeds this. You know that a "number" is just bytes (Metal-to-C Day 1), that memory is one addressable array (Day 4), that a function's return address sits on the stack (Day 12). Attackers weaponize exactly that knowledge: they treat the machine as it *actually is*, not as the documentation pretends.

Key idea
The core question of offensive security: "What does this system trust, and what happens when that trust is misplaced?" A web app trusts that input is data, not code. A program trusts that a buffer won't overflow. A server trusts that a URL points somewhere safe. Every vulnerability in this course is a violated trust boundary. Learn to *see the boundaries* and you'll find the bugs.

The attacker's methodology

Real attacks are not random. They follow a loop you'll repeat for every target. CTF box or authorized engagement:

The offensive loop
 ┌──────────────┐
 │ 1. RECON │ What's here? Hosts, ports, services, versions.
 └──────┬───────┘
 v
 ┌──────────────┐
 │ 2. ENUMERATE │ Dig into each service. Users, paths, configs, versions.
 └──────┬───────┘
 v
 ┌──────────────┐
 │ 3. EXPLOIT │ Turn one weakness into a foothold (code exec / access).
 └──────┬───────┘
 v
 ┌──────────────┐
 │ 4. ESCALATE │ Low-priv user -> root/SYSTEM.
 └──────┬───────┘
 v
 ┌──────────────┐
 │ 5. PERSIST/ │ Maintain access, move laterally, document everything.
 │ PIVOT │ (In authorized work: then you write the report.)
 └──────────────┘

Most beginners fixate on step 3 (the exploit) because it looks cool. Professionals know 80% of success is recon and enumeration, you cannot exploit what you haven't found. We'll spend real time on steps 1-2 before touching the flashy stuff.

The line you do not cross

This has to be blunt, because the skill is genuinely dangerous.

Careful
Only ever attack systems you own or have explicit, written authorization to test. Scanning, exploiting, or accessing a computer you don't own is a crime in essentially every country (in the US: the Computer Fraud and Abuse Act; UK: the Computer Misuse Act). "I was just curious" is not a defense. The exact same command is *training* against your own VM and a *felony* against someone else's server. The technique is identical, the authorization is everything.

This isn't moralizing, it's the professional standard. Penetration testers work under signed scope agreements. Bug-bounty hunters work within published program rules. CTF players attack sandboxes built to be attacked. You will have a lifetime of legal, lucrative, fascinating targets. There is zero reason to touch anything you're not allowed to.

Build your lab

You need an isolated environment: a place where you are both attacker and target, disconnected from anything real. The standard setup:

  • A host machine (your laptop) running a hypervisor: VirtualBox (free) or VMware.
  • An attacker VM: Kali Linux or Parrot OS. Linux distros preloaded with the tools (nmap, Burp Suite, gdb, pwntools, Ghidra).
  • One or more victim VMs: intentionally vulnerable images.
  • A host-only / internal network so the VMs talk to each other but not to the internet or your real LAN.
lab sanity checks (run inside your Kali VM)sh
1# confirm the core tooling exists
2nmap --version # network scanner
3gdb --version # debugger (you met this in Metal-to-C)
4python3 -c "import pwn" # pwntools: the exploitation framework
5searchsploit --version # local exploit database
6
7# find your attacker VM's address on the isolated lab network
8ip addr show # note the host-only adapter's inet, e.g. 192.168.56.101

Why isolation matters

The ip addr output tells you which network your VMs share. If that adapter is host-only or internal, packets from your attacks physically cannot reach the internet, you could run the most aggressive exploit in the world and nothing outside the sandbox is touched. That is the whole point: make mistakes freely, harm nothing.

Where to train

You don't have to build every target yourself. These exist specifically to be hacked, legally:

PlatformWhat it's forBest for
picoCTFBeginner CTF, always onlineFirst exploits, fundamentals
OverTheWire (Bandit→)Wargames over SSHLinux + escalation basics
pwnable.kr / pwnable.twBinary exploitationPhase C (pwn)
HackTheBox / TryHackMeFull vulnerable machinesThe whole methodology
DVWA / Juice ShopDeliberately vulnerable web appsPhase B (web)
VulnHubDownloadable victim VMsOffline lab practice
Note
Start with picoCTF and OverTheWire Bandit today, no VM required for those, just a browser and SSH. They'll get you moving while your local lab downloads. Everything in this track maps onto challenges from these platforms, so you always have a legal target to apply each lesson to.
finished reading?
Your task, you write the code

Stand up your lab and land your first flag

Two parts. (1) Set up an isolated lab: install VirtualBox, import a Kali VM, and configure a host-only network, confirm with `ip addr` that Kali is NOT on your real LAN. (2) Independent of the VM, create an account on OverTheWire and solve Bandit levels 0 through 5 by SSH. Keep a notes.md logging each level: the command you used and the one-sentence lesson. You do the solving, no walkthroughs until after you've genuinely tried each level.

deliverable: notes.md (your Bandit 0-5 solutions + lab network confirmation)
build & run
$ ssh bandit0@bandit.labs.overthewire.org -p 2220 # password: bandit0
$ # each level's password unlocks the next; read the level goal, explore, find it
self-review before running
  • Your Kali VM's IP is on a host-only/internal range, not your home network
  • You reached Bandit level 6 (i.e. solved 0-5) on your own
  • notes.md explains the WHY of each solution, not just the command
  • You can state the 5 steps of the offensive loop from memory
stretchOn picoCTF, solve two 'General Skills' challenges. Notice how each is really just 'the intended interface isn't the only interface', the hacker mindset in miniature.

Self-check

01The single most important factor separating training from a crime is:
02In the attacker's methodology, most real-world success comes from:
03The unifying idea behind essentially every vulnerability is:
04Why configure your lab VMs on a host-only network?
0/4 correct · 0/4 checked