Every level, in the open
Networking
11 worlds · 151 levels · 11 bosses
SOLUTION HIDDENTeachers see answer keys in the classroom.
A real lab of hosts, wires and routers inside your VM. Packets are creatures: learn where they live, how they travel, and why they get lost.
Guided levels show the command first. Alone levels give the goal only. Bosses and exams are timed.
Jump to a world
World 1Bits & Layers
14 levelsBefore the wires: light switches (bits), hex name tags (MACs), nesting dolls (layers) and the harbor signs (ports).
Level 1: Light switches
Objective: Three times: read the 8 switches in ~/question.txt and tell Kern their value in decimal (e.g. kern 192).
A byte is 8 light switches worth 128 64 32 16 8 4 2 1. Add the ones that are on. bash checks your sum: echo $((2#BITS)).
Commands taught
binaryLevel 2: Flip it
Objective: Three times: turn the number in ~/question.txt into 8 switches with bc and tell Kern (e.g. kern 10101100).
Decimal to binary: take the biggest switch that fits, switch it on, subtract, repeat. bc does it for you: echo "obase=2; 172" | bc.
Level 3: Dotted quad
Objective: Twice: turn the 32 bits in ~/question.txt into a dotted address and tell Kern (e.g. kern 192.168.1.10).
An IPv4 address is 32 switches: four octets with dots between them. 11000000.10101000.00000001.00001010 = 192.168.1.10.
Level 4: Masks are switches
Objective: Three rounds: ~/question.txt holds a mask (kern its /N) or a /N (kern its mask).
A netmask is a run of 1 switches, then 0s: 255.255.255.192 = 24 + 2 ones = /26. The /N after an address counts those ones.
Level 5: Hex name tags
Objective: Read wire0's MAC, then turn its last byte into decimal.
Hex counts to 15 in one digit (0-9 then a-f), so two hex digits = one byte. A MAC is a network card's 6-byte name tag, written in hex.
Level 6: Layer cake
Objective: Catch one of the creatures meadow keeps sending you and name each layer.
One line of tcpdump -e shows every layer of a packet: MACs (link), IP addresses (internet), ports (transport), and with -A the data (application).
Commands taught
layersLevel 7: Nesting dolls
Objective: Open the dolls of one of meadow's packets, one header at a time.
Encapsulation: the data rides in a UDP datagram, inside an IP packet, inside an Ethernet frame. Each outer doll says what is inside the next one.
Level 8: Private streets
Objective: Three in a row: is the address in ~/question.txt private or public? (kern private / kern public)
Three ranges are private (RFC 1918): 10.0.0.0/8, 172.16.0.0/12 (172.16 to 172.31) and 192.168.0.0/16. The internet never routes them: they live behind NAT.
Commands taught
special-addressesLevel 9: Home sweet home
Objective: Ping yourself on a strange 127 address, then find the interface that never got a DHCP answer.
127.0.0.0/8 is loopback: every 127.x.y.z is your own machine. 169.254.0.0/16 (APIPA) is the address a host gives itself when no DHCP server answered.
Level 10: Old classes
Objective: Three rounds: tell Kern the class of the address in ~/question.txt (kern A / B / C / D).
Before CIDR, the first octet set the class: A 1-126 (/8), B 128-191 (/16), C 192-223 (/24), D 224-239 (multicast). History, but interviews and old docs still use it.
Level 11: Harbor signs
Objective: Three rounds: tell Kern the /etc/services name of the port in ~/question.txt (kern ntp).
Well-known services sail into well-known ports. /etc/services is the harbor sign: grep -w 123/udp /etc/services → ntp.
Commands taught
servicesLevel 12: Which layer broke?
Objective: Three tickets in a row: tell Kern the layer of the problem in ~/question.txt (kern link / internet / transport / application).
Triage from the bottom up: cable, link state, MAC → link; address, mask, route, ttl → internet. Port, refused, a firewall on a port → transport; names, HTTP codes, logins → application.
Level 13: Harbor quiz
Objective: Answer five questions in a row with kern ANSWER.
Five right answers in a row, against the clock; a wrong answer resets the streak. Come back any time for more reps.
Level 14: BOSS: Annotate the capture
Objective: Catch one of meadow's packets and annotate it: link, ethertype, internet, protocol, ttl, service, data.
The network team wants one packet explained, layer by layer, with no help.
World 2The Wire
11 levelsWhere packets are born: interfaces, links up and down, addresses, MACs, and your first wires between hosts.
Level 15: Roll call
Objective: A new wire just appeared on your machine: tell Kern its name (kern <name>).
Every way in or out of a machine is an interface. ip link lists them; lo is the machine talking to itself.
Commands taught
ip-linkLevel 16: Wake up
Objective: Bring your interface wire0 up.
An interface that is DOWN is a closed door: no creature gets through. sudo ip link set NAME up opens it.
Level 17: An address
Objective: Give wire0 the address 10.0.1.1/24, then ping meadow at 10.0.1.2.
An IP address is a home address: packets need one to be delivered and to find their way back. hidden gives wire0 one.
Commands taught
ip-addrpingLevel 18: The other side
Objective: Find meadow's IP address and tell Kern (kern <address>).
Each host in this lab is a network namespace with its own interfaces. on meadow CMD runs CMD there (it is short for sudo hidden exec meadow CMD).
Commands taught
onLevel 19: Lay a wire
Objective: Lay a wire to orchard: a veth pair named wire5 (your end) and orch0 (orchard's end, moved into orchard).
A veth pair is a virtual cable with two ends. Create one with ip link add A type veth peer name B, then move end B to a host with ip link set B netns HOST.
Commands taught
vethLevel 20: Written down
Objective: Write a stanza for wire0 with the address 10.0.11.1/24 in /etc/network/interfaces, then bring it up with ifup so you can ping meadow (10.0.11.2).
ip addr add is forgotten at reboot. A stanza in /etc/network/interfaces (auto DEV, iface DEV inet static, address A.B.C.D/NN) is applied at every boot, and sudo ifup DEV applies it now.
Commands taught
interfacesLevel 21: Lights on
Objective: Fix meadow so that ping 10.0.6.2 gets an answer.
A wire has two ends, and each must be up.
Level 22: Name tag
Objective: Tell Kern the MAC address of meadow's eth0.
Under the IP, each interface wears a hardware name tag: its MAC address (link/ether). On one wire, delivery is by MAC.
Commands taught
macLevel 23: Rescue
Objective: PAGER: make ping to meadow (10.0.8.2) work, with your wire0 (10.0.8.1/24) written in /etc/network/interfaces for the next boot.
Pager time: links down, addresses gone, and last time the fix vanished at the next reboot.
Level 24: Line-up
Objective: The MAC in ~/suspect.txt belongs to one of the hosts h1, h2, h3: tell Kern which.
A card with a known name tag went missing.
Level 25: BOSS: Two wires
Objective: Wire orchard (you 10.0.1.1/24, orchard 10.0.1.2/24) and grove (you 10.0.2.1/24, grove 10.0.2.2/24), so both answer pings.
Two new hosts, no cables at all. Everything from this world, from scratch.
World 3The Hive
8 levelsStreets and house numbers: CIDR prefixes, networks and broadcasts, bridges where many hosts share one wire.
Level 26: Street name
Objective: Tell Kern the network address of the street wire0 lives on (e.g. kern 10.20.3.64).
The /26 after an address says how many leading bits name the street (the network); the rest number the houses. hidden shows the street an address joined.
Commands taught
cidrLevel 27: Town crier
Objective: Tell Kern wire0's broadcast address.
A street's last address is its broadcast: a creature sent there visits every house. ip addr shows it after brd.
Commands taught
broadcastLevel 28: Zoning
Objective: Zoning drill: for each order in ~/order.txt (3 in a row), tell Kern the smallest prefix whose street fits that many hosts (e.g. kern /27).
Each prefix bit you give up doubles the street: /28 = 16 addresses, /27 = 32, /26 = 64. Two go to the network and broadcast addresses.
Level 29: Same street
Objective: bee1 and bee2 share the bridge hive0 but can't talk: give bee2's eth0 an address on bee1's street.
The bridge hive0 is a virtual switch, a power strip for network cables: everything plugged in shares one wire. Sharing a wire is not enough, they must share a street too.
Commands taught
bridgeLevel 30: Too narrow
Objective: Fix bee3's 10.2.0.30 so it answers your ping again (you are 10.2.0.1/24 on hive0).
A /32 is a street of one house: no neighbours, so replies have nowhere to go. ip addr del removes a wrong address.
Level 31: Second home
Objective: Without touching bee4 (10.3.1.5/24), make it answer your ping by giving hive0 a second address.
One interface can hold several addresses, one per street it serves.
Level 32: Quick math
Objective: Survey drill: 3 times in a row, tell Kern the network and broadcast of the address in ~/survey.txt (kern NETWORK BROADCAST).
The surveyor is waiting, with three plots.
Level 33: BOSS: The renumbering
Objective: Make bees b1-b4 answer your ping at 10.6.0.11-14 (you are 10.6.0.1/24 on hive0).
Four bees on hive0, four different kinds of broken. Keep each bee's host number.
World 4Crossroads
11 levelsWhere streets meet: routing tables, default gateways, routers that forward, ARP shouts and counting hops.
Level 34: Signposts
Objective: Tell Kern which interface a packet to 10.77.5.9 leaves your machine through.
Every host keeps a routing table: for each destination, which door and which next hop. hidden get ADDR asks which road a packet would take.
Commands taught
ip-routeLevel 35: The default road
Objective: Give village a default route via gate (10.32.2.1) so it can ping you at 10.32.1.1.
For every street a host isn't on, it follows the default route to a gateway router. No default route, no way out.
Level 36: Open the gate
Objective: Turn gate into a router so you can ping village at 10.33.2.2.
A host with two wires only passes packets between them when net.ipv4.ip_forward is 1. That switch (sysctl -w net.ipv4.ip_forward=1) makes it a router.
Commands taught
ip-forwardLevel 37: Who has?
Objective: Ping 10.35.0.12, then tell Kern its MAC address from your neighbour table.
On a street, IP addresses become MACs by shouting "who has 10.35.0.12?" (ARP). hiddens the answers your machine remembers.
Commands taught
arpLevel 38: Wrong number
Objective: ping 10.39.0.2 (meadow) fails: remove your wrong neighbour entry for it so the ping works.
A neighbour entry marked PERMANENT is never re-asked: if its MAC is wrong, every packet goes to a house that does not exist. sudo hidden del ADDR dev DEV removes it, and the next ping shouts ARP again.
Level 39: For good
Objective: Your machine is the router between west (10.30.1.2) and east (10.30.2.2): turn forwarding on now and for every boot, with a file in /etc/sysctl.d/.
sysctl -w is forgotten at the next reboot. A line in a file under /etc/sysctl.d/ is applied at every boot; sudo sysctl -p FILE applies it right now too.
Level 40: The way back
Objective: Add the route your machine is missing so that ping 10.34.2.2 works.
Routes are one-way signposts. Your machine needs its own sign to the far street.
Level 41: How far?
Objective: Tell Kern how many routers stand between you and castle (10.36.9.9).
TTL (time to live) is a packet's life counter: each router it crosses takes 1, and Linux starts replies at 64. ping shows ttl=, traceroute lists every router.
Commands taught
tracerouteLevel 42: Detour
Objective: PAGER: village (10.37.2.2) is unreachable from you, fix the road.
Two things broke at once: gate stopped forwarding, and a neighbour entry has the wrong MAC. Fix one and the ping still fails.
Level 43: Power cut
Objective: PAGER: since the reboot, west (10.29.1.2) cannot reach east (10.29.2.2) through you: fix it now and for every boot after.
Someone "made it permanent" last month. Then the power went out.
Level 44: BOSS: The long road
Objective: Make ping 10.38.3.2 (far) work from your machine.
You → r1 → r2 → far. Three streets, two routers, and every signpost you can break is broken.
World 5Subnet Dojo
16 levelsCut streets in halves, quarters and eighths, plan a whole office with VLSM, and drill until subnetting is a reflex.
Level 45: Halves
Objective: Two rounds: split the /24 in ~/question.txt into two halves and tell Kern both (kern 10.x.y.0/25 10.x.y.128/25).
One more prefix bit cuts a street in two: a /24 (256 addresses) becomes two /25s of 128. The second half starts at .128.
Commands taught
subnettingLevel 46: Quarters
Objective: Three rounds: which /26 is street number N of the /24 in ~/question.txt? (kern 10.x.y.128/26)
Two more bits: four /26 streets of 64. They start at .0, .64, .128 and .192 (multiples of the block size).
Level 47: Eighths
Objective: Three rounds: which /27 street holds the address in ~/question.txt? (kern 10.x.y.96/27)
Eight /27 streets of 32: .0, .32, .64, .96, .128, .160, .192, .224. To find the street of an address: the biggest multiple of 32 at or below its last number.
Level 48: Fit and mask
Objective: Three rounds: for the host count in ~/question.txt tell Kern the prefix and the mask (kern /26 255.255.255.192).
Hosts → smallest prefix → mask: 50 hosts → /26 (62 usable) → 255.255.255.192. Past 254 hosts the third octet joins in: 500 hosts → /23 → 255.255.254.0.
Level 49: Wildcards
Objective: Three rounds: tell Kern the wildcard mask for the prefix in ~/question.txt (kern 0.0.0.63).
A wildcard mask is the mask upside down: 255 minus each octet. /26 = 255.255.255.192 → wildcard 0.0.0.63. Router ACLs and OSPF speak in wildcards.
Commands taught
route-mathLevel 50: First and last
Objective: Three rounds: tell Kern the first and last usable host of the street in ~/question.txt (kern FIRST LAST).
Usable hosts sit between the network and the broadcast: first = network + 1 (often the gateway), last = broadcast - 1.
Level 51: The office plan
Objective: Plan the office: write ~/plan.txt with one line per department, NAME NETWORK/PREFIX, inside the block in ~/office.txt.
VLSM: biggest department first, each gets the smallest street that fits, each street starts right after the previous one.
Commands taught
vlsmLevel 52: Overlap
Objective: Two rounds: tell Kern the names of the two networks in ~/question.txt that overlap (kern net-b net-e).
Two subnets overlap if one street contains the other's network address. Overlaps break routing, VPNs and cloud peering.
Level 53: Summary
Objective: Two rounds: tell Kern the one route that summarizes the networks in ~/question.txt (kern 10.x.y.0/22).
Neighbour streets that fill a bigger aligned block can be announced as one: 10.1.4.0/24 to 10.1.7.0/24 = 10.1.4.0/22 (4 = 2 bits less).
Level 54: Longest match
Objective: Three destinations in a row: tell Kern the next hop (via) your machine uses for the address in ~/question.txt.
When several routes contain the destination, the longest prefix (most specific) wins. hidden get DEST asks the kernel which one it would use.
Level 55: Paper table
Objective: Three rounds: tell Kern the next hop for the destination in ~/question.txt using ~/table.txt.
No kernel to ask this time: the table is on paper (~/table.txt). Same rule: longest prefix that contains the destination wins.
Level 56: Build it
Objective: Read ~/plan.txt and give router gate's eth1 (sales) and eth2 (dev) the first usable address of each street, so s1 and d1 can ping each other.
A plan only counts once it routes. Router legs take the FIRST usable address of each street: the hosts already point their default gateway there.
Level 57: Speed: hosts
Objective: Five in a row: tell Kern the smallest prefix for each host count (kern /N).
Five in a row, against the clock: hosts in, prefix out. Come back for endless reps.
Level 58: Speed: ranges
Objective: Five in a row: tell Kern the network and broadcast of each address (kern NETWORK BROADCAST).
Network and broadcast of a random address, five in a row, against the clock.
Level 59: The endless dojo
Objective: Answer ten mixed questions in a row with kern ANSWER.
Every kind of question, mixed, ten in a row. This is the dojo's infinite drill: replay it daily and subnetting becomes a reflex.
Level 60: BOSS: The branch office
Objective: Plan the branch in ~/plan.txt, then give gate and the three hosts their addresses so all of them can ping each other.
A new branch: three departments, one /24, one router. Plan it, then build it, until every department pings every other.
World 6The Owl's Library
13 levelsNames for numbers: /etc/hosts, getent, resolv.conf, asking a DNS server with dig, reverse lookups and lying phonebooks.
Level 61: The phonebook
Objective: Add meadow (10.41.0.2) to your /etc/hosts so that hidden answers.
Packets need numbers, people like names. The oldest phonebook is /etc/hosts: an address, then its names, one per line.
Commands taught
etc-hostsLevel 62: Their book
Objective: Tell Kern the address the name oracle has on owl.
getent hosts NAME resolves a name exactly the way programs on that host will. Each lab host has its own phonebook (/etc/netns/HOST/hosts).
Level 63: Ask the owl
Objective: Ask the owl's DNS server (10.43.0.53) for treasure.lab and tell Kern the address.
A DNS (Domain Name System) server is a phonebook other hosts can ask over the network. dig @SERVER NAME asks it directly.
Commands taught
digLevel 64: Trust the owl
Objective: Make your machine use the owl (10.44.0.53) for DNS, so that hidden works.
Programs don't run dig; they ask the servers listed in /etc/resolv.conf (nameserver lines).
Commands taught
resolv-confLevel 65: Mail route
Objective: Ask the owl (10.49.0.53) which host receives mail for river.lab (its MX record) and tell Kern that host.
Names hold more than addresses. An MX record says which host takes the mail for a domain: dig @SERVER NAME MX asks for it.
Commands taught
dns-recordsLevel 66: Nickname
Objective: www.river.lab is a nickname: ask the owl (10.49.0.53) and tell Kern the real name it points to.
A CNAME says "this name is just a nickname for that one". dig shows the CNAME first, then the address of the real name.
Level 67: Best before
Objective: Ask the owl (10.49.0.53) for river.lab and tell Kern how many seconds its answer may be cached.
Every DNS answer has a TTL: how many seconds others may keep it in their cache. dig +noall +answer shows it, right after the name.
Level 68: Who knocks?
Objective: Something at the address in ~/knock.txt keeps knocking: ask the owl (10.45.0.53) its name and tell Kern.
DNS works backwards too: a PTR record turns an address into a name (dig -x).
Level 69: Stale page
Objective: treasure.lab moved, the owl knows the new address, but your machine still uses the old one: fix it.
/etc/hosts is read before DNS. One stale line there overrules every server.
Level 70: Silent owl
Objective: PAGER: hidden fails on your machine; fix it, then tell Kern the name the owl gives 10.47.5.9.
Names broke across the whole machine.
Level 71: Three answers
Objective: Ask the owl (10.49.0.53) about ghost.lab and vault.lab, then tell Kern both statuses in that order (kern STATUS STATUS).
dig's header line says how the question went: NOERROR (name exists), NXDOMAIN (no such name) or SERVFAIL (the server failed: its zone is broken).
Level 72: Migration night
Objective: PAGER: tell Kern river.lab's mail host, the real name behind www.river.lab, river.lab's TTL and old.river.lab's status (kern MAIL REAL TTL STATUS).
The ops team moves river.lab tonight and needs four facts from the owl (10.49.0.53), fast.
Level 73: BOSS: The lying owl
Objective: Make village resolve bank.lab via the real owl (10.48.0.53) and ping it.
Village sends its savings to bank.lab. But village's phonebooks were tampered with, and a fake owl answers at 10.48.0.66.
World 7The Harbor
11 levelsDocks for packets: ports, TCP and UDP, who listens where (ss), talking raw with nc and socat, bind addresses and port scans.
Level 74: Dock numbers
Objective: Tell Kern which TCP port harbor is listening on.
An address finds a machine; a port (a numbered dock: ssh waits on 22, the web on 80) finds the program on it. ss -ltn lists the TCP ports where programs listen.
Commands taught
portsssLevel 75: Knock knock
Objective: Connect to harbor (10.52.0.2) on port 7000 with nc and tell Kern the password it gives you.
nc HOST PORT opens a TCP conversation with whatever listens there and shows what it says.
Commands taught
ncLevel 76: Open shop
Objective: Listen on port 9000 in the background, saving what arrives into ~/inbox.txt; harbor has a letter for you.
A server is just a program waiting on a port. nc -l PORT waits for one visitor and prints what it says.
Level 77: The lighthouse
Objective: Harbor's lighthouse beams a word at your UDP port 5000: catch it and tell Kern.
UDP has no phone call: messages (datagrams) are thrown at a port like postcards. nc -u -l PORT catches them.
Level 78: Every visitor
Objective: Serve 'welcome' on port 8080 to every visitor with socat, running in the background.
nc -l serves one visitor and quits. socat TCP-LISTEN:PORT,fork,reuseaddr SYSTEM:CMD gives every visitor their own copy of CMD.
Commands taught
socatLevel 79: Sonar
Objective: Scan ports 1-1000 on lookout (10.51.0.2) with nmap and tell Kern the one port that is filtered.
nmap scans many ports at once and labels each: open (a program answers), closed (nobody listens) or filtered (silence: a firewall dropped the knock).
Commands taught
nmapLevel 80: Wrong door
Objective: Harbor's shop on port 8080 only answers harbor itself: make it answer you at 10.56.0.2:8080 with its SHOP OPEN sign.
A program listening on 127.0.0.1 only hears its own host. 0.0.0.0 (or the host's address) hears everyone.
Level 81: Port scan
Objective: From your machine, find the two open TCP ports below 1000 on lookout (10.57.0.2) and tell Kern both.
nc -z tries ports without sending anything; nmap does the same, faster. Any scanner will do.
Level 82: Night shift
Objective: The harbor master beams (UDP, to your port 5000) which TCP port to open: listen there and save the cargo into ~/cargo.txt.
The harbor master only radios, never calls.
Level 83: Impostor
Objective: PAGER: an impostor holds port 8080 on harbor, get the REAL SHOP back for visitors at 10.58.0.2.
Two programs can't listen on the same port. The real shop is waiting for its pier back.
Level 84: BOSS: The registry
Objective: Make harbor answer 'REGISTRY OK' on port 6000 to every visitor from you (harbor is 10.59.0.2).
The harbor registry must answer every ship. It's down, its pier is squatted, and the dock light is off.
World 8The Market
15 levelsWhere creatures trade: HTTP by hand, curl, status codes, POST, peeking at TLS certificates, and ssh tunnels to back rooms.
Level 85: By hand
Objective: Fetch /menu.txt from market (10.61.0.80, port 80) with nc and tell Kern today's dish.
HTTP is plain text over TCP: send GET /path HTTP/1.0 and an empty line, and the server answers a status line, headers, a blank line and the page.
Commands taught
httpLevel 86: Status
Objective: Tell Kern the HTTP status code market (10.62.0.80) gives for /vault.
Every answer starts with a status code: 200 OK, 301 moved, 404 not found. curl -I shows just the status and headers.
Commands taught
curlLevel 87: Place an order
Objective: Order 3 apples: POST item=apple&qty=3 to http://10.63.0.80/cgi-bin/order.
GET asks; POST sends data in the body, like a filled-in form. curl -d DATA URL posts it.
Level 88: Name badge
Objective: Tell Kern the DNS name in the SAN of the certificate on 10.64.0.2 port 443.
TLS encrypts the conversation, and the server shows a certificate. Its subject (CN) is only a label; the names it is really valid for are in the SAN (Subject Alternative Name) list, and that is what clients check.
Commands taught
tlsLevel 89: The secret key
Objective: Create ~/tls/key.pem, an EC private key on the P-256 curve, readable only by you.
Every certificate starts with a private key: a secret only you hold. openssl genpkey makes one; nobody else may read it.
Commands taught
pkiLevel 90: The request
Objective: From ~/tls/key.pem, write ~/tls/market.csr asking for the name market.lab (CN and SAN).
A CSR (certificate signing request) is the form you hand a CA: your public key plus the names you want. Put the name in the SAN with -addext subjectAltName=DNS:NAME.
Level 91: The notary
Objective: You run the market's little CA (~/ca/ca.pem + ~/ca/ca.key): sign ~/tls/market.csr into ~/tls/cert.pem, keeping its SAN.
A CA signs a CSR with its own key: openssl x509 -req -in REQ -CA ca.pem -CAkey ca.key. -copy_extensions copy keeps the SAN you asked for; openssl verify -CAfile ca.pem cert.pem proves the stamp.
Level 92: Trust, on purpose
Objective: Fetch https://shop.lab/ with certificate checks on, trusting the market CA saved in ~/market-ca.pem, and tell Kern the page's word.
curl refuses a certificate it can't link to a CA it trusts. The fix is never -k (that trusts everybody): hand curl the right CA with --cacert FILE.
Level 93: The back room
Objective: Vault's ledger listens only on vault's own 127.0.0.1:8080: tunnel to it with ssh and tell Kern the ledger's word.
ssh -L 8080:127.0.0.1:8080 HOST opens your port 8080 and carries it, encrypted, to HOST's own 127.0.0.1:8080. -f -N keep it in the background with no shell.
Commands taught
ssh-tunnelLevel 94: Delivery hatch
Objective: Your bakery listens on your own 127.0.0.1:5000: let vault (10.67.0.2) reach it at vault's 127.0.0.1:5000.
ssh -R works the other way round: it opens a port on the far host that leads back to you.
Level 95: Your own badge
Objective: From scratch: a new private key ~/tls/key.pem (only you can read it) and a self-signed ~/tls/cert.pem for market.lab, with the name in the SAN.
openssl req -x509 is openssl req -new that signs its own form: a self-signed certificate. That is exactly how a CA certificate is born.
Level 96: The audit
Objective: Let vault's auditor fetch your ledger at vault's 127.0.0.1:9999 (yours is on your 127.0.0.1:8000), then POST done=yes to http://10.68.0.2:8080/cgi-bin/audit.
The auditor sits on vault and trusts only vault's own 127.0.0.1.
Level 97: Rush order
Objective: Buy 4 of the item in ~/want.txt: POST item=NAME&qty=4&total=PRICE*4 to http://10.70.0.80/cgi-bin/order (prices at /prices.txt).
Prices change by the minute.
Level 98: Renewal night
Objective: PAGER: build a new CA (~/ca/ca.pem + ca.key) and a shop.lab cert signed by it (~/shop/cert.pem + key.pem, SAN, keys 600); Kern installs and tests them.
The market CA's key was lost, so its old certificates are worthless.
Level 99: BOSS: The secure ledger
Objective: Find the ledger's port with ss on vault (10.69.0.2), then tell Kern its certificate's DNS name and its page's word (kern NAME WORD), without -k.
Vault's secure ledger speaks HTTPS only to vault itself, with a certificate signed by vault's CA (~/vault-ca.pem). Prove who it is and what it says, checks on.
World 9The Wall
16 levelsWatching and guarding: tcpdump nets, iptables and nft walls, default-deny, NAT, and the final outage.
Level 100: Butterfly net
Objective: Something keeps sending you UDP on wire0: catch it with tcpdump and tell Kern the destination port.
tcpdump catches the packets crossing an interface and prints one line per creature: from, to, port. -n skips name lookups, -c N stops after N.
Commands taught
tcpdumpLevel 101: Read the letter
Objective: Among the noise on wire0, one UDP flow goes to port 7777: read its secret word and tell Kern.
Filters choose which creatures to catch (udp port 7777, host X), and -A prints what they carry as text.
Level 102: First wall
Objective: Stop bully (10.73.0.66) from reaching your machine with iptables; friend (10.73.0.7) must still get through.
A firewall is a bouncer: iptables rules in the INPUT chain (packets coming in) decide each creature's fate. sudo iptables -A INPUT -s ADDR -j DROP throws away everything from ADDR.
Commands taught
iptablesLevel 103: Wrong brick
Objective: Someone walled out friend (10.74.0.7) by mistake: delete only that rule, keep the others.
iptables -L INPUT -n --line-numbers lists the rules with numbers; iptables -D INPUT N deletes rule N.
Level 104: The new wall
Objective: Block bully (10.75.0.66) with nft in a table named wall (leave iptables empty); friend (10.75.0.7) must still get through.
nftables is the modern firewall: a table holds chains, a chain hooks into input, rules go in the chain.
Commands taught
nftLevel 105: Closed by default
Objective: Set your INPUT policy to DROP, then ping friend (10.81.0.7) and watch what happens.
The chain policy is what happens to every packet that no rule matched. hidden turns your wall into "nobody gets in unless a rule says so".
Level 106: Let replies in
Objective: With the policy still DROP, make your own ping to friend (10.82.0.7) work again without opening anything to newcomers.
The kernel tracks every conversation (conntrack). -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT lets in packets that answer something you started, and nothing else.
Level 107: One door open
Objective: You serve the shop on TCP 8080 and a private tool on 9090: let friend (10.83.0.7) reach 8080, and only 8080.
With the policy DROP and replies allowed, open exactly what you serve: sudo iptables -A INPUT -p tcp --dport PORT -j ACCEPT. Everything else stays shut.
Level 108: Default deny
Objective: Set your INPUT policy to DROP with only TCP port 8080 open to others, while your own pings to friend (10.76.0.7) still work.
Safest wall: drop everything by default (policy DROP), then open only what you serve. Allow ESTABLISHED,RELATED, or the replies to your own pings (they come back IN) get dropped too.
Level 109: The costume
Objective: Village pings you through gate: catch them on gate's eth1 and on your wire0, and tell Kern both sources (kern BEFORE AFTER).
Gate already masquerades: packets it forwards toward you leave with gate's address as the source. tcpdump on both sides of gate shows the costume going on.
Level 110: Disguise
Objective: Village (10.77.2.2) must ping you at 10.77.1.1 without you adding any route: masquerade on gate.
Masquerade: a router rewrites the source of packets it forwards to its own address, and undoes it on the replies.
Commands taught
natLevel 111: The blueprint
Objective: ~/wall.nft is a ready-made wall that blocks bully (10.85.0.66): check it with nft -c -f, then load it.
Real walls are written in a file and loaded in one go: sudo nft -f FILE replaces rules all at once, or changes nothing if the file has an error.
Level 112: A wall that remembers
Objective: Your live wall blocks bully (10.86.0.66): save it to /etc/nftables.nft (starting with flush ruleset) and enable the nftables service at boot.
Everything typed with nft lives in memory and dies at reboot. At boot, the nftables service loads /etc/nftables.nft (Alpine: rc-update add nftables; RHEL/Debian: systemctl enable nftables).
Commands taught
firewall-mapLevel 113: Intruder
Objective: PAGER: a host keeps knocking on your port 8080: find it with tcpdump on hive0, block only it in nft table wall, and save the wall to /etc/nftables.nft.
Somebody is hammering your shop. Your wall here is nft table inet wall (chain input).
Level 114: Lockdown
Objective: Lock your INPUT down (policy DROP, only TCP 8080 open, replies allowed), and let village (10.80.2.2, behind gate) reach your 8080 without you adding routes.
Two walls to build, against the clock.
Level 115: BOSS: The great outage
Objective: Make curl http://10.79.2.2/ show the shop page while gate still blocks port 23, fixing causes rather than adding relays.
The shop on village (10.79.2.2) is down: four things are broken between you and it, and gate must keep blocking telnet (port 23). The shop service reads /etc/shop.conf, and hidden applies it.
World 10Leases & Clocks
17 levelsAddresses handed out by a librarian (DHCP), rogue librarians, empty shelves, and the clock tower every certificate trusts (NTP).
Level 116: Library card
Objective: Get a lease on lan0 from the librarian, then read what you received.
DHCP hands a newcomer everything at once: an address, a gateway and DNS servers. udhcpc -i IF -n -q asks for it once and quits.
Commands taught
dhcpudhcpcLevel 117: DORA
Objective: Record a DHCP conversation to a file, then read it back.
DORA = Discover (client shouts), Offer (server proposes), Request (client says yes please), Ack (server confirms). Ports 67 (server) and 68 (client).
Level 118: Card for life
Objective: Make lan0 use DHCP at boot: add an auto lan0 + iface lan0 inet dhcp stanza to /etc/network/interfaces, then bring it up with ifup.
udhcpc by hand is forgotten at reboot. In /etc/network/interfaces, "iface lan0 inet dhcp" makes ifup run the DHCP client at every boot.
Level 119: Open the library
Objective: Serve DHCP on hive0 so pup gets an address from your pool.
Now you are the librarian. dnsmasq reads a small config: which interface, which pool (dhcp-range), and port=0 so it does DHCP only.
Commands taught
dnsmasqLevel 120: Directions
Objective: Give pup a gateway and DNS: add both options to ~/lan.conf, restart dnsmasq and renew pup's lease.
DHCP options add the way out (option 3, router) and the name helper (option 6, DNS) to the address. dnsmasq reads its config at start, so restart it after editing.
Level 121: Reserved seat
Objective: Reserve 10.86.0.50 for printer inky by its MAC in ~/lan.conf, restart dnsmasq and renew inky.
A reservation ties a MAC to one address: dhcp-host=MAC,IP. Printers and servers get the same address every time, still through DHCP.
Level 122: Short stay
Objective: Make the café's leases last 10 minutes (dhcp-range ...,10m), restart dnsmasq and renew pup.
The lease time is the last field of dhcp-range (10m, 1h, 12h). Busy cafés use short leases so addresses of people who left come back quickly.
Level 123: Relay
Objective: Run a DHCP relay on router gate so pup (10.88.2.0/24) gets a lease from keeper (10.88.1.10) on the other street.
A Discover is a broadcast, and routers do not forward broadcasts. A DHCP relay on the router passes it to the server as a normal packet (Cisco: ip helper-address).
Level 124: The tent
Objective: Get pup (stuck on 169.254) a real address from keeper, whose /etc/dnsmasq.conf is fine.
A 169.254.x.x address (APIPA) means the host asked for DHCP and nobody answered. Fix the server, then renew the client.
Level 125: The ledger
Objective: Tell Kern the hostname of the machine at the address in ~/complaint.txt (kern NAME).
The server keeps a ledger of every card: /var/lib/misc/dnsmasq.leases (expiry, MAC, IP, hostname). "Who has this IP?" starts there.
Level 126: Empty shelves
Objective: Get the laptop host an address on hive0 (10.91.0.0/24) from your DHCP server (~/lan.conf).
Pager: a new laptop gets no address, because old leases filled a tiny pool.
Level 127: Rogue librarian
Objective: Find the rogue DHCP server on hive0 (tcpdump in the background, then wait), cut it off (bridge port or process), and renew pup to get gateway 10.92.0.1.
Pager: hosts on hive0 get a gateway that is not ours. Two DHCP servers answer: the real one (10.92.0.1) and a rogue.
Level 128: Clock tower
Objective: Sync your clock to the tower (10.93.0.123) with chrony.
chronyd keeps your clock in step with a time server over NTP (UDP 123). One server line in /etc/chrony/chrony.conf, start chronyd, ask chronyc.
Commands taught
chronyLevel 129: Be the tower
Objective: Make your machine (10.94.0.1) serve time to 10.94.0.0/24 so pup can sync from you.
chronyd can serve time too: "allow NETWORK" lets clients in, "local stratum N" lets it serve even with no upstream.
Level 130: Wrong year
Objective: Make curl --cacert ~/vault-ca.pem https://vault.lab/ work by syncing your clock to the tower (10.95.0.123).
Pager: "the vault website is broken", yet the certificate is fine. Your clock thinks it is three years ago, so the certificate is "not yet valid".
Level 131: After the reboot
Objective: Get pup (behind gate) a lease from keeper again, then make your lan0 take its address by DHCP at every boot.
Pager after a maintenance night: the branch relay did not come back and your own uplink was configured by hand. Fix both, the second one for good.
Level 132: BOSS: The new floor
Objective: Serve the new floor: pool .100-.200 with gateway and DNS, the printer inky reserved at .50, and every host leased correctly.
A new floor opens on hive0 (10.96.0.0/24, gateway 10.96.0.1, DNS 10.96.0.53) and you are its DHCP server. Every machine must come up on its own.
World 11Six
19 levelsThe 128-bit city: hex addresses and shorthand, link-locals, routers that announce streets, AAAA, dual stack, and walls that must not forget ICMPv6.
Level 133: Long names
Objective: Read wire0's link-local address, then ping meadow's link-local over wire0.
An IPv6 address is 128 bits in 8 hex groups. Every interface gets a link-local fe80:: address by itself; it only works on its own wire, so you add %INTERFACE when you use it.
Commands taught
ipv6Level 134: Shorthand
Objective: Three in a row: tell Kern the short form of the address in ~/question.txt.
Two rules: drop the leading zeros of each group (0db8 → db8, 0000 → 0), then replace ONE longest run of zero groups with :: (the first one if tied). Write it in lower case.
Level 135: Longhand
Objective: Three in a row: tell Kern the full form (8 groups of 4) of the address in ~/question.txt.
Backwards: pad every group to 4 digits, and expand :: into as many 0000 groups as needed to reach 8.
Level 136: A real address
Objective: Give wire0 the address 2001:db8:4::1/64 and ping meadow at 2001:db8:4::20.
Global addresses work beyond your wire. Same ip command, with -6: hidden.
Level 137: The way out
Objective: Reach the far host 2001:db8:5:b::20 through the router at 2001:db8:5:a::1 (your wire0 already has 2001:db8:5:a::10/64).
A v6 host needs a default route too: sudo hidden add default via ROUTER. hidden lists the table.
Level 138: Neighbours
Objective: Ping meadow (2001:db8:6::20), then tell Kern meadow's MAC from your v6 neighbour table.
IPv6 has no ARP. Neighbour Discovery asks over ICMPv6 instead, and ip -6 neigh shows what it learned: address → MAC.
Commands taught
icmpv6Level 139: Announced streets
Objective: Read the address SLAAC built on wire0 from router r's adverts, and the gateway it picked.
The router announces its street (Router Advertisement). Your machine builds a global address by itself (SLAAC) and takes the router's link-local as default gateway.
Commands taught
slaacLevel 140: Name from a MAC
Objective: Three rounds: tell Kern the 64-bit interface id SLAAC would build from the MAC in ~/question.txt (kern 5054:ff:fe12:3456).
EUI-64: split the MAC in half, put ff:fe in the middle, and flip the 0x02 bit of the first byte. 52:54:00:12:34:56 → 5054:00ff:fe12:3456 → written short 5054:ff:fe12:3456.
Level 141: Privacy please
Objective: Turn on privacy addresses on leaf's eth0 (its address gives away its MAC) until a temporary address shows up.
Privacy addresses (RFC 8981) are random temporary interface ids for outgoing traffic, so websites cannot track your MAC. On Linux: net.ipv6.conf.IF.use_tempaddr=2.
Level 142: Be the crier
Objective: Make router r advertise its street 2001:db8:10::/64 on eth1 so leaf builds a global address.
A v6 router announces its streets itself. dnsmasq can send the adverts: --enable-ra --dhcp-range=::,constructor:IF,ra-only (prefix taken from IF's address).
Level 143: Dead end
Objective: Find and fix the router that does not forward IPv6 on the way to far (2001:db8:11:c::20).
traceroute6 shows each v6 router on the way. Where the hops stop is where to look: a router must have net.ipv6.conf.all.forwarding=1 to pass packets on.
Level 144: Quad A
Objective: Ask the owl (10.12.0.53) for shop.lab's AAAA record and tell Kern the IPv6 address.
A records hold IPv4 addresses, AAAA ("quad A") records hold IPv6 ones. dig AAAA NAME @SERVER asks for them.
Level 145: Two roads
Objective: Find out which of shop.lab's two addresses curl uses by default, and which one with -4.
When a name has both A and AAAA, programs try IPv6 first (and fall back to v4). curl -v shows which one it used; -4 and -6 force a family.
Level 146: Silent wall
Objective: Make http://[2001:db8:14::80]/ work again by allowing the ICMPv6 that IPv6 needs on shop, keeping the policy drop and port 2222 closed.
Pager: after a firewall change, shop works over IPv4 but IPv6 times out. The ruleset forgot that IPv6 needs ICMPv6 to find neighbours.
Level 147: Site plan
Objective: Three rounds: tell Kern the /64 of street number N (decimal) in the /48 from ~/question.txt (kern 2001:db8:abcd:1a::/64).
A site usually gets a /48, and the fourth group numbers its /64 streets in hex: 2001:db8:abcd:0::/64 to 2001:db8:abcd:ffff::/64. Street 26 is 2001:db8:abcd:1a::/64.
Level 148: The translator
Objective: Two rounds: tell Kern the NAT64 address (64:ff9b::/96) for the IPv4 address in ~/question.txt.
NAT64 lets v6-only hosts reach v4 servers: DNS64 writes the IPv4 address into the last 32 bits of 64:ff9b::/96. 192.0.2.33 = c0.00.02.21 → 64:ff9b::c000:221.
Level 149: Speed: six
Objective: Answer five questions in a row with kern ANSWER.
Five in a row: shorthand, longhand, EUI-64 and /64 plans. Replay any time: endless reps.
Level 150: Slow site
Objective: Find where IPv6 to shop.lab dies and fix it, so curl -6 http://shop.lab/ works.
Pager: "our IPv6 phones cannot open shop.lab." The name has an AAAA record, so the v6 road must be broken somewhere.
Level 151: BOSS: Dual stack
Objective: Give gate v6 on both legs, let the hosts configure themselves, and fix gate's firewall so w1 reaches e1's web page over IPv6 and nothing else.
The company goes dual stack: router gate links west (w1) and east (e1, the web server), and IPv4 already works. Add IPv6 without opening the wall.
For teachers
Use these levels with a class
SOLUTION HIDDEN Teachers see answer keys in the classroom.