Skip to main content
command

penetration-test — Claude Code command: app pentesting

A slash command that runs penetration testing on a web app, API or auth flow and returns a report with fixes.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command security/penetration-test
Open on GitHub

What penetration-test does

The command walks through pentest phases: service discovery, vulnerability assessment, exploitation attempts, authentication checks, API security and infrastructure review. It follows the OWASP Testing Guide and NIST guidelines. The output is a report with an executive summary, findings, risk ratings and a remediation roadmap.

Before testing, it gathers context on its own: listening ports via netstat or lsof, the framework from package.json or requirements.txt, plus counts of routes and auth references under src/. That work needs Read, Bash, Grep and Glob — strip those tools and the reconnaissance steps fail.

The argument picks the target: [target], --web-app, --api, --auth or --full-scan. Point it at your own code and staging environments. Running it against systems you do not own or have written permission to test is not what this is for.

What it helps with

  • check a web app against OWASP Top 10 flaws
  • find broken authentication and session handling
  • test an API for auth bypass and missing rate limits
  • get risk ratings and a fix plan for each finding
  • map the attack surface: open ports and framework version

Example prompts for the agent

  • /penetration-test --web-app
  • /penetration-test --api
  • /penetration-test --full-scan

How to install penetration-test

1claude-code-templates

npx claude-code-templates@latest --command security/penetration-test

2Manually: put the files in place

.claude/commands/penetration-test.md

Call it with /penetration-test. For all projects use ~/.claude/commands/

Questions about penetration-test

How do I install penetration-test in Claude?

Run npx claude-code-templates@latest --command security/penetration-test. It writes the command to .claude/commands/penetration-test.md.

What does penetration-test do?

It runs a phased pentest: reconnaissance, vulnerability assessment, exploitation, authentication testing, API and infrastructure checks. You get a report with risk ratings and remediation steps.

What arguments does the command take?

A target as [target], or one of --web-app, --api, --auth, --full-scan. The flag narrows testing to that area.

Source text

penetration-test.md · MIT
---
allowed-tools: Read, Bash, Grep, Glob
argument-hint: "[target] | --web-app | --api | --auth | --full-scan"
description: Perform penetration testing and vulnerability assessment on application
---

# Penetration Test

Perform penetration testing and vulnerability assessment: **$ARGUMENTS**

## Application Context

- Running services: !`netstat -tlnp 2>/dev/null | grep LISTEN | head -10 || lsof -i -P | grep LISTEN | head -10`
- Web framework: @package.json or @requirements.txt (detect framework and version)
- API endpoints: !`grep -r "route\|endpoint\|@app\\.route\|@RequestMapping" src/ 2>/dev/null | wc -l`
- Authentication: !`grep -r "auth\|login\|jwt\|session" src/ 2>/dev/null | wc -l`

## Task

Conduct systematic penetration testing following ethical hacking methodologies:

**Test Target**: Use $ARGUMENTS to focus on web application, API, authentication, or comprehensive testing

**Testing Phases**:
1. **Reconnaissance** - Service discovery, technology fingerprinting, attack surface mapping
2. **Vulnerability Assessment** - OWASP Top 10, injection flaws, broken authentication
3. **Exploitation Testing** - XSS, CSRF, SQL injection, privilege escalation attempts
4. **Authentication Testing** - Brute force, session management, authorization bypasses
5. **API Security Testing** - Input validation, rate limiting, authentication bypass
6. **Infrastructure Testing** - Network security, container security, configuration issues

**Testing Methodology**:
- Follow OWASP Testing Guide and NIST guidelines
- Use both automated tools and manual testing techniques
- Document all findings with proof-of-concept examples
- Provide remediation recommendations for each vulnerability
- Maintain ethical boundaries and avoid data damage

**Output**: Comprehensive penetration test report with executive summary, detailed findings, risk ratings, and remediation roadmap.

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

Everything for Security →

From the same set205

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor