ArcanaAI PTA - AI-Powered Penetration Testing Agent
Project description
๐ Penetration Testing Claude Skill
Production-grade penetration testing automation powered by Claude AI
Overview
The Penetration Testing Claude Skill is a comprehensive security assessment tool that combines Static Application Security Testing (SAST), dynamic attack simulation, and enterprise-grade reporting to automate penetration testing workflows.
Built on Claude's advanced semantic code understanding, this Skill goes beyond simple pattern matching to identify complex vulnerabilities across code, infrastructure, and application layers.
Key Features
- ๐ Semantic SAST Analysis - Deep code understanding using Claude's AI
- ๐ฏ OWASP Top 10 Coverage - Comprehensive vulnerability detection
- ๐ CI/CD Integration - Seamless GitHub Actions workflows
- ๐ Enterprise Reporting - Professional HTML/PDF/JSON reports
- ๐ Attack Chain Detection - Identify multi-step exploitation paths
- โ False Positive Filtering - Context-aware noise reduction
- ๐ก๏ธ Dynamic Testing (Phase 2) - Active vulnerability confirmation
Quick Start
Installation
# Clone the repository
git clone https://github.com/yourusername/pentesting-skill.git
cd pentesting-skill
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
export ANTHROPIC_API_KEY="your-api-key"
Basic Usage
1. Run SAST Analysis
from handlers.sast_analyzer import SASTAnalyzer
analyzer = SASTAnalyzer()
findings = analyzer.analyze_codebase(
repo_path="./my-project",
scope="full_codebase"
)
# Export results
analyzer.export_findings(findings, "findings.json", format="json")
2. Generate Security Report
from handlers.report_generator import ReportGenerator
report_gen = ReportGenerator(organization_context={
"name": "Your Company",
"application": "My Application"
})
report_path = report_gen.generate_report(
findings=findings,
format="html"
)
print(f"Report generated: {report_path}")
3. GitHub Actions Integration
Add to .github/workflows/security.yml:
name: Security Scan
on:
pull_request:
branches: [main]
jobs:
pentest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Security Assessment
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
python -m handlers.sast_analyzer \
--scope changed_files \
--output findings.json
Architecture
pentesting-skill/
โโโ SKILL.md # Skill manifest
โโโ instructions/ # Analysis instructions for Claude
โ โโโ security-review.md # SAST guidelines
โ โโโ dynamic-testing.md # Active testing protocols
โ โโโ attack-vectors.md # Attack taxonomy
โ โโโ reporting.md # Report generation
โ โโโ orchestration.md # Workflow coordination
โโโ handlers/ # Core Python modules
โ โโโ sast_analyzer.py # Static analysis engine
โ โโโ report_generator.py # Report generation
โ โโโ finding_aggregator.py # Finding deduplication
โ โโโ payload_generator.py # Attack payload creation
โ โโโ dynamic_executor.py # Dynamic testing (Phase 2)
โโโ resources/ # Configuration & templates
โ โโโ attack_vectors.json # Vulnerability taxonomy
โ โโโ severity_matrix.json # CVSS scoring matrix
โ โโโ false_positive_filters.txt
โ โโโ report_templates/
โโโ tests/ # Test suite
โโโ .github/workflows/ # CI/CD workflows
Vulnerability Coverage
OWASP Top 10 2021
โ A01:2021 - Broken Access Control
- IDOR (Insecure Direct Object References)
- Path Traversal
- Missing Authorization
โ A02:2021 - Cryptographic Failures
- Weak Algorithms (MD5, SHA1, DES)
- Hardcoded Secrets
- Insufficient Key Length
โ A03:2021 - Injection
- SQL Injection
- NoSQL Injection
- Command Injection
- LDAP/XPath Injection
โ A04:2021 - Insecure Design
- Business Logic Flaws
- Race Conditions
โ A05:2021 - Security Misconfiguration
- Debug Mode Enabled
- Default Credentials
- CORS Misconfiguration
- Missing Security Headers
โ A06:2021 - Vulnerable Components
- Outdated Dependencies
- Known CVEs
โ A07:2021 - Authentication Failures
- Weak Password Hashing
- Predictable Session Tokens
- Missing Rate Limiting
โ A08:2021 - Integrity Failures
- Insecure Deserialization
- CI/CD Pipeline Vulnerabilities
โ A09:2021 - Logging Failures
- Insufficient Logging
- Sensitive Data in Logs
โ A10:2021 - SSRF
- Server-Side Request Forgery
- Cloud Metadata Access
Additional Coverage
- Cross-Site Scripting (XSS) - Reflected, Stored, DOM-based
- XML External Entities (XXE)
- CSRF (Cross-Site Request Forgery)
- Open Redirect
- Clickjacking
- Information Disclosure
Configuration
Custom Security Policies
Create .security/pen-test-policies.json:
{
"severity_threshold": "medium",
"scan_scope": "changed_files",
"false_positive_filters": true,
"custom_rules": [
{
"id": "CUSTOM-001",
"pattern": "hardcoded_api_key",
"severity": "critical",
"message": "API keys must be in environment variables"
}
],
"excluded_paths": [
"tests/",
"vendor/",
"node_modules/"
],
"compliance_frameworks": ["OWASP", "PCI-DSS", "NIST"]
}
Environment Variables
# Required
ANTHROPIC_API_KEY=your-claude-api-key
# Optional
PENTEST_ENVIRONMENT=staging # Target environment
PENTEST_MAX_RPS=2 # Rate limit for dynamic testing
PENTEST_TIMEOUT=30 # Timeout in seconds
PENTEST_HALT_ON_ERROR=true # Stop on service disruption
Report Formats
JSON (Machine-readable)
{
"report_metadata": {
"report_id": "PENTEST-2025-001",
"date": "2025-10-31T14:30:00Z",
"scope": "Customer Portal v2.3.1"
},
"findings": [
{
"id": "FIND-001",
"severity": "CRITICAL",
"category": "SQL Injection",
"cvss_score": 9.8,
"file": "api/auth.py",
"line": 42,
"description": "...",
"remediation": "..."
}
]
}
HTML (Professional Report)
- Executive summary
- Severity distribution charts
- Detailed findings with code snippets
- Remediation guidance
- Compliance mapping
PDF (Executive Distribution)
- Print-ready format
- One-page executive summary
- Technical appendices
Testing
# Run unit tests
python -m pytest tests/
# Test SAST analyzer
python -m pytest tests/test_sast.py -v
# Test finding aggregator
python -m pytest tests/test_finding_aggregator.py -v
# Test with vulnerable code fixtures
python -m pytest tests/ --fixtures
CI/CD Integration
Pull Request Scanning
Automatically scans changed files on every PR:
on:
pull_request:
branches: [main]
jobs:
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run SAST
run: python -m handlers.sast_analyzer --scope changed_files
Scheduled Full Scans
Weekly comprehensive security assessment:
on:
schedule:
- cron: '0 2 * * 1' # Every Monday at 2 AM
jobs:
full-scan:
runs-on: ubuntu-latest
steps:
- name: Comprehensive Security Scan
run: python -m handlers.sast_analyzer --scope full_codebase
Roadmap
Phase 1: MVP (Weeks 1-4) โ
- SAST analysis with Claude
- GitHub Actions integration
- JSON/HTML reporting
- False positive filtering
Phase 2: Advanced Analysis (Weeks 5-8)
- Infrastructure-as-Code scanning (Terraform, K8s)
- Dependency vulnerability analysis
- API security assessment
- Business logic flaw detection
Phase 3: Dynamic Testing (Weeks 9-14)
- Payload generation engine
- Sandboxed attack execution
- Multi-step attack chains
- Vulnerability confirmation
Phase 4: Enterprise Features (Weeks 15-20)
- PDF report generation
- CVSS v3.1 scoring
- Jira/GitHub issue integration
- Compliance mapping (PCI-DSS, HIPAA, SOC2)
- Multi-assessment trending
Security & Safety
โ ๏ธ Important Safety Guidelines:
- Never run dynamic testing against production environments
- Always validate target environment before active testing
- Use rate limiting to prevent service disruption
- Maintain audit logs of all testing activities
- Obtain proper authorization before conducting penetration tests
Dynamic Testing Safety Controls
- Environment Validation: Blocks testing on production domains
- Circuit Breaker: Halts testing after repeated failures
- Rate Limiting: Maximum 2 requests/second (configurable)
- Audit Logging: Comprehensive testing activity logs
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Development Setup
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/ -v
# Run linter
pylint handlers/
# Format code
black handlers/ tests/
License
MIT License - see LICENSE file for details.
Support
- Documentation: docs/
- Issues: GitHub Issues
- Security: security@example.com
- Discord: Join our community
Acknowledgments
- Built on Claude by Anthropic
- Inspired by the open-source security community
- OWASP for vulnerability classifications
- CWE/SANS for security standards
โ ๏ธ Disclaimer: This tool is for authorized security testing only. Ensure you have proper authorization before conducting penetration tests. The authors are not responsible for misuse of this tool.
Made with โค๏ธ by the Security Engineering Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arcanaai_pta-1.0.0.tar.gz.
File metadata
- Download URL: arcanaai_pta-1.0.0.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81aad4013576a1cf90368a360ec48bb97bc266cf1566ecb4fb07ff4725daafd9
|
|
| MD5 |
a4dfd6309b7684d2afa68b6d6c5f627a
|
|
| BLAKE2b-256 |
2332d640ed328b8f25645435dd752bc1bfc00d5179f38ca29eb50ecf1547f8cb
|
File details
Details for the file arcanaai_pta-1.0.0-py3-none-any.whl.
File metadata
- Download URL: arcanaai_pta-1.0.0-py3-none-any.whl
- Upload date:
- Size: 35.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1107fa7126ab381ebd2facb5ebd5c387def75c62fdabd30b3b818cf065633527
|
|
| MD5 |
d0a42d06f5330fafe31806fc96a722c8
|
|
| BLAKE2b-256 |
f107cf3565466f21c74fe8eef2bb670bef30835388b336d4e22c9f82469b49c4
|