pentest-toolkit
AI-Powered Security Testing Toolkit - Professional penetration testing scripts for discovering vulnerabilities, analyzing application structure, and generating context-aware security tests. All scripts return structured JSON for agent consumption.
What this skill does
# AI-Powered Security Testing Toolkit
A comprehensive penetration testing skill designed specifically for AI agents. This toolkit provides specialized scripts that perform intelligent security assessments and return structured JSON output for agent consumption. All scripts are designed for automated execution without human interaction.
## ๐ AI Agent Scripts
All scripts are located in the `scripts/` directory and return structured JSON output.
### Discovery Scripts
#### `discover_structure.py`
**Purpose**: Blindly discovers API structure, data models, and business logic without source code access.
**Usage**:
```bash
uv run python scripts/discover_structure.py <TARGET_URL>
```
**Returns JSON**:
```json
{
"base_url": "string",
"discovered_endpoints": [...],
"data_models": {...},
"business_entities": [...],
"authentication_patterns": {...},
"technologies": [...],
"vulnerability_indicators": [...]
}
```
**Key Features**:
- Automatic endpoint enumeration
- Data model inference from responses
- Business entity identification
- Authentication pattern mapping
- Technology stack detection
#### `enumerate_endpoints.py`
**Purpose**: Fast endpoint enumeration for quick attack surface mapping.
**Usage**:
```bash
uv run python scripts/enumerate_endpoints.py <TARGET_URL>
```
**Returns JSON**:
```json
{
"endpoints": [
{
"url": "string",
"method": "string",
"status_code": "number",
"content_type": "string",
"parameters": [...]
}
],
"total_found": "number"
}
```
#### `scan_ports.py`
**Purpose**: Network port scanning for service discovery.
**Usage**:
```bash
uv run python scripts/scan_ports.py <TARGET_IP>
```
**Returns JSON**:
```json
{
"target": "string",
"open_ports": [
{
"port": "number",
"service": "string",
"version": "string"
}
],
"scan_time": "string"
}
```
### Analysis Scripts
#### `analyze_responses.py`
**Purpose**: Extracts security-relevant patterns and relationships from HTTP responses.
**Usage**:
```bash
uv run python scripts/analyze_responses.py <RESPONSES_FILE>
```
**Input**: JSON file with HTTP responses
**Returns JSON**:
```json
{
"patterns": {
"data_relationships": [...],
"business_logic_flaws": [...],
"authentication_bypasses": [...]
},
"recommendations": [...]
}
```
**Key Features**:
- Pattern recognition in response structures
- Data relationship mapping
- Business logic vulnerability identification
- Security control gaps detection
### Test Generation Scripts
#### `generate_context_tests.py`
**Purpose**: Creates targeted security tests based on discovered application structure and patterns.
**Usage**:
```bash
uv run python scripts/generate_context_tests.py <STRUCTURE_FILE> <PATTERNS_FILE>
```
**Returns JSON**:
```json
{
"test_scenarios": [
{
"id": "string",
"name": "string",
"category": "string",
"risk_level": "HIGH|MEDIUM|LOW",
"target_endpoints": ["string"],
"test_cases": [...]
}
]
}
```
**Key Features**:
- Context-aware test generation
- Business logic focused testing
- Application-specific payloads
- Risk-based test prioritization
### Vulnerability Testing Scripts
#### `test_sql_injection.py`
**Purpose**: Comprehensive SQL injection testing with multiple techniques.
**Usage**:
```bash
uv run python scripts/test_sql_injection.py <TARGET_URL>
```
**Returns JSON**:
```json
{
"vulnerabilities": [
{
"type": "SQL_INJECTION",
"location": "string",
"payload": "string",
"evidence": "string",
"severity": "CRITICAL|HIGH|MEDIUM|LOW"
}
],
"tested_endpoints": ["string"]
}
```
**Techniques**:
- Union-based injection
- Boolean-based blind injection
- Time-based blind injection
- Error-based injection
#### `test_xss.py`
**Purpose**: Cross-site scripting vulnerability detection.
**Usage**:
```bash
uv run python scripts/test_xss.py <TARGET_URL>
```
**Returns JSON**:
```json
{
"xss_vulnerabilities": [
{
"type": "REFLECTED|STORED|DOM",
"location": "string",
"payload": "string",
"context": "string",
"severity": "HIGH|MEDIUM|LOW"
}
]
}
```
#### `comprehensive_test.py`
**Purpose**: Runs all vulnerability tests in a coordinated manner.
**Usage**:
```bash
uv run python scripts/comprehensive_test.py <TARGET_URL>
```
**Returns JSON**:
```json
{
"assessment_summary": {
"target": "string",
"start_time": "string",
"end_time": "string",
"total_vulnerabilities": "number"
},
"vulnerabilities_by_category": {...}
}
```
### Report Generation Scripts
#### `generate_report.py`
**Purpose**: Generates security reports from test results.
**Usage**:
```bash
uv run python scripts/generate_report.py <RESULTS_FILE>
```
**Outputs**:
- `security_report.md` - Human-readable report
- `security_report.json` - Machine-readable findings
## ๐ฏ AI Agent Workflows
### Standard Security Assessment
```bash
# Step 1: Discover application structure
uv run python scripts/discover_structure.py https://target.com > structure.json
# Step 2: Analyze responses for patterns
uv run python scripts/analyze_responses.py structure.json > patterns.json
# Step 3: Generate targeted tests
uv run python scripts/generate_context_tests.py structure.json patterns.json > tests.json
# Step 4: Execute vulnerability tests
uv run python scripts/comprehensive_test.py https://target.com > vuln_results.json
# Step 5: Generate final report
uv run python scripts/generate_report.py vuln_results.json
```
### API Security Testing
```bash
# Focus on API endpoints
uv run python scripts/discover_structure.py https://api.target.com > api_structure.json
# Test for API-specific vulnerabilities
uv run python scripts/test_sql_injection.py https://api.target.com/users
uv run python scripts/test_xss.py https://api.target.com/search
# Analyze API responses
uv run python scripts/analyze_responses.py api_responses.json
```
### Business Logic Testing
```bash
# Discover business entities and relationships
uv run python scripts/discover_structure.py https://app.target.com > app_structure.json
# Generate business logic tests
uv run python scripts/generate_context_tests.py app_structure.json patterns.json > business_tests.json
# Execute with focus on authorization and workflow abuse
```
## ๐ Knowledge Base
### Pattern Libraries
Located in `patterns/` directory:
#### `business_logic.json`
Contains vulnerability patterns for:
- Authorization bypasses
- State manipulation
- Workflow circumvention
- Race conditions
- Resource abuse
#### `data_relationships.json`
Contains patterns for:
- Insecure direct object references
- Foreign key manipulation
- Junction table abuse
- Hierarchical relationship attacks
### Using Patterns with Agents
```python
# Load business logic patterns
with open('patterns/business_logic.json', 'r') as f:
business_patterns = json.load(f)
# Generate tests based on discovered structure + patterns
# This creates context-aware tests for the specific application
```
## ๐ง Script Execution Requirements
### Critical: UV Usage
All scripts MUST use `uv run python` for proper dependency management:
```bash
# Correct
uv run python scripts/discover_structure.py https://target.com
# Incorrect - will fail
python scripts/discover_structure.py https://target.com
```
### Input/Output Format
All scripts follow these conventions:
- **Input**: Command-line arguments or JSON files
- **Output**: Structured JSON to stdout
- **No prompts**: All scripts run non-interactively
- **Error handling**: Structured error messages in JSON
### Error Format
```json
{
"success": false,
"error_type": "NETWORK_ERROR|VALIDATION_ERROR|SECURITY_ERROR",
"message": "string",
"context": {}
}
```
## ๐ฏ Agent Integration Examples
### Claude Skill Integration
```bash
# Claude will automatically discover and use these scripts
skill: "pentest-toolkit"
# Claude can execute:
uv run python scripts/discover_structure.py {{TARGET_URL}}
```
##Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts โ single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score โฅ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.