x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/post-exploitation/tools/sshuttle.md
View on GitHub# sshuttle
- **Category**: Post-Exploitation / Pivoting
- **Risk Level**: 🟡 Medium
---
## 描述
一款透明的 VPN-over-SSH 工具,通过 SSH 连接创建完整的网络隧道,无需在远程服务器上拥有管理员权限。与传统的 SSH 端口转发(`-L`/`-D`)不同,sshuttle 使用本地 iptables/pf 规则将整个子网路由通过 SSH 隧道。远程服务器只需安装 Python,不需要特殊软件或 root 权限。非常适合在后渗透阶段进行跳板转发以访问内部网段。
## 安装
```bash
sudo apt install sshuttle
# 或通过 pip 安装
pip install sshuttle
sshuttle --version
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `-r, --remote <[user@]host[:port]>` | 通过其建立隧道的 SSH 远程服务器 |
| `<subnet>` | 位置参数——要路由的子网(CIDR 表示法) |
| `-e, --ssh-cmd <cmd>` | 自定义 SSH 命令(如指定密钥或端口) |
| `--dns` | 通过隧道转发 DNS 查询 |
| `-x, --exclude <subnet>` | 排除不走隧道的子网 |
| `--auto-hosts` | 通过检查 DNS 流量自动发现主机名 |
| `--auto-nets` | 通过监控远程主机上的流量自动发现子网 |
| `-v, --verbose` | 增加详细程度(重复以增加更多:`-vv`) |
| `--method <method>` | 转发方式:`auto`、`nft`、`nat`、`tproxy`、`pf`、`ipfw` |
| `-l, --listen <[ip:]port>` | 代理的本地监听地址 |
| `--pidfile <file>` | 将 PID 写入文件以进行守护进程管理 |
| `-D, --daemon` | 以守护进程方式在后台运行 |
| `--no-latency-control` | 禁用延迟优化 |
## 常用命令
```bash
# 将单个子网路由通过 SSH 隧道
sshuttle -r user@pivot-host 10.10.10.0/24
# 路由多个子网
sshuttle -r user@pivot-host 10.10.10.0/24 192.168.1.0/24
# 通过隧道转发 DNS 查询
sshuttle --dns -r user@pivot-host 10.10.10.0/24
# 排除特定主机不走隧道
sshuttle -r user@pivot-host 10.10.10.0/24 -x 10.10.10.1
# 使用指定的 SSH 密钥
sshuttle -r user@pivot-host --ssh-cmd "ssh -i /path/to/key" 10.10.10.0/24
# 隧道所有流量(0/0 = 除到跳板主机的 SSH 外的所有流量)
sshuttle -r user@pivot-host 0/0
# 详细模式用于调试连接问题
sshuttle -vv -r user@pivot-host 10.10.10.0/24
# 以守护进程方式运行并写入 PID 文件
sshuttle -D --pidfile /tmp/sshuttle.pid -r user@pivot-host 10.10.10.0/24
# 使用非标准 SSH 端口
sshuttle -r user@pivot-host:2222 10.10.10.0/24
```
## 注意事项
1. 需要本地机器的 root/sudo 权限(用于修改 iptables/pf 规则),但不需要远程服务器的 root 权限。
2. 远程服务器只需安装 Python,无需其他额外软件。
3. 与 `proxychains` 不同,sshuttle 是透明的——任何工具无需特殊配置即可使用,使用 `--dns` 时包括类似 UDP 的 DNS 查询。
4. 使用 `0/0` 可将所有流量路由通过隧道;sshuttle 会自动排除到跳板主机的 SSH 连接。
5. 在 macOS 上,sshuttle 使用 `pf` 防火墙方式;在 Linux 上默认使用 `nat`(iptables)。
6. 结合后渗透阶段获取的凭据材料,可通过多个被攻陷的主机进行多跳跳板转发。
---
## 官方参考
- [sshuttle (GitHub)](https://github.com/sshuttle/sshuttle)
- [Kali sshuttle](https://www.kali.org/tools/sshuttle/)
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 |