Skip to main content

A command-line workflow tool for HackTheBox — manage the full machine lifecycle without leaving the terminal.

Project description

htb-flow

CI codecov PyPI

A command-line workflow tool for HackTheBox. Manage the full machine lifecycle from initial setup to completion: spawn machines, run recon, track credentials, submit flags, and archive finished boxes — all without leaving the terminal.

Installation

Requirements: Python 3.11+, nmap

# Recommended (isolated environment)
pipx install htb-flow

# Alternative
pip install htb-flow

Or from source:

git clone https://github.com/TimBoBN/htb-flow
cd htb-flow
pipx install .

Set your API key (stored encrypted in the system keyring):

htb key set

Commands

Workflow

htb init   <machine> [ip]   # Setup: VPN check, folders, /etc/hosts, notes.md, nmap
htb done   <machine>        # Finish: submit flags, terminate, cleanup, archive
htb update <machine> [ip]   # Update IP in /etc/hosts and notes.md

Recon

htb list                           # All active machines
htb list --retired                 # Retired machines
htb list --os Linux --diff Easy    # With filters
htb list --search <query>          # Search within list
htb search <query>                 # Search across all machines
htb info   <machine>               # Machine details + local status
htb status                         # Currently active machine + time remaining

Profile & Stats

htb profile          # Your profile (rank, points, owns)
htb activity [n]     # Last n solves (default 20)
htb timeline         # Solve history as ASCII chart
htb tracks           # Learning paths
htb fortresses       # Fortresses
htb todo             # Local machines with flag status

Lifecycle

htb spawn  <machine>   # Start a machine via API, waits for IP
htb reset  <machine>   # Reset a running machine
htb vpn    status      # VPN status
htb vpn    start       # Start VPN
htb vpn    stop        # Stop VPN
htb vpn    switch      # Switch VPN profile

Quick actions

htb notes   <machine>              # Open notes.md in $EDITOR
htb flag    <machine>              # Submit a flag without running done
htb scan    <machine> [ip]         # Re-run nmap quick scan
htb scan    <machine> [ip] --full  # Re-run full port scan (background)
htb creds   <machine>              # Save found credentials to notes.md
htb shell   <machine>              # SSH/evil-winrm with creds from notes.md
htb port    <machine> <port> <svc> # Add port to notes.md table
htb writeup <machine>              # Export clean writeup
htb open    <machine>              # Open machine page in browser
htb diff    <machine>              # Git diff of notes.md

Auth

htb key set     # Store API key encrypted in system keyring
htb key status  # Show where the key is coming from
htb key clear   # Remove key from keyring

Shell completion

htb completion bash >> ~/.bashrc   # Bash
htb completion zsh  >> ~/.zshrc    # Zsh

Configuration

Optional config file at ~/.config/htb/config.toml:

htb_base  = "~/Data/Cyber/HTB"       # Where machine folders are created
ovpn_path = "~/Data/Cyber/HTB.ovpn"  # Path to your .ovpn file
editor    = "nvim"                    # Editor for htb notes (fallback: $EDITOR)

API Key

The API key is read in this order:

  1. $HTB_API_KEY environment variable (CI/scripts)
  2. System keyring — set with htb key set
  3. ~/.config/htb/api_key plaintext file (legacy fallback)

Get your API key from HackTheBox → Profile → Settings → API Key.

Machine folder structure

htb init creates the following layout under htb_base:

<machine>/
├── notes.md      ← metadata, flags, credentials, write-up notes
├── nmap/
│   ├── quick.txt
│   └── full.txt
├── web/
├── exploits/
├── loot/
└── creds/

License

MIT

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

htb_flow-0.1.6.1.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

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

htb_flow-0.1.6.1-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

Details for the file htb_flow-0.1.6.1.tar.gz.

File metadata

  • Download URL: htb_flow-0.1.6.1.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for htb_flow-0.1.6.1.tar.gz
Algorithm Hash digest
SHA256 4747140afc6b37e4ab64803d414a87c1b4a0fa29eb2a816ce7155d1d113d9cac
MD5 dc23fd47d9b5e2c5f54ea8fe20878cad
BLAKE2b-256 989d4353066e9628179410b88c4a12ac59060a4cafb42438541f0494e3d637c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for htb_flow-0.1.6.1.tar.gz:

Publisher: release.yml on TimBoBN/htb-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file htb_flow-0.1.6.1-py3-none-any.whl.

File metadata

  • Download URL: htb_flow-0.1.6.1-py3-none-any.whl
  • Upload date:
  • Size: 40.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for htb_flow-0.1.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d62795e0a215d1a2cc994d5ca2bdd5a146a9ecb3d70df7127c91492656f8a58
MD5 77f3cda620bb4e4740b79d375a2a16c1
BLAKE2b-256 6760cc5dcb8a34bed4684305e587d14a2b9bd64e36b329c4dca89fcca3d23696

See more details on using hashes here.

Provenance

The following attestation bundles were made for htb_flow-0.1.6.1-py3-none-any.whl:

Publisher: release.yml on TimBoBN/htb-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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