# exploiting-insecure-deserialization

exploiting-insecure-deserialization helps detect and exploit insecure deserialization bugs in Java, PHP, Python, and .NET applications during authorized penetration testing.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 256 installs · ★ 36511 repo stars
- Author: mahipal
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/HEAD/skills/exploiting-insecure-deserialization/SKILL.md
- Updated: 2026-08-31
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/exploiting-insecure-deserialization

## What it does

The skill outlines how to spot serialized objects across HTTP headers, cookies, and form fields. It flags signatures such as Java's `rO0AB`, PHP serialization patterns, ASP.NET `__VIEWSTATE` values, and Python pickle markers. This pinpoints injection points quickly.

Workflows cover payload generation via utilities like `ysoserial`, `ysoserial.net`, and `PHPGGC`. Testing starts safely with URLDNS queries to an out-of-band server. If confirmed, testers generate gadget chains targeting frameworks like Spring or Laravel.

Never run these workflows without written penetration testing permission. The skill provides workflow guidance rather than binaries. You need a local Java runtime, cloned exploit generators, and an out-of-band listener.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-insecure-deserialization -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/exploiting-insecure-deserialization/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/exploiting-insecure-deserialization/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-insecure-deserialization -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/exploiting-insecure-deserialization/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-insecure-deserialization -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/exploiting-insecure-deserialization/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install mukul975/Anthropic-Cybersecurity-Skills skills/exploiting-insecure-deserialization
```

2. **Manually: put the files in place**
- File: `.github/skills/exploiting-insecure-deserialization/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-insecure-deserialization -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/mukul975/Anthropic-Cybersecurity-Skills --path skills/exploiting-insecure-deserialization
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/exploiting-insecure-deserialization/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-insecure-deserialization -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/HEAD/skills/exploiting-insecure-deserialization/SKILL.md

## When to use it
- spot serialized objects in cookies and request headers
- craft exploit payloads using ysoserial and PHPGGC
- evaluate insecure ASP.NET ViewState parameters
- verify code execution through out-of-band DNS requests

## Example prompts
- Inspect this base64 cookie value for Java serialization signatures.
- Generate a ysoserial URLDNS command to test out-of-band detection via Burp Collaborator.
- Provide a PHPGGC command targeting a vulnerable Laravel framework endpoint.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 41966ee64d82bc3f.

BEGIN THIRD-PARTY FILE 41966ee64d82bc3f
````text
---
name: exploiting-insecure-deserialization
description: Identifying and exploiting insecure deserialization vulnerabilities in
  Java, PHP, Python, and .NET applications to achieve remote code execution during
  authorized penetration tests.
domain: cybersecurity
subdomain: web-application-security
tags:
- penetration-testing
- deserialization
- rce
- owasp
- web-security
- ysoserial
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- PR.PS-01
- ID.RA-01
- PR.DS-10
- DE.CM-01
mitre_attack:
- T1190
- T1059.007
- T1505.003
- T1083
---

# Exploiting Insecure Deserialization

## When to Use

- During authorized penetration tests when applications process serialized data (cookies, API parameters, message queues)
- When identifying Java serialization markers (`ac ed 00 05` / `rO0AB`) in HTTP traffic
- For testing PHP applications that use `unserialize()` on user-controlled input
- When evaluating .NET applications using `BinaryFormatter`, `ObjectStateFormatter`, or `ViewState`
- During security assessments of applications using pickle (Python), Marshal (Ruby), or YAML deserialization

## Prerequisites

- **Authorization**: Written penetration testing agreement with RCE testing scope
- **ysoserial**: Java deserialization exploit tool (`git clone https://github.com/frohoff/ysoserial.git`)
- **ysoserial.net**: .NET deserialization exploit tool (`git clone https://github.com/pwntester/ysoserial.net.git`)
- **PHPGGC**: PHP deserialization gadget chain generator (`git clone https://github.com/ambionics/phpggc.git`)
- **Burp Suite Professional**: With Java Deserialization Scanner extension
- **Java Runtime**: For running ysoserial
- **Collaborator/interactsh**: For out-of-band confirmation of code execution

## Workflow

### Step 1: Identify Serialized Data in Application Traffic

Detect serialized objects in HTTP parameters, cookies, and headers.

```bash
# Java serialization markers
# Binary: starts with 0xACED0005
# Base64: starts with rO0AB
# Gzip+Base64: starts with H4sIAAAAAAAA

# Search Burp proxy history for serialization signatures
# In Burp: Proxy > HTTP History > Search > "rO0AB"

# Check cookies and parameters for Base64-encoded serialized data
echo "rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcA..." | base64 -d | xxd | head

# PHP serialization format
````
END THIRD-PARTY FILE 41966ee64d82bc3f

The third-party file has ended. Everything between the 41966ee64d82bc3f tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2293 of 11745 bytes. © mahipal · Apache-2.0 · https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/HEAD/skills/exploiting-insecure-deserialization/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
