Skip to main content

flaghunter

Point it at a CTF crypto challenge or a packet capture and it runs a full attack battery for you, then writes up what it found.

Built on cryptsmith, which does all the crypto and pcap heavy lifting. flaghunter is the analyst on top.

Install

pip install flaghunter

Use

# throw a crypto challenge file at it
flaghunter solve challenge.txt

# hunt a pcap for enrollment keys, flags, and obfuscated blobs
flaghunter pcap capture.pcap

# custom token pattern, json output
flaghunter pcap capture.pcap --pattern "FLAG\{[^}]+\}" --format json

What the pcap hunter does

  1. Reassembles TCP streams from the capture
  2. Carves printable strings out of every stream
  3. Hunts tokens matching your pattern (default: 12 char alpha strings, like enrollment keys)
  4. Scores every stream for entropy, then runs single byte xor, repeating key xor, caesar, and layered base64/hex decoding on anything suspicious
  5. Writes a markdown report with stream labels, findings, and decoded candidates

What the solver does

Reads a challenge file and runs the battery: encoding layers, xor attacks, classical ciphers, hash identification. Ranks everything by english score so the real answer floats to the top.

Example

Say a capture has a server checking a 12 character alpha enrollment key, and the key is xor obfuscated in the traffic. flaghunter finds the stream, breaks the xor, and hands you the key.

License

MIT

Metadata

Release files for flaghunter 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flaghunter 0.1.0
File Size Uploaded
flaghunter-0.1.0.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flaghunter 0.1.0
File Interpreter ABI Platform
flaghunter-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / flaghunter-0.1.0.tar.gz

Download URL flaghunter-0.1.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4ca0aaeb5464704a1c24d7d28e72fcdfe44114343bb8ef21346848d91121f081
BLAKE2b-256 checksum
How to use checksums
d5095008ce978480c22502347405347098030e35629f9f479006a47db173672e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / flaghunter-0.1.0-py3-none-any.whl

Download URL flaghunter-0.1.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a691a613d2fc3fee4ad21a21d473fec1012e730f167a208767062bf5428732a
BLAKE2b-256 checksum
How to use checksums
94282acdaa9d59683fce5211c48766605459e605c8f465666ad4a81291ad19da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page