ShiroAttack2 CLAUDE.md

A project instruction file for ShiroAttack2, a Java security tool that can run from the command line or with a graphical interface. It documents how to install local libraries, build the executable JAR, and run its commands.

In plain words
What is it for?
It is for building and running ShiroAttack2, using commands such as detection, password cracking, execution, memory-shell operations, and key changes, as well as managing its plugin entries.
Why use it?
It gives agents the project-specific setup and build commands needed to work with software that has local Maven dependencies and no test suite.

Instructions file

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/claude-md
Clone the repo
git clone --depth 1 https://github.com/SummerSec/ShiroAttack2
Per session 1,128 This file is loaded in full into every session.
When invoked 1,128 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.01128 $0.01128
Opus 5 $0.00564 $0.00564
Sonnet 5 $0.00226 $0.00226
Haiku 4.5 $0.00113 $0.00113

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

Security

Grade A, and why

ShiroAttack2 CLAUDE.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.

CLAUDE.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Build & Run

# 前置步骤:安装本地 JAR 到 Maven(仅首次需要)
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

# 运行 CLI(命令行模式,无需 GUI)
java -cp target/shiro_attack-5.1.1-all.jar com.summersec.attack.CLI.MainCLI <command> [options]

# CLI 可用命令: detect | crack | exec | memshell | changekey | gui
# 详见 .claude/skills/shiro-attack-cli/SKILL.md

# 运行(需要 JavaFX 运行时,Java 8)
java -jar target/shiro_attack-5.1.1-all.jar

本项目无测试套件;仅有 GitHub Release CI(推送 tag 触发)。

插件市场

本项目同时也是 Claude Code 插件市场,通过 .claude-plugin/marketplace.json 注册了 shiro-attack-cli 技能。

# 安装(来源为 GitHub)
claude plugins add github:SummerSec/ShiroAttack2

支持平台:Claude Code (.claude-plugin/)、Codex CLI (.codex-plugin/)、Cursor (.cursor-plugin/)。skill 源文件在 skills/shiro-attack-cli/SKILL.md

架构概述

ShiroAttack2 是一个利用 Apache Shiro rememberMe AES 反序列化漏洞(Shiro-550)的 JavaFX GUI 工具。

攻击流程

  1. 密钥爆破deser/plugins/keytest/KeyEcho.javaSimplePrincipalCollection 序列化后用候选密钥(resources/data/shiro_key.txt)逐一加密,通过响应判断有效密钥
  2. Gadget 链选择 — 用户在 UI 中选择适合目标 classpath 的 CommonsBeanutils 变体(1.8.3 / 1.9.2 / AttrCompare)
  3. 回显类型选择 — Tomcat / Spring / DFS-AllEcho / NoEcho / 反弹 Shell
  4. Payload 构造deser/util/Gadgets.java 用 Javassist 将回显类嵌入 TemplatesImpl translet,Gadget 链包装后序列化
  5. 加密发送Encrypt/CbcEncrypt.java(AES-CBC)或 Encrypt/GcmEncrypt.java(AES-GCM)加密后 Base64 编码,写入 rememberMe cookie 发送

主要包职责

职责
attack.UI JavaFX 入口 (Main) 和主窗口控制器
attack.core AttackService — 串联爆破、Gadget、加密、发送的编排层
attack.Encrypt AES-CBC / AES-GCM 加密;KeyGenerator 生成新密钥
attack.deser.payloads CommonsBeanutils gadget 链实现
attack.deser.echo 各平台回显 Payload 生成(Tomcat/Spring/DFS/Reverse/NoEcho)
attack.deser.plugins 内存马注入(InjectMemTool)、密钥探测(KeyEcho
attack.deser.frame Shiro cookie 序列化/加密封装
attack.deser.util Gadgets(TemplatesImpl 构造)、反射工具、JavaVersion
attack.utils HTTP 请求(Hutool)、AES 工具、控制台输出
attack.entity ControllersFactory(JavaFX 控制器注册表)、RequestInfo
org.apache.shiro.* 内嵌 Shiro 加密源码(AesCipherService 等),便于定制

Read the full file on GitHub · 73 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 · 73 lines · 1,128 tokens per session scan A 703d8284f1e5

Subscribe to this mod's changes

ShiroAttack2 CLAUDE.md is an instructions file published in the GitHub repository SummerSec/ShiroAttack2 (2,622 stars, last pushed 3mo ago), licensed MIT. It adds 1,128 tokens to every session, about $0.0056 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.