Skip to main content

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

Project description

htbflow

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+, pipx, nmap

pipx 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.3.tar.gz (26.1 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.3-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: htb_flow-0.1.3.tar.gz
  • Upload date:
  • Size: 26.1 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.3.tar.gz
Algorithm Hash digest
SHA256 32ca2865c1c21c8a84384e841f3e3ce504bdd42f37a83b7ec973965980701758
MD5 93b7a61438c0cb4a1f74d571b0acf790
BLAKE2b-256 0f075a58cf8cdfa485fd46eb34d8149fdbcb32e5fa879f90270af5a33dee7d85

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: htb_flow-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 35.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b1ac2bee166c9b0821474f6269f57b4567a8940bd6966745591bf68956db693d
MD5 5b4533935e6240b4177cfe0c6ffe88dc
BLAKE2b-256 1556c088d551ce6124d9325b65871a2737410e9d562d6e309b0a609a8deff5ed

See more details on using hashes here.

Provenance

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