Skip to content
Back to skills

Pentest

ASecurity

Static-analysis penetration test: map the attack surface, trace untrusted input to dangerous sinks, and report exploitable flaws with proof-of-concept inputs and fix code. Triggers: pentest, find exploitable vulnerabilities, attack surface review.

  • 25 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added May 29, 2026
ai-agentsrustgojavarubyphpshellsqlexpressdockeraws

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 27, 2026

npx -y skills add tinh2/skills-hub-registry --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/tinh2-pentest/badge)](https://www.skillsdirectory.com/skills/tinh2-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: "Static-analysis penetration test: map the attack surface, trace untrusted input to dangerous sinks, and report exploitable flaws with proof-of-concept inputs and fix code. Triggers: pentest, find exploitable vulnerabilities, attack surface review."
version: "2.1.0"
category: security
platforms:
  - CLAUDE_CODE
---

Find vulnerabilities an attacker could actually exploit in this codebase, by reading the code. Work through it without stopping to ask.

**Scope:** `$ARGUMENTS` (e.g. "auth module", "API routes"); if empty, the whole project in the working directory.

**Boundaries.** Static analysis only: don't run exploits, send requests to live systems, install tools, or modify code. Redact secrets to their first 4 characters. Every finding cites file:line and states confidence (confirmed reachable vs possible). Check every category below even on small projects, and re-read flagged code in context before reporting, to drop false positives.

## 1. Map the attack surface

Stack, framework, auth mechanism and middleware chain (auth, validation, rate limiting). Every entry point: HTTP routes with methods, WebSocket handlers, CLI commands, queue consumers, webhooks. For each: authenticated or not, which inputs it accepts (body, query, params, headers, files), whether it is privileged. Then trace input from entry to sinks (database, shell, filesystem, HTML, outbound HTTP), noting where validation and escaping happen. Most real findings come from this trace, not from grepping.

## 2. Hunt by category

- **Injection.** SQL built by concatenation, template literals or format strings, including ORM raw methods and dynamic stored-procedure calls. NoSQL operator injection (`$where`, `$ne`, `$regex`, `JSON.parse`d objects in queries), user-controlled Firestore field paths, Redis command strings.
- **XSS and template injection.** Reflected (search terms, error messages, path segments), stored (user content, filenames, inline-served HTML/SVG uploads), DOM sinks (`innerHTML`, `document.write`, `eval`/`Function`, `.html()`, user-controlled `location`/`window.open`), unescaped template output (`dangerouslySetInnerHTML`, `v-html`, `<%- %>`, `| safe`, `{{{ }}}`, `{!! !!}`), server-side template injection.
- **Authentication.** Sensitive or admin routes and WebSockets without auth; JWT algorithm confusion or unchecked expiry; predictable session tokens; reusable or long-lived reset tokens; missing OAuth `state`; no login rate limit or lockout; user enumeration through messages or timing.
- **Authorization.** IDOR (`findById(req.params.id)` without an owner filter), batch endpoints not scoped to the caller, role checks only on reads or only client-side, mass assignment (`Model.update(req.body)` letting callers set `role`, `isAdmin`, `balance`), GraphQL mutations that accept arbitrary fields.
- **Files.** Path traversal (`path.join(base, userInput)` without containment), uploads validated by extension only, no size limit, stored in web-served directories, unsanitized names; dynamic `require`/`import` or template paths from input.
- **Command injection.** `exec`/`shell=True`/`Runtime.exec`/backticks with user data; indirect paths such as env vars, CLI arguments, cron expressions, git branch or repo names.
- **Request forgery.** State-changing endpoints without CSRF protection or `SameSite`, credentialed CORS with broad origins; SSRF via fetched user URLs, webhooks or previews without an allowlist; open redirects (`?next=`, OAuth callbacks).
- **Secrets.** AWS keys (`AKIA[0-9A-Z]{16}`), private keys, hardcoded JWT or OAuth secrets, credentials in connection strings, committed `.env`, secrets in docker-compose, CI config or frontend bundles.
- **Deserialization.** `pickle.loads`, `yaml.load` without SafeLoader, PHP `unserialize`, Java `ObjectInputStream`, Ruby `Marshal.load` on untrusted data; XML parsers with external entities enabled (XXE).

For each finding give: location, severity (injection, command injection and secrets usually Critical; CSRF/SSRF/redirects Medium-High; adjust for reachability), a concrete PoC input or request, the impact, and fix code.

## Output

```
## Penetration Test Report (Code Analysis)
Project / Stack / Scope / Date

### Executive summary
| Category | Critical | High | Medium | Low |
(Injection, XSS, Auth bypass, Authorization, Path traversal/files, Command injection,
 CSRF/SSRF/redirects, Hardcoded secrets, Deserialization, Total)

### Findings (severity order)
#### [SEVERITY] <title>
- Category / Location `path:line` / Confidence
- Description
- Proof of concept (payload or steps)
- Impact
- Fix (code)

### Attack surface
Total routes N, unauthenticated N, accepting input N, reaching dangerous sinks N

### Remediation priority (Critical first, with effort)
```

Suggested follow-ups: `/owasp` for Top 10 coverage, `/dependency-scan` for vulnerable packages, `/secure` after remediation.

## Telemetry

If a memory directory for this project exists under `~/.claude/projects/`, append to its `skill-telemetry.md`:

```
### /pentest — YYYY-MM-DD
- Outcome: SUCCESS | PARTIAL | FAILED
- Bottleneck: <phase that struggled, or none>
- Suggestion: <one-line improvement for /evolve, or none>
```

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 ai-agents →

Comments

Loading comments…

Newsletter

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