Hacking challenges › The Terminal

Learning route · 7 challenges

>_ The Terminal

Getting around a Linux system as if it were home: files, permissions, searches and how privileges get escalated.

⚠ For educational purposes only. A simulation for strictly educational purposes. Everything happens in your browser against made-up machines: it doesn't connect to any real system. Using these techniques against computers or networks without their owner's written permission is a crime (articles 197 bis and 264 of the Spanish Criminal Code). Learn in order to defend.

The basics before you start

01Everything is a file

In Linux almost everything can be read as text: configs, logs, users (/etc/passwd). ls lists, cd goes in, cat reads. Files starting with a dot are hidden: ls -a shows them.

02Search instead of looking

grep searches for text inside files (grep -r across whole folders) and find searches for files by name or owner. With | you chain commands: cat log | grep error | sort | uniq -c.

03Permissions

Every file has an owner and read, write and execute permissions. root can do anything. What you can't read as your user is what's worth protecting… and what an attacker is after.

04Escalating privileges

Getting in as a normal user isn't the end: an attacker looks for forgotten passwords, misconfigured sudo (sudo -l) or programs that spawn a shell. Defending means granting the minimum permissions.

Challenges, from easiest to hardest

▮▯▯▯ Easy10 pts · 5 minFirst stepsCIPHER has left you a message on your own machine, but not in plain sight. Learn to find your way around a terminal and track it down.You learn The basic commands: ls to list, cd to go into folders, cat to read and ls -a to see hidden files.Enter →🩸 no first blood yet▮▯▯▯ Easy10 pts · 8 minNeedle in a haystackFROG visited a KOI website and left a note hidden in the address. The log has hundreds of lines: don't read it all, search for it.You learn grep to search for text inside files, with -i to ignore case, and wc -l to count lines.Enter →🩸 no first blood yet▮▮▯▯ Medium20 pts · 12 minPipesOne KOI machine connects to the Parallel's network more than any other. Work out which one by counting connections and open its vault.You learn Chaining commands with |: cut to keep one column, sort to sort, uniq -c to count repeats and head to keep the first few.Enter →🩸 no first blood yet▮▮▯▯ Medium20 pts · 12 minSearch without lookingYou start as an intern in KOI's archive. Somewhere on the disk there's a copy of a budget that shouldn't exist. You're not going to open it folder by folder.You learn find to search the whole disk for files by name, and how a forgotten copy leaks information.Enter →🩸 no first blood yet▮▮▯▯ Medium20 pts · 15 minSecrets in the environmentYou've got a dev account on KOI's deployment server. Developers are in a hurry and leave passwords where they shouldn't. Get to the backup account.You learn Environment variables (env), scheduled tasks (crontab) and scripts with passwords inside; su to switch user.Enter →🩸 no first blood yet▮▮▮▯ Hard35 pts · 20 minHash in the binYou've got intern access to a KOI backup server. Someone left a trail in the history. Escalate your privileges and read what only root can read.You learn Command history, identifying and cracking an MD5 hash with a wordlist, su and sudo -l.Enter →🩸 no first blood yet▮▮▮▮ Elite50 pts · 30 minThe forgotten bitThe Fog's bunker has a guest FTP and an admin who left a door open after a migration. Get in without credentials, become root and read what it's hiding.You learn Chaining recon, leaked credentials and privilege escalation with a SUID binary (find -perm -4000 and the find -exec escape).Enter →🩸 no first blood yet

FAQ

What do you learn on the Hacklab's Terminal route?

Getting around a Linux system like it's home: files, permissions, searches and how privileges get escalated. Concepts: everything is a file, search instead of looking, permissions, escalating privileges.

How many challenges are on The Terminal route?

7 challenges ordered from easy to elite. Complete them all to earn the route badge.

More questions about Cyberpunks España →