x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/exploitation/tools/gophish.md
View on GitHub# Gophish
- **Category**: Exploitation / Phishing
- **Risk Level**: 🔴 Critical
---
## 描述
GoPhish 是一个开源钓鱼框架,专为安全意识测试和授权钓鱼模拟设计。它提供基于 Web 的管理界面和 REST API,用于完整的活动生命周期管理。虽然它有用于管理的 Web UI,但活动和数据导出完全可通过 REST API 控制,使其可通过 CLI 自动化。
主要功能:
- 支持跟踪和变量替换的电子邮件模板创建
- 用于凭据收集的登录页面克隆和托管
- SMTP 发送配置管理
- 目标组管理,支持 CSV 导入
- 活动调度和实时结果跟踪
- 全面的 REST API 用于自动化
- 每事件跟踪:邮件发送、打开、点击、提交数据
## 安装
```bash
sudo apt install gophish
# 或从 GitHub releases 下载
wget https://github.com/gophish/gophish/releases/latest/download/gophish-v0.12.1-linux-64bit.zip
unzip gophish-v0.12.1-linux-64bit.zip
chmod +x gophish
```
## 参数说明
### CLI
| 参数 | 说明 |
|------|------|
| (无) | 使用当前目录下的 `config.json` 启动 GoPhish 服务 |
> **Note (Kali):** 在 Kali Linux 上,命令为 `gophish-start`(不是 `gophish`)。此包装脚本自动处理路径和权限。
### 配置文件 (config.json)
| 参数 | 说明 |
|------|------|
| `admin_server.listen_url` | 管理面板地址(默认:`127.0.0.1:3333`) |
| `admin_server.use_tls` | 为管理面板启用 TLS |
| `admin_server.cert_path` | 管理面板 TLS 证书路径 |
| `admin_server.key_path` | 管理面板 TLS 私钥路径 |
| `phish_server.listen_url` | 钓鱼服务器地址(默认:`0.0.0.0:80`) |
| `phish_server.use_tls` | 为钓鱼服务器启用 TLS |
| `db_name` | 数据库文件路径(默认:`sqlite3:gophish.db`) |
### REST API 端点
| 参数 | 说明 |
|------|------|
| `GET /api/campaigns` | 列出所有活动 |
| `POST /api/campaigns` | 创建新活动 |
| `GET /api/campaigns/:id` | 获取活动详情 |
| `GET /api/campaigns/:id/results` | 获取活动结果 |
| `DELETE /api/campaigns/:id` | 删除活动 |
| `GET /api/groups` | 列出目标组 |
| `POST /api/groups` | 创建目标组 |
| `GET /api/templates` | 列出邮件模板 |
| `POST /api/templates` | 创建邮件模板 |
| `GET /api/pages` | 列出登录页面 |
| `POST /api/pages` | 创建登录页面 |
| `GET /api/smtp` | 列出 SMTP 配置 |
| `POST /api/smtp` | 创建 SMTP 配置 |
| `POST /api/import/email` | 导入原始邮件作为模板 |
## 常用命令
### 启动 GoPhish 服务
```bash
# 启动服务(首次运行时默认管理员凭据输出到标准输出)
sudo gophish
```
### 配置文件
```json
{
"admin_server": {
"listen_url": "0.0.0.0:3333",
"use_tls": true,
"cert_path": "gophish_admin.crt",
"key_path": "gophish_admin.key"
},
"phish_server": {
"listen_url": "0.0.0.0:80",
"use_tls": false
},
"db_name": "sqlite3:gophish.db"
}
```
### 创建 SMTP 发送配置
```bash
curl -k -X POST https://localhost:3333/api/smtp/ \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "Internal SMTP",
"host": "smtp.example.com:25",
"from_address": "it-support@example.com",
"ignore_cert_errors": true
}'
```
### 创建目标组
```bash
curl -k -X POST https://localhost:3333/api/groups/ \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "Finance Team",
"targets": [
{"first_name": "John", "last_name": "Doe", "email": "john@example.com"},
{"first_name": "Jane", "last_name": "Smith", "email": "jane@example.com"}
]
}'
```
### 创建邮件模板
```bash
curl -k -X POST https://localhost:3333/api/templates/ \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "Password Reset",
"subject": "Action Required: Password Reset",
"html": "<html><body>Dear {{.FirstName}},<br>Click <a href=\"{{.URL}}\">here</a> to reset.</body></html>",
"text": "Dear {{.FirstName}}, visit {{.URL}} to reset your password."
}'
```
### 创建登录页面
```bash
curl -k -X POST https://localhost:3333/api/pages/ \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "Login Page",
"html": "<html><body><form method=\"POST\"><input name=\"username\"><input name=\"password\" type=\"password\"><input type=\"submit\"></form></body></html>",
"capture_credentials": true,
"capture_passwords": true
}'
```
### 启动活动
```bash
curl -k -X POST https://localhost:3333/api/campaigns/ \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "Q1 Phishing Test",
"template": {"name": "Password Reset"},
"page": {"name": "Login Page"},
"smtp": {"name": "Internal SMTP"},
"groups": [{"name": "Finance Team"}],
"url": "https://phish.example.com"
}'
```
### 获取活动结果
```bash
# 获取所有活动
curl -k https://localhost:3333/api/campaigns/ \
-H "Authorization: Bearer <api_key>"
# 获取特定活动结果
curl -k https://localhost:3333/api/campaigns/1/results \
-H "Authorization: Bearer <api_key>"
```
### 导入原始邮件作为模板
```bash
curl -k -X POST https://localhost:3333/api/import/email \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"content": "Raw email content here...",
"convert_links": true
}'
```
## 注意事项
1. 首次启动时默认管理员密码会输出到标准输出;请立即修改
2. API 密钥可在管理面板的设置中获取
3. 所有 API 请求需要 `Authorization: Bearer <api_key>` 头
4. 当管理面板使用自签名 TLS 证书时,`curl` 需要使用 `-k`
5. 模板变量:`{{.FirstName}}`、`{{.LastName}}`、`{{.Email}}`、`{{.Position}}`、`{{.URL}}`、`{{.From}}`
6. 钓鱼服务器 URL(活动配置中的 `url`)必须对目标用户可访问
7. 活动结果跟踪:邮件发送、邮件打开、链接点击、凭据提交
8. 运行钓鱼模拟前请确保已获得适当授权;此工具仅用于授权安全测试
---
## 官方参考
- GitHub: https://github.com/gophish/gophish
- Kali Tools: https://www.kali.org/tools/gophish/
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |