Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DC34 Badge — Flag Hunt Notes & Tools

Working notes and offline tooling for the DEF CON 34 badge light-exchange / flag challenge.

This repo does not contain the badge firmware. It holds analysis, a small offline Ko cracker, and helpers that sit next to the official bunnie / betrusted sources.

Official badge help: defcon.org/34b.

What's in here

Path What it is
FLAG_HUNT_ANALYSIS.md Full investigation write-up: easter eggs, dead ends, flag #1 vs #2, live-badge probes, how to capture a transcript
ko_cracker/ Offline AES-256-GCM-SIV verifier / brute-forcer for Ko (CPU reference), pinned to the badge's crate versions
ko_cracker_gpu/ CUDA port of the cracker — same crypto, sharded, ~100–1000× faster; crypto validated against the crate via a host KAT
deploy/ Cloud GPU fleets to run the crack at scale: a RunPod Terraform module (IaC) and a Vast.ai launch script, both driven by deploy/bootstrap.sh
decode_k0.py Decodes the factory test k0 base64 vectors (write-only path — dead end; do not replay on a real badge)

Sibling repos (clone next to this one)

Expected layout under ~/dev (or wherever you work):

dev/
├── dc34-badge/      ← this repo
├── dc34-vault/      https://github.com/bunnie/dc34-vault
├── dc34-console/    https://github.com/bunnie/dc34-console
├── dc34-api/        https://github.com/bunnie/dc34-api
├── dc34-core-hw/    https://github.com/bunnie/dc34-core-hw
├── dc34-image/      https://github.com/bunnie/dc34-image
├── dc34-bio/        https://github.com/bunnie/dc34-bio
└── xous-core/       https://github.com/betrusted-io/xous-core
mkdir -p ~/dev && cd ~/dev
git clone https://github.com/jonfen/dc34-badge
git clone https://github.com/bunnie/dc34-vault
git clone https://github.com/bunnie/dc34-console
git clone https://github.com/bunnie/dc34-api
git clone https://github.com/bunnie/dc34-core-hw
git clone https://github.com/bunnie/dc34-image
git clone https://github.com/bunnie/dc34-bio
git clone https://github.com/betrusted-io/xous-core

Environment setup

Rust (required for ko_cracker)

# Install rustup if needed: https://rustup.rs/
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

rustc --version   # tested with 1.97.1; any recent stable is fine
cargo --version

No RISC-V target is needed for the cracker — it is a host (x86_64 / aarch64) binary.

Python (optional, for decode_k0.py)

Python 3 with the stdlib only (base64, zlib). No pip packages.

Live badge console (optional)

USB CDC serial at 115200 baud on /dev/ttyACM0 (Linux / WSL2). You need membership in dialout (or equivalent):

sudo usermod -aG dialout "$USER"   # then re-login
# tip: picocom / screen / minicom at 115200 8N1

Image upload (separate tool in dc34-image) uses 1_000_000 baud.

Build & run ko_cracker

cd ko_cracker
cargo build --release
./target/release/ko_cracker selftest          # proves encrypt → verify → search
./target/release/ko_cracker selftest --bits 24
./target/release/ko_cracker --help

Point it at a real exchange once you have the two QR payloads (see analysis doc):

./target/release/ko_cracker crack \
  --key '????????????<52 hex of public Kp for the day>' \
  --req-qr '<REQUEST_QR_TEXT>' \
  --resp-qr '<RESPONSE_QR_TEXT>'

Or raw hex: --nonce <12B hex> plus --ct-tag <32B hex>.

Day-4 reality check: a 48-bit search is GPU-scale (~1 day on an RTX 4090 per the scheme doc). This crate is a correctness reference (~10 Mkeys/s on CPU); port the verify() loop to a GPU for a serious crack.

Safety — do not brick your badge

  • Do not flash a developer image unless you accept wiping flag #1, Ko, and light exchange (one-way into developer mode).
  • Do not send the factory test k0 <base64> vectors to a production badge — that overwrites Ko.
  • Prefer capturing one exchange transcript and cracking offline. Ko is shared across all badges, so any badge's transcript works and nothing is wiped.

Details, dead ends, and the full capture procedure: FLAG_HUNT_ANALYSIS.md.

Status (high level)

  • Flag #1 (THE_FLAG_1, RRAM slot 260): wiped before developer mode — fault injection only (standing bounty).
  • Flag #2 ("somewhere else"): not in the erase set; needs a sacrificial badge + survivor dump (destructive).
  • Non-destructive Ko path: capture light-exchange QRs → brute force with public Kp (recommended).
  • ko_cracker is built and self-tested; only missing input is a real transcript.

License / provenance

Analysis and tooling here are personal notes for the DC34 badge challenge. Firmware copyright remains with the original authors (bunnie / betrusted / Baochip). See the linked upstream repos for their licenses.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages