A modular cybersecurity CLI framework written in Python designed for reconnaissance, scanning, vulnerability analysis, and automated attack chains.
The framework provides:
- π’ Beginner Mode: Guided menu-driven interface
- π» Advanced Console Mode: Metasploit-style interactive CLI
- βοΈ Automated Attack Chain: Multi-stage reconnaissance and scanning workflows
- π Attack Graph Visualization: Structural attack surface mapping
- π SQLite Findings Database: Transaction-safe persistence and history tracking
- π Multi-Format Reporting: Text, JSON, and XSS-sanitized HTML report exports
- π‘ Built-in Safety & Scope Enforcement: Strict authorization boundaries and opt-in intrusive testing
Most cybersecurity tools focus on a single capability such as scanning, exploitation, or reconnaissance.
Cyber Framework integrates multiple phases of a penetration testing workflow into a single modular CLI environment, enabling security researchers and students to simulate realistic attack pipelines.
Key objectives of the framework:
- Provide a Metasploit-style learning platform
- Demonstrate attack chain automation with safety boundaries
- Enable modular security tool development with clean contracts
- Provide an interactive penetration testing console with TAB auto-completion
This project is designed for:
- Cybersecurity students
- Ethical hackers
- Security researchers
- Developers building offensive and defensive security tools
- β Beginner Mode (interactive guided menu)
- β Advanced Console Mode (interactive CLI with custom prompt)
- β
Automatic Module Discovery (dynamic loading from
modules/) - β
Automated Multi-stage Attack Chain (
Recon->Scan->Web Scan) - β
Multi-Stage Pipeline Runner (
run pipeline) - β
SQLite Persistent Scan Database (
cyber_framework.db) - β Atomic JSON Results & Session State Storage
- β Real-time Execution Spinners (honest status tracking)
- β¨οΈ TAB command auto-completion
- π§ Syntax-highlighted commands
- π Persistent command history (
data/command_history.txt) - π― Dynamic module prompt (
cyber(recon)>) - π Built-in Manual Viewer (
man <module>)
- π recon: Domain and DNS reconnaissance (
theHarvesterwith native DNS fallback) - π scan: Network port and service scanning (unprivileged
nmapwith native TCP socket scanner fallback) - πΈ web_scan: Web vulnerability and header inspection (
niktowith native HTTP security header inspection fallback) - β‘ exploit: Targeted SQL injection testing (
sqlmap, strictly requiring explicit intrusive authorization) - π§ intelligence: Empirical DNS and network service correlation distinguishing facts from heuristics
- π Attack Graph Generation: Structural graph showing Target -> Port -> Service relationships (
show graph) - π Multi-Format Reporting: Generate text, JSON, or styled HTML reports (
report html) - β± Task Scheduler: Background recurring scans (backed by
apscheduler) - π Distributed Controller: Proof-of-concept socket agent for distributed scans (experimental, disabled by default)
Cyber Framework is designed with explicit defensive controls:
- Target Validation: All targets are strictly validated against injection characters (
;,&,|,`,$,\n) and option injection (leading-or/). - Scope Enforcement: Configured via
config.json. Out-of-scope targets are rejected before executing any network operations. - Opt-in Intrusive Testing: Exploitation actions are never executed automatically in default workflows. Intrusive testing requires explicit authorization (
set intrusive true). - Subprocess Argument Vectors: Subprocess calls avoid shell string interpolation (
shell=False) with fixed timeouts to prevent hangs. - Credential Redaction: Passwords, API tokens, and Basic Auth credentials are automatically scrubbed from runtime logs.
+-------------------+
| main.py |
+---------+---------+
|
+---------+---------+
| |
v v
+---------------+ +---------------+
| Beginner Mode | | Advanced CLI |
+---------------+ +---------------+
| |
+---------+---------+
|
v
+--------------+
| Command |
| Parser |
+-------+------+
|
+------------+-------------+
| |
v v
+---------------+ +---------------+
| Core Engine | | Modules |
+---------------+ +---------------+
| Session State | | recon |
| Scope Policy | | scan |
| Safe Runners | | web_scan |
| Attack Chain | | exploit |
| Pipeline | | intelligence |
| Attack Graph | +---------------+
| Reporting |
| SQLite DB |
+---------------+
Detailed component descriptions are available in docs/architecture.md.
cyber-framework/
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions CI workflow (Python 3.10-3.12)
βββ core/
β βββ advanced_console.py # Rich-enhanced interactive console
β βββ attack_chain.py # Automated attack chain workflow
β βββ attack_graph.py # Attack surface relationship graph
β βββ command_parser.py # CLI command dispatch and parameter parser
β βββ console.py # Base prompt-toolkit console loop
β βββ console_style.py # Console styling and palette tokens
β βββ database.py # SQLite connection, migration, and query layer
β βββ distributed_controller.py # Distributed socket worker controller (experimental)
β βββ intelligence_engine.py # Target profiling & empirical correlation
β βββ logger.py # Log handler with automated secret scrubbing
β βββ man_viewer.py # Terminal manual page reader
β βββ module_info.py # Metadata registry for tools and commands
β βββ module_loader.py # Dynamic module discovery and validation
β βββ os_detection.py # OS environment and privilege detection
β βββ output.py # Styled output panels and terminal banners
β βββ pipeline.py # Multi-stage security assessment pipeline
β βββ progress_engine.py # Real-time status execution spinners
β βββ report.py # Text, JSON, and XSS-safe HTML report generator
β βββ scheduler.py # Background scan job scheduler
β βββ session_manager.py # Session target, scope, and intrusive state
β βββ syntax_highlighter.py # Prompt-toolkit lexer for CLI commands
β βββ tool_detection.py # External binary availability detector
β βββ utils.py # Target validator, scope policy, and safe runner
βββ modules/
β βββ recon.py # OSINT & DNS reconnaissance
β βββ scan.py # Network port and service scanner
β βββ web_scan.py # Web application security inspector
β βββ exploit.py # Targeted SQL injection tester (opt-in)
β βββ intelligence.py # Target intelligence gathering
βββ man/
β βββ attack_chain.man # Manual page for automated attack chain
β βββ exploit.man # Manual page for exploit module
β βββ intelligence.man # Manual page for intelligence module
β βββ recon.man # Manual page for recon module
β βββ scan.man # Manual page for scan module
β βββ web_scan.man # Manual page for web scan module
βββ ui/
β βββ banner.py # Framework startup banner
βββ data/
β βββ results.json # Atomic JSON scan findings repository
β βββ sessions.json # Persistent session cache
β βββ command_history.txt # Shell command history
βββ docs/
β βββ architecture.md # Comprehensive technical architecture
β βββ usage.md # User guide and command reference
βββ tests/ # Automated test suite (84+ pytest tests)
βββ config.json # Active configuration file
βββ config.example.json # Template configuration file
βββ requirements.txt # Production dependencies
βββ requirements-dev.txt # Development & test dependencies
βββ LICENSE # MIT License
βββ README.md # Project overview and documentation
βββ main.py # Framework entry point
- Python: 3.10, 3.11, or 3.12
- Operating System: Linux (Ubuntu, Debian, Kali, Arch) or Windows (10/11)
- Git
git clone https://github.com/Bhuvaneshkumar1/cyber-framework.git
cd cyber-frameworkOn Linux / macOS:
python3 -m venv venv
source venv/bin/activateOn Windows (PowerShell):
python -m venv venv
.\venv\Scripts\Activate.ps1pip install -r requirements.txt(Optional) Install development and testing dependencies:
pip install -r requirements-dev.txtThe framework loads configuration from config.json in the project root:
{
"scope": {
"enforce_scope": true,
"allowed_targets": [
"localhost",
"127.0.0.1",
"::1"
]
},
"safety": {
"allow_intrusive_actions": false,
"subprocess_timeout_seconds": 30
},
"logging": {
"file": "scan.log",
"redact_secrets": true
},
"distributed": {
"enabled": false,
"bind_host": "127.0.0.1",
"bind_port": 9090,
"auth_token": ""
}
}scope.enforce_scope: Whentrue, rejects targets not listed inallowed_targets.safety.allow_intrusive_actions: Global safety switch for intrusive modules.safety.subprocess_timeout_seconds: Maximum execution time per external process call.logging.redact_secrets: Automatically masks passwords and API tokens inscan.log.
Start Cyber Framework:
python main.pyYou will be prompted to select an interface mode:
1. Beginner Mode
2. Advanced Console
Beginner mode provides a menu-driven, guided interface ideal for quick assessments or learning:
- Select Beginner Mode.
- Enter the target (e.g.,
127.0.0.1orexample.com). - Select an operation:
ReconScanWeb ScanExploit(requires confirmation)Attack ChainFull Pipeline
Advanced Console Mode provides an interactive shell with tab auto-completion, command history, and dynamic prompts.
| Command | Arguments | Description |
|---|---|---|
help, ? |
None | Display available console commands |
show modules |
None | List all discovered security modules |
show options |
None | Display active target, module, and safety status |
show info |
[module] |
View tool metadata and usage for a module |
show graph |
None | Visualize the attack surface relationship graph |
show scans |
None | Display recorded scan findings from the database |
use |
<module> |
Select and switch into a specific module context |
set target |
<target> |
Set target domain, IP, CIDR, or URL |
set intrusive |
<true|false> |
Authorize or disable intrusive vulnerability actions |
run |
None | Execute the currently selected module |
run pipeline |
[--exploit] |
Run the multi-stage assessment pipeline |
run attack_chain |
[--exploit] |
Execute automated attack chain workflow |
report |
[txt|json|html] |
Export assessment report to text, JSON, or HTML |
man |
<module> |
View manual page for a module or workflow |
back |
None | Deselect current module and return to main prompt |
clear |
None | Clear terminal screen |
exit, quit |
None | Exit the framework |
cyber> show modules
Available Modules:
- recon
- scan
- web_scan
- exploit
- intelligence
cyber> set target 127.0.0.1
[+] Target set to: 127.0.0.1
cyber> use scan
cyber(scan)> run
[*] Starting scan against 127.0.0.1...
[+] Discovered open port 80/tcp (http)
[+] Discovered open port 443/tcp (https)
[+] Scan findings saved to database.
cyber(scan)> show graph
Target: 127.0.0.1
βββ Port: 80/tcp (http)
βββ Port: 443/tcp (https)
cyber(scan)> report html
[+] HTML report generated successfully: reports/report_127.0.0.1_20261015.html
cyber(scan)> back
cyber> exit
Cyber Framework includes an extensive automated test suite covering target validation, subprocess safety, scope policies, database migrations, atomic I/O, manual pages, and module contracts.
Run the test suite with pytest:
python -m pytest tests -vAll 84+ tests pass across Windows and Linux environments without external tool dependencies.
| Symptom | Cause | Resolution |
|---|---|---|
Target out of scope |
Scope enforcement is active in config.json |
Add the target to scope.allowed_targets or set "enforce_scope": false in config.json for authorized testing. |
Exploit module refused |
Intrusive actions disabled by default | Run set intrusive true in the console or set "allow_intrusive_actions": true in config.json. |
External tool not found |
nmap, theHarvester, nikto, or sqlmap not in PATH |
Install external tools or rely on automatic native Python fallbacks for DNS and TCP port scanning. |
Port scanning permissions |
Raw SYN scans require administrative privileges on some OS | Cyber Framework defaults to unprivileged TCP connect (-sT) scans and native Python socket fallbacks. |
Distributed controller |
Socket worker listener not running | The distributed controller is an experimental proof-of-concept disabled by default. Run locally or configure distributed.enabled and auth_token in config.json. |
This tool is designed strictly for educational purposes and authorized security assessments.
Do NOT use this tool against targets without prior written authorization from the system owners. The authors and contributors assume no liability for misuse or damage caused by this software.
The following capabilities are planned for future major releases:
- Real-time Web UI dashboard
- Async distributed worker node orchestration
- Dynamic CVSS scoring integration
- Automated PDF report exports
This project is licensed under the MIT License. See the LICENSE file for complete details.
Bhuvaneshkumar β Modular Cybersecurity Framework
