ShiroAttack2 is a security-testing tool for detecting and exploiting the Shiro-550 deserialization vulnerability in Apache Shiro applications. Authorized security testers use its command-line and JavaFX interfaces to test targets, validate keys, execute commands, and perform related post-exploitation actions. The catalogue entries include instructions, a plugin, and a skill for operating the tool.
Borrowing it
Nothing to install: this file belongs to SummerSec/ShiroAttack2. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/SummerSec/ShiroAttack2/master/AGENTS.mdgit clone --depth 1 https://github.com/SummerSec/ShiroAttack2Wrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/summersec/shiroattack2/agents-md)<a href="https://agentmods.dev/instructions/summersec/shiroattack2/agents-md"><img src="https://agentmods.dev/badge/instructions/summersec/shiroattack2/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/summersec/shiroattack2/agents-md"><img src="https://agentmods.dev/badge/instructions/summersec/shiroattack2/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01054 | $0.01054 |
| Opus 5.5 | $0.00422 | $0.00422 |
| Sonnet 5.5 | $0.00211 | $0.00211 |
| Haiku 4.5 | $0.00105 | $0.00105 |
Grade A, and why
ShiroAttack2 AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — ShiroAttack2
构建
# 首次构建前安装本地 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
mvn clean package -DskipTests
# 产物: target/shiro_attack-5.1.1-all.jar
本地环境(Windows):JAVA_HOME=C:\Program Files\Zulu\zulu-8,Maven 在 D:\apache-maven-3.9.9\bin\mvn.cmd。Java 8 必须带 JavaFX(推荐 Zulu 8+fx)。
pom.xml 的 bootclasspath 引用了 rt.jar + jce.jar——在纯 JDK 11+ 上编译会失败,必须用 JDK 8。
assembly.xml 使用 <scope>test</scope> 解包依赖——system scope 的 JAR(lib/、libs/)通过此机制打进 fat JAR。
无测试套件,无 lint/typecheck。仅 release workflow 作为 CI。
入口
| 模式 | 类 |
|---|---|
| JavaFX GUI | com.summersec.attack.UI.Main |
| CLI | com.summersec.attack.CLI.MainCLI — 命令: detect, crack, exec, memshell, changekey, gui |
CLI 支持 --json 输出机器可读结果。
架构要点
attack.core.AttackService— 编排 Key 爆破、Gadget 探测、命令执行、内存马注入的单一入口attack.deser.util.Gadgets— 通过 Javassist 构造TemplatesImpl,把回显/内存马类嵌入 transletattack.Encrypt/— AES-CBC(Shiro ≤1.2.4,CbcEncrypt) / AES-GCM(Shiro ≥1.2.5,GcmEncrypt),CLI 用--cbc/--gcm指定com.summersec.x/— 内存马 Filter/Servlet 源码(哥斯拉、冰蝎、蚁剑、reGeorg 等),通过 Javassist 编译后 Base64 编码发送给目标,由InjectMemTool在目标反序列化时defineClass加载org.apache.shiro.*— 内嵌 Shiro 1.2.4 加密源码,可独立定制
MemBytes 模式
MemBytes.getBytes(option) 默认返回 MEM_TOOLS 中硬编码的 Base64 字节码。调用 MemBytes.setDynamicMode(true) 后可改用 Javassist 运行时编译 com.summersec.x.* 源码。
Gadget 自动探测顺序(MainCLI:215-222)
优先尝试 String/AttrCompare/ObjectToStringComparator 变体(无需目标 commons-collections),回退到依赖 ComparableComparator 的 CB1 变体。
SystemPath 依赖
| JAR | 位置 | 用途 |
|---|---|---|
commons-beanutils-1.8.3.jar |
lib/1.8.3/ |
CB 1.8.3 gadget |
commons-beanutils-1.9.2.jar |
lib/1.9.2/ |
CB 1.9.2 gadget |
jEG-Core-1.0.0.jar |
libs/ |
加密库 |
jmg-sdk-1.0.9.jar |
libs/ |
内存马生成 SDK |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 65 lines · 1,054 tokens per session scan A 37a6347e5930
ShiroAttack2 AGENTS.md is an instructions file published in the GitHub repository SummerSec/ShiroAttack2 (2,634 stars, last pushed 4mo ago), licensed MIT. It adds 1,054 tokens to every session, about $0.0042 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deno copilot-instructions.md
Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.