Skip to content
imattas
Go back

Flagr

Edit page

Direct URL:

https://github.com/imattas/Flagr

Quick install:

curl -fsSL https://github.com/imattas/Flagr | bash

Overview

Flagr is a multithreaded Python 3 framework that automates solving Capture the Flag challenges. Point it at a file, URL, or raw data and it runs through 96 built-in solver units covering crypto, stego, forensics, web, pwn, encoding, and more — reporting flags as it finds them.

It is a fork of Katana by John Hammond and Caleb Stewart, extended with additional units, CTF platform integration, and remote exploitation support.

Table of contents

Open Table of contents

Key Features

Installation

One-liner (Ubuntu/Debian/Fedora/Arch)

curl -fsSL https://raw.githubusercontent.com/imattas/Flagr/main/install.sh | sudo bash

This installs system dependencies (python3, binwalk, steghide, foremost, tesseract, exiftool, etc.), Python packages, and optional stego tools automatically.

Manual

# System deps (Ubuntu/Debian)
sudo apt update && sudo apt install -y python3 python3-pip python3-dev python3-venv \
    build-essential libffi-dev libssl-dev libgmp-dev libmpfr-dev libmpc-dev \
    libmagic1 libenchant-2-dev tesseract-ocr libimage-exiftool-perl \
    binwalk foremost steghide poppler-utils tcpflow unzip git nodejs ruby

# Clone and install
git clone https://github.com/imattas/Flagr.git && cd Flagr
pip3 install .

Docker

cd docker
docker build -t flagr .
docker run -v "$(pwd)/ctf:/data" -it flagr

Usage

Quick Start

# Solve a base64 challenge
flagr -f "FLAG{.*?}" "RkxBR3t0aGlzX2lzX2FfYmFzZTY0X2ZsYWd9"

# Solve a file
flagr -f "picoCTF{.*?}" challenge.png

# Solve a URL
flagr -f "FLAG{.*?}" "http://ctf.example.com/challenge"

# Run a specific unit only
flagr -f "FLAG{.*?}" -u steghide challenge.jpg

# Exploit a remote binary
flagr --remote host.ctf.com 1337 ./binary

Interactive REPL

Without arguments, Flagr drops into an interactive shell:

flagr - waiting - 0 units queued
> target add ./challenge.bin
[+] ./challenge.bin: queuing target

flagr - running - 14 units queued
> status
running - 14 units queued - 42 cases evaluated

> target list
./challenge.bin - completed
 hash: 2f0a02add67b58de837c7be054ae9e77
 Flag: FLAG{solved_it}

Key REPL commands include target add/list/solution, batch, monitor add (watch a directory for new files), set (change config at runtime), export (save results as markdown/JSON), and ctf list/queue/submit for CTFd integration.

Configuration

Create a .ini file for persistent settings:

[manager]
flag-format = FLAG{.*?}
auto = yes
threads = 8

[ctf]
provider = ctfd
url = http://ctf.example.com
username = player1
password = supersecret
auto-submit = yes
flagr -c ctf.ini

Solver Unit Categories

CategoryCountExamples
Crypto24caesar, vigenere, xor, rsa, affine, jwt, substitution
Encoding12base64, base32, base58, morse, hex, qrcode
Web15sqli, ssti, ssrf, xxe, robots, dirbuster, jwt_forge
PWN7checksec, overflow, ret2win, ret2libc, formatstring
Stego11steghide, lsb, png_chunks, zsteg, audio_spectrogram
Esoteric6brainfuck, malbolge, ook, jsfuck, pikalang
Forensics4binwalk, file_carve, foremost, pcap_creds
Other17+strings, exiftool, tesseract, pdfcrack, apktool, ltrace

Units that depend on external binaries are skipped gracefully if the binary is not installed.

References


Edit page
Share this post on:

Previous Post
PwnSmith