Every level, in the open
CTF Arena
18 worlds · 183 levels · 18 bosses
SOLUTION HIDDENTeachers see answer keys in the classroom.
Capture-the-flag for beginners, then blue-team work: crack encodings, dig through evidence, hunt logs, script puzzles, then handle evidence, use real crypto and hunt threats on a live box.
Guided levels show the command first. Alone levels give the goal only. Bosses and exams are timed.
Jump to a world
World 1Recon Row
10 levelsWelcome to the Arena: find flags, submit them to Kern and learn where secrets hide.
Level 1: First blood
Objective: Read ~/arena/recon/flag.txt and submit the flag to Kern.
CTF means Capture The Flag: every challenge hides a secret string, the flag, shaped like PTR{...}. Find it, then submit it with kern PTR{...}.
Commands taught
ctf-flagsLevel 2: Behind the curtain
Objective: One file in ~/arena/recon hides from ls: find it and submit its flag.
Names that start with a dot are hidden from plain ls. ls -a shows everything.
Commands taught
dotfilesLevel 3: Needle in the stacks
Objective: Somewhere in ~/arena/recon/stack, 200 straws hide one flag: find it and submit it.
grep -r searches every file under a folder. -o prints only the match and -h hides the file names.
Commands taught
grep-flagsLevel 4: Clocks and modes
Objective: Submit the flag from the newest owner-executable file among the twelve in ~/arena/recon/clock.
Metadata is data about a file. ls -l shows its mode (-rwxr-xr-x: the first three letters are what the owner may do, x means execute) and its modified time. ls -t sorts newest first, and find -type f -perm -u+x lists files the owner can execute.
Commands taught
timestamps-modesLevel 5: Owners and exact clocks
Objective: Type each command as it appears and watch what every part does.
Every file has an owner and a timestamp. ls -l shows the minute, but ls --full-time shows the exact second, and find -user NAME lists the files one account owns.
Commands taught
find-ownerLevel 6: Dash of trouble
Objective: Submit the flag stored in the file named -flag in ~/arena/recon.
A file named -flag looks like an option to every command. Write ./-flag or put -- before it.
Commands taught
dash-namesLevel 7: Weigh the crates
Objective: In ~/arena/recon/crates, submit the flag from the crate of exactly 1337 bytes.
Every crate has a flag, but only one is real: the crate that weighs exactly 1337 bytes. find -size 1337c matches an exact byte count.
Commands taught
find-sizeLevel 8: Ghost in the lockers
Objective: Submit the flag from the locker in ~/arena/recon/lockers that is owned by ghost.
Fifty lockers, fifty flags, but only one locker belongs to the user ghost. find -user ghost finds it.
Level 9: Recon sprint
Objective: Read ~/arena/recon/sprint/-readme and submit the one real flag from sprint/stack.
Speed round: a note with a silly name tells you which file is real, and the stack is full of decoys.
Level 10: BOSS: Shattered flag
Objective: Rebuild the flag from ~/arena/recon/shards using note.txt, and submit PTR{part1part2part3}.
The final recon flag was smashed into three shards. note.txt says how to find each one.
World 2Cipher Hall
10 levelsEncodings are not locks but costumes: base64, hex, rot13, reversed text and XOR.
Level 11: Sixty-four
Objective: Decode ~/arena/crypto/msg.b64 and submit the flag inside.
An encoding rewrites data in another alphabet with no key, so anyone can undo it. base64 uses letters, digits, + and /, often ends in =, and base64 -d decodes it.
Commands taught
base64Level 12: Rotate thirteen
Objective: msg.txt in ~/arena/crypto starts with CGE{: undo the rot13 and submit the flag.
rot13 moves every letter 13 places, so doing it twice gives the text back. tr 'A-Za-z' 'N-ZA-Mn-za-m' does it.
Commands taught
rot13Level 13: Hex marks the spot
Objective: Turn the hex in ~/arena/crypto/msg.hex back into text and submit the flag.
Computers store every character as a number: P is 80, and hex (counting in 16s, digits 0-9a-f) writes 80 as 50. xxd -r -p turns plain hex like 50 54 52 back into text: PTR.
Commands taught
xxdLevel 14: XOR with a key
Objective: Use the key in ~/arena/crypto/key.txt to decode secret.hex with xorit, and submit the flag.
XOR mixes every byte with a key number from 0 to 255, and XOR with the same key again gives the original back. xorit KEY FILE is an Arena helper that undoes it on hex text. Real tools do the same: in bash, $((0x50 ^ 42)) XORs one byte (80 with key 42) and prints 122.
Commands taught
xoritLevel 15: Slice a string
Objective: slice.txt in ~/arena/crypto has 10 junk characters, then the flag, then junk: slice the flag out and submit it.
bash can cut a piece out of a variable: with s holding text, ${s:10:17} is 17 characters starting at position 10 (positions count from 0). Cipher loops use this to rotate alphabets.
Commands taught
sliceLevel 16: Counting and XOR warm-up
Objective: Type each command as it appears and watch what every part does.
Cipher puzzles try many keys. seq counts for you, $(( )) does maths (and ^ is XOR) and xorit KEY FILE decodes hex that was XORed with one key.
Commands taught
caesarLevel 17: Mirror, mirror
Objective: Undo both disguises on ~/arena/crypto/msg.txt and submit the flag.
Someone base64-encoded the flag, then wrote it backwards. rev flips each line.
Commands taught
revLevel 18: Caesar's mystery shift
Objective: msg.txt in ~/arena/crypto uses an unknown shift: crack it and submit the flag.
A Caesar cipher shifts letters by an unknown amount from 1 to 25. Try every shift with a loop and keep the one that shows PTR{.
Level 19: The lost key
Objective: Brute-force the XOR key of ~/arena/crypto/msg.hex with xorit and submit the flag.
This XOR key is lost, but a one-byte key has only 256 values. Try them all and look for PTR{.
Level 20: BOSS: The onion
Objective: Peel every layer of ~/arena/crypto/onion.hex (see intel.txt) and submit the flag.
The vault message wears four costumes. intel.txt lists the order they were put on.
World 3Evidence Locker
8 levelsFiles lie about what they are, so read the bytes: magic numbers, strings, archives, deleted files and timestamps.
Level 21: Liar's extension
Objective: ~/arena/forensics/report.pdf is not a PDF: find out what it is, open it, and submit the flag.
Forensics means examining files for clues. A file's name can lie, but its first bytes (its magic bytes) can't: file reads them and tells you what it really is.
Commands taught
file-magicLevel 22: Strings attached
Objective: Pull the flag out of ~/arena/forensics/firmware.bin with strings and submit it.
Binaries are mostly noise, but text inside them survives. strings prints every readable run of characters.
Commands taught
stringsLevel 23: Nesting dolls
Objective: Open every layer of ~/arena/forensics/doll.tar.gz and submit the flag at the core.
Archives can hold archives. tar xf unpacks one layer (tar works out gzip by itself), zcat opens a .gz.
Commands taught
archivesLevel 24: Newest first, oldest first
Objective: Type each command as it appears and watch what every part does.
ls sorts by name, but -t sorts by modification time (newest first) and -r reverses any order. -tr gives oldest first: the order things happened.
Commands taught
trailing-dataLevel 25: After the end
Objective: Find the comment smuggled after the end of ~/arena/forensics/cat.png and submit the flag it hides.
A PNG image ends with an IEND marker, but nothing stops someone from adding bytes after it. Image viewers ignore them, strings doesn't.
Level 26: Deleted, not gone
Objective: ~/arena/forensics/README says evidence.txt was deleted, but a sleep 7777 process still holds it open: recover it and submit the flag.
A deleted file lives on while a process keeps it open. /proc/<PID>/fd lists that process's open files, and you can cat them.
Commands taught
proc-fdLevel 27: Timeline
Objective: Join the fragments in ~/arena/forensics/frags from oldest to newest and submit PTR{...} with them inside.
Twelve fragments with random names: only their modification times give the order. ls -tr lists the oldest first.
Level 28: BOSS: The case file
Objective: Work out what ~/arena/forensics/evidence.dat really is, open it, and submit the flag hidden in the suspect's photo.
The whole case arrived as one file called evidence.dat. Somewhere inside, a photo carries a secret after its end.
World 4Log Mines
7 levelsThousands of lines, one story: grep, awk, sort and uniq -c dig out who did what and when.
Level 29: Needle in the log
Objective: One request in ~/arena/logs/access.log carries a flag in its browser name: submit it.
A web log has one line per request. grep -o pulls just the matching text out of 5,000 lines.
Commands taught
log-huntingLevel 30: Top talker
Objective: The flag is PTR{<IP>} for the IP with the most failed logins in ~/arena/logs/auth.log: submit it.
To find who shows up most: pull out the thing you count (grep -oE with a pattern for an IP is safer than a field number), sort it, count with uniq -c, sort -n again. The last line wins.
Commands taught
uniq-countLevel 31: The breach
Objective: The flag is PTR{<account>} for the account the IP in attacker.txt logged into successfully (~/arena/logs/auth.log).
attacker.txt holds the attacker's IP. Follow it into auth.log: which account let them in?
Level 32: The broken path
Objective: The flag is PTR{<path>} for the path that caused the most 500 errors in ~/arena/logs/access.log.
Status 500 means the server crashed on that request. Field 9 of this log is the status, field 7 the path.
Level 33: Night shift
Objective: The flag is PTR{errors_<N>}: N is the number of ERROR lines between 03:00 and 03:59 on Nov 16 in ~/arena/logs/app.log (syslog format).
Syslog timestamps look like Nov 16 03:12:01: no year, no timezone, just month, day and time. They sort like text, so a whole hour shares a prefix: grep '^Nov 16 03:' keeps 03:00-03:59.
Level 34: Critical mass
Objective: Join the token of every CRIT line in ~/arena/logs/big.log, in order, and submit PTR{...}.
20,000 lines and twelve of them are CRIT. Their tokens, in order, spell the flag.
Level 35: BOSS: Incident report
Objective: The flag is PTR{<name of the file the attacker downloaded>}: find the IP with the most 401s in access.log, then its wget in cmds.log.
One attacker hammered /login until it worked, then ran commands. Find them in access.log, follow them into cmds.log.
World 5The Automaton
9 levelsChallenges too big for hands, where loops, filters and little scripts do a thousand tries in seconds.
Level 36: Twenty coats
Objective: Decode ~/arena/script/layers.b64 with base64 -d until the flag appears and submit it.
The flag was base64-encoded twenty times. A for loop can decode it twenty times for you.
Commands taught
for-loopLevel 37: The PIN lock
Objective: Brute-force ~/arena/script/vault and submit the flag it prints.
./vault <pin> opens only with the right PIN from 1 to 150. Nobody types 150 guesses: a loop does.
Level 38: Fingerprint match
Objective: Of the 300 flags in ~/arena/script/cands, submit the one whose sha256 hash matches target.sha256.
A hash is a file's fingerprint. sha256sum prints one per file, so grep can find the file matching a known hash. (Use SHA-256 for integrity: MD5 is broken, because attackers can build two different files with the same MD5.)
Commands taught
sha256summd5sumLevel 39: Count the treasure
Objective: The flag is PTR{<total>}: the sum of the 2,000 outbound transfer sizes (bytes) in ~/arena/script/bytes_out.txt.
awk can add up a column: awk '{s += $1} END {print s}'. Defenders use it to total how much data left a host.
Level 40: The lonely line
Objective: Submit the only flag that appears once in ~/arena/script/lines.txt.
Every decoy flag appears twice, the real one once. sort | uniq -u keeps lines that are not repeated.
Level 41: Ordered parts
Objective: Decode ~/arena/script/parts/part-1 to part-36 in order and submit PTR{...} with them inside.
The flag was cut into 36 parts, part-1 to part-36: each holds one character, base64-encoded. Decode them in number order.
Level 42: Peeling tools: rev, zcat, case
Objective: Type each command as it appears and watch what every part does.
Three tools for the unwrapper: rev flips each line backwards, zcat reads a gzip file as text, and `case $w in gz) echo zip;; esac` picks one action by matching a word against patterns.
Level 43: Loop until it says stop
Objective: Type each command as it appears and watch what every part does.
A while loop repeats as long as its test is true. while true runs forever, and break leaves the loop the moment you decide it is done. Peel layers until a label says DONE.
Level 44: BOSS: The unwrapper
Objective: Unwrap ~/arena/script/onion.txt layer by layer (see README) and submit the flag under DONE.
Each layer's first line names its wrapping (b64, rev or gz): head -1 reads it, tail -n +2 gives the rest. Nobody knows how many layers, so loop until the label says DONE.
World 6The Finals
7 levelsText puzzles, speed rounds that mix every category, and the final boss of the Arena.
Level 45: Acrostic
Objective: Read the first column of ~/arena/finals/poem.txt and submit PTR{those characters}.
An acrostic hides a word in the first letter of each line. cut -c1 takes the first character of every line.
Commands taught
cutLevel 46: Ledger
Objective: Join the char of every 'keep' row of ~/arena/finals/ledger.csv in id order and submit PTR{...}.
CSV (comma-separated values) is a table in plain text, and awk -F, splits it on commas, so $2 is the second column. Sort by id first, then keep the rows you need.
Level 47: Jammed
Objective: Remove the junk from the captured line in ~/arena/finals/transmission.txt (see README) and submit the flag.
sed 's/old/new/g' replaces every match on a line. Replace junk with nothing to delete it, the same way analysts strip noise out of a captured log.
Commands taught
sedLevel 48: Speedrun: dead drop
Objective: Find the hidden key in ~/arena/finals/drop, decode it, and submit the flag.
Speed round mixing recon and crypto: one locker hides a dotfile, and its content is encoded.
Level 49: Speedrun: holiday photo
Objective: Open ~/arena/finals/holiday.jpg, find the request with status 500, and submit its flag.
Speed round mixing forensics and logs: a 'photo' that isn't, and a log inside it.
Level 50: Speedrun: sixty blobs
Objective: Decode the hex blobs in ~/arena/finals/blobs and submit the only PTR flag.
Speed round mixing scripting and crypto: sixty hex blobs, only one decodes to a PTR flag.
Level 51: FINAL BOSS: Root of the Arena
Objective: Open ~/arena/finals/arena.bak, follow README, and submit the Arena's final flag.
Everything at once: an archive, a hidden folder, a log, the busiest visitor, ordered pieces, hex and base64.
World 7Evidence Room
14 levelsHandle evidence like a forensic analyst: hash it, log who touched it, image devices, mount read-only, recover and carve.
Level 52: Fingerprint first
Objective: Fingerprint ~/arena/evidence/photo.jpg with SHA-256 and submit the hash to Kern.
Analysts fingerprint evidence before opening it. sha256sum FILE prints a 64-character SHA-256 hash: change one byte and the whole hash changes. MD5 is broken: two different files can be built with the same MD5, so it proves nothing in court.
Commands taught
evidence-hashingLevel 53: Seal the bag
Objective: Seal the four files in ~/arena/evidence/case into intake.sha256, then verify the seal with sha256sum -c.
A hash manifest is a list of 'hash name' lines, one per file: hidden writes one for a whole folder. Later, hidden re-hashes every file and prints OK or FAILED for each, so you can prove nothing changed since intake.
Level 54: Chain of custody
Objective: Append a custody line to ~/arena/evidence/custody.log saying that you (guest) received stick.img now, with its SHA-256.
Chain of custody records who held evidence, when, and what they did. Each line here is when (UTC)|who|item|sha256|action. hidden prints UTC time like 2026-11-17T09:30:00Z, whoami prints your name, and >> appends a line.
Commands taught
chain-of-custodydateLevel 55: Copy, stat and time windows
Objective: Type each command as it appears and watch what every part does.
Evidence work starts with exact copies (dd), exact metadata (stat) and time windows (find -newermt). All three are read-only on the original.
Commands taught
ddfind-newermtLevel 56: Image the stick
Objective: Image the seized USB stick named in ~/arena/evidence/README into ~/arena/evidence/usb.dd and submit the image's SHA-256.
Analysts never work on the original device. dd copies a whole device byte for byte into an image file: sudo dd if=/dev/DEVICE of=copy.dd bs=64k (if = input, of = output, bs = block size). Then sha256sum on the device and on the image must print the same hash.
Level 57: Read-only
Objective: Mount ~/arena/evidence/usb.dd read-only at /mnt/usb and submit the tag written in notes/plan.txt.
Mounting a file system read-write can write to it (mount counters, journal, access times), and then the image's hash changes. A loop mount opens an image file as a disk: sudo mount -o ro,loop IMAGE DIR mounts it read-only, and sudo umount DIR detaches it.
Commands taught
mount-roLevel 58: Three clocks
Objective: Submit the tag from the one file in ~/arena/evidence/incident modified between 02:00 and 02:30 UTC on 2026-11-16.
stat FILE shows three clocks: Access (atime, last read), Modify (mtime, content changed) and Change (ctime, file info changed). find -newermt 'DATE' matches files modified after DATE, ! -newermt 'DATE' those not after: together, a time window.
Commands taught
statLevel 59: The forged clock
Objective: Mount ~/arena/evidence/logs.img read-only at /mnt/logs and submit the tag inside the one back-dated file.
touch -d can set a file's mtime to any date, but touching a file also sets its ctime to the real current time, and touch cannot change ctime. A file whose ctime is long after its mtime has been back-dated.
Level 60: Sleuth Kit: fls and icat
Objective: Type each command as it appears and watch what every part does.
A disk image keeps deleted files until their space is reused. fls lists files inside an image (-r to go into folders, -d for deleted only) and icat prints a file by its inode number.
Commands taught
sleuthkitLevel 61: Undelete
Objective: Recover the file deleted from the camera card image ~/arena/evidence/card.img, without mounting it, and submit its tag.
Deleting a file removes its name, but the data stays until overwritten. Sleuthkit reads an image without mounting: fls -rd IMAGE lists deleted entries (a lost one may show as OrphanFile-INODE), and icat IMAGE INODE prints that inode's data.
Level 62: Searching raw bytes
Objective: Type each command as it appears and watch what every part does.
Raw data is not text. grep -a treats binary as text, -b prints the byte offset of each match, -U stops grep rewriting line ends, and $'\x41' lets you type a byte by its hex value.
Commands taught
carvingLevel 63: Carve it out
Objective: Carve the gzip file hidden in the raw unallocated space ~/arena/evidence/unalloc.bin and submit the tag inside.
Carving rebuilds files from raw bytes by their magic numbers; gzip starts with 1f 8b 08. LC_ALL=C grep -obUa $'\x1f\x8b\x08' FILE prints each match's byte offset, dd ... iflag=skip_bytes skip=OFFSET cuts from there, and zcat decompresses.
Level 64: Who touched it?
Objective: Check the six items in ~/arena/evidence/locker against the hashes in custody.log and submit the name of the item that changed.
custody.log records each item's SHA-256 at intake. awk -F'|' splits a line on |, so awk -F'|' '$5=="received" {print $4" locker/"$3}' custody.log turns the log into a manifest that sha256sum -c can check. Any FAILED line is an item that changed after intake.
Level 65: BOSS: The seized stick
Objective: Process case 42 in ~/arena/evidence/case42: image, log, mount read-only, recover, timeline, close the custody record.
A full evidence workflow: image the device, log custody with the hash, mount the image read-only, recover what was deleted, build a timeline, then re-hash to prove the evidence never changed.
World 8Real Crypto
16 levelsReal cryptography with openssl and GnuPG: hashes, AES, HMAC, password hashes, signatures, keys and certificates.
Level 66: Three kinds of secret
Objective: Turn back the one file in ~/arena/vault (note.b64, note.sha256 or note.enc) that needs no key, and submit the tag.
Encoding (base64, hex) changes the alphabet and anyone can undo it; hashing (SHA-256) makes a one-way fingerprint; encryption (AES) can be undone only with the key. The file command tells you what you are holding.
Commands taught
crypto-kindsLevel 67: Trust the checksum
Objective: Find the copy of tool-1.4.tar.gz in ~/arena/vault/mirrors that matches SHA256SUMS and submit the tag in its README.
Vendors publish SHA256SUMS, one 'hash file' line per download: if your copy's sha256sum matches, you got the exact file they released. Run from the file's folder, hidden compares for you.
Level 68: AES by hand
Objective: In ~/arena/vault: encrypt diary.txt with my.key, then decrypt orders.enc with hq.key and submit the tag inside.
openssl enc -aes-256-cbc -pbkdf2 -salt -in PLAIN -out CIPHER -pass file:KEYFILE encrypts with AES-256. -pbkdf2 makes password guessing slow, -salt makes every encryption different, -pass file: keeps the password out of your history. -d decrypts.
Commands taught
opensslLevel 69: openssl dgst: hash and HMAC
Objective: Type each command as it appears and watch what every part does.
openssl dgst -sha256 FILE prints a file's SHA-256, -r uses the familiar 'hash file' layout, and -hmac KEY mixes a secret key in so only key holders can make the same code.
Commands taught
hmacLevel 70: Wrong key or tampered?
Objective: Both reports in ~/arena/vault fail with hq.key: use sent.sha256 to find the intact one, decrypt it with the right key from keys/ and submit its tag.
'bad decrypt' can mean a wrong password or a changed file, and AES-CBC alone cannot tell which. A hash of the ciphertext can: if sha256sum -c says OK, the file arrived intact and your key is wrong; if it says FAILED, the file was changed, so do not trust anything inside it.
Level 71: Sealed orders
Objective: Submit the tag from the one order in ~/arena/vault/orders whose .mac is a valid HMAC for hmac.key.
An HMAC is a hash mixed with a secret key: openssl dgst -sha256 -hmac KEY -r FILE prints it (-r: just 'hash *file'). Only someone with the key can make a matching HMAC, so it proves who wrote the message and that nobody changed it.
Level 72: Password hashes, fixed strings, read
Objective: Type each command as it appears and watch what every part does.
openssl passwd -6 -salt NAME turns a password into a salted SHA-512 hash, the same kind /etc/shadow stores. grep -F matches text literally, and read splits a line into variables.
Commands taught
password-hashesLevel 73: Inside /etc/shadow
Objective: Read ~/arena/vault/shadow.txt: kern the account on MD5-crypt, then find which password in note.txt is carol's.
Linux stores password hashes as $ID$SALT$HASH: $1$ MD5-crypt (outdated), $5$ SHA-256, $6$ SHA-512, $y$ yescrypt; ! means locked. The salt makes equal passwords hash differently. openssl passwd -6 -salt XXXX PASSWORD rebuilds a $6$ hash to compare.
Level 74: Password audit
Objective: Audit staff-shadow.txt (our staff, approved by IT) against common.txt and list the accounts that must reset in ~/arena/vault/must-reset.txt, one per line.
Defenders audit their OWN staff's hashes against common passwords, so weak accounts reset before an attacker tries them. openssl passwd -6 -salt XXXX -stdin < LIST hashes every word with one salt; grep -qxF "$HASH" says if one matches.
Level 75: Key pairs and signatures
Objective: Type each command as it appears and watch what every part does.
A key pair has a private half you keep and a public half you share. You sign with the private key and anyone can verify with the public one.
Commands taught
signaturesLevel 76: Sign the release
Objective: In ~/arena/vault: make a P-256 key pair, lock down private keys, sign app-2.0.tar.gz, then check the mirror's copy.
A key pair signs and verifies: the private key signs, the public key checks. openssl genpkey makes the private key, openssl pkey -pubout its public half, openssl dgst -sha256 -sign / -verify signs and checks. The private key stays mode 600.
Level 77: GnuPG: import and fingerprint
Objective: Type each command as it appears and watch what every part does.
GnuPG keeps keys in a keyring. gpg --import adds keys from a file, and hidden shows each key's fingerprint: the short identity you compare with the vendor's website.
Commands taught
gpgLevel 78: Whose signature?
Objective: In ~/arena/vault, import vendor-keys.asc, then kern the one tool package that was really signed by the fingerprint in README.
gpg --import FILE adds keys to your keyring, hidden lists them, gpg --verify FILE.asc FILE checks a detached signature. 'Good signature' only means SOME key in your keyring matches: its fingerprint must equal the vendor's published one.
Level 79: Reading and verifying certificates
Objective: Type each command as it appears and watch what every part does.
A certificate says who owns a key and who vouches for it. openssl x509 reads one (-issuer, -dates) and openssl verify checks its chain: -CAfile is the trusted root, -untrusted the helpers in between, -verify_hostname the name you expect.
Commands taught
certificatesLevel 80: Certificate line-up
Objective: Five certificates in ~/arena/vault/pki/certs claim to be shop.ptr.lab: kern the name of the only one valid today, for that name, chained to root-ca.crt.
A TLS certificate binds a name to a public key, signed by a CA. openssl x509 -noout -subject -issuer -dates shows who, signed by whom, until when. openssl verify -CAfile ROOT -untrusted INTERMEDIATE -verify_hostname NAME CERT checks it all.
Level 81: BOSS: Poisoned update
Objective: In ~/arena/vault: pick the authentic bundle by HMAC, decrypt it, import the vendor keys, and install the one package that passes every check into opt/.
Supply-chain defence: an HMAC proves which bundle is authentic, AES opens it, GnuPG proves who signed each package (by fingerprint), and a signed SHA256SUMS proves which version is current.
World 9Threat Hunter
14 levelsTriage a Linux box like an incident responder: collect volatile evidence, find persistence, preserve, contain and clean up.
Level 82: Order of volatility
Objective: In ~/arena/hunt, save the process list and the listening sockets into case/, then hash both into case/collect.sha256.
Evidence fades at different speeds: processes and connections vanish at the next kill or reboot, disk files last longer, backups longest. So collect the most volatile first: ps aux, hidden (listeners and their programs), then hash it.
Commands taught
volatilitypsssLevel 83: Who is listening?
Objective: One process in this box listens on a port that is not in ~/arena/hunt/baseline.txt. kern the full path of its program.
hidden shows each listening port with users:(("NAME",pid=N)). /proc/N/exe links to the program that process really runs: sudo readlink /proc/N/exe shows its path, even when ps shows a fake name. lsof -i :PORT finds the PID too.
Commands taught
proc-exelsofLevel 84: Deleted but running
Objective: One running process on this box was started from a file that has since been deleted. kern its PID.
Malware often deletes its own file after starting, to hide. The process keeps running, and /proc/PID/exe then points to the old path with (deleted) at the end. hidden finds them all at once.
Level 85: Cron comeback
Objective: Remove the line in root's crontab that runs every 10 minutes (keep the five run-parts jobs) and move the script it ran into ~/arena/hunt/case/.
Cron runs commands on a schedule: a favourite way back in. On Alpine root's jobs live in /etc/crontabs/root (hidden). sudo sed -i '/PATTERN/d' FILE removes one line; move (don't delete) the script it ran into your case folder.
Commands taught
crontabLevel 86: Key fingerprints and removing accounts
Objective: Type each command as it appears and watch what every part does.
ssh-keygen -l prints a key fingerprint, awk -F: lists accounts with UID 0 and deluser removes one.
Commands taught
authorized-keysLevel 87: The extra key
Objective: Remove the key in /root/.ssh/authorized_keys that is not in ~/arena/hunt/approved_keys.txt and keep the approved ones.
Any public key in ~/.ssh/authorized_keys can log in as that user without a password, so an extra line is a silent backdoor. Lines are TYPE KEY COMMENT, ssh-keygen -lf FILE prints fingerprints, and the file must stay mode 600.
Level 88: Two roots
Objective: Find the second account with UID 0 on this box and delete it.
In /etc/passwd each line is name:x:UID:GID:comment:home:shell. UID 0 means root powers, whatever the name. hidden lists every UID-0 account; only root should appear. sudo deluser NAME removes an account from /etc/passwd and /etc/shadow.
Commands taught
passwd-fileLevel 89: Login hook
Objective: Find the line in server's start-up files that starts a hidden program at each login and remove only that line.
Shell start-up files run every time a user logs in: ~/.profile (login shells), ~/.bashrc (bash), /etc/profile.d/*.sh (everyone). One added line there starts a program at each login. grep -n PATTERN FILE shows line numbers; sudo sed -i '/PATTERN/d' FILE removes just that line.
Commands taught
login-hooksLevel 90: OpenRC: add, show, del
Objective: Type each command as it appears and watch what every part does.
On Alpine, OpenRC starts services at boot. rc-update add enables a service in a runlevel, show lists what is enabled, and del disables it.
Commands taught
rc-updateLevel 91: Unwanted service
Objective: Stop and disable the netcache service, keep crond enabled, and move its init script into ~/arena/hunt/case/.
Boot services are another way back. On Alpine (OpenRC) /etc/init.d/NAME is the script, rc-update show lists what is enabled, sudo rc-update del NAME default disables it, sudo kill $(cat /run/NAME.pid) stops it. systemd: systemctl disable --now.
Level 92: It keeps coming back
Objective: Kill the kcached miner and remove what restarts it at boot (keep 10-motd.start), then survive my reboot check.
Killing a process is not removing it: on Alpine, executable /etc/local.d/*.start scripts run at every boot (like rc.local or systemd units elsewhere). Find what starts it, remove that, kill the running copy, and let a reboot prove it.
Commands taught
boot-scriptsLevel 93: Integrity check
Objective: Check /usr/local/bin against /var/lib/fim/baseline.sha256, preserve the running trojan, stop it, and restore the clean copy from /var/lib/fim/golden.
File integrity monitoring: hash important files while clean (a baseline), re-check with sha256sum -c; FAILED means changed. If it runs, preserve before killing: copy /proc/PID/exe and save /proc/PID/cmdline (NUL-separated: tr '\0' ' ').
Commands taught
fim-baselinekillLevel 94: grep with several -e patterns
Objective: Type each command as it appears and watch what every part does.
grep -e PATTERN can be given more than once: match any of them. With -v it keeps only the lines matching none, which is how you remove the known-good entries from a list.
Level 95: BOSS: Eradicate
Objective: Identify, preserve and stop the implant listening on app01, remove all four ways it comes back, keep the shop working, and survive my reboot.
Incident response in order: identify, collect (preserve), contain (stop it), eradicate (remove every way back), recover (the real service still works) and verify with a reboot.
World 10Wire Watch
8 levelsRead network captures like a SOC analyst: tcpdump -r, filters, top talkers, and cleartext findings to report.
Level 96: First look
Objective: Read ~/arena/wire/first.pcap with tcpdump -nr and tell Kern how many packets it holds.
A capture (.pcap file) is a recording of network packets. tcpdump -r FILE reads one and prints one line per packet: time, IP, source.port > destination.port, then details. -n shows raw numbers instead of looking names up. Analysts record with tcpdump -w and read later.
Commands taught
pcap-tcpdumpLevel 97: Narrow it down
Objective: Answer ticket.txt in ~/arena/wire: how many packets did that host exchange on port 22 in office.pcap?
A filter after the file name keeps only matching packets: 'host 10.0.0.5' (to or from that address), 'port 22', 'src host X', 'dst port 80'. Join them with and / or / not, and quote the filter so the shell leaves it alone.
Commands taught
pcap-filtersLevel 98: Top talkers
Objective: Find the top talker (most packets sent) in ~/arena/wire/lan.pcap and submit its IP.
Field 3 of a tcpdump line is the source, written ADDRESS.PORT. cut -d. -f1-4 keeps the four parts of the address, and sort | uniq -c | sort -rn ranks how often each appears: the top talker is the host sending the most packets.
Commands taught
pcap-talkersLevel 99: Read the payload
Objective: Answer ticket.txt in ~/arena/wire by submitting the path (like /docs/x.html) of the file that host downloaded in files.pcap.
Plain HTTP (port 80) is not encrypted: anyone on the path can read it. tcpdump -A prints each packet's payload as text under its header line, so GET lines, headers and pages show up. grep -a treats that output as text.
Commands taught
pcap-asciiLevel 101: Base64 is not a lock
Objective: Someone logged in to intranet.lan over plain HTTP: find the exposed account in ~/arena/wire/intranet.pcap and report only its name to Kern.
HTTP Basic auth sends 'Authorization: Basic VALUE', where VALUE is base64 of user:password, an encoding that base64 -d reverses, not encryption. Over plain HTTP that is a finding: report the name (never use the password), rotate the account, move the app to HTTPS.
Commands taught
pcap-cleartextLevel 102: Telnet in the noise
Objective: Somewhere in ~/arena/wire/busy.pcap a device accepts telnet: report its IP and the account that logged in with kern SERVER ACCOUNT.
Telnet (port 23) is a remote shell with no encryption: login name and password cross the wire as text. In a busy capture filter on the port first, then read with -A (the server is the side using port 23).
Level 103: BOSS: Cleartext audit
Objective: Audit ~/arena/wire/audit/audit.pcap: top talker, the Basic-auth account, the telnet server, then write report.txt.
A cleartext audit ranks who talks the most, finds every credential that crosses the network unencrypted (even on unusual ports), and ends with a report that names accounts and fixes but never contains a secret.
World 11Wire Watch II
10 levelsHunt attacks in packet captures: DNS tunnels, port scans, beacons, exfiltration, log correlation, and the firewall rule that stops it.
Level 104: Long names
Objective: Find the domain used for DNS tunnelling in ~/arena/wire2/dns.pcap and kern its base domain (last two labels, like example.net).
Every DNS question shows in tcpdump as 'A? name.', and normal names are short; DNS tunnelling hides data in long random labels under one domain (xk3...q7.cdn-evil.net). awk '{print length($8), $8}' prints each name with its length, so the longest rise to the top of sort -rn.
Commands taught
pcap-dns-tunnelLevel 105: The knocker
Objective: Find the IP that port-scanned 10.0.0.80 in ~/arena/wire2/scan.pcap and kern it.
A TCP connection opens with a SYN packet (Flags [S]); a port scan sends SYNs to many ports from one source, most answered by a reset. The filter 'tcp[tcpflags] == tcp-syn' keeps only those opening packets, so the scanner stands out even when another host sends more traffic.
Commands taught
pcap-syn-scanLevel 106: Heartbeat
Objective: Answer ticket.txt in ~/arena/wire2: is it beaconing, and every how many seconds? kern the interval.
Malware 'beacons': it calls its command server (C2) at a fixed interval. tcpdump -tt prints time as seconds since 1970, so awk can subtract: '{t=int($1); if (p) print t-p; p=t}' prints the gap between each line and the previous one. The same gap over and over is a beacon.
Commands taught
pcap-beaconLevel 107: Count the bytes
Objective: Answer ticket.txt in ~/arena/wire2: how many payload bytes did the host send to that server in upload.pcap? kern the total.
tcpdump -q (quick) prints a short line for each packet, and the last field is the payload size in bytes. awk '{s+=$NF}' adds each line's last field ($NF) to a running total s; END {print s} prints it after the last line. Filter first so only the right packets are summed.
Level 108: Heavy bags
Objective: Which internal host sent the most bytes to the internet in ~/arena/wire2/egress.pcap? kern its IP.
Exfiltration is about bytes, not packets. tcpdump -q prints a short line ending with the payload size (tcp 1400). Keep only traffic leaving the network ('src net 10.0.0.0/8 and not dst net 10.0.0.0/8') and let awk sum the last field ($NF) per source.
Commands taught
pcap-exfilLevel 109: Behind the proxy
Objective: access.log in ~/arena/wire2 shows one successful (200) GET /admin/export: find its real client in edge.pcap and kern its IP.
Correlation joins two sources on time. access.log only sees the reverse proxy (10.0.0.2); a capture in front of the proxy sees the real client. Same request, same second (both UTC): the log gives the time, the capture the who. tcpdump shows HTTP: GET /path.
Commands taught
pcap-correlateLevel 110: A firewall rule, step by step
Objective: Type each command as it appears and watch what every part does.
nft is the Linux firewall. A table holds chains and a chain holds rules. sudo nft add rule TABLE CHAIN ip daddr ADDRESS drop adds a rule that throws away every packet going to ADDRESS, and sudo nft list shows what is there.
Level 111: Close the door
Objective: Find the C2 address in ~/arena/wire2/c2.pcap, then block it in the prepared nft chain inet wirewatch egress.
nft is the Linux firewall: tables hold chains, and a chain on the output hook sees every packet this host sends. sudo nft add rule inet wirewatch egress ip daddr ADDRESS drop blocks one address; hidden shows it. A bare 'drop' would cut the host off.
Commands taught
pcap-nft-blockLevel 112: Night shift
Objective: In ~/arena/wire2/night.pcap, find the host that beacons and its interval: kern HOST SECONDS.
Several hosts talk to the internet at night, but only one keeps a fixed rhythm. Track the gap per source: awk can remember the last time for each host in an array p[host].
Level 113: BOSS: The quiet leak
Objective: Work ~/arena/wire2/leak/leak.pcap: patient zero, C2, its domain, interval, exfil bytes, then block the C2 in inet wirewatch egress.
A full network hunt: find the infected host by its rhythm, name its C2, measure the beacon, measure what it stole, and block it, all from one capture.
World 12SOC Desk
11 levelsYour first night in the Security Operations Centre: query logs like a SIEM with sqlite3 and jq, then turn questions into alert rules.
Level 114: First query
Objective: Find the table that holds logins in ~/arena/soc/siem.db, then tell Kern who logged in first today.
A SIEM keeps every log line in a searchable store; here it is a sqlite database: sqlite3 siem.db ".tables" lists its tables, ".schema NAME" shows a table's columns, and sqlite3 siem.db "SELECT col1, col2 FROM NAME ORDER BY ts LIMIT 5" asks a question. -box draws a table.
Commands taught
siem-litesqlite3Level 115: Only what matters
Objective: Kern the outside IP that failed logins on the service accounts (their names start with svc).
WHERE keeps only matching rows (WHERE result = 'fail'); the keyword AND joins two conditions. LIKE matches a pattern where % means any characters, so user LIKE 'svc%' is every account starting with svc; SELECT DISTINCT prints each value once.
Commands taught
sql-whereLevel 116: Count it
Objective: Kern the IP with the most failed logins in siem.db.
GROUP BY src_ip makes one group per IP; COUNT(*) counts the rows in each group: SELECT src_ip, COUNT(*) AS n FROM auth WHERE result = 'fail' GROUP BY src_ip ORDER BY n DESC. This is the SIEM classic 'stats count by src'.
Commands taught
sql-group-byLevel 117: JSON logs
Objective: Kern the actor who switched off cloud audit logging (action StopLogging) in ~/arena/soc/cloud.jsonl.
Cloud and app logs are JSON lines: one {"key": value} object per line. jq reads them: jq . FILE pretty-prints, jq -r '.actor' FILE prints one field (-r = raw, no quotes), and jq -r 'select(.action == "X") | .actor' FILE keeps only matching events, then prints a field.
Commands taught
jqLevel 118: Two conditions
Objective: Count the admin account's failed logins in siem.db, then count its events in cloud.jsonl.
AND needs both conditions true: WHERE user = 'admin' AND result = 'fail' keeps only the admin's failed logins. jq does the same with select(.actor == "admin") (== is 'equals'), and jq -c prints each matching event on ONE line so wc -l can count them.
Level 119: Time buckets
Objective: Kern the hour (two digits, like 07) with the most failed VPN logins.
strftime('%H', ts) cuts a timestamp down to its hour (00-23); GROUP BY that bucket counts events per hour. strftime('%Y-%m-%d %H:00', ts) keeps the day too. A spike in one bucket is how most attacks first show up on a SIEM chart.
Commands taught
sql-time-bucketsLevel 120: Join the dots
Objective: Kern the user who logged in successfully from the IP that downloaded /backup/db.sql.gz (status 200) from the web server.
JOIN glues two tables where a column matches: FROM auth a JOIN web w ON a.src_ip = w.src_ip pairs each login with each web request from the same IP (a and w are short names). Correlating sources is the whole point of a SIEM.
Commands taught
sql-joinLevel 121: Count JSON
Objective: Kern the client (internal IP) that sent the most requests to files.drop-zone.top in ~/arena/soc/proxy.jsonl.
jq can feed the classic pipeline: jq -r 'select(...) | .field' FILE | sort | uniq -c | sort -rn counts how often each value appears, biggest first, just like GROUP BY.
Level 122: Make it an alert
Objective: Write rules/bruteforce.sql so it returns every source IP with MORE than 20 failed logins, on today's data and on tomorrow's.
An alert is a saved query plus a threshold, kept in rules/NAME.sql and run on every new day of logs. HAVING filters groups after counting: GROUP BY src_ip HAVING COUNT(*) > 20 keeps only IPs with more than 20 rows.
Commands taught
detection-ruleLevel 123: Spray detector
Objective: Write rules/spray.sql to return the IP of anyone who failed against 5 or more different users within one clock hour (tested on two days).
Password spraying tries one password on many accounts, so per-user counts stay low. Catch it by counting DIFFERENT users: COUNT(DISTINCT user), grouped by IP and by clock hour (GROUP BY src_ip, strftime('%Y-%m-%d %H', ts)).
Commands taught
password-sprayLevel 124: BOSS: The Breach Query
Objective: Find the brute-forcer, the account it broke into, the cloud user it created, then write rules/compromise.sql so the SIEM catches the next one.
A breach investigation is a chain of questions: who attacked (count), did it work (a success after the failures), what did they do next (another log source), and how do we catch it next time (a rule).
World 13Night Shift
9 levelsRun the alert queue like a tier-1 analyst: true or false positive, how bad, which ATT&CK technique, escalate with evidence, hand over clean.
Level 125: TP or FP?
Objective: Triage the four alerts in ~/arena/shift/soc.db: add one line per alert to triage.csv as alert_id,TP or FP,REASON-CODE.
Every alert gets a verdict: TP (true positive, a real attack) or FP (false positive, harmless). A verdict without a reason is a guess, so each one carries a reason code (codes.txt) backed by evidence: the allowlist table, the auth log, changes.txt.
Commands taught
alert-triageLevel 126: How bad is it?
Objective: Rate all five alerts in ~/arena/shift/soc.db: write alert_id,severity lines into severity.csv.
Severity = impact (assets table: 1 lab, 2 prod, 3 crown jewel) x confidence (alert: 1 weak, 2 likely, 3 confirmed), and matrix.txt turns the score into low, medium, high or critical. A JOIN of alerts and assets on host does the maths.
Commands taught
severity-matrixLevel 127: Name the technique
Objective: Tag the five true positives in ~/arena/shift/soc.db: add alert_id,technique lines to tags.csv (an alert may get two ids, separated by a space).
MITRE ATT&CK is the shared dictionary of attacker techniques; each has an id like T1110 (Brute Force). Tagging alerts with ids lets every SOC, tool and report speak the same language. attack.txt lists the five this desk uses.
Commands taught
mitre-attackLevel 128: Impossible travel
Objective: Kern the user whose account logged in from two different countries less than 2 hours apart.
Two successful logins by one user, from two countries, too close in time to travel between, mean two different people: one of them stole the password. JOIN auth to the geo table to get each login's country; julianday(b.ts) - julianday(a.ts) is the gap in days (x 24 = hours).
Commands taught
impossible-travelLevel 129: Escalate it
Objective: Escalate the one true positive among the three alerts in ~/arena/shift/soc.db by filling ticket.tpl's fields into ticket.txt.
Tier 1 escalates real incidents to tier 2 with a ticket that stands on its own: which alert, how severe, which ATT&CK ids, the IOC (indicator of compromise, here the attacker's IP), the user and host hit, a one-line summary and the first action to take.
Commands taught
escalation-ticketLevel 130: Handover
Objective: Write ~/arena/shift/handover.txt with OPEN:, ESCALATED:, WATCH: and NOTE: lines, from the queue table in soc.db.
The shift ends; the queue does not. A handover note tells the next analyst what is still OPEN, what was ESCALATED (ticket ids), which IOCs to WATCH, plus a short NOTE. group_concat(col, ' ') joins a column's values into one line.
Commands taught
shift-handoverLevel 131: Too noisy
Objective: Tune rules/web-scan.sql to skip every IP in the allowlist table but still catch real scans (tested on today and tomorrow).
A rule that fires on approved activity buries real alerts (alert fatigue), so tune it rather than delete it: WHERE src_ip NOT IN (SELECT ip FROM allowlist). The list lives in a table, so the rule stays right when the list changes.
Commands taught
rule-tuningLevel 132: Rush hour
Objective: Triage all twelve alerts in ~/arena/shift/soc.db into triage.csv (alert_id,TP or FP,REASON-CODE) before the clock runs out.
Speed comes from routine: read the queue once, check each alert type's evidence the same way every time (allowlist, auth log, geo table, changes.txt), write the verdict with its reason, move on.
Level 133: BOSS: Night Shift Queue
Objective: Close the false positives among the 20 alerts in ~/arena/shift/soc.db, escalate the 2 true positives (tickets/ESC-1.txt, ESC-2.txt), then write handover.txt.
A full shift: triage everything (close FPs with reasons), escalate each true positive with a complete ticket (severity, ATT&CK ids, IOC), then hand over so the morning shift knows exactly where things stand.
World 14Detection Lab
12 levelsWrite rules that catch attackers: threat-intel feeds, web-attack signatures, tuning, Sigma and YARA, and a detector that blocks on its own.
Level 134: The feed
Objective: In ~/arena/detect: put the feed's IP addresses into ips.txt, then find which internal host (src=) talked to one of them and kern it.
An IOC feed lists hashes, IPs and domains seen in attacks. Do any appear in OUR logs? grep -Ff LIST LOG searches for every line of LIST at once as fixed text (dots are dots). -w matches whole words only, so 203.0.113.5 does not match inside 203.0.113.50.
Commands taught
det-ioc-feedLevel 135: Defang it
Objective: In ~/arena/detect: refang indicators.txt into refanged.txt, find the user in proxy.log who visited one, and put that URL, defanged, in share.txt.
Reports write indicators defanged so nobody clicks them: http becomes hxxp, every dot becomes [.] (kern-pay[.]example). Refang them (sed) to search logs; defang any bad URL before you share it in chat or a ticket.
Commands taught
det-defangLevel 136: Sample zoo
Objective: In ~/arena/detect: list in hits.txt the names of the zoo/ files whose SHA-256 is in feed.csv, one per line.
Malware gets renamed all the time, so names prove nothing; the SHA-256 of the bytes does not change. sha256sum zoo/* prints 'hash name' for every sample, and grep -Ff hashes.txt keeps the lines whose hash is in the feed. (Every 'sample' here is inert text, safe to touch.)
Level 137: Signatures of noise
Objective: In ~/arena/detect, write every attack-attempt line of web/access.log into attempts.log, then kern the IP that sent the most attempts.
Scanners spray every web server with old tricks, and the log records the attempts: ../ (%2e%2e%2f), %27 or 1=1 (a quote bending a database query), <script (%3c). grep -Ei 'A|B|C' finds any of them, any case. We only detect: a 404 means it failed.
Commands taught
det-attack-sigsLevel 138: Remember and reuse with sed
Objective: Type each command as it appears and watch what every part does.
In sed, \( \) remembers the text inside it and \1 pastes it back in the replacement. while IFS= read -r l reads a stream one whole line at a time into l; -r keeps backslashes exactly as they are.
Level 139: Decode first
Objective: In ~/arena/detect, URL-decode web/access.log into decoded.log (same lines, same order), then kern how many decoded lines contain ../
Scanners mix encodings to dodge rules: %2e./, .%2E/ and ..%2F all mean ../ once decoded. Decoding turns + into a space and %XX into the character with hex code XX: sed rewrites %XX as \xXX, printf '%b' prints the real character.
Commands taught
det-url-decodeLevel 140: Too loud
Objective: In ~/arena/detect, tune rules.txt and allow.txt so sh detector.sh web/access.log flags every real attempt and nothing else (I also test a fresh log).
A rule that fires on everything gets muted, then the real attack slips by. Tune with precise signatures (<script, not script; union select, not select) and an exact allow list for known-good sources, never by switching the rule off.
Commands taught
det-false-positivesLevel 141: Rules in files
Objective: In ~/arena/detect, save an awk rule in notfound.awk and run it with awk -f, then write your first YARA rule and count the samples it matches.
Detection rules live in files, so a team can review and reuse them. awk -f FILE runs the awk program saved in FILE; yara RULEFILE DIR runs a YARA rule (rule NAME { strings: $m = "text" condition: $m }) on every file in DIR and prints 'rule file' per match.
Commands taught
det-yaraLevel 142: Read the Sigma
Objective: Read rules/web_traversal_ok.yml, kern the address its filter skips, implement it as sigma.awk, then count and triage its hits.
Sigma is a YAML format for detection rules that sigma-cli converts to any SIEM. detection: has named blocks of field: value; |contains = appears anywhere (any case); a list = any of them; condition: joins blocks. Here YOU convert it, to awk.
Commands taught
det-sigmaLevel 143: YARA hunt
Objective: Write first.yar matching the beacon domain, then kernloader.yar per intel.txt (domain AND a mutex), which I also test on a fresh zoo.
YARA matches files with rules: rule NAME { strings: $a = "text" condition: $a }. yara RULEFILE DIR prints 'rule file' per match. nocase ignores case; any of ($m*) = at least one string named $m...; and / or / not combine.
Level 144: Night shift
Objective: Fix bin/watch.sh so that, run by cron, it writes every attempt line once into ~/arena/detect/alerts.log, and schedule it every 5 minutes.
cron fields: minute hour day month weekday, then the command (*/5 = every 5 minutes). Cron starts in / with almost no PATH and runs the file itself: full paths, chmod +x, and > (not >>) so reruns don't duplicate alerts.
Commands taught
det-cron-detectorLevel 145: BOSS: Pipeline
Objective: The shop is under scan (TICKET.txt): count the alerts, build bin/detect.sh -> alerts/ips.txt, auto-block every listed IP in the nft set, and write ticket.txt.
A detection pipeline: a detector runs (cron) and writes alerts, a responder turns alerts into action (block the source on the firewall, never the allow-listed ones), and every action leaves a ticket with evidence (a hash of what you acted on).
Commands taught
det-pipeline
World 15Hardened
11 levelsHarden a server: inventory, advisories, CVSS, baselines, accounts, least privilege and default-deny, then a lockdown dry run.
Level 146: Know what you run
Objective: Inventory shop01 into ~/arena/harden/inv/, then combine it into assets.csv.
An inventory lists packages with versions (apk info -v), users who can log in (shell in /etc/passwd field 7 is not nologin or false) and listening ports (hidden). sed 's/^/pkg,/' puts a label in front of every line: that turns lists into CSV.
Commands taught
asset-inventoryapk-infoLevel 147: Read the vector
Objective: In ~/arena/harden/advisories.txt, find the advisory an attacker on the internet can use with no account and no click, and kern its CVE id.
A CVSS v3.1 vector explains a score: AV attack vector (N network, L local), AC complexity, PR privileges needed (N none, L low, H high), UI user interaction (N none, R required), then C/I/A impact (H, L, N). Codex: cvss.
Commands taught
cvssLevel 148: Match the feed
Objective: Match shop01's packages against feed.csv, then kern the CVE to patch first.
grep -F -w -f LIST FILE keeps the lines of FILE containing a line of LIST as a whole word (-F plain text, -w whole word). Then rank: risk = CVSS score x exposure (3 if the package listens on the network, 1 if not).
Commands taught
advisory-feedLevel 149: Spot the difference
Objective: Compare the lists, configs and folders in ~/arena/harden and tell Kern what changed.
comm compares two SORTED lists: comm -13 A B prints lines only in B (new), comm -23 A B lines only in A (gone). diff A B prints changed lines (-old, +new), and diff -r DIR1 DIR2 compares whole folders.
Commands taught
commdiffLevel 150: Accounts and services
Objective: Create a system account, give it a folder, lock an old account, restart the shop as the new account, and run the audit.
System accounts run services: sudo adduser -S -D -H -h /var/empty -s /sbin/nologin NAME (no password, no home, no shell). chown -R gives a folder away, passwd -l locks an account, shopctl restart restarts the shop, and shop-audit is the auditor's checklist.
Commands taught
service-accountsshopctlshop-auditdefault-denyLevel 151: The baseline door
Objective: Make every line of ~/arena/harden/ssh-baseline.txt true in the effective config of /etc/ssh/shop/sshd_config.
Check the EFFECTIVE sshd settings: sudo sshd -T -f FILE prints them in lowercase. The first value wins, and Include pulls drop-ins in at that spot. grep -v -x -F -f now.txt baseline.txt prints baseline lines not in effect.
Commands taught
sshd-baselineLevel 152: Drift
Objective: Find every SUID or world-writable file that is not in the known-good lists in /var/lib/baseline, and fix it without deleting it.
Known-good lists of SUID and world-writable files were taken when the box was clean. List them again, sorted, and comm -13 KNOWN NOW prints only the new ones; fix those with chmod u-s or chmod o-w, and leave the known-good ones alone.
Commands taught
baseline-driftLevel 153: Least privilege
Objective: Make the shop run as a new system account shopd (no shell, site files still root's, /srv/shop/data owned by shopd and closed to others) and keep it up.
A service runs best as its own account: no shell, no home, read-only code, write only to its data. sudo adduser -S -D -H -h /var/empty -s /sbin/nologin NAME makes one. SHOP_USER= in /etc/conf.d/shop, then hidden.
Level 154: Default deny
Objective: Finish ~/arena/harden/wall.nft so shop01 follows policy.txt, load it, and check from the probe that 8080 is open and 6379 is closed.
Default deny: the input chain has policy drop, then an allow-list like tcp dport { 22, 8080 } accept (keep established,related and lo). sudo nft -c -f FILE checks, sudo nft -f FILE loads, and the probe namespace plays another LAN machine.
Level 155: Audit script
Objective: Add control C6 to ~/arena/harden/audit.sh, run the audit into report.txt, then fix the three high-severity findings.
An audit script turns a checklist into lines (PASS or FAIL, id, severity, what), each control a command that exits 0 when it holds. Fix high severity first and re-run; lynis, CIS-CAT and OpenSCAP do this at scale.
Commands taught
audit-scriptLevel 156: BOSS: Lockdown
Objective: Make every high-severity line of hidden PASS (the backup is next world's job) without taking the shop down.
A dry run before Audit Day: fix every HIGH finding of shop-audit, one control at a time, while the shop stays up. sshd drop-ins, SUID drift, a service account and default deny: all things you did in this world.
World 16Audit Day
10 levelsSecrets in git history, sealed backups and restore drills, then the real audit: every control PASS while the shop stays up.
Level 157: Read the history
Objective: Read the history of ~/arena/harden/notes and answer Kern's three questions.
git keeps every version of a project. hidden lists commits (newest first, short hash + message), hidden shows the newest commit's changes, and git log --all -S TEXT finds the commits that added or removed TEXT on any branch.
Commands taught
git-basicsLevel 158: Save a change
Objective: In ~/arena/harden/shopapp, add a .gitignore that ignores *.env files and commit it.
A commit saves staged changes into the history. git add FILE stages a file, git commit -q -m 'MESSAGE' saves it quietly with a message. A .gitignore file lists names git must never track, like *.env files that hold secrets.
Level 159: Rewrite history (practice)
Objective: Practice on ~/arena/harden/practice: roll the TEST key, remove config/test.env from every commit, then delete git's leftovers.
To remove a file from EVERY commit: git filter-branch --index-filter 'git rm --cached --ignore-unmatch FILE' -- --all. git keeps backups (refs/original, the reflog): hidden, hidden and hidden delete them.
Commands taught
git-secretsLevel 160: Pack and seal
Objective: Pack ~/arena/harden/albums/photos into photos.tgz, list it, seal it, and unpack a test copy.
tar -czf ARCHIVE -C DIR NAME packs DIR/NAME with names starting at NAME, tar -tzf lists an archive, sha256sum seals it, and tar -xzf ARCHIVE -C DIR unpacks somewhere else. diff -r proves the copy equals the original.
Commands taught
backup-drillLevel 161: Side branch
Objective: A database password was committed somewhere in ~/arena/harden/shopapp. kern the hash of the commit that added DB_PASSWORD.
git log only shows the branch you are on. A secret committed on another branch is invisible there, and --all searches every branch.
Level 162: Broken seal
Objective: One of last night's archives in /var/backups/nightly is damaged. kern its file name.
A backup manifest lists 'hash file' for every archive. sha256sum -c MANIFEST, run in the manifest's folder, re-hashes each file and prints OK or FAILED.
Level 163: Restore one folder
Objective: Restore the deleted /srv/shop/data/uploads from /var/backups/shop-data.tgz without losing today's orders.
tar -xzf ARCHIVE -C DIR PATH restores only PATH from the archive. Restoring everything would also roll back files that changed since the backup.
Level 164: Secret in the history
Objective: Find the commit that leaked a payment key into ~/arena/harden/shopapp, rotate the key, purge it from every commit, and ignore config/*.env.
A file deleted in a later commit still lives in older commits. Find it (git log --all -p -S TEXT), ROTATE the secret first, PURGE it (git filter-branch, then drop refs/original and the reflog, gc), then .gitignore it.
Level 165: Restore drill
Objective: Back up /srv/shop/data into /var/backups/shop-data.tgz with a .sha256, run a restore drill into ~/arena/harden/drill, then handle what happens next.
tar -czf ARCHIVE -C DIR NAME packs DIR/NAME; sha256sum seals it. A restore drill extracts into a test folder (tar -xzf ARCHIVE -C TEST) and compares with diff -r. tar -xzf ARCHIVE -C DIR PATH restores one file.
Level 166: BOSS: Audit Day
Objective: Triage feed.csv against this box, then make hidden print only PASS lines while the shop stays up.
Audit Day: triage the advisories, run the checklist, fix every finding by severity, prove it with a clean re-run, and never take the service down. Each fix is something you've done in these two worlds: sshd drop-ins, drift, a service account, default deny, a sealed backup.
World 17Incident Command
9 levelsThe pager goes off, so lead the incident: NIST CSF 2.0, scope, contain, root cause, then the timeline, the summary and the report.
Level 167: Six functions
Objective: Read ~/arena/ir/functions.txt and actions.txt, then write csf.txt with one line per action: the action ID and its function, like A1 GOVERN.
NIST CSF 2.0 sorts every security action into six functions: GOVERN (rules, roles), IDENTIFY (know your assets), PROTECT (make attacks harder), DETECT (notice them), RESPOND (act on an incident), RECOVER (get back to normal). Incident response lives in the last three.
Commands taught
nist-csfLevel 168: Blast radius
Objective: Write ~/arena/ir/scope.txt: every host (one per line, like web02) whose log in hosts/ shows a connection to the C2 address in ioc.txt.
Scoping answers: which hosts are touched? Search every host's log for the IOC (indicator of compromise). grep -l prints only the NAMES of matching files; -F treats the IP as plain text (no regex dots), -w matches whole words only, so 203.0.113.6 skips 203.0.113.66.
Commands taught
ir-scopinggrep-lLevel 169: Isolate or watch?
Objective: Decide every ticket in tickets/ with playbook.txt (decision.txt, like T1 ISOLATE), then contain this box: preserve and stop the unknown listener.
Containment is a trade-off: ISOLATE stops the harm now but tips off the attacker, MONITOR teaches you their tools but is only allowed when nothing leaks or spreads and the IR lead approved it. Either way, preserve volatile evidence before you stop anything.
Commands taught
containmentLevel 170: The way in
Objective: Find the first appearance of the attacker IP (ioc.txt) across ~/arena/ir/logs/ and kern the cause ID (RC1-RC4) from causes.txt that it proves.
The root cause is how the attacker got in, not the loudest symptom. A miner burning CPU is a symptom; the way in is the attacker's FIRST event. grep -h (no file names) the attacker IP across every log, sort the ISO times, and read the top line.
Commands taught
root-causeLevel 171: Dates, sorting numbers, and a threshold
Objective: Type each command as it appears and watch what every part does.
Timelines and board summaries need three small tools. date -u -d @SECONDS +%FT%TZ turns epoch seconds into UTC ISO time. sort -t= -k2 -n orders lines by the number after the = sign. [ $N -ge 100 ] is true when N is at least 100.
Level 172: Timeline
Objective: Build ~/arena/ir/timeline.csv from evidence/: header, then rows for initial-access, persistence, exfil and contained (in the event field), oldest first.
An incident timeline is a CSV (when_utc,host,source,event) with one row per key event, oldest first, every time in UTC ISO like 2026-11-16T02:14:07Z. cron.log uses epoch seconds, so convert with date -u -d @SECONDS +%FT%TZ.
Commands taught
ir-timelineLevel 173: Five lines for the board
Objective: Write ~/arena/ir/exec-summary.txt, 5 lines max: severity (severity.txt), how many different customers are in exfil.csv, and that it is contained.
Executives read the top and stop, so a summary fits a line budget: how bad (severity), who is hurt (a number people understand) and where we are (status). No IPs, PIDs or jargon, and count unique customers, not rows.
Commands taught
exec-summaryLevel 174: Never again
Objective: Write lessons.txt with the three fields, then add a rule to detect.rules that catches every attacker login in incident.log and nothing in benign.log.
Lessons learned turn an incident into a better defence: blameless (processes, not people) and concrete, like a detection rule. ./detect LOG prints lines matching detect.rules (one regex per line, grep -E -f). Catch every attack line, no normal line.
Commands taught
lessons-learnedLevel 175: BOSS: The incident report
Objective: Run incident INC-4471 end to end in ~/arena/ir: severity, scope, containment, stakeholder update, timeline and postmortem, all under report/.
A NIST SP 800-61r3 style response runs the whole loop: triage (severity), scope, contain with evidence preserved, communicate with stakeholders, rebuild the timeline, and close with a blameless postmortem that changes a control.
Commands taught
nist-800-61
World 18Cases
8 levelsFive real SOC tickets, start to finish, each one combining everything the Arena has taught you.
Level 176: Warm-up: read an audit
Objective: Run the warm-up audit, kern how many controls FAIL, then kern the SHA-256 hash of warm.img (just the 64 characters).
An audit prints one PASS or FAIL line per control; grep -c FAIL counts the FAILs. sha256sum prints the hash, then the file name: cut -c1-64 keeps characters 1 to 64, exactly the hash.
Commands taught
ptr-auditLevel 177: Warm-up: awk keeps a table
Objective: Use awk's table to look up the stock of bolt in stock.txt, then use split to take the third piece of the line in order.txt.
awk can remember things while it reads. q[$1] = $2 stores the second word of each line in a table (an array) under the first word. END { ... } runs once after the last line. split($0, a, ",") cuts the whole line ($0) at every comma into a[1], a[2], a[3].
Commands taught
awk-joinLevel 178: Warm-up: join two files with awk
Objective: Count how many lines of want.txt match stock.txt on name AND amount, then do the same join on a CSV that has a header line.
awk 'NR==FNR {...; next} ...' f1 f2 joins two files. NR counts all lines read and FNR the lines of this file, so NR==FNR holds only in f1: fill a table there (next skips on), then look things up while reading f2.
Level 179: Case 1: Harden and prove it
Objective: Make every control in hidden PASS without deleting anything the box needs, then save the passing audit to ~/arena/cases/report/audit-after.txt.
Hardening is only done when an audit proves it: run the audit, fix each failed control without breaking the service, baseline what you fixed, schedule the integrity check, and save the passing audit.
Level 180: Case 2: The seized laptop
Objective: Take ~/arena/cases/laptop.dd into custody, examine it read-only at /mnt/laptop, find the file from the handover window, and prove the image is unchanged.
Forensics is a chain: hash and log custody before anything else, look only through a read-only mount, narrow by time, write findings a court can follow, and prove the image never changed.
Level 181: Case 3: Patient Zero
Objective: Trace the incident in ~/arena/cases from the phishing mail to the beacon, remove its persistence, and write report.txt.
A real incident crosses every tool: mail and hashes find the lure, auth.log finds the login, crontab finds the persistence, the capture proves the beacon, and the report closes it.
Commands taught
capstone-casesLevel 182: Case 4: Build a mini-SOC
Objective: In ~/arena/cases, query day1.db, write rules/brute.sql that alerts on the attack but stays quiet on noise.db, count the high alerts, and file ticket.txt.
A mini-SOC is logs in a database, rules that turn events into alerts, tuning so a normal day stays quiet, and a ticket when a real attack shows. sqlite3 stands in for the SIEM (Splunk SPL or KQL on a job).
Level 183: Case 5: Vuln week
Objective: In ~/arena/cases, match advisories to the inventory, rank them in priority.txt, patch the top 3 with ./pkgtool, accept the 4th in accept.txt, verify.
Vulnerability management is a loop: match the inventory to advisories by name AND version, rank by CVSS times exposure, patch the top, accept what must wait in writing, and verify.
Commands taught
pkgtool
For teachers
Use these levels with a class
SOLUTION HIDDEN Teachers see answer keys in the classroom.