<!-- Canonical page: https://reversedwithai.com/p/rea-ctf-masked-squares-flag-checker -->
Canonical page: https://reversedwithai.com/p/rea-ctf-masked-squares-flag-checker

# Solved a DownUnderCTF flag checker by extracting its rules with REA and Z3

> A CTF checker turned into 26 equations and solved.

The REA project shows an agent using REA and Ghidra to pull 26 mask-and-target rules out of a DownUnderCTF binary and solve them, then confirming the answer on the original program.

## Key facts

- Target: DownUnderCTF masked squares flag checker
- Category: Research and benchmarks
- Platform: Linux x64
- Tools: REA, Ghidra, Z3
- Outcome: Works
- Checks: Source available: yes; Repro steps: yes; Real hardware: not reported; Verified by others: not reported
- Author: [REA project (morluto)](https://github.com/morluto/rea)
- Added: 2026-10-15
- Updated: 2026-10-15
- Sources reviewed: 2026-10-15 (editor)

## What was done

The REA project published a case study that solves an easy reverse engineering challenge from DownUnderCTF, a flag checker built on masked squares. A coding agent with REA connected to Ghidra finds the check, extracts its rules and solves them, then runs the original program to confirm.

### How it was done

The page says the run used REA with Ghidra 12.1.4 on Linux x64. The agent opened the binary, searched strings, followed cross references to the checking code and analysed the functions. It then pulled 26 mask-and-target rules out of the binary and solved them as equations with Z3. The page does not name the model or the agent.

### Results

The recovered answer made the original program print "Correct!". Changing one character made it print "Incorrect!" and exit with code 255. The page says the answer matches the organisers' published metadata, and the run was done on 8 October 2026. The challenge comes from DownUnderCTF's public 2023 repository, and REA's evidence notes are linked from the page.

## What the commit history shows

1,015 of 8,057 commits in the public repository credit an AI, over 40 days between 2026-08-10 and 2026-11-14. Credited: Claude Opus 5.5 (676), Cursor (266), factory-droid[bot] (50), Codex (12).

Measured by this site from public git history.

## Questions about DownUnderCTF masked squares flag checker

### What is the DownUnderCTF masked squares flag checker project?

The REA project shows an agent using REA and Ghidra to pull 26 mask-and-target rules out of a DownUnderCTF binary and solve them, then confirming the answer on the original program. It is listed under Research and benchmarks for Linux x64.

### Which tools were used on DownUnderCTF masked squares flag checker?

The entry names REA, Ghidra and Z3. It does not name an AI model.

### Did the AI reverse engineering of DownUnderCTF masked squares flag checker work?

Its author reports that it works. Checks recorded: source available yes, repro steps yes.

### Is the source code for DownUnderCTF masked squares flag checker available?

Yes. The code, patches or tooling are public: https://github.com/morluto/rea. The sources give enough steps to reproduce it.

## Sources

- [Repository](https://github.com/morluto/rea)
- [Write-up](https://rea.tools/showcase/ctf/)

Figures are reported by the author and not measured by this site, except the commit history. Entry drafted with AI from the linked sources and checked against them.

Cite as: REA project (morluto) (2026). Solved a DownUnderCTF flag checker by extracting its rules with REA and Z3. Reversed with AI. https://reversedwithai.com/p/rea-ctf-masked-squares-flag-checker
