First off, thank you for considering contributing to Batman Security Auditor! It's people like you that make this tool better for everyone.
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.)
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
- Fork the repo and create your branch from
main - Follow the coding style (see below)
- Add tests if you're adding functionality
- Update documentation as needed
- Ensure tests pass before submitting
- Write a clear commit message
- 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
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
passWe use Black for code formatting:
# Install Black
pip install black
# Format your code
black batman.py
# Check formatting without making changes
black --check batman.pyWe use flake8 for linting:
# Install flake8
pip install flake8
# Run linting
flake8 batman.py --max-line-length=100# Install pytest
pip install pytest pytest-cov
# Run tests
pytest tests/
# Run tests with coverage
pytest --cov=batman 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"]<type>(<scope>): <subject>
<body>
<footer>
- 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
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
When adding a new security check:
- Create a new method in the
BatmanAuditorclass - Add a corresponding CLI command
- Update the
fullscancommand to include your check - Add tests for the new functionality
- Update the README with usage examples
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...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
- GitHub Issues: For bug reports and feature requests
- Pull Requests: For code contributions
- Discussions: For questions and general discussion
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
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
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!