Skip to content

RaheesAhmed/Code-to-Cash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Bug Hunter AI - LangGraph Code-to-Cash System

An autonomous multi-agent AI system built with LangGraph that automatically discovers, analyzes, and reports security vulnerabilities in GitHub repositories to earn bug bounties.

πŸš€ Features

Multi-Agent Architecture

  • Repository Scanner Agent: Automatically discovers GitHub repositories with potential vulnerabilities
  • Vulnerability Analyzer Agent: Performs static code analysis using Semgrep and Bandit
  • Exploit Generator Agent: Creates proof-of-concept exploits for discovered vulnerabilities
  • Report Writer Agent: Generates professional bug bounty reports
  • Submission Agent: Automatically submits reports to bug bounty platforms

Advanced Capabilities

  • πŸ” Automated Repository Discovery: Searches for high-value targets with smart filtering
  • πŸ›‘οΈ Multi-Tool Security Analysis: Integrates Semgrep and Bandit for comprehensive scanning
  • πŸ’° Bounty Estimation: Intelligent bounty value estimation based on vulnerability severity
  • πŸ“ Professional Report Generation: AI-powered bug report writing with industry standards
  • 🎯 Multi-Platform Submission: Supports HackerOne and Bugcrowd platforms
  • πŸ’Ύ State Persistence: LangGraph memory system for session continuity

πŸ› οΈ Prerequisites

Required Tools

  • Python 3.8+
  • Git
  • Semgrep - Static analysis tool
  • Bandit - Python security linter

API Keys Required

  • Anthropic API Key - For Claude AI model
  • GitHub Token - For repository access
  • HackerOne API Token - For bug report submission
  • Bugcrowd API Token - For bug report submission

πŸ“¦ Installation

  1. Clone the repository:

    git clone <your-repo-url>
    cd bounty-agent
  2. Create virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt

    OR

  4. Install external tools:

    pip install langgraph langchain-anthropic github semgrep bandit

βš™οΈ Configuration

  1. Create a .env file in the project root:

    ANTHROPIC_API_KEY=your_anthropic_api_key_here
    GITHUB_TOKEN=your_github_token_here
    HACKERONE_API_TOKEN=your_hackerone_api_token_here
    BUGCROWD_API_TOKEN=your_bugcrowd_api_token_here
  2. Configuration Options:

    • MAX_CONCURRENT_SCANS: Maximum number of concurrent repository scans (default: 5)
    • EARNINGS_THRESHOLD: Minimum estimated bounty value to report (default: $100)

πŸš€ Usage

Basic Usage

python main.py

What Happens When You Run It

  1. Repository Discovery: The system searches GitHub for repositories with potential vulnerabilities
  2. Vulnerability Analysis: Each repository is cloned and analyzed using Semgrep and Bandit
  3. Exploit Generation: AI creates proof-of-concept exploits for discovered vulnerabilities
  4. Report Writing: Professional bug bounty reports are generated
  5. Submission: Reports are automatically submitted to HackerOne and Bugcrowd
  6. Earnings Tracking: The system tracks estimated earnings from submitted reports

πŸ—οΈ System Architecture

LangGraph Workflow

Repository Scanner β†’ Vulnerability Analyzer β†’ Exploit Generator β†’ Report Writer β†’ Submission Agent

State Management

The system maintains state across the workflow including:

  • Current repository being analyzed
  • Scan results and vulnerabilities found
  • Generated exploits and reports
  • Submission status and earnings

πŸ”§ Key Components

Repository Scanner

  • Searches GitHub for repositories with specific criteria
  • Filters by language, stars, and update frequency
  • Prioritizes repositories without security policies

Vulnerability Analyzer

  • Uses Semgrep for general security pattern detection
  • Employs Bandit for Python-specific security issues
  • Focuses on high-impact vulnerability types:
    • SQL Injection
    • Cross-Site Scripting (XSS)
    • Authentication bypasses
    • Input validation issues
    • Cryptographic weaknesses

Exploit Generator

  • Creates non-destructive proof-of-concept exploits
  • Explains attack vectors and impact
  • Provides remediation recommendations

Report Writer

  • Generates professional bug bounty reports
  • Includes executive summary, technical details, and impact assessment
  • Follows industry-standard formats

Submission Agent

  • Automatically submits to multiple platforms
  • Handles API authentication and rate limiting
  • Tracks submission status and responses

πŸ’° Bounty Estimation

The system uses intelligent bounty estimation based on:

  • Vulnerability Severity: Critical ($2000), High ($1000), Medium ($300), Low ($100)
  • Vulnerability Type Multipliers:
    • Remote Code Execution: 3.0x
    • Authentication Bypass: 2.5x
    • SQL Injection: 2.0x
    • Cross-Site Scripting: 1.5x
    • Path Traversal: 1.3x
    • CSRF: 1.2x

πŸ›‘οΈ Security & Ethics

Responsible Disclosure

  • All exploits are proof-of-concept only
  • No destructive actions are performed
  • Follows responsible disclosure practices

Rate Limiting

  • Respects GitHub API rate limits
  • Implements delays between repository scans
  • Limits concurrent operations

πŸ“Š Logging & Monitoring

  • Comprehensive logging of all operations
  • Real-time progress tracking
  • Error logging and recovery
  • Earnings tracking and reporting

πŸ” Troubleshooting

Common Issues

  1. API Rate Limits: Reduce MAX_CONCURRENT_SCANS if hitting rate limits
  2. Missing Dependencies: Ensure Semgrep and Bandit are installed
  3. Authentication Errors: Verify all API tokens are valid
  4. Permission Issues: Ensure proper file system permissions for cloning

Debug Mode

Set logging level to DEBUG in the code:

logging.basicConfig(level=logging.DEBUG)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

βš–οΈ Legal Disclaimer

This tool is for educational and authorized security testing purposes only. Users are responsible for:

  • Obtaining proper authorization before testing
  • Complying with all applicable laws and regulations
  • Following responsible disclosure practices
  • Respecting platform terms of service

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🎯 Future Enhancements

  • Support for additional programming languages
  • Integration with more bug bounty platforms
  • Advanced machine learning for vulnerability prediction
  • Real-time monitoring and alerting
  • Web dashboard for monitoring and control

⚠️ Important Note: This system is designed for authorized security testing only. Always ensure you have proper permission before testing any systems or applications.

About

An autonomous multi-agent AI system built with LangGraph that automatically discovers, analyzes, and reports security vulnerabilities in GitHub repositories to earn bug bounties.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages