AI-Powered Cybersecurity Assistant for Security Professionals
CyberSec CLI is a comprehensive, production-ready cybersecurity platform that combines an intelligent command-line interface with a modern web application. It features advanced network scanning capabilities, AI-powered security analysis, and enterprise-grade deployment options with Redis caching, PostgreSQL database, and comprehensive monitoring.
- High-Performance Scanning: 76,260 packets/second with adaptive concurrency control
- Multiple Scan Types: TCP connect, SYN scan, UDP scanning, service detection
- Intelligent Service Detection: Enhanced active probing for accurate service identification
- CVE Enrichment: Automatic vulnerability intelligence integration
- Port Priority System: Smart port prioritization for efficient scanning
- Natural Language Interface: Ask security questions in plain English
- Intelligent Threat Analysis: AI-driven vulnerability assessment and recommendations
- Multi-Provider Support: OpenAI GPT, Anthropic Claude, and local LLM options
- Real-time Security Insights: Context-aware security recommendations
- Interactive CLI: Rich terminal UI with themes, progress bars, and live updates
- Modern Web Interface: Real-time dashboard with WebSocket support
- RESTful API: Comprehensive API with WebSocket streaming
- Mobile Responsive: Optimized for desktop and mobile devices
- Redis Integration: Intelligent caching and job queuing with automatic fallback
- PostgreSQL Database: Scalable data storage with migration support
- Rate Limiting: Advanced abuse protection with sliding window algorithms
- Monitoring & Metrics: Prometheus integration with Grafana dashboards
- Docker Deployment: Production-ready containerized deployment
| Metric | CyberSec CLI | Nmap | Masscan | RustScan |
|---|---|---|---|---|
| Scanning Speed | 76,260 p/s | ~10-100 p/s | 10M+ p/s | Very Fast |
| Accuracy (F1) | 1.0 | High | Low | Medium |
| Adaptive Logic | Yes (ML-driven) | Limited | No | Partial |
| Resource Efficiency | ~0.5% CPU / 45MB | Medium | High | Low |
- Python 3.10 or higher
- Docker & Docker Compose (for containerized deployment)
- Redis (optional, for enhanced performance)
- PostgreSQL (optional, for production deployments)
# Clone the repository
git clone https://github.com/Yash7256/cybersec-cli.git
cd cybersec-cli
# Run the quick start script
bash scripts/quickstart.sh
# Configure your environment
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
# Start the CLI
python -m cybersec_cli# Clone and setup
git clone https://github.com/Yash7256/cybersec-cli.git
cd cybersec-cli
cp .env.example .env
# Configure environment variables
nano .env
# Add your OPENAI_API_KEY and other settings
# Start the full stack
docker-compose up -d
# Access the web interface
open http://localhost:8000# Install from PyPI (when available)
pip install cybersec-cli
# Or install from source
pip install -e .# Start the interactive shell
cybersec
# Show help
help
# Basic network scan
scan example.com
# Advanced scanning options
scan 192.168.1.1-254 --ports 1-1000 --service-detection --cve-enrichment
# AI-powered security analysis
ask "What are the security implications of an open SSH port?"
# Generate security report
report example.com --format pdf --export-path ./reports/Access the modern web dashboard at http://localhost:8000:
- Real-time Scanning: Live scan progress with Server-Sent Events
- Historical Analysis: Scan history and trend analysis
- API Access: Comprehensive REST API with interactive documentation
- Export Capabilities: Multiple formats (JSON, CSV, PDF, XML)
# Start a scan via API
curl -X POST "http://localhost:8000/api/scan" \
-H "Content-Type: application/json" \
-d '{"target": "example.com", "ports": "1-1000"}'
# Stream scan results in real-time
curl "http://localhost:8000/api/scan/stream?target=example.com"Create a .env file in the project root:
# Required for AI features
OPENAI_API_KEY=sk-your-openai-api-key
# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/cybersec
REDIS_URL=redis://localhost:6379
# Scanning Configuration
ADAPTIVE_SCANNING=true
MAX_CONCURRENCY=100
DEFAULT_TIMEOUT=3.0
# Security
SECRET_KEY=your-secret-key-here
WEBSOCKET_API_KEY=your-websocket-api-key
# Rate Limiting
RATE_LIMIT_ENABLED=true
CLIENT_RATE_LIMIT=10
TARGET_RATE_LIMIT=50The application uses a hierarchical configuration system:
- Environment Variables (highest priority)
- Configuration File:
~/.cybersec/config.yaml - Default Values (lowest priority)
Example config.yaml:
ai:
provider: "openai"
model: "gpt-4"
temperature: 0.7
scanning:
default_timeout: 3
max_threads: 50
adaptive_scanning: true
enhanced_service_detection: true
ui:
theme: "matrix"
show_banner: true
color_output: true
output:
default_format: "table"
save_results: true
export_path: "./reports/"The docker-compose.yml includes:
- Redis: Caching and job queuing
- PostgreSQL: Primary database
- CyberSec Web: Main application
- Celery Worker: Background task processing
- Nginx: Reverse proxy and SSL termination
- Prometheus: Metrics collection
- Grafana: Visualization dashboard
# Scale the workers
docker-compose up -d --scale celery-worker=4
# View logs
docker-compose logs -f cybersec-web
# Monitor metrics
open http://localhost:3000 # Grafana
open http://localhost:9090 # Prometheus- User Guide - Complete CLI and web interface usage
- API Documentation - RESTful API and WebSocket interface
- Deployment Guide - Docker, Kubernetes, and cloud deployment
- Configuration Guide - Advanced configuration options
- Redis Integration - Caching and performance optimization
- Security Best Practices - Security configuration and hardening
- Performance Tuning - Optimization and benchmarking
- Troubleshooting - Common issues and solutions
- CLI Examples - Practical command-line examples
- API Examples - Code samples and integration guides
- Deployment Scripts - Automation and deployment scripts
# Run all tests
pytest
# Run with coverage
pytest --cov=cybersec_cli --cov-report=html
# Run specific test categories
pytest -m unit # Unit tests only
pytest -m integration # Integration tests only
pytest -m slow # Include slow tests# Run performance benchmarks
python tests/benchmarking/run_all_benchmarks.py
# Generate comparison reports
python tests/benchmarking/tools/generate_report.pyWe welcome contributions! Please see our Contributing Guidelines for details.
# Clone the repository
git clone https://github.com/Yash7256/cybersec-cli.git
cd cybersec-cli
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run the development server
python -m cybersec_cli --debug- Linting:
flake8 src/ - Formatting:
black src/ - Type Checking:
mypy src/ - Security:
bandit -r src/
cybersec-cli/
βββ src/cybersec_cli/ # Main application code
β βββ commands/ # CLI command implementations
β βββ tools/ # Security tools and scanners
β βββ analysis/ # Security analysis modules
β βββ ai/ # AI integration
β βββ core/ # Core functionality
β βββ utils/ # Utility functions
β βββ ui/ # User interface components
βββ web/ # Web application
β βββ routes/ # API endpoints
β βββ static/ # Static assets
βββ api/ # API-specific code
βββ tasks/ # Background tasks (Celery)
βββ scripts/ # Deployment and utility scripts
βββ docs/ # Documentation
βββ tests/ # Test suite
βββ monitoring/ # Monitoring configuration
βββ systemd/ # Systemd service files
This tool is designed for authorized security testing and educational purposes only. Users are responsible for:
- Legal Compliance: Ensure you have proper authorization before scanning
- Responsible Usage: Use only on networks you own or have permission to test
- Data Privacy: Handle scan results according to applicable regulations
For security concerns, see our Security Policy.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ using Python, FastAPI, and modern web technologies
- Inspired by industry-standard tools like Nmap, Masscan, and security best practices
- Powered by OpenAI and other amazing AI providers
- Community contributions and feedback
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
Empowering security professionals with intelligent tools
