Cliente de la API de Hack The Box sin navegador (no oficial)
- Python 81%
- Shell 19%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| bin | ||
| docs | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
htb-labs-kit — HackTheBox Labs por API, sin navegador
Cliente de línea de comandos (bin/htb.py, solo librería estándar de Python) para usar HTB Labs
sin la web: listar máquinas pendientes, spawnear, ver la IP, subir flags y terminar.
Puesta a punto
# 1. token al llavero (o export HTB_TOKEN=... y ya)
echo '<jwt>' | secret-tool store --label=htb-labs service hackthebox account htb
# 2. ¿funciona?
bin/htb.py check # → HTTP 200 · <tu-user> (id ...) · token OK
bin/htb.py todo --os linux # lista lo pendiente, Easy → Insane
No hay login por usuario/contraseña porque está detrás de Cloudflare Turnstile: el token se
cuña una vez (ver docs/api.md). Si caduca, bin/htb.py apptoken <nombre> saca otro y lo guarda
en el llavero sin imprimirlo.
Uso
id=$(bin/htb.py todo --os linux | head -1 | awk '{print $1}')
bin/htb.py spawn "$id" --force # termina la activa + espera IP
bin/htb.py active # máquina activa e IP
bin/htb.py own "$id" --file flags.txt # sube user: y root: (omite las ya owned)
bin/htb.py owned "$id" # → (True, True)
bin/htb.py terminate
Comandos: check, todo, active, spawn, own, owned, terminate, apptoken, renew, raw.
Reenviar una flag ya owned da 500 Incorrect Flag.: consulta owned antes.
Variables
HTB_TOKEN · HTB_ACCOUNT (atributo del llavero, por defecto htb)
Ficheros
| fichero | para qué |
|---|---|
bin/htb.py |
el cliente |
docs/api.md |
endpoints y trampas de la API |
bin/check-leaks.sh |
auditoría de secretos/identidades antes de compartir (LEAK_NAMES="miuser mi@correo") |
No guarda credenciales de tu cuenta ni tu .ovpn.
Licencia
MIT (ver LICENSE). Proyecto no oficial, sin relación con Hack The Box.