You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ExploitCraft edited this page May 5, 2026
·
1 revision
Development
Everything you need to contribute to ReconNinja — setup, project structure, code style, adding phases, and the test policy.
Dev Setup
git clone https://github.com/ExploitCraft/ReconNinja.git
cd ReconNinja
chmod +x install.sh && ./install.sh
# Run the full test suite
python3 -m pytest tests/ -v
# Or with unittest
python3 -m unittest discover -s tests -v
Project Structure
ReconNinja/
├── reconninja.py # Entry point — CLI parsing + interactive mode
├── info/
│ ├── version # Single source of truth for the version string
│ └── __init__.py # Exposes __version__
├── core/
│ ├── orchestrator.py # Phase pipeline engine — the brain
│ ├── ports.py # RustScan, AsyncTCP, Masscan, Nmap
│ ├── subdomains.py # Passive recon
│ ├── web.py # httpx, WhatWeb, Nikto, dir scan
│ ├── vuln.py # Nuclei, screenshots
│ ├── ai_analysis.py # Groq / Ollama / Gemini / OpenAI
│ ├── ai_enhanced.py # Consensus mode, attack paths, remediation
│ ├── resume.py # Checkpoint save / load
│ ├── updater.py # Self-update from GitHub
│ └── ... # One file per module (cors_scan, jwt_scan, etc.)
├── output/
│ ├── report_html.py # Dark-mode HTML report generator
│ ├── reports.py # JSON + Markdown report generators
│ ├── sarif_export.py # SARIF 2.1.0 exporter
│ └── integrations.py # PDF, Jira, GitHub Issues, SIEM
├── utils/
│ ├── models.py # All dataclasses — ScanConfig, ReconResult, etc.
│ ├── helpers.py # Shared utility functions
│ ├── logger.py # Rich terminal logger
│ ├── notify.py # Webhook notifications
│ └── parser.py # Argparse wrapper
├── gui/
│ └── app.py # Flask GUI application
├── plugins/ # Drop .py plugins here
└── tests/ # Full test suite
Versioning
Version is stored in info/version (plain text, one line). All source files import from info:
frominfoimport__version__
To cut a release: edit info/version, commit, tag.
Code Style
Python 3.10+ — use match/case, X | Y unions
Type hints on all function signatures
Dataclasses for all data — no raw dicts passed between modules
safe_print() not print() — respects the thread lock in concurrent phases
log.warning() / log.debug() for non-critical messages
No bare except: — always catch specific exceptions
No hardcoded paths — use pathlib.Path throughout
Imports at top of file — no inline imports except inside if TYPE_CHECKING:
Adding a New Phase
Implement logic in a new core/my_module.py
Add a phase name to the Phase enum in utils/models.py
Add the result field to ReconResult in utils/models.py
Add the config flag to ScanConfig in utils/models.py
Add the CLI flag to parse_args() in reconninja.py
Wire the phase into core/orchestrator.py with the standard skip guard:
ifcfg.run_my_phaseand"my_phase"notinresult.phases_completed:
console.print(Panel.fit("[phase] PHASE N — My Phase [/]"))
# ... do work ...result.my_phase_results=my_module.run(target, out_folder, cfg)
result.phases_completed.append("my_phase")
save_state(result, cfg, out_folder)
elif"my_phase"inresult.phases_completed:
safe_print("[dim]Phase N — My Phase: already completed, skipping[/]")
Add resume support to core/resume.py (_dict_to_config and _dict_to_result)
Write tests in tests/test_orchestrator.py
Adding a New AI Provider
Add an entry to the PROVIDERS dict in core/ai_analysis.py:
Every code change ships with tests. No exceptions.
# Full suite
python3 -m pytest tests/ -v
# Specific file
python3 -m pytest tests/test_orchestrator.py -v
# Specific test
python3 -m pytest tests/test_orchestrator.py::TestPhaseSkipLogic::test_rustscan -v
Test File Ownership
File
What to test here
tests/test_models.py
New fields on ScanConfig, ReconResult, etc.
tests/test_resume.py
Changes to core/resume.py
tests/test_orchestrator.py
Changes to core/orchestrator.py
tests/test_ports.py
Changes to core/ports.py
tests/test_cve_lookup.py
Changes to core/cve_lookup.py
tests/test_ai_analysis.py
Changes to core/ai_analysis.py
tests/test_report_html.py
Changes to output/report_html.py
Submitting a Pull Request
Fork the repo and create a branch: git checkout -b fix/my-fix
Make your changes following the code style above
Write tests — all passing
Update README.md if you added features or changed flags
Open a PR against main
PR title format:
fix: what was broken and how you fixed it
feat: what new capability was added
test: what coverage was added
docs: what documentation was updated
What We Accept
Bug fixes with regression tests
New scan phases (core/ module + orchestrator wiring)
New report formats (output/)
New AI providers
Plugin contributions (plugins/)
Test improvements
Documentation fixes
What We Reject
Features with no tests
Changes that break existing tests
Code that enables unauthorized scanning
Hardcoded credentials or API keys
Changes to the plugin contract without updating CONTRIBUTING.md
Security Issues in ReconNinja Itself
Open a private GitHub security advisory — do not open a public issue.
Related
Plugin-System — writing plugins (fastest way to extend ReconNinja)