Skip to main content

ArcanaAI PTA - AI-Powered Penetration Testing Agent

Project description

๐Ÿ”’ Penetration Testing Claude Skill

Production-grade penetration testing automation powered by Claude AI

Version License Python

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:

  1. Never run dynamic testing against production environments
  2. Always validate target environment before active testing
  3. Use rate limiting to prevent service disruption
  4. Maintain audit logs of all testing activities
  5. 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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arcanaai_pta-1.0.0.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arcanaai_pta-1.0.0-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

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

Hashes for arcanaai_pta-1.0.0.tar.gz
Algorithm Hash digest
SHA256 81aad4013576a1cf90368a360ec48bb97bc266cf1566ecb4fb07ff4725daafd9
MD5 a4dfd6309b7684d2afa68b6d6c5f627a
BLAKE2b-256 2332d640ed328b8f25645435dd752bc1bfc00d5179f38ca29eb50ecf1547f8cb

See more details on using hashes here.

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

Hashes for arcanaai_pta-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1107fa7126ab381ebd2facb5ebd5c387def75c62fdabd30b3b818cf065633527
MD5 d0a42d06f5330fafe31806fc96a722c8
BLAKE2b-256 f107cf3565466f21c74fe8eef2bb670bef30835388b336d4e22c9f82469b49c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page