ShiroAttack2: Instructions file for Codex

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is SummerSec/ShiroAttack2's own configuration. It tells Codex and OpenCode how to work on ShiroAttack2 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ShiroAttack2 configures →

About the project

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.

SummerSec/ShiroAttack2 · 2,634 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/SummerSec/ShiroAttack2/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/SummerSec/ShiroAttack2

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for ShiroAttack2 AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/summersec/shiroattack2/agents-md/github.svg)](https://agentmods.dev/instructions/summersec/shiroattack2/agents-md)
Your own site
<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.

agentmods 80×15 button for ShiroAttack2 AGENTS.md

Your own site · 80×15
<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>
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. A grade says what 26 rules found in the file — not that it is safe.
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.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

Measured 1mo ago against content hash 37a6347e5930, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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.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,把回显/内存马类嵌入 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. 1mo 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,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.

Related

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).

microsoft/vscode · 9,715 tokens

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.

vercel/next.js · 7,786 tokens

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).

microsoft/vscode · 5,262 tokens

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.

langchain-ai/langchain · 4,680 tokens

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).

microsoft/vscode · 2,731 tokens

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.

denoland/deno · 3,077 tokens