A comprehensive security assessment tool that leverages artificial intelligence to detect vulnerabilities, misconfigurations, and security risks across networks, web applications, containers, and cloud infrastructure.
- Multiple AI Model Support: Integrates with OpenAI, Google Gemini, and local ML models
- Ensemble Learning: Combines results from multiple AI models for enhanced accuracy
- False Positive Reduction: AI-powered verification of findings to minimize false positives
- Pattern Recognition: Machine learning for identifying complex attack patterns
- Context-Aware Analysis: Understands system context for more accurate risk assessment
- Resilient Operation: Gracefully handles missing API keys or quota limitations, continuing with reduced functionality
- AI Service Failover: Automatically switches between AI providers if one becomes unavailable
- Port Scanning: Advanced port scanning with service detection
- Vulnerability Detection: CVE matching and exploit identification
- Service Fingerprinting: Detailed service and version detection
- Network Mapping: Visual representation of network topology
- Protocol Analysis: Detection of insecure protocols and configurations
- Dynamic Analysis: Runtime security testing of web applications
- Vulnerability Testing:
- SQL Injection detection
- Cross-Site Scripting (XSS) detection
- Security header analysis
- Form submission testing
- API Security: Testing of REST and GraphQL endpoints
- Authentication Testing: Detection of authentication vulnerabilities
- Session Management: Analysis of session handling security
- Image Scanning: Deep analysis of container images
- Vulnerability Detection: CVE scanning in container components
- Configuration Analysis: Detection of container misconfigurations
- Secret Detection: Identification of exposed secrets in containers
- Compliance Checking: Verification against security standards
- Base Image Analysis: Security assessment of base images
- Layer Analysis: Security scanning of each container layer
- Multi-Cloud Support:
- Amazon Web Services (AWS)
- Microsoft Azure
- Google Cloud Platform (GCP)
- Resource Assessment:
- Infrastructure scanning
- Service configuration analysis
- Security group analysis
- Identity and Access Management:
- IAM policy review
- Permission analysis
- Role configuration assessment
- Network Security:
- VPC configuration review
- Network ACL analysis
- Firewall rule assessment
- Compliance:
- Regulatory compliance checking
- Security standards verification
- Best practice validation
- Enhanced HTML Reports: Beautiful, interactive HTML reports with improved visualization
- Multi-language Support: Reports available in English and other languages
- AI Analysis Section: Dedicated sections for AI-generated security insights
- Visualizations:
- Vulnerability severity distribution
- Attack surface mapping
- Risk trends over time
- Remediation Guidance: AI-generated fix recommendations
- CVSS Scoring: Detailed risk scoring for findings
- Export Options: PDF, HTML, and JSON formats
- Custom Templates: Configurable report templates with failover options
- Adaptive Layout: Reports adapt to available visualization libraries
- Clone the repository:
git clone https://github.com/THE-RZ1-x/Ai_Vuln_Scanner.git
cd Ai_Vuln_Scanner- Install dependencies:
pip install -r requirements.txt- Configure environment variables:
cp .env.example .env
# Edit .env with your API keys and credentials
# Note: The scanner will function with missing API keys, but with reduced capabilitiesThe easiest way to use the scanner is through the graphical interface:
python run_gui.pyThis will launch the GUI interface where you can:
- Configure scan settings
- Run scans against various targets
- Generate exploits for identified vulnerabilities
- View and manage scan reports
- Configure API keys and settings
python ai_vuln_scanner.py -t target_ip -s basicpython ai_vuln_scanner.py -t target_ip -s comprehensivepython ai_vuln_scanner.py -t image_name -s container
# or
python ai_vuln_scanner.py -t image_name --container# Scan all configured cloud providers
python ai_vuln_scanner.py -t cloud -s cloud
# Scan specific providers
python ai_vuln_scanner.py -t cloud -s cloud --cloud-providers aws azure
# Scan single provider
python ai_vuln_scanner.py -t aws -s cloudThe project is organized into the following directories:
src/: Core Python modulesscanner.py: Main scanning engineweb_scanner.py: Web application scanning modulecloud_scanner.py: Cloud infrastructure scanning modulecontainer_scanner.py: Container scanning moduleexploit_generator.py: Exploit generation modulereport_generator.py: Report generation modulegui_scanner.py: GUI interface module
utils/: Utility scriptsdependency_checker.py: Checks and installs required dependenciestest_exploit_gen.py: Test exploit generation utility
docs/: Documentationscans/: Output directory for scan results
The scanner includes automatic dependency management to ensure all required packages are installed:
- Automatic Checking: The scanner checks for required dependencies on startup
- Interactive Installation: Missing dependencies can be installed with a single click
- Graceful Degradation: The scanner will function with reduced capabilities if optional dependencies are missing
- Manual Installation: Dependencies can be installed manually with:
python utils/dependency_checker.py --install
The scanner uses several API keys to enhance its capabilities, but is designed to function even when some or all keys are missing:
- Vulners API: Used for vulnerability database lookups
- Shodan API: Used for external reconnaissance
- Gemini API: Used for AI-powered analysis
- OpenAI API: Used for AI-powered analysis
When API keys are missing or quota is exceeded, the scanner will:
- Notify you about which keys are missing or limited
- Continue operation with reduced functionality
- Use offline analysis methods where possible
- Switch to alternative AI providers when available
- Provide clear indications of limitations in the scan results
This resilient design ensures the scanner remains useful in environments with limited API access.
If you encounter issues with OpenAI analysis not appearing in reports:
- Check API Key: Verify your OpenAI API key in the
.envfile - Quota Limitations: OpenAI has usage quotas - check if you've exceeded your limit
- Error Messages: Look for error messages in the console output containing:
OpenAI API quota exceededinsufficient_quotaRateLimitError
- Fallback to Gemini: The scanner will automatically use Gemini AI if OpenAI is unavailable
If charts or visualizations are not appearing in reports:
- Check Dependencies: Ensure Plotly, Matplotlib and NetworkX are installed
- Console Warnings: Look for warnings about missing visualization libraries
- Fallback Modes: The scanner has multiple fallback options for visualizations
If reports display incorrectly:
- Web Connectivity: Some report templates require internet access for CDN resources
- Template Levels: The scanner selects the best available template based on your system capabilities
- Default Browser: Try opening the report in different browsers
- Check CSS: Verify that style elements are loading correctly
python ai_vuln_scanner.py [-h] -t TARGET [-s {basic,comprehensive,container,cloud}] [-v] [-o OUTPUT] [--container] [--cloud-providers {aws,azure,gcp} [{aws,azure,gcp} ...]] [--gui]-t, --target: Specify the target to scan- For network scans: IP address or hostname (e.g.,
192.168.1.1orexample.com) - For container scans: Container image name (e.g.,
nginx:latestorubuntu:20.04) - For cloud scans: Use
cloudor specific provider name (aws,azure,gcp)
- For network scans: IP address or hostname (e.g.,
-s, --scan-type: Choose the type of scan to performbasic(default): Quick scan of essential security checkscomprehensive: In-depth security assessmentcontainer: Container-specific security scancloud: Cloud infrastructure security scan
-v, --verbose: Enable detailed output for debugging-o, --output: Specify custom output file name (without extension)--container: Flag to treat target as a container image--cloud-providers: Specify which cloud providers to scan (when using cloud scan type)--gui: Launch the graphical user interface
- Organized codebase into logical directories (src, utils, docs)
- Cleaner file organization for better maintainability
- Standardized module interfaces
- Modern cybersecurity-themed interface
- Improved threading for better responsiveness
- Added About dialog with license and author information
- Automatic dependency checking and installation
- Better handling of missing dependencies
- Support for both required and optional packages
- Multi-language support (English and others)
- Better visualization with interactive charts
- Improved template selection based on system capabilities
- Added convenient launcher scripts (run_gui.py, run_gui.bat)
- Unified command-line interface through ai_vuln_scanner.py
- Better error handling and user feedback
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
RHAZOUANE SALAH-EDDINE
- GitHub: https://github.com/THE-RZ1-x
- Repository: https://github.com/THE-RZ1-x/Ai_Vuln_Scanner
