Recovery of server-side source code via PHP filter wrappers, backup/.bak/.swp/editor temp files, source maps and misserved handlers that return raw code instead of executing it. Tier 1. Use when backups/editor artifacts appear or a parameter looks file-driven.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Source Disclosure?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-source-disclosure)
---
name: source-disclosure
description: Recovery of server-side source code via PHP filter wrappers, backup/.bak/.swp/editor temp files, source maps and misserved handlers that return raw code instead of executing it. Tier 1. Use when backups/editor artifacts appear or a parameter looks file-driven.
---
# Source Code Disclosure
Reading server source hands over logic, hardcoded secrets, DB creds, hidden endpoints and the exact code to attack next.
## Trigger phrases
`source disclosure, source code leak, php filter, bak file, swp file, source map, raw source, code disclosure`
## Method
1. **Backup/temp variants** of every known server file (per `content-discovery`): append `~ .bak .old .orig .save .swp .swo .txt .inc .dist .sample .1 .copy` and prefix patterns (`.index.php.swp`, `#file#`, `file.php~`). Vim swap `.<name>.swp` holds full buffers.
2. **Source maps**: append `.map` to each JS bundle; parse `sourcesContent[]` to reconstruct original TS/JS + inline secrets/endpoints → `secrets-disclosure`.
3. **Misserved handlers**: request scripts with alternate extensions/case/encoding (`index.phps`, `index.php.`, `index.php%00.txt`, `.PHP`, `::$DATA` on IIS) to make the server return raw code instead of executing.
4. **PHP filter chain read** (error-based oracle, RARE): where a param drives `include`/file read, use `php://filter/convert.base64-encode/resource=index.php` to dump source, or `convert.iconv.*` chains (`php_filter_chain_generator`) to leak bytes under an error oracle. See ${CLAUDE_PLUGIN_ROOT}/payloads/injection.md and `code-injection`.
5. **LFI → source**: file-driven params (`?page=`, `?template=`, `?file=`) with filter wrappers or `../` to read `.php`/`.config` source.
## Modern / rare techniques
- **Apache confusion (Orange Tsai)**: filename/handler/doc-root confusion can return `.php` source instead of running it → `tech-misconfig`.
- **Editor artifacts**: `.vscode/`, `.idea/`, `*.php.save-failed`, `nohup.out`.
- **Template/engine source** via SSTI read primitives when direct read is blocked.
## Bypass / evasion
Encoding/case tricks and wrapper chaining to defeat extension/handler filters; see ${CLAUDE_PLUGIN_ROOT}/payloads/waf-bypass.md.
## Escalation / chaining
Recovered source → `secrets-disclosure`, `database-enumeration` (creds), targeted `web-sqli`/`code-injection`/`web-deserialization` from exact code, `idor`/`business-logic` from logic review. Overlaps `script-source-control` (VCS dumps) and `exposed-files`.
## Backend & tooling
Kali/HexStrike (ffuf/curl/`php_filter_chain_generator`). Burp Repeater for handler/encoding fuzzing.
## Verification (background, before reporting)
Re-fetch and confirm the response is genuine server source (not client JS or an error page); diff against expected execution output to prove it's raw code. Validate any recovered secret safely.
## Evidence
URL + method of disclosure, source excerpt (redact secrets), what it reveals, impact + remediation (block dotfiles/backups/`.map` in prod, disable dangerous wrappers, fix handler mappings).