press any key to skip
// you have arrived in
15 districts · 0/0 flags captured · population: hackers
// city directory
// AI CORE · neural archive
Click a card to watch the attack play out as an animated sequence diagram, with the vulnerable code, the fix, and the defenses that actually work.
// SENTINEL SPIRE · threat landscape
A simulated security operations dashboard. Drag the globe to spin it. Every arc is randomly generated to show the kind of noise defenders watch all day. None of it is real traffic.
// CHAIN BRIDGE · the cyber kill chain
Lockheed Martin's seven-phase model of an intrusion. Break any link and the attack fails.
// THE DISTRICTS · hands-on labs
Twelve districts, each with a mission: offense, crypto and blue-team defense. Capture flags to rank up; your progress is saved in this browser. Everything is simulated in this page and nothing is sent anywhere.
This login runs one SQL query against a real (tiny) database engine inside this page. The app logs you in as the first row the query returns. Table: users(id, name, pass, role).
The driver sends the SQL text and the values separately. In PostgreSQL's protocol that's three messages: Parse, Bind, Execute. The query plan is fixed before your input arrives, so input can never change its structure.
No data or errors on the page? Attackers ask yes/no questions like ' AND SUBSTRING(pass,1,1)='T'-- and watch whether the page changes, or use delays such as SLEEP(5). Tools like sqlmap automate thousands of these requests.
' UNION SELECT number, cvv FROM cards-- appends rows from a different table to the results, as long as the column counts match.
Input is stored safely, then later concatenated into a different query. The injection fires on a page far from where it was entered.
Search boxes, sort parameters, cookies and HTTP headers are all inputs. ORDER BY columns can't be bound as parameters, so allowlist them.
Your comment is inserted into every visitor's page. The lab shows the DOM their browser would build. It's parsed in an inert document, so nothing actually runs here.
The payload is saved (comments, profiles, product reviews) and served to everyone who views the page. This lab is stored XSS, the most dangerous kind.
The payload rides in a link, such as /search?q=<script>…, and the server echoes it back. The victim has to click the attacker's link.
The page's own JavaScript writes attacker-controlled data (like location.hash) into innerHTML. The server never sees the payload.
HTML body, attribute, JavaScript string and URL each need different encoding. Encoding for the wrong context still leaves a hole.
script-src 'self' blocks inline scripts and event handlers like onerror. Nonces or hashes can allow specific scripts. It's a seatbelt, not a substitute for encoding.
HttpOnly hides cookies from JavaScript, but injected script can still send requests as the user from inside the page.
A C function copies your name into a 16-byte stack buffer with strcpy, which never checks length. Watch the x86-64 stack frame byte by byte as you type.
x86-64 is little-endian: the least significant byte sits at the lowest address. 0x0000555555555189 is stored as 89 51 55 55 55 55 00 00.
Locals sit below the saved frame pointer and the return address, so writing upward past buf runs straight into them.
With a non-executable stack, attackers chain existing code snippets ending in ret (“gadgets”) into a program. That's return-oriented programming.
Code and stack addresses are randomized on every run, so attackers first need an information leak to learn where things are.
Hardware features like Intel CET keep a protected copy of return addresses and kill the process if they don't match.
Bounds-checked copies (snprintf, strlcpy) or memory-safe languages remove the bug class entirely.
A hash turns any input into a fixed-size fingerprint. It's one-way, so attackers can't reverse it; they guess and compare. All hashes here are real (Web Crypto).
This unsalted SHA-256 hash leaked from a breached database. Guess the password, or run a wordlist attack the way real crackers do.
SHA-256 is built to be fast. A single modern GPU computes billions per second, so a stolen database of unsalted SHA-256 hashes falls quickly.
A unique random salt per user means identical passwords get different hashes, and precomputed lookup tables (rainbow tables) become useless. Each user has to be attacked separately.
bcrypt, scrypt and Argon2 are deliberately slow and tunable. Argon2 also needs lots of memory, which blunts GPU and ASIC cracking.
MD5 and SHA-1 have practical collision attacks (SHAttered, 2017), so don't use them for signatures or integrity.
Estimates an offline brute-force attack at 10 billion guesses per second (a GPU rig against a fast, unsalted hash). It runs entirely in this page, but don't type a password you really use.
Most account takeovers don't crack anything. Attackers replay email/password pairs leaked from other sites, which is why reuse is the real killer.
A unique random password per site makes stuffing useless. You only need to remember one strong passphrase.
A second factor stops most stolen-password logins. Phishing-resistant options (passkeys, security keys) also stop fake login pages.
Have I Been Pwned's range API takes only the first 5 hex characters of a password's SHA-1 hash and returns all matching suffixes, so the full password never leaves your machine.
Most breaches start with a message, not an exploit. Inspect each message in this inbox and decide: legit or phish? Hover links to see where they really lead. Every brand and domain here is fictional.
What matters is the registered domain at the end of the hostname: in novabank.example.verify-login.example the site is verify-login.example. Watch for lookalikes like c1ouddrive, or rn posing as m.
Link text can say anything. The status bar, or a long-press on mobile, shows where the link really goes.
Urgency, fear, secrecy and authority (“the CEO needs this now”) are designed to make you skip checking.
An unexpected request for money, codes or credentials? Contact the person or company through a channel you already trust, never the one in the message.
Passkeys and hardware security keys are bound to the real domain, so a fake login page can't use them even if you're fooled.
You're on shift at the Log Citadel. These are 20 lines from the web server's access log. Click every line that shows malicious activity, then check your analysis. grep filters the view.
URL-decode suspicious parameters: %27 is a quote and %3C is <. Quotes, angle brackets and dot-dot-slashes in parameters are classic probe signs.
Scanners often announce themselves in the User-Agent (sqlmap, zgrab, nikto). Scripts show up as python-requests or curl instead of a browser.
Many failures in seconds from one IP is brute force. Many IPs each trying one password is credential stuffing, which is harder to spot.
A 200 right after a burst of 401s is the most important line in the log: the attacker got in.
Not every 404 is an attack. Too many false positives and real alerts start getting ignored.
Nine kinds of traffic hit your servers: four you need and five you don't. Write firewall rules that let the good in and keep the bad out. Rules are checked top to bottom, and the first match wins.
Port: any or a number. Source: internet, vpn (your admins), internal (your own servers) or any.
Modern firewalls track connections, so replies to traffic you started are allowed back in automatically. Rules only describe who may start a connection.
Filtering outbound traffic too stops malware from phoning home and data from leaking out.
Split the network into zones (web, app, database) so one compromised server can't reach everything.
Security groups and network ACLs are the same idea. Misconfigured ones (a database open to 0.0.0.0/0) are among the most common cloud mistakes.
Attackers injected four things into your page, and someone is trying to frame it. Build a Content-Security-Policy that blocks every attack while your own scripts keep working.
Content-Security-Policy-Report-Only reports violations without blocking anything, so you can test a policy on real traffic before enforcing it.
A nonce is random per response. A hash ('sha256-…') allows one exact inline script. Both beat 'unsafe-inline'.
'strict-dynamic' lets a trusted, nonced script load the scripts it needs, so you don't have to maintain long host allowlists.
In Chromium-based browsers, require-trusted-types-for 'script' forces DOM sinks like innerHTML to only accept sanitized values.
An intercepted message, encrypted with a Caesar cipher: every letter is shifted by the same secret amount. There are only 25 possible keys, but frequency analysis finds the right one without trying them all.
Six snippets from a pull request at Audit Tower. For each one, click the line with the security bug, then choose the fix that actually works.
Base64, hex and URL-encoding only change how data is written. There's no key, so anyone can reverse them. Attackers see “obfuscated” secrets in apps all the time.
Base64, hex, URLAES-GCM, ChaCha20SHA-256, Argon2// BEYOND THE CITY · keep going
The industry's shortlist of the most critical web application risks.
Web Security Academy ↗PortSwigger's free, hands-on labs for every bug class on this page.
MITRE CWE ↗The catalogue behind all those CWE numbers: every weakness, classified.
OverTheWire ↗Wargames that teach Linux, crypto and exploitation from zero.