# dsh-pentester/kali —— 镜像内工具清单与路径

Kali Linux（rolling）+ 精选渗透测试工具集。Agent 从不指定镜像名：它通过
`/pentester/tools.json` 发现工具，一切执行经 `container_exec`
（契约见 `docs/architecture.md`）。

> **给 Agent 的工具使用 Prompt 在镜像内是 `/pentester/PROMPT.md`
> （仓库源文件为同目录 [`TOOL_PROMPT.md`](TOOL_PROMPT.md)）**；
> 本文件是给人看的镜像内容清单。
>
> **构建说明见 [`../README.md`](../README.md)**（本文件只描述镜像内容）。

> 分类与 `bin/gen-tools-json.sh` 一一对应；`tools.json` 在构建期用 `command -v`
> 探测生成，**只有真实装进镜像的工具才会出现在目录里**（装漏的不会进）。

## 产品根目录 `/pentester`

| 路径 | 内容 |
| --- | --- |
| `/pentester/tools.json` | 工具目录（构建期探测生成；Agent 的唯一发现入口） |
| `/pentester/bin/` | `tool-list`（分类清单）· `tool-info`（单工具详情）· `gen-tools-json.sh` · `record-traffic.sh` · `entrypoint.sh` · `clone-kb` |
| `/pentester/tools/bin/` | Go 工具族 + fscan / kscan / defaulthound + jar 包装脚本 + pipx bin（jc / mitmdump） |
| `/pentester/tools/jars/` | ysoserial / marshalsec / JNDI-Injection-Exploit |
| `/pentester/tools/pipx/` | pipx 隔离环境 |
| `/pentester/kb/` | 离线知识库（`--build-arg WITH_KB=1` 时存在） |
| `/pentester/VERSION` | 镜像版本（构建期写入） |
| `/pentester/PROMPT.md` | Agent 工具使用 Prompt（TOOL_PROMPT.md 的镜像内副本） |

## 工具分类

### base —— 基础运行时

- `/usr/bin`（apt）：`bash` · `zsh` · `python3` · `pip` · `pipx` · `git` · `curl` · `wget` · `aria2c` · `jq` · `yq` · `ruby` · `perl` · `go`（golang-go）· `java`（default-jre）· `gcc` · `make` · `unzip` · `7z` · `tar` · `openssl` · `file` · `tree` · `gdb` · `tmux` · `screen` · `vim` · `nano` · `less` · `gawk`
- `/pentester/tools/bin`（Go）：`red-tldr`（Red Team TL;DR）

### cli-extras —— 现代化 CLI 基础件

- `/usr/bin`（apt）：`rg`（ripgrep）· `fd`（fdfind 符号链接 → `/usr/local/bin/fd`）· `xh` · `hurl` · `sd` · `mlr`（miller）
- `/pentester/tools/bin`（pipx / Go）：`jc`（任意命令输出 → JSON）· `gron`（JSON flatten）

### traffic —— 全流量记录（只记录，不分析）

- `tcpdump`（/usr/bin，apt）；`mitmdump`（mitmproxy，pipx → `/pentester/tools/bin`）
- 容器启动时 `entrypoint.sh` 自动执行 `record-traffic.sh`（幂等）：pcap → `/workspace/traffic/pcap/`，HTTP(S) 明文流 → `/workspace/traffic/flows.mitm`（mitmproxy :8080）

### network —— 网络 / 诊断（/usr/bin，apt）

`ip`（iproute2）· `ping` · `dig` / `nslookup` / `host`（dnsutils）· `whois` · `traceroute` · `mtr` · `tcpdump` · `tshark` · `nc`（netcat-openbsd）· `ncat` · `socat` · `telnet` · `ssh`（openssh-client）· `proxychains4`（符号链接 → `/usr/local/bin/proxychains`）· `torsocks`

### network-discovery —— 网络发现 / 端口扫描

- `/usr/bin`（apt）：`nmap` · `masscan` · `arp-scan` · `netdiscover`
- `/pentester/tools/bin`：`naabu`（Go）· `fscan`（预编译）· `kscan`（预编译）

### dns-osint —— DNS / 子域名 / OSINT

- `/usr/bin`（apt）：`dnsrecon` · `dnsenum` · `fierce` · `amass` · `subfinder` · `theHarvester` · `whatweb` · `wafw00f`
- `/pentester/tools/bin`（Go）：`dnsx` · `fofax`

### web-discovery —— Web 发现 / fuzz / 爬取

- `/usr/bin`（apt）：`ffuf` · `gobuster` · `feroxbuster` · `dirb` · `dirbuster` · `nikto`
- `/pentester/tools/bin`（Go）：`httpx` · `katana` · `gospider` · `interactsh-client`

### vulnerability —— 漏洞扫描 / 利用辅助

- `/usr/bin`（apt）：`nuclei` · `sqlmap`
- `/pentester/tools/bin`（Go）：`usql`（通用 SQL 客户端）
- `/pentester/tools/bin` 包装脚本 + `/pentester/tools/jars/*.jar`：`ysoserial` · `marshalsec` · `jndi-injection-exploit`（Java 反序列化三件套）

### password —— 密码 / 爆破 / 凭据

- `/usr/bin`（apt）：`hydra` · `john` · `medusa` · `crunch` · `hashid` · `hashcat`
- `/pentester/tools/bin`（预编译）：`defaulthound`（默认口令扫描）

### smb-ad —— SMB / Windows / AD（/usr/bin，apt）

`smbclient` · `enum4linux-ng` · `impacket-*`（psexec / smbexec / secretsdump 等）· `netexec` · `evil-winrm`

### wordlists —— 字典（apt 数据目录）

- `/usr/share/seclists`（seclists 合集）
- `/usr/share/wordlists/rockyou.txt.gz`（rockyou）

### misc —— 取证 / 逆向 / 响应（/usr/bin，apt）

`exiftool` · `binwalk` · `foremost` · `radare2`（r2）· `responder` · `bettercap`

### knowledge —— 离线知识库（`--build-arg WITH_KB=1` 时存在）

- `/pentester/kb/vulhub`（漏洞环境复现）
- `/pentester/kb/PayloadsAllTheThings`（payload 大全）
- `/pentester/kb/awesome-poc`（POC 集）
- `/pentester/kb/exphub`（漏洞利用脚本）
- `/pentester/kb/INDEX.txt`（全库文件索引）

## 运行行为

- **ENTRYPOINT** `/pentester/bin/entrypoint.sh`：启动流量记录（幂等）后 `exec CMD`；**CMD** `sleep infinity`，**WORKDIR** `/workspace`。
- **proxychains 已预配置**：`/etc/proxychains4.conf` 指向本地 mitmproxy :8080 —— `proxychains curl https://example.com` 即可让明文 HTTP(S) 流进入 `/workspace/traffic/flows.mitm`（不强制，避免影响不兼容代理的工具）。
- **版本**：写入 `/pentester/VERSION`、`DSH_PENTESTER_KALI_VERSION` env 与 OCI label。

> `wordlists` 与 `knowledge` 的 `dir:` 条目是路径提示（path hint），非可执行工具；
> 会原样出现在 tools.json 中（如 `/usr/share/seclists`、`/pentester/kb`）。
