Skip to content

SSZcreate/Pentab_server / .agents/skills/cybersecurity/skills/exploiting-insecure-deserialization

exploiting-insecure-deserialization

Unverified

Identifying and exploiting insecure deserialization vulnerabilities in Java, PHP, Python, and .NET applications to achieve remote code execution during authorized penetration tests.

FileKindSize
LICENSEother11.0 KB
SKILL.mdskill md11.5 KB
references/api-reference.mdmarkdown2.0 KB
scripts/agent.pyscript6.2 KB

references/api-reference.md

View on GitHub
# API Reference: Insecure Deserialization Detection Agent

## Dependencies

| Library | Version | Purpose |
|---------|---------|---------|
| requests | >=2.28 | HTTP requests for scanning cookies and responses |
| pickle | stdlib | Python pickle payload generation for testing |

## CLI Usage

```bash
python scripts/agent.py --url https://target.example.com/dashboard \
  --callback oob.attacker.com --output deser_report.json
```

## Functions

### `detect_serialization_format(data) -> str`
Identifies serialization format from a string: `java_serialized`, `dotnet_viewstate`, `php_serialized`, `python_pickle`.

### `scan_cookies(url, session) -> list`
Fetches the URL and checks each response cookie value for serialization markers.

### `scan_response_body(url, method, data) -> list`
Scans the HTTP response body for Java Base64 (`rO0AB`), PHP serialized objects, and `__VIEWSTATE` fields.

### `test_java_deserialization(url, cookie_name, callback_host) -> dict`
Injects a URLDNS-style probe into a cookie to trigger DNS callback on deserialization.

### `test_php_deserialization(url, param_name) -> dict`
Sends PHP serialized object payloads attempting role escalation.

### `test_python_pickle(url, param_name, callback_host) -> dict`
Generates a pickle payload with `__reduce__` that triggers a DNS lookup for OOB detection.

### `run_assessment(url, callback_host) -> dict`
Orchestrates cookie and body scanning.

## Serialization Markers

| Format | Magic / Prefix | Example |
|--------|---------------|---------|
| Java binary | `\xac\xed\x00\x05` | Raw bytes |
| Java Base64 | `rO0AB` | Base64-encoded |
| .NET ViewState | `/wE` | `__VIEWSTATE` hidden field |
| PHP | `O:4:`, `a:2:` | Object/array notation |
| Python pickle | `\x80` (protocol byte) | Base64-encoded |

## Output Schema

```json
{
  "target": "https://target.example.com/",
  "serialized_data_found": 2,
  "cookie_findings": [{"name": "session", "format": "java_serialized"}],
  "formats_detected": ["java_serialized"]
}
```
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 193kUpdated Claude CodeCodexVerifiedInstall