ShiroAttack2 AGENTS.md

ShiroAttack2 AGENTS.md is an instructions file for Codex, OpenCode from SummerSec/ShiroAttack2. It costs 1,054 tokens per session, scanned A, original, MIT.

Build instructions for a Java security tool distributed as a single bundled Java archive, or JAR file. They specify installing local libraries, using Java 8 with JavaFX, and the Maven command that creates the packaged file.

In plain words
What is it for?
Preparing the local build, packaging the application, running its graphical interface or command-line commands, and producing machine-readable JSON results.
Why use it?
They prevent build failures caused by using a newer Java version or missing local libraries. They also identify the available graphical and command-line entry points.

Instructions file for CodexOpenCode

Install

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.

agentmods
npx agentmods add instructions/summersec/shiroattack2/agents-md
Clone the repo
git clone --depth 1 https://github.com/SummerSec/ShiroAttack2

Made for: Codex, OpenCode.

Per session 1,054 This file is loaded in full into every session.
When invoked 1,054 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 3d ago against content hash 37a6347e5930, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

AGENTS.md · 65 lines

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.xmlbootclasspath 引用了 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,把回显/内存马类嵌入 translet
  • attack.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

Read the full file on GitHub · 65 lines

Changes

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.

  1. 3d ago First seen · 65 lines · 1,054 tokens per session scan A 37a6347e5930

Subscribe to this mod's changes

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.

Related

Other instructions, from other repositories