Termux CTF

6 challenges you play in your own terminal, against files that are really on your phone. Real permissions, real tools, no simulator. Every flag is generated on your device, so a walkthrough you find online contains someone else's answer.

█░░ █▀▀ ▄▀█ █▀█ █▀▄▀█ █░█ ▀▄▀
█▄▄ ██▄ █▀█ █▀▄ █░▀░█ █▄█ █░█
▀▀▀ ▀▀▀ ▀░▀ ▀░▀ ▀░░░▀ ▀░▀ ▀░▀
Termux CTF real flags, on your own device ──────────────────────────────────────────────── 01 hidden-file Easy 10 pts open 02 owner-only Easy 15 pts open 03 two-halves Medium 20 pts open 04 read-the-log Medium 20 pts open 05 twice-over Hard 30 pts open 06 inside-the-archive Medium 25 pts open ──────────────────────────────────────────────── 0 of 6 captured, 0 of 120 points

Install it

Termux from F-Droid, then four commands. The installer checks for Termux, prints exactly what it is going to write, and waits for you to say yes. Nothing is written before that, and nothing needs root.

pkg install git
git clone https://github.com/apsideslabs/learmux-ctf
cd learmux-ctf
./install.sh

Then run ctf list. Run ctf on its own for a menu, which is easier than typing on a phone.

Read the source on GitHub

What makes it different

The files are real

A challenge writes real files into your home directory with real permissions. You find them with ls, grep, tar and base64, the same tools you would use anywhere.

Your flags are yours

Every flag comes from a random value created on your device at install time, and so does every file name. Two people playing the same challenge get different answers.

It works offline

No account, no server, no network traffic. Once it is installed, the whole thing runs on the phone in your pocket.

The loop

Every challenge follows the same four steps.

  1. Look at what is on offer ctf list shows each challenge, its difficulty, and whether you have captured it.
  2. Read the briefing and set it up ctf start 01 teaches the concept, then writes the files into your home directory.
  3. Find the flag This part is up to you. The briefing points at the tool, the hints narrow the search.
  4. Hand it in ctf check 01 LEARMUX{...} decides. Right or wrong, you know straight away.

How to play, command by command

The 6 challenges

120 points between them.

# Challenge Topic Difficulty Points
01 Hidden in plain sight Filesystem Easy 10
02 Owner only Permissions Easy 15
03 Two halves Filesystem Medium 20
04 Read the log Text Medium 20
05 Twice over Encoding Hard 30
06 Inside the archive Archives Medium 25

Every challenge, with briefings and hints

Keeping score

The tool decides whether a flag is right, because it is the only thing that has your seed. When you want to see the whole picture here, run ctf export and paste the result into the progress page.

Worth being straight about This site cannot check your answers, and it does not pretend to. It has no seed, so it has no way to know whether a flag is right, and a receipt you paste in is something you told it about yourself. The tool is where the score is real.

Before you start

Play only on your own device. Everything the tool touches is under your home directory, plus one command in $PREFIX/bin. There is no network activity anywhere in it, and nothing needs root.

You can read the challenge source, because it is on your machine and nothing can stop you. The worked solutions are the one thing held back: they live in the repository for the test suite, and the installer deliberately does not copy them. The score only means something if you earned it.

Tool version 0.2.0.