rea
Reverse engineer anything with agents, from app behavior down to native binaries.
Claude Code
> /plugin marketplace add SummerSec/ShiroAttack2> /plugin install shiro-attack-cli@shiro-attack2
Codex
$ npx skills add SummerSec/ShiroAttack2 -a codex
Cursor
$ npx skills add SummerSec/ShiroAttack2 -a cursor
Gemini CLI
$ npx skills add SummerSec/ShiroAttack2 -a gemini-cli
GitHub Copilot
$ copilot plugin marketplace add SummerSec/ShiroAttack2$ copilot plugin install shiro-attack-cli@shiro-attack2
OpenCode
$ npx skills add SummerSec/ShiroAttack2 -a opencode
Windsurf
$ npx skills add SummerSec/ShiroAttack2 -a windsurf

完整使用说明:docs/USAGE.md
2016 年的洞,到现在还能用。不是漏洞本身多高级,而是三个很现实的原因叠在一起。
第一,默认 Key。 Shiro 1.2.4 及之前版本在 CookieRememberMeManager 里硬写了一个 AES Key:kPH+bIxk5D2deZiIxcaaaA==。十几年来的教程和脚手架代码一直在拷贝这个值。
第二,Key 换不掉。 rememberMe 要求客户端和服务端用同一个 Key。一旦 Key 写进了配置文件、Docker 镜像、源码仓库,要替换就得所有节点一起改。
第三,利用成本足够低。 GUI 点几下就能拿 shell,CLI 可以直接嵌进脚本。
探测 ── 发 rememberMe=yes,看有没有 Set-Cookie: rememberMe=deleteMe
Shiro 1.x 遇到非法 Cookie 一定会回 deleteMe
爆破 ── 用 SimplePrincipalCollection 序列化 + 候选 Key 逐个加密
响应里没有 deleteMe 就是 Key 对了
Gadget ── 用确认的 Key 加密完整 Payload(Gadget 链 + TemplatesImpl 回显类)
命令执行 ── rememberMe Cookie 带着 Gadget Payload,命令写在 Authorization 头里
内存马 ── 同样的 Gadget 链注入 Filter/Servlet,不再依赖 rememberMe
Key 替换 ── 用内存马机制改掉 Shiro 的 AES Key,旧 Key 失效
5.0 之后增加了 CLI 模式。核心攻击逻辑 AttackService(1000+ 行)一行没改——通过继承 TextArea 拦截日志输出,利用 ControllersFactory 注册表注入假的 MainController,GUI 和 CLI 共用同一套攻击代码。CLI 不需要 JavaFX 窗口,启动时用一个 JFXPanel 初始化 JavaFX 线程即可。
# 启动 CLI
java -cp shiro_attack-<version>.jar com.summersec.attack.CLI.MainCLI <command> [options]
| 命令 | 用途 |
|---|---|
detect | 探测目标是否为 Shiro 框架 |
crack | 爆破或验证 Shiro AES Key |
exec | 执行系统命令(自动探测 Gadget 链) |
memshell | 注入内存马(哥斯拉/冰蝎/蚁剑等) |
changekey | 替换目标 Shiro Key |
gui | 启动 JavaFX 图形界面 |
--json 模式下输出分为两个通道:以 { 开头的是结构化日志,AI 或脚本可以按行 JSON.parse;不以 { 开头的是命令原始输出,tail -1 就能拿到结果。
AES 模式:--cbc(Shiro ≤1.2.4),--gcm(Shiro ≥1.2.5)。
Gadget 自动探测优先尝试 String/AttrCompare/ObjectToStringComparator 变体(无需 commons-collections),回退到依赖 ComparableComparator 的 CB 变体。
详细 CLI 用法见 @skills/shiro-attack-cli/SKILL.md(此文件是给 AI Agent 加载的 skill 描述,结构化为命令参数和排错规则)。
--json 结构化输出,适合脚本化和 AI 调用# 安装本地 JAR(仅首次需要)
mvn install:install-file -Dfile=libs/jEG-Core-1.0.0.jar -DgroupId=jeg -DartifactId=jeg-core -Dversion=1.0.0 -Dpackaging=jar
mvn install:install-file -Dfile=libs/jmg-sdk-1.0.9.jar -DgroupId=jmg -DartifactId=jmg-sdk -Dversion=1.0.9 -Dpackaging=jar
# 打包 fat JAR(Java 8)
mvn clean package -DskipTests
# 产物: target/shiro_attack-5.1.1-all.jar
Release 提供两类产物:
shiro_attack-<version>-<jdk>.jar:单文件可执行版本shiro_attack-<version>-<jdk>-bundle.zip:包含 data/ 和 lib/ 的完整压缩包运行目录结构:
./
├── shiro_attack-{version}-{jdk}.jar
├── data/
│ └── shiro_keys.txt # Key 字典,每行一个 Base64 Key
└── lib/ # CommonsBeanutils 各版本 JAR
Release 由 GitHub Actions 在推送 tag(v* 或 X.Y.Z)时自动构建。可选版本说明放在 docs/releases/<tag>.md。
| 文档 | 说明 |
|---|---|
| docs/USAGE.md | 完整功能使用说明 |
| docs/FAQ.md | 常见问题 |
| docs/ShiroAttack2-v5-guide.md | 5.x 版本功能深度介绍 |
| docs/memshell.md | 内存马说明 |
| docs/BypassWaf.md | WAF 绕过 |
| docs/NoGadget.md | 无 Gadget 场景 |
| docs/THIRD_PARTY_GENERATORS.md | jEG/jMG 集成说明 |
| AGENTS.md | OpenCode Agent 指令 |
| @skills/shiro-attack-cli/SKILL.md | AI Agent Skill 描述 |
免责声明:
本文档仅用于授权安全测试和学术研究。严禁利用本文档内容进行任何非法活动。
合规要求:
使用规范:
责任声明:
ShiroAttack2) 的开发者/维护者不承担任何因使用本工具而产生的法律责任法律依据:
报告漏洞: 如发现安全漏洞,请通过负责任的方式披露,勿直接公开漏洞细节。
See 12 shiro-attack2 alternatives
Reverse engineer anything with agents, from app behavior down to native binaries.
A skill pack for authorized reverse engineering, security research, and penetration testing that routes tasks to the right skill and sets up needed tools on demand. It covers API security assessment and Android APK analysis, among others.
Gives an AI agent the step-by-step workflow a senior security analyst follows, covering when to use each technique, what to check first, how to run it and how to verify the result. Covers incident response, forensics, threat intelligence, malware analysis, penetration testing and red teaming.
Agent skill + stdlib Python service to strip multi-vendor AI provenance marks from text and files, for privacy and hygiene on content you own. The skill is a thin client: it drives the machinery over HTTP, so the agent host needs no Python.
shiro-attack2 is indexed on Flowy in the Security category. Install it with the command on its page. It includes shiro-attack-cli. Its skills do not fire on their own yet. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it