snailsploit/claude-red/offensive-deserialization
Claude Code and agent skill by snailsploit/claude-red
- community
Checking that the SKILL.md file is still in the repository.
Insecure deserialization exploitation across Java, PHP, .NET, Python, Node.js, and Ruby. Covers gadget chain construction with ysoserial/phpggc/ysoserial.net, ObjectInputStream and BinaryFormatter sink identification, pickle __reduce__ RCE, phar:// wrapper abuse, Jackson polymorphic typing, Json.NET TypeNameHandling, ViewState tampering, node-serialize IIFE injection, Ruby Marshal.load and YAML.load gadgets, framework-specific chains for Spring/Hibernate/Laravel/Symfony, modern attack surfaces including Kubernetes admission webhooks and message queue consumers, WAF bypass through encoding layers and content-type manipulation, and serialVersionUID/JMX/RMI vectors. Activate when the engagement involves deserialization sinks, serialized data in cookies or request bodies, gadget chain development, magic method abuse, ysoserial payload generation, or any review of marshalling and unmarshalling logic in target applications.
Install
npx vskill@latest install snailsploit/claude-red/offensive-deserializationSKILL.md
The same SKILL.md was published earlier as snailsploit/claude-red/offensive-deserialization.
Offensive Deserialization
Deserialization vulnerabilities arise when an application reconstructs objects from serialized byte streams without validating the type, integrity, or origin of the data. Object reconstruction triggers constructors, finalizers, and language-specific magic methods, so an attacker who controls the serialized input often achieves remote code execution before any application-level validation runs.
Quick Workflow
- Enumerate every entry point accepting opaque binary or encoded data -- cookies,
HTTP bodies, headers, message queue messages, file uploads, GraphQL custom scalars, gRPC fields, JMX/RMI endpoints.
- Fingerprint the serialization format via magic bytes, content-type headers, and
error behavior (see Recognition Signatures).
- Determine the server-side language and framework version from error pages, HTTP
headers, or source code.
- Select candidate gadget chains matching the target classpath or installed packages.
Generate payloads with ysoserial, phpggc, ysoserial.net, or manual construction.
- Deliver through the identified entry point. Start with DNS-only or sleep-based
proof to confirm execution without destructive side effects.
- Escalate from proof-of-concept to the engagement objective with authorization.
- Document the full chain: entry point, format, gadget chain, library versions, proof.
Recognition Signatures
| Format | Signature | Notes | |
|---|---|---|---|
| Java ObjectInputStream | Hex ac ed 00 05, Base64 rO0AB | Cookies, POST bodies, JMX/RMI streams | |
| PHP serialize | O:<len>:"ClassName": or a:<count>:{ | Frequently Base64-wrapped in cookies | |
| .NET BinaryFormatter | Base64 AAEAAAD///// | ViewState, remoting, session state | |
| Python pickle | Opcodes \x80\x04\x95 (v4+), older (dp0 text | Redis caches, Celery tasks, ML pipelines | |
| Ruby Marshal | \x04\x08 leading bytes | Session cookies in older Rails apps | |
| YAML (any lang) | --- !ruby/object: or !!python/object/apply: | Tag-based instantiation | |
| Java XMLDecoder | <?xml with <java> or <object class= | Legacy Java admin panels | |
| .NET Json.NET | "$type": key in JSON | TypeNameHandling != None | |
| Java Jackson | ["class.name", { JSON array wrapper | enableDefaultTyping / polymorphic handling |
Java Deserialization
ObjectInputStream.readObject() instantiates arbitrary classes present on the classpath. Decades of library code provide usable gadget chains.
Identifying Sinks
serialVersionUID and Classpath Constraints
Every serializable Java class carries a serialVersionUID. A mismatch causes InvalidClassException before any gadget logic executes. Extract the server's UID from error messages or decompiled JARs, then rebuild the payload with ysoserial's source. The UID often changes only on major releases, so brute-forcing common versions is feasible when the exact version is unknown.
ysoserial Gadget Chains
Match the chain to libraries present on the target classpath.
JMX/RMI Deserialization
JMX and RMI registries accept serialized objects over the wire and are frequently exposed without authentication on internal networks.
Jackson Polymorphic Typing
When enableDefaultTyping() or @JsonTypeInfo(use = Id.CLASS) is active, you supply a JSON array naming the class to instantiate.
Jackson maintainers continuously add classes to a denylist. Check the target's version against known bypass classes: org.apache.ibatis.datasource.jndi.JndiDataSourceFactory, com.caucho.config.types.ResourceRef, and similar JNDI-capable beans.
PHP Deserialization
unserialize() instantiates objects and can invoke __wakeup or __unserialize during reconstruction; gadget chains may subsequently use __destruct or __toString. On PHP before 8.0, loading a PHAR archive through phar:// can deserialize metadata without an explicit unserialize() call.
Identifying Sinks
phpggc Gadget Chains
phar:// Exploitation
On PHP before 8.0, a file operation that loads an attacker-controlled PHAR through phar:// can deserialize the archive's metadata. The application must also have an available gadget class for object instantiation to reach an exploitable sink.
PHP 8.0 removed automatic metadata deserialization from ordinary file operations. On PHP 8+, look for an explicit Phar::getMetadata() or PharFileInfo::getMetadata() call and inspect its allowed_classes options. A file-operation sink alone is insufficient. See the PHP 8.0 migration notes.
On PHP before 8.0, upload the polyglot as an image, then trigger a file operation referencing phar://uploads/exploit.jpg/test.txt.
.NET Deserialization
BinaryFormatter is the most dangerous .NET serializer. Microsoft has formally deprecated it, but legacy applications and internal tools still use it.
Identifying Sinks
ysoserial.net Payloads
ViewState Exploitation
ASP.NET ViewState is a serialized hidden form field. When MAC validation is disabled or the machine key is known, you inject a gadget chain directly.
Json.NET TypeNameHandling
When TypeNameHandling is not None, the $type property controls instantiation.
Python Deserialization
Python's pickle executes arbitrary code during deserialization through the __reduce__ method. There is no safe way to deserialize untrusted pickle data.
pickle RCE
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingSkills/web/offensive-deserialization/SKILL.md
Popularity
- Repository stars
- 1,288
- Repository forks
- 221
- 7-day trend score
- 36
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/snailsploit/claude-red/offensive-deserialization)