Skip to content

Latest commit

 

History

History
279 lines (199 loc) · 6.82 KB

File metadata and controls

279 lines (199 loc) · 6.82 KB

Contributing to Batman Security Auditor

First off, thank you for considering contributing to Batman Security Auditor! It's people like you that make this tool better for everyone.

🎯 How Can I Contribute?

Reporting Bugs

Before creating bug reports, please check the existing issues to avoid duplicates. When creating a bug report, include:

  • Use a clear and descriptive title
  • Describe the exact steps to reproduce the problem
  • Provide specific examples (URLs, commands, outputs)
  • Describe the behavior you observed and what you expected
  • Include screenshots if applicable
  • Specify your environment (OS, Python version, etc.)

Suggesting Enhancements

Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:

  • Use a clear and descriptive title
  • Provide a detailed description of the suggested enhancement
  • Explain why this enhancement would be useful to users
  • Provide examples of how it would work

Pull Requests

  1. Fork the repo and create your branch from main
  2. Follow the coding style (see below)
  3. Add tests if you're adding functionality
  4. Update documentation as needed
  5. Ensure tests pass before submitting
  6. Write a clear commit message

🎨 Coding Style

Python Style Guide

  • Follow PEP 8
  • Use 4 spaces for indentation (no tabs)
  • Maximum line length: 100 characters
  • Use type hints where possible
  • Write docstrings for all functions and classes

Example

def check_security_feature(url: str, feature: str) -> Dict[str, Any]:
    """
    Check if a specific security feature is present on a URL.
    
    Args:
        url: The target URL to check
        feature: The security feature to look for
        
    Returns:
        Dict containing the check results with 'present' and 'details' keys
        
    Raises:
        RequestException: If the URL cannot be reached
    """
    # Implementation here
    pass

Code Formatting

We use Black for code formatting:

# Install Black
pip install black

# Format your code
black batman.py

# Check formatting without making changes
black --check batman.py

Linting

We use flake8 for linting:

# Install flake8
pip install flake8

# Run linting
flake8 batman.py --max-line-length=100

🧪 Testing

Running Tests

# Install pytest
pip install pytest pytest-cov

# Run tests
pytest tests/

# Run tests with coverage
pytest --cov=batman tests/

Writing Tests

  • Place test files in the tests/ directory
  • Name test files test_*.py
  • Name test functions test_*
  • Use descriptive test names

Example:

def test_captcha_detection_google_recaptcha():
    """Test that Google reCAPTCHA is correctly detected"""
    auditor = BatmanAuditor()
    result = auditor.detect_captcha("https://example.com")
    assert "Google reCAPTCHA" in result["captcha_types"]

📝 Commit Messages

Format

<type>(<scope>): <subject>

<body>

<footer>

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • test: Adding or updating tests
  • chore: Maintenance tasks

Examples

feat(captcha): add support for FunCaptcha detection

Implemented detection logic for FunCaptcha using pattern matching
on script tags and iframe sources.

Closes #42
fix(ratelimit): handle connection timeout errors

Added proper exception handling for connection timeouts during
rate limit testing to prevent crashes.

Fixes #38

🌟 Feature Development Guidelines

Adding New Security Checks

When adding a new security check:

  1. Create a new method in the BatmanAuditor class
  2. Add a corresponding CLI command
  3. Update the fullscan command to include your check
  4. Add tests for the new functionality
  5. Update the README with usage examples

Example Structure

def check_new_feature(self, url: str) -> Dict:
    """Check for new security feature"""
    self.log(f"Checking new feature for: {url}")
    
    result = {
        "url": url,
        "feature_present": False,
        "details": {}
    }
    
    try:
        # Implementation
        pass
    except Exception as e:
        self.log(f"Error: {str(e)}", "ERROR")
        result["error"] = str(e)
    
    return result

# Add CLI command
@cli.command()
@click.argument('url')
@click.option('--output', '-o', help='Output file')
@click.option('--verbose', '-v', is_flag=True)
def newfeature(url, output, verbose):
    """Check new security feature"""
    auditor = BatmanAuditor(verbose=verbose)
    result = auditor.check_new_feature(url)
    # Handle output...

🎁 Ideas for First-Time Contributors

Good first issues are labeled with good first issue. Here are some ideas:

  • Documentation improvements: Fix typos, improve clarity
  • Add examples: Create example scripts or use cases
  • Improve error messages: Make error messages more helpful
  • Add CAPTCHA types: Support for new CAPTCHA services
  • Expand test coverage: Write tests for existing functionality
  • CLI improvements: Better formatting, colors, or progress indicators

📚 Resources

💬 Communication

  • GitHub Issues: For bug reports and feature requests
  • Pull Requests: For code contributions
  • Discussions: For questions and general discussion

📜 Code of Conduct

Our Pledge

We are committed to providing a welcoming and inclusive environment for everyone, regardless of:

  • Age
  • Body size
  • Disability
  • Ethnicity
  • Gender identity and expression
  • Level of experience
  • Nationality
  • Personal appearance
  • Race
  • Religion
  • Sexual identity and orientation

Our Standards

Examples of behavior that contributes to a positive environment:

  • Using welcoming and inclusive language
  • Being respectful of differing viewpoints
  • Gracefully accepting constructive criticism
  • Focusing on what is best for the community
  • Showing empathy towards other community members

Examples of unacceptable behavior:

  • Trolling, insulting/derogatory comments, and personal attacks
  • Public or private harassment
  • Publishing others' private information without permission
  • Other conduct which could reasonably be considered inappropriate

🙏 Thank You!

Your contributions make Batman Security Auditor better for everyone. We appreciate your time and effort!


Questions? Feel free to ask in the discussions or open an issue!