Saturate/HTB-CLI

GitHub: Saturate/HTB-CLI

Hack The Box 平台的终端客户端,用命令行管理靶机、挑战、VPN 连接并提交 flag,同时支持 MCP 协议供 AI Agent 集成。

Stars: 0 | Forks: 0

# htb-cli 一个用于 [Hack The Box](https://hackthebox.com) 的终端客户端。浏览靶机、挑战、Sherlocks 和赛季。生成实例、提交 flag、管理 VPN 连接。 适用于任何 HTB 账户(免费或 VIP)。 ## 安装 ``` cargo install htb-cli ``` 或者从 [releases](https://github.com/Saturate/HTB-CLI/releases) 下载二进制文件。 ## 设置 ``` # 保存你的 API token (来自 https://app.hackthebox.com/profile/settings) htb auth login # 验证其是否有效 htb auth status ``` ## 用法 ``` # Machines htb machines list --os linux --difficulty easy htb machines info Bedside htb machines start Bedside htb machines submit Bedside 'HTB{flag_here}' htb machines active # Challenges htb challenges list --category Web htb challenges categories htb challenges info Poly htb challenges start Poly htb challenges submit 112 'HTB{flag_here}' htb challenges download Poly # Sherlocks htb sherlocks list --category DFIR htb sherlocks info Brutus # Seasons htb seasons list htb seasons rank # VPN htb vpn status htb vpn list htb vpn switch 1 htb vpn download # User htb user me htb user info 1234567 # 搜索 htb search nmap ``` ## 输出 默认为表格输出。在任何命令上使用 `--json` 以获取机器可读的输出: ``` htb machines list --json htb auth status --json ``` ## MCP Server 作为 [MCP](https://modelcontextprotocol.io) 服务器运行,以便进行 AI agent 集成: ``` htb --mcp-stdio ``` 暴露的工具:`list_machines`、`get_machine_info`、`list_challenges`、`get_challenge_info`、`start_challenge`、`submit_challenge_flag`、`get_active_machine`、`list_seasons`、`search`、`get_user_profile`。 ### Claude Code 配置 ``` { "mcpServers": { "htb": { "command": "htb", "args": ["--mcp-stdio"] } } } ``` ## 配置 可在 `~/.htb-cli/config.toml` 进行可选配置: ``` output = "table" # or "json" vpn_server = 1 # default VPN server ID no_color = false ``` Token 存储在 `~/.htb-cli/.token`(0600 权限)。 ## License MIT
标签:AI智能体, API客户端, CISA项目, Python安全, Rust, 动态分析, 可视化界面, 网络安全, 网络流量审计, 通知系统, 隐私保护