Skip to main content

Interactive CTF, Cryptography & Cybersecurity Toolkit

Project description

🔥 CTF-H

Interactive CTF, Cryptography & Cybersecurity Toolkit

CTF-H is a fully interactive, menu‑driven CLI toolkit for:

  • CTF competitions
  • Cybersecurity learning & training
  • Cryptography practice
  • Reversing & forensics
  • Web security testing
  • Steganography & encoding challenges

Launch it with:

  • Windows:
    python -m ctfh.main
    
  • Linux / macOS (or if ctfh is on PATH):
    ctfh
    

You’ll see a full‑screen pixel banner and a numbered main menu. Navigate by typing the number of a module and pressing Enter; each module shows its own submenu and returns to the main menu when you choose the “Back”/0 option.


🧰 Features

  • Hashing: MD5, SHA1, SHA256, SHA512, SHA3 (224/256/384/512), Blake2b
  • Ciphers: Caesar (encrypt/decrypt/bruteforce), Vigenère, Atbash, XOR, Rail Fence, frequency analysis
  • Encoding / Decoding: Base64/32/58/85, Hex, Binary/ASCII, URL encode/decode, ROT13 / ROT‑N, XOR encode/decode
  • Steganography (CTF‑safe): PNG LSB embed/extract, BMP text extraction, EXIF metadata dump
  • Binary Analysis: file metadata, strings extraction, objdump preview (if installed), entropy estimation
  • Vulnerability Scanner: regex‑based detection for dangerous sinks (eval, innerHTML, document.write, shell=True, pickle.loads, os.system, …)
  • JavaScript Tools: JS prettifier, sink detection (eval, Function, DOM sinks, jQuery sinks, etc.)
  • HTTP Fuzzer: parameter fuzzing with built‑in payload sets, explicit confirmation required before sending any requests

Each module is interactive and guides you through required inputs (text, files, URLs, etc.) and shows results directly in the terminal.


🚀 Installation (virtual environment required)

For all operating systems, it is strongly recommended and effectively required to run CTF‑H inside a dedicated Python virtual environment.

The pattern is always:

python3 -m venv venv
source venv/bin/activate

On Windows python3 is usually python, and source venv/bin/activate is equivalent to venv\Scripts\activate in PowerShell/cmd.

Once your environment is active, follow the OS‑specific steps below.


Windows

  1. Create and activate virtual environment (required)
python -m venv venv
venv\Scripts\activate
  1. Install from PyPI (full feature set)
pip install "ctfh[full]"
  1. Run
python -m ctfh.main
  1. From source (development)
git clone https://github.com/ghanishpatil08/ctfh
cd ctfh

python -m venv venv
venv\Scripts\activate

pip install -e ".[full]"
python -m ctfh.main

Linux / Kali

  1. Create and activate virtual environment (required)
python3 -m venv venv
source venv/bin/activate
  1. Install from PyPI (full feature set)
pip install "ctfh[full]"
  1. Run
ctfh
  1. From source (development)
git clone https://github.com/ghanishpatil08/ctfh
cd ctfh

python3 -m venv venv
source venv/bin/activate

pip install -e ".[full]"
ctfh

Termux (Android)

CTF-H works on Termux (Android terminal emulator). Since Termux is Linux-based, it follows the same installation pattern as Linux.

Prerequisites:

  1. Install Termux from F-Droid or GitHub Releases
  2. Update packages and install Python 3.10+ plus system libraries needed for Pillow:
pkg update && pkg upgrade
pkg install python python-pip git
pkg install libjpeg-turbo libpng libwebp tiff freetype

Installation:

  1. Create and activate virtual environment (required)
python3 -m venv venv
source venv/bin/activate
  1. Install from PyPI

Option A: Full feature set (includes steganography)

pip install "ctfh[full]"

If Pillow fails to build, install system dependencies first:

pkg install libjpeg-turbo libpng libwebp tiff freetype
pip install --upgrade pip
pip install "ctfh[full]"

Option B: Core features only (no steganography/JS tools)

If you encounter Pillow build issues, you can install the core version:

pip install ctfh

This installs CTF-H without optional dependencies (Pillow, jsbeautifier, base58). You'll still have access to:

  • Hashing, Ciphers, Encoding/Decoding
  • Binary Analysis, Vulnerability Scanner
  • HTTP Fuzzing
  1. Run
ctfh
  1. From source (development)
git clone https://github.com/ghanishpatil08/ctfh
cd ctfh

python3 -m venv venv
source venv/bin/activate

pip install -e ".[full]"
ctfh

Note: Some features may have limitations on Termux:

  • Binary analysis tools (like objdump) require additional packages: pkg install binutils
  • Image processing (steganography) requires Pillow and system libraries: pkg install libjpeg-turbo libpng libwebp tiff freetype
  • Network features (HTTP fuzzing) work normally

macOS

  1. Create and activate virtual environment (required)
python3 -m venv venv
source venv/bin/activate
  1. Install from PyPI (full feature set)
pip install "ctfh[full]"
  1. Run
ctfh
  1. From source (development)
git clone https://github.com/ghanishpatil08/ctfh
cd ctfh

python3 -m venv venv
source venv/bin/activate

pip install -e ".[full]"
ctfh

Local system‑wide install from source (advanced)

If you know what you’re doing and still want to install system‑wide:

pip install .

📋 Requirements

Minimum (core):

  • Python 3.10+
  • colorama
  • requests

Full feature set adds:

  • Pillow – image handling & EXIF for steganography
  • jsbeautifier – JavaScript prettifier
  • base58 – Base58 encoding/decoding

All of these are installed automatically when using:

pip install "ctfh[full]"

🛠 Troubleshooting

ctfh is not recognized as an internal or external command

This usually means the Python Scripts directory (where console scripts are installed) is not on your PATH.

Quick workaround (always works):

python -m ctfh.main

If python points to a different version, try:

py -m ctfh.main

Permanent fix on Windows:

  1. Find the Scripts directory mentioned in pip warnings, e.g.
    • C:\Users\<you>\AppData\Roaming\Python\Python313\Scripts
  2. Open Start → “Environment Variables” → Edit the system environment variables
  3. Click Environment Variables…
  4. Under User variables, select Path → Edit → New
  5. Paste the Scripts path and save
  6. Close old terminals, open a new one, and run:
ctfh

No module named build (when running python -m build)

Install the packaging tools into your development environment:

pip install build twine
python -m build

Optional feature errors (Pillow / jsbeautifier / base58 missing)

If a module warns that an optional dependency is missing, either:

  • Install the full extras:
pip install "ctfh[full]"
  • Or install the specific package:
pip install Pillow jsbeautifier base58

Pillow build fails on Termux (Android)

If you see RequiredDependencyException: The headers or library files could not be found for jpeg when installing ctfh[full]:

  1. Install system libraries first (required for Pillow):
pkg install libjpeg-turbo libpng libwebp tiff freetype
  1. Upgrade pip and retry:
pip install --upgrade pip
pip install "ctfh[full]"
  1. Alternative: Install core version only

If Pillow still fails after installing system libraries, use the core version (no steganography):

pip install ctfh

This gives you all features except steganography and some JS tools. You can always add Pillow later once system libraries are properly installed.

HTTP fuzzing / scanner connectivity issues

  • Verify you have an active network connection and the target URL is correct
  • The fuzzer will not run unless you explicitly type CONFIRM when prompted
  • Only use these features against systems you own or have written permission to test

For any other error, run with python -m ctfh.main and capture the full traceback when reporting issues.


⚠️ Disclaimer

CTF‑H is for educational use and authorized security testing only.

  • Do not run the HTTP fuzzer or vulnerability scanner against systems you do not own or explicitly control.
  • Always obtain written permission before testing third‑party infrastructure.
  • You are responsible for complying with all applicable laws and rules where you operate.

📝 License (MIT)

Copyright (c) 2025 CSBC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctfh-1.1.0.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctfh-1.1.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file ctfh-1.1.0.tar.gz.

File metadata

  • Download URL: ctfh-1.1.0.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for ctfh-1.1.0.tar.gz
Algorithm Hash digest
SHA256 72e759de974f613e8cb5d113d2e1680bf593ceb8bd2973d9274070e05acfab0a
MD5 032302b1187c6d07dd2b69398545a88b
BLAKE2b-256 060968c6a77edeca6c1cbab223366bf3a209dcc59c77155e130cfb64f4f4a7a1

See more details on using hashes here.

File details

Details for the file ctfh-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ctfh-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for ctfh-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 692b910df6611d280b81a9d4b0ac7f89669a57ab42974269881e0312a6220519
MD5 01d7548c437f998ec8c3e146b07e973b
BLAKE2b-256 7e2a5b31ed9eeb2f0004e9f3b7a4e576783a21013a41e3a0b4c806c0f5a025a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page