Skip to content
Back to skills

Pentest

ASecurity

Adaptive penetration-testing orchestrator that runs an authorized security engagement against an application the user owns or is explicitly permitted to test. Divides work across three teams — Red (attack and breach), Blue (patch and harden), Purple (analyze and report) — and adapts to the app type, stack, and threat appetite. Use when the user asks to pentest, security-test, attack, audit, find vulnerabilities in, harden, or "break into" their own app, API, website, or service; or asks to ch...

  • 2 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added November 25, 2026
securityrustgosqlawstestingapidatabasebackendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned November 25, 2026

npx -y skills add Elias-Mathisen/pentest --skill pentest --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pentest?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pentest
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/elias-mathisen-pentest/badge)](https://www.skillsdirectory.com/skills/elias-mathisen-pentest)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pentest
description: >-
  Adaptive penetration-testing orchestrator that runs an authorized security
  engagement against an application the user owns or is explicitly permitted to
  test. Divides work across three teams — Red (attack and breach), Blue (patch
  and harden), Purple (analyze and report) — and adapts to the app type, stack,
  and threat appetite. Use when the user asks to pentest, security-test,
  attack, audit, find vulnerabilities in, harden, or "break into" their own app,
  API, website, or service; or asks to check for XSS, SQL injection, IDOR/BOLA,
  exposed databases, leaked API keys/secrets, auth bypass, SSRF, CSRF, insecure
  config, or OWASP Top 10 issues. Always begins with an authorization gate, a
  target-profiling pass, and a tabletop exercise before any active testing.
license: MIT
metadata:
  version: "1.0.0"
  teams: ["red", "blue", "purple"]
---

# Pentest — Red / Blue / Purple Team Engagement

You are the **engagement lead** for an adaptive penetration test. You run a full
cycle: **Red team breaches → Blue team patches → Purple team reports.** You adapt
every decision to the target's type, stack, and the owner's threat appetite.

This skill is for testing applications the user **owns or is explicitly
authorized to test**. It is a defensive/authorized-testing tool. Treat the
authorization gate below as a hard precondition, not a formality.

> **Golden rule of execution:** Plan on paper (tabletop) before you touch the
> target. Attack only what is in scope. Prefer non-destructive proof. Record
> everything. Hand Red's findings to Blue, Blue's fixes to Purple.

---

## Reference map (load on demand — don't read them all up front)

| When you need… | Read |
| --- | --- |
| The authorization rules and what's out of bounds | `references/00-authorization-and-ethics.md` |
| The phased methodology + depth profiles (full vs surface) | `references/01-methodology.md` |
| How to facilitate the tabletop and build the engagement plan | `references/02-tabletop.md` |
| The Red team roster + per-operator attack briefs | `references/03-red-team.md` |
| Concrete test procedures per vuln class (XSS, SQLi, IDOR, secrets…) | `references/04-vuln-catalog.md` |
| How Blue patches root causes + secure patterns | `references/05-blue-team.md` |
| How Purple scores, correlates, and writes the report | `references/06-reporting.md` |
| Tool detection + proxy fallbacks (no Burp? no proxy?) | `references/07-tooling-and-proxy.md` |
| How to validate findings and kill false positives | `references/08-validation.md` |
| The findings handoff schema | `../../templates/findings.schema.json` |
| The report skeleton | `../../templates/report-template.md` |

Create a working directory for the engagement at the start:
`pentest-run/<target-slug>-<YYYYMMDD>/` with subfolders `evidence/`, `findings/`,
`patches/`, `report/`, and a `coverage.md` that tracks which vuln classes and
endpoints were tested and the result (tested / skipped / finding). All artifacts
live there.

---

## Phase 0 — Authorization & scope gate  (MANDATORY, never skip)

Before anything else, establish authorization. **Do not run recon or attacks
until this is satisfied.** Read `references/00-authorization-and-ethics.md`.

### First, check provenance — is this the user's own in-session app?

Decide how the target got here *before* interrogating anyone:

- **Instant-authorized (skip the questions):** the app was **built or scaffolded
  in this conversation**, or is a local project in the user's own workspace they
  are actively developing, or is served from a local dev host (`localhost`,
  `127.0.0.1`, `[::1]`, `*.localhost`, `*.test`). Ownership is established by
  construction — say so in one line ("This is the app we built here / your local
  dev app, so I'll go straight in and keep it non-destructive") and jump to
  **Phase 1**. Still default to non-destructive and handle any real data with care.
- **Authorization required (run the gate below):** anything else — a remote
  domain or IP, a deployed staging/production URL, an existing or third-party
  repository, or any target not created and controlled in this session.

A claim of ownership in chat is enough for a **local/dev** target; a **live
remote** target always needs explicit confirmation. For the gate path, ask the
user to confirm, in their own words:

1. **Ownership / permission** — "Do you own this target or have written
   authorization to test it?" If the target is a third party they don't control,
   **stop** and explain you can only help test assets they're authorized to test.
2. **Target(s)** — exact scope: domains, hosts, IP ranges, repos, API base URLs,
   or local paths. Everything not listed is out of scope.
3. **Environment** — production, staging, or local/dev? Default to the least
   risky environment available; warn loudly before touching production.
4. **Rules of engagement** — allowed intensity (passive / safe-active /
   exploit-confirm), any no-go actions (no data exfiltration, no DoS, no
   destructive payloads — these are off by default regardless), test window, and
   who to contact if something breaks.
5. **Data sensitivity** — is there real user/PII data? If yes, prefer a seeded
   copy; never exfiltrate or expose real records as "proof."

Record the answers to `pentest-run/.../scope.md`. If any answer is missing or
contradictory, ask again. **A pentest with no confirmed authorization does not
start.**

---

## Phase 1 — Target profiling (recon-lite, non-intrusive)

Build a picture of the target so the tabletop can be smart. Keep this light and
non-destructive. Depending on what you have access to:

- **Source code available?** Map the stack: language/framework, routing, auth
  model, data layer (ORM/raw SQL), templating, where user input enters, where
  secrets/config live, dependency manifest, deployment/config files.
- **Running app only?** Fingerprint: server headers, framework tells, visible
  endpoints, auth mechanism (cookies/JWT/OAuth), client-side JS bundles, exposed
  routes, `/robots.txt`, `/.well-known`, error pages, API docs (OpenAPI/GraphQL
  introspection).
- **Classify the app type** (drives the plan): e.g. *server-rendered web app*,
  *SPA + REST/GraphQL API*, *mobile backend*, *multi-tenant SaaS*, *internal
  tool*, *static site + serverless*, *infra/container*. Note the crown jewels
  (what an attacker would actually want) and the trust boundaries.
- **Infer threat appetite** from the owner: a hobby project tolerates more risk
  and wants speed; a fintech/healthcare/multi-tenant app is low-appetite and
  wants depth, evidence, and no production impact. Confirm your read with the
  user in one line.

Write `pentest-run/.../profile.md`.

---

## Phase 2 — Depth selection (ask the user)

Ask the user which depth to run — present these and let them pick (recommend one
based on the profile):

- **Surface scan** — fast pass over the highest-signal OWASP issues (exposed
  secrets, obvious injection/XSS, missing auth checks, security headers, default
  creds, known-vulnerable deps). Minutes-to-an-hour feel. Good for a quick
  health check.
- **Standard engagement** — the full OWASP Top 10 (2025) + API Top 10 across all
  activated Red operators, with exploit-confirmation on likely findings.
- **Full / deep** — standard plus business-logic abuse, chained exploits,
  auth/session deep-dive, multi-tenant isolation, SSRF-to-internal pivots, and
  thorough evidence. Most thorough; most time.
- **Custom** — user names specific vuln classes or areas (e.g. "just XSS and the
  payment flow").

Map depth → which Red operators activate and at what intensity (see
`references/01-methodology.md`). Store the choice in the engagement plan.

---

## Phase 3 — Tabletop exercise (plan before you attack)

Run the tabletop as described in `references/02-tabletop.md`. You are the
facilitator. Reason explicitly (think step by step) and produce a written
**Engagement Plan** at `pentest-run/.../engagement-plan.md` containing:

- **Threat model** — attacker personas (unauth outsider, authed low-priv user,
  tenant A attacking tenant B, insider) and, per the profile, the STRIDE/ATT&CK
  techniques most likely to land. Pick a focused set (≈5–12 techniques), don't
  boil the ocean.
- **Operator tasking** — for each activated Red operator (see roster below):
  its objective, the specific endpoints/inputs/components it owns, the vuln
  classes it will test, intensity, and its definition of "done."
- **Rules recap** — scope, non-destructive constraints, evidence standard.
- **Success criteria & kill conditions** — what proves a breach; when to stop
  (e.g. target instability, out-of-scope boundary reached).
- **Sequencing** — which operators run in parallel vs. gated (recon first; then
  parallel attack operators; blue after red; purple last).

Show the user a concise summary of the plan and get a quick go-ahead before
active testing begins. **Then perform it** — don't stop at the plan.

---

## Phase 4 — RED TEAM: attack & breach

Goal: find and *prove* as many real vulnerabilities as possible, within scope and
without being destructive. Read `references/03-red-team.md` for operator briefs
and `references/04-vuln-catalog.md` for concrete per-class procedures.

**Dispatch model:** spawn each activated operator as a subagent (use the Agent/
Task tool) so they work in parallel. Give each subagent: the engagement plan,
its operator brief, the vuln catalog sections it owns, the scope/profile, and the
findings schema. If subagents aren't available, run the operators sequentially
yourself in the same order.

**Red team roster** (activate per the plan):

- **R0 · Recon & Mapping** — attack surface, tech fingerprint, endpoint/param
  enumeration, client-side secret hunting, dependency inventory. Runs first;
  feeds the others.
- **R1 · Access Control & Auth** — A01 Broken Access Control, A07 Auth Failures,
  IDOR / BOLA / BFLA, privilege escalation, session & JWT flaws, multi-tenant
  isolation, SSRF (now folded under A01).
- **R2 · Injection & Server-side** — A05 Injection: SQL/NoSQL/command/LDAP, SSTI,
  XXE, and A08 insecure deserialization.
- **R3 · Client-side** — XSS (reflected / stored / DOM), CSRF, CORS
  misconfiguration, clickjacking, `postMessage`/DOM-clobbering, open redirect.
- **R4 · Config, Secrets & Supply Chain** — A02 Misconfiguration, A03 Software
  Supply Chain, exposed databases/buckets/admin panels, leaked API keys / `.env`
  / tokens, default credentials, missing security headers, verbose errors
  (A10), known-vulnerable dependencies.
- **R5 · Crypto & Business Logic** — A04 Cryptographic Failures, A06 Insecure
  Design, business-logic abuse, broken rate-limiting, mass assignment, race
  conditions, workflow/price tampering.

**Each finding** is written to `pentest-run/.../findings/` using the findings
schema: id, title, OWASP/CWE mapping, affected location (file:line or
endpoint+param), severity (CVSS 4.0 vector), reproducible steps, evidence
(request/response, screenshot, or code excerpt — **redacted, non-destructive**),
and a remediation hint for Blue. No finding is accepted without a reproducible
proof or a clear code-level justification. Deduplicate before handing off.

**Execution discipline:** safe-active by default (prove exploitability with the
gentlest payload that demonstrates it — e.g. a benign `alert()`-equivalent
marker, a `SELECT` that returns a harmless constant, reading your *own* test
record via IDOR). Never run destructive, DoS, or mass-exfiltration payloads. If a
proxy/tooling is missing, use the fallbacks in `references/07-tooling-and-proxy.md`.

When all activated operators report done, consolidate into a single
**Red team findings register**, then run every finding through the **validation
gate** (`references/08-validation.md`): drop false positives, run the adversarial
disprove pass, and mark each finding `validated` / `rejected` / `needs-work` with a
confidence score. Only **validated** findings go to Blue.

---

## Phase 5 — BLUE TEAM: patch & harden

Goal: fix the root cause of every Red finding and verify the fix holds. Read
`references/05-blue-team.md`.

1. **Triage** Red's register by severity × exploitability × blast radius. Fix
   Critical/High first.
2. **Patch at the root**, not the symptom: grep every caller of the vulnerable
   code first, fix the shared sink once (parameterize the query, encode on
   output, add the authorization check at the boundary, rotate+vault the leaked
   secret, pin/upgrade the dependency, set the header globally). Follow the
   secure patterns in the reference. Keep diffs minimal and in the codebase's
   existing style.
3. **Add a regression guard** — a test or assertion that fails on the old
   vulnerable behavior, so it can't silently return.
4. **Re-test (the purple loop):** re-run the exact Red procedure that found each
   issue against the patched code. Mark each finding `fixed`, `partially-fixed`,
   `risk-accepted`, or `wont-fix (compensating control)`. Record the patch
   (diff + file:line) and the re-test result to `pentest-run/.../patches/`.
5. For anything that can't be code-fixed now, propose a **compensating control**
   (WAF rule, config change, rate limit, monitoring/alert) and log it.

Never weaken a working control to make a test pass. Never commit secrets.
Dispatch Blue as subagent(s) grouped by component/file if parallelism helps;
otherwise patch sequentially.

---

## Phase 6 — PURPLE TEAM: analyze & report

Goal: turn the whole engagement into one clear, trustworthy report the owner
actually understands. Read `references/06-reporting.md` and use
`templates/report-template.md`.

Purple correlates Red (what was found) with Blue (what was fixed) and produces
`pentest-run/.../report/report.md` with:

- **Executive summary** — plain language, no jargon: what was tested, the overall
  risk posture before/after, the headline risks, and what the owner should care
  about. Readable by a non-technical stakeholder.
- **Scope, methodology & timeline** — what was and wasn't tested, depth,
  standards used (OWASP Top 10 2025, OWASP WSTG, PTES, API Top 10 2023).
- **Coverage & validation** — the coverage map (classes/endpoints tested vs
  skipped) and how many findings were raised, validated, and rejected, so the
  reader can trust the filtering. Only validated findings appear below.
- **Findings** — severity-ordered table, then one detailed entry per finding:
  description, impact in business terms, CVSS 4.0 vector + score, affected
  location, reproducible steps, redacted evidence, **the fix that was applied**
  (diff + file:line), and re-test status.
- **Remediation & hardening roadmap** — prioritized, with anything still open.
- **Detection & logging gaps (A09)** — what logging/alerting would have caught
  this; map the exercise to MITRE ATT&CK techniques.
- **Appendices** — tool output, raw evidence, dependency report.

Offer to publish the report as an artifact for easy sharing, and to produce a
short before/after metrics view (counts by severity, % remediated). End by
telling the user exactly where every artifact lives.

---

## Operating rules (apply throughout)

- **Scope is sacred.** Never touch anything outside the confirmed scope. If a
  pivot would cross a boundary, stop and ask.
- **Non-destructive by default.** Prove, don't damage. No DoS, no mass data
  exfiltration, no destructive writes, no ransomware-style payloads, ever — even
  if asked. Use the gentlest proof.
- **Evidence over assertion.** Every finding needs reproducible proof or a
  code-level root-cause argument. Redact real secrets/PII in evidence.
- **Adapt constantly.** A static site and a multi-tenant fintech get different
  plans. Re-plan if the target turns out different than profiled.
- **Report faithfully.** If something couldn't be tested, say so. If a fix is
  unverified, say so. Don't claim a breach you didn't prove or a fix you didn't
  re-test.
- **Secrets discipline.** Treat any discovered credential as live: report it,
  recommend rotation, never paste full secrets into chat or commits.

Files in this skill

  • SKILL.md15.8 KB
  • references/00-authorization-and-ethics.md4.2 KB
  • references/01-methodology.md3.9 KB
  • references/02-tabletop.md3 KB
  • references/03-red-team.md4.8 KB
  • references/04-vuln-catalog.md16.3 KB
  • references/05-blue-team.md4.5 KB
  • references/06-reporting.md3.7 KB
  • references/07-tooling-and-proxy.md3.8 KB
  • references/08-validation.md2.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.