Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/summersec/shiroattack2/agents-mdgit clone --depth 1 https://github.com/SummerSec/ShiroAttack2What 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 | $0.01054 | $0.01054 |
| Opus 5 | $0.00527 | $0.00527 |
| Sonnet 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 3d 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.
- 3d 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,622 stars, last pushed 3mo ago), licensed MIT. It adds 1,054 tokens to every session, about $0.0053 per session on Opus 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
liteflow CLAUDE.md
Instructions for dromara/liteflow, covering claude.md, 概述, 命令, 构建 and 构建整个项目(模块集由 jdk 版本自动选择 —— 见下方说明).
java_upgrade CLAUDE.md
Instructions for kousen/java_upgrade, covering project context for claude code, project structure, key features, recently added exercises and java features covered.
sivalabs-agent-skills AGENTS.md
Instructions for sivaprasadreddy/sivalabs-agent-skills, covering agent instructions, installation methods, method 1: claude code plugin installation, add the agent-skills marketplace and install plugins.
Flydb AGENTS.md
Instructions for zzxCoding/Flydb, covering flydb 仓库 agent 指引, 1. 开始工作前, 2. 仓库结构与版本边界, 3. 修改规则 and 4. 构建与验证.
recaf-mcp AGENTS.md
Instructions for tha23rd/recaf-mcp, covering project overview, architecture, build & test, release flow and key conventions.
copilot-setting java.instructions.md
Load when writing or reviewing .java code — Java 8 version-lock floor: syntax, exceptions, logging, concurrency. Triggers on: var, records, text blocks, List.of/Map.of, pattern matching, java.time, BigDecimal, SLF4J. Forces Java 8, not modern Java. Defer SQL/Spring/JSP to their files.