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.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-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: htb_flow-0.1.6.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.tar.gz
Algorithm Hash digest
SHA256 7631f4c6fb6a509723ecd037bd2ffcb6816a92c6b0099d52d3098f5622bdb93b
MD5 9d6947103b9b11a48b2810a445c7abc3
BLAKE2b-256 31d65b2cde68f53a54e0a94b269ceb69ade969cc93d3bb3f6aedd5e99199d2d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for htb_flow-0.1.6.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-py3-none-any.whl.

File metadata

  • Download URL: htb_flow-0.1.6-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-py3-none-any.whl
Algorithm Hash digest
SHA256 774e2d72baa9490549fd860a19f522a57ddd5f38c8806e52a4409e9701e1663c
MD5 60490c5f70b9b3f851f2a2b032fc466d
BLAKE2b-256 bca15588a8bf962f8c9c64a4edbcd8f851d9f91c98259f6f58b68e331112e652

See more details on using hashes here.

Provenance

The following attestation bundles were made for htb_flow-0.1.6-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