Skip to main content

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

Metadata

Release files for htb-flow 0.1.6.1

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

Source distribution (sdist)

Source distribution for htb-flow 0.1.6.1
File Size Uploaded Provenance Actions
htb_flow-0.1.6.1.tar.gz 29.0 kB With provenance Details for htb_flow-0.1.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for htb-flow 0.1.6.1
File Interpreter ABI Platform Actions
htb_flow-0.1.6.1-py3-none-any.whl Python 3 none any Details for htb_flow-0.1.6.1-py3-none-any.whl

Total release size: 69.4 kB

Release files / htb_flow-0.1.6.1.tar.gz

Download URL htb_flow-0.1.6.1.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4747140afc6b37e4ab64803d414a87c1b4a0fa29eb2a816ce7155d1d113d9cac
BLAKE2b-256 checksum
How to use checksums
989d4353066e9628179410b88c4a12ac59060a4cafb42438541f0494e3d637c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 31, 2026.

Transparency log

Release files / htb_flow-0.1.6.1-py3-none-any.whl

Download URL htb_flow-0.1.6.1-py3-none-any.whl
Size 40.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d62795e0a215d1a2cc994d5ca2bdd5a146a9ecb3d70df7127c91492656f8a58
BLAKE2b-256 checksum
How to use checksums
6760cc5dcb8a34bed4684305e587d14a2b9bd64e36b329c4dca89fcca3d23696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 31, 2026.

Transparency log

Security for htb-flow 0.1.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for htb_flow-0.1.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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