- Overview
- Features
- System Requirements
- Installation
- Quick Start
- Usage Guide
- Architecture
- Configuration
- Report Generation
- Troubleshooting
- Disclaimer
- Contributing
- Author
X-Scan is a sophisticated network vulnerability assessment tool designed for security professionals and system administrators. It combines aggressive network reconnaissance with real-time CVE (Common Vulnerabilities and Exposures) analysis from the National Vulnerability Database (NVD). Version 1.1 introduces an optional Auto-Update mechanism that can check for, download, and apply signed updates automatically to keep X-Scan current and secure.
The tool performs three critical phases:
- Network Scanning - Aggressive port scanning with service enumeration
- Data Acquisition - Real-time vulnerability lookup via NVD API
- Intelligent Prioritization - Advanced semantic filtering to identify truly relevant threats
- π Fast & Accurate - Combines Nmap's power with NVD's comprehensive vulnerability database
- π§ Smart Filtering - Semantic analysis eliminates false positives by matching versions and CVSS scores
- π Professional Reports - Generates detailed, actionable security assessments
- π Resilient - Exponential backoff retry logic handles rate limiting and timeouts gracefully
- π¨ User-Friendly - Colorized terminal interface with interactive menus
- SYN Scan (-sS) for stealthy port enumeration with TCP Connect fallback (-sT) on non-privileged systems
- Service Version Detection (-sV) to identify running services and applications
- OS Detection (-O) for comprehensive target profiling
- Flexible Targeting - Single IP addresses or entire CIDR networks
- Default Port Range - Scans ports 1-1000 (configurable)
- NVD API Integration - Direct connection to NIST Vulnerability Database
- Comprehensive CVE Data - CVE IDs, descriptions, CVSS scores, and severity ratings
- CVSS Dual Support - Prioritizes CVSS v3.1, falls back to v2.0 for older vulnerabilities
- Exponential Backoff - Intelligent retry mechanism with configurable retry limits
- Rate Limiting Handling - Graceful management of 429/403 HTTP responses
- Connection Resilience - Timeout detection and automatic reconnection logic
- Version Matching - Semantic analysis to match detected versions with vulnerable versions in CVE descriptions
- CVSS Filtering - Configurable severity thresholds (default: β₯ 7.0 for High/Critical)
- False Positive Reduction - Advanced regex pattern matching for accurate version extraction
- Fallback Logic - Graceful degradation when version parsing fails
- Top 5 Results - Returns the most relevant vulnerabilities for each service
- Detailed Text Reports - Structured, timestamp-named output files
- Executive Summary - Quick overview of risk assessment
- Per-Host Breakdown - Service-by-service vulnerability analysis
- Actionable Recommendations - Specific guidance for remediation
- Methodology Documentation - Complete transparency about assessment approach
- Automatic Updates - Optionally checks for new releases and can perform a secure self-update of the tool.
- Secure Update Channel - Update manifests and packages are verified (signed) before applying.
- Configurable Behavior - Enable/disable automatic updates and control check frequency via configuration.
- Rollback Support - Previous stable versions are retained to allow quick rollback if an update fails.
- Python - 3.8 or higher
- RAM - 512 MB (1 GB recommended)
- Disk Space - 100 MB for dependencies and reports
- Network - Active internet connection for NVD API queries
- β Linux (Recommended for root-required SYN scans)
- β macOS
- β Windows (with Nmap installed)
- β BSD Variants
- Linux/macOS: Root/sudo privileges required for SYN scans (-sS)
- Without root, automatically falls back to TCP Connect scan (-sT)
- Windows: Standard user permissions sufficient (uses TCP Connect by default)
git clone https://github.com/alfanoandrea/X-Scan.git
cd X-Scansudo apt-get update
sudo apt-get install nmap python3-pipsudo yum install nmap python3-pipbrew install nmap python3- Download and install Nmap from nmap.org
- Add Nmap to your system PATH
- Install Python 3 from python.org
pip install -r requirements.txtOr manually:
pip install python-nmap requests packagingpython xscan.pyYou should see the X-Scan banner and main menu.
Auto-Update (v1.1): When run with an active internet connection, X-Scan will optionally check for newer releases and offer to download and apply updates securely. You can disable automatic update checks via configuration (see Configuration section).
python xscan.py
# Select option 1 (Scan Single IP)
# Enter target IP: 192.168.1.1
# Wait for scan and analysis to complete
# Review report in ./scans/ directorypython xscan.py
# Select option 2 (Scan CIDR Network)
# Enter CIDR network: 192.168.1.0/24
# Tool scans all 256 hosts in the rangesudo python xscan.py
# Enables full SYN scan capability for maximum stealth __ __ _____ _____ _____ _____
| | |___| __| | _ | | |
|- -|___|__ | --| | | | |
|__|__| |_____|_____|__|__|_|___|
by alfanowski version: x.x
(1) Scan Single IP
(2) Scan CIDR Network
(3) Check for updates
(X) Exit
>>
- Choose option 1
- Enter target IP in format:
xxx.xxx.xxx.xxx - Press Enter
- Wait for scan completion (typically 30-120 seconds depending on network)
- Tool automatically analyzes results and generates report
- View summary in console and detailed report in
scans/directory
- Choose option 2
- Enter CIDR network in format:
xxx.xxx.xxx.xxx/yy - Press Enter
- Tool scans all hosts in range
- Consolidated report generated for all hosts
Input:
Option: 1
Target IP: 192.168.1.100
Output:
[-] Starting scan on 192.168.1.100...
[+] Scan complete. Found 3 open services on 1 analyzed host(s).
[***] Starting Dynamic Analysis and Prioritization [***]
[>] Analysis: Host 192.168.1.100 | apache version 2.4.29 (Port 80)
[+] Found 2 Prioritized CVEs.
[>] Analysis: Host 192.168.1.100 | OpenSSH version 7.4 (Port 22)
[+] Found 1 Prioritized CVE.
[+] Report successfully generated: scans/xscan-report_20240315_143022.txt
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β X-Scan Architecture β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β [CLI Interface] β
β β β
β [Input Validation] β User enters IP/CIDR β
β β β
β [PHASE 1: SCANNER] β Nmap aggressive scan β
β ββ SYN Scan (-sS) β
β ββ Service Detection (-sV) β
β ββ OS Detection (-O) β
β β β
β [PHASE 2: DATA ACQUISITION] β Query NVD API β
β ββ Product lookup β
β ββ Retry logic with exponential backoff β
β ββ Timeout handling β
β β β
β [PHASE 3: PRIORITIZATION] β Semantic analysis β
β ββ Version matching β
β ββ CVSS filtering β
β ββ False positive reduction β
β β β
β [PHASE 4: REPORTING] β
β ββ Executive summary generation β
β ββ Detailed vulnerability breakdown β
β ββ File output (./scans/) β
β ββ Console summary display β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Terminal color and formatting codes for enhanced readability.
Terminal UI management:
clear()- Cross-platform screen clearingintro()- Animated banner display with optional timing
| Function | Purpose | Input | Output |
|---|---|---|---|
run_aggressive_scan() |
Execute Nmap scan | Target IP/CIDR | Dict with ports_data |
fetch_vulnerabilities() |
Query NVD API | Product name | List of CVEs |
prioritize_vulnerabilities() |
Filter relevant CVEs | Raw CVE list + version | Top 5 relevant CVEs |
analyze_scan_data() |
Full analysis pipeline | Scan results | Complete assessment |
generate_txt_report() |
Create report file | Assessment data | File path |
print_report_summary() |
Display console output | Assessment data | Console output |
userInput() |
CLI menu handler | User input | Target address |
# API Configuration
NVD_API_URL = "https://services.nvd.nist.gov/rest/json/cves/2.0" # NVD endpoint
USER_AGENT = f'X-Scanner/{version}' # API request header
DEFAULT_PORTS = '1-1000' # Port range for scanning
# Resilience Configuration
MAX_RETRIES = 5 # Maximum retry attempts for API calls
API_TIMEOUT = 15 # Seconds before request timeout
# Output
OUTPUT_DIR = 'scans' # Directory for report storageTo scan a different port range, edit line ~34:
DEFAULT_PORTS = '1-65535' # Scan all ports (slow!)To modify API retry behavior, edit line ~40:
MAX_RETRIES = 10 # More retries for unreliable networks
API_TIMEOUT = 30 # Longer timeoutTo change output directory, edit line ~41:
OUTPUT_DIR = '/var/log/xscan_reports'Each scan generates a timestamped text report in the scans/ directory with the format:
xscan-report_YYYYMMDD_HHMMSS.txt
================================================================================
X-SCAN REPORT | TARGET: 192.168.1.100 | DATE: 2024-03-15 14:30:22
TOOL DEVELOPED BY ALFANOWSKI
================================================================================
--- EXECUTIVE SUMMARY ---
STATUS: High/Critical Risk identified on 1 host(s). IMMEDIATE ACTION REQUIRED.
-----------------------------------
#####################
### HOST ANALYZED ### --> 192.168.1.100
#####################
################################################################################
VULNERABLE SERVICE: apache 2.4.29 (Port TCP/80)
################################################################################
[CRITICAL FINDING] CVE ID: CVE-2021-41773 | SEVERITY: HIGH (CVSS: 7.5)
Description: Apache HTTP Server 2.4.41 through 2.4.49 contains an out-of-bounds
write in the mod_auth_digest module which may allow an attacker...
--- RECOMMENDED ACTION: Immediate patching by updating the service to a fixed
version (consult NVD for exact fix version).
================================================================================
METHODOLOGY: Aggressive Nmap Scan (sV) + Dynamic NVD API Analysis with Exponential
Backoff + Version & CVSS Match Prioritization.
DISCLAIMER: This tool provides a risk assessment based on public data. It does
not guarantee the complete absence of vulnerabilities.
================================================================================
Solution:
pip install -r requirements.txt
# or manually:
pip install python-nmap requests packagingCause: Running on Linux without sudo Solution:
sudo python xscan.py # Automatic fallback to TCP Connect if you don't have rootCause: Incorrect IP address format
Solution: Use standard IPv4 notation: 192.168.1.1
For networks: Use CIDR notation: 192.168.1.0/24
Possible Causes:
- Nmap not installed or not in PATH
- Invalid target address
- Firewall blocking port scanning
Solutions:
# Verify Nmap installation
nmap --version
# Test basic scan
nmap 192.168.1.1
# Add Nmap to PATH on Windows (if needed)
# System Properties β Environment Variables β PATH β Add Nmap installation directoryCause: API rate limiting from NVD Solution:
- Tool automatically handles this with exponential backoff
- Consider running scans during off-peak hours
- Check NVD API status at services.nvd.nist.gov
Cause: Network connectivity issues or slow internet Solution:
# Increase API timeout (edit xscan.py line 40)
API_TIMEOUT = 30 # Increased from 15
MAX_RETRIES = 10 # Increased from 5Cause: Output directory permission issue Solution:
# Verify scans directory is writable
ls -la | grep scans
# If needed, create manually
mkdir -p scans
chmod 755 scansCause: Service not recognized by Nmap or version detection failed Solution:
- This is expected behavior for unusual services
- Manual inspection of the scan may reveal more information
- Try running with more aggressive Nmap options (edit DEFAULT_PORTS)
IMPORTANT LEGAL NOTICE:
-
Authorization Required
- Only scan networks and systems you own or have explicit written permission to test
- Unauthorized network scanning may violate laws in your jurisdiction
-
Liability
- X-Scan is provided "as-is" without warranty
- Authors are not responsible for misuse or damages caused by this tool
- Users assume full responsibility for their actions
-
Data Accuracy
- This tool provides risk assessments based on public vulnerability data
- It does not guarantee the complete absence of vulnerabilities
- Results should be interpreted by qualified security professionals
- False positives and false negatives are possible
-
Compliance
- Ensure compliance with:
- GDPR (if EU citizens' data involved)
- HIPAA (healthcare systems)
- PCI-DSS (payment systems)
- CFAA (Computer Fraud and Abuse Act - US)
- Similar regulations in your jurisdiction
- Ensure compliance with:
-
Responsible Disclosure
- If you discover vulnerabilities via this tool, follow responsible disclosure practices
- Report findings to affected organizations through proper channels
Contributions are welcome and encouraged! X-Scan uses a Community License that allows anyone to contribute improvements, bug fixes, and enhancements.
- Fork the repository on GitHub
- Create a feature branch (
git checkout -b feature/your-feature) - Make your changes and improvements
- Test thoroughly before submitting
- Commit with clear messages (
git commit -m 'Add your feature') - Push to your fork (
git push origin feature/your-feature) - Submit a Pull Request to the main repository
- Follow PEP 8 Python style guide
- Add docstrings to new functions and classes
- Include type hints where possible
- Test your code and ensure no regressions
- Update README if adding new features
- Provide clear commit messages and PR descriptions
- Respect the Community License terms
β Bug fixes and patches β Performance improvements β New features and enhancements β Documentation improvements β Code refactoring and cleanup β Security hardening β Test coverage expansion β Integration with other tools
All contributors will be recognized in the project. By contributing, you agree to:
- License your contributions under this Community License
- Accept that your code may be used commercially with proper attribution
- Allow the Creator (alfanowski) to integrate your changes into the main project
- Check existing GitHub Issues
- Start a discussion in GitHub Discussions
- Contact the Creator directly if needed
Community License v1.0 - Owned by alfanowski
X-Scan is distributed under a Community License that balances open-source collaboration with creator ownership.
| Capability | Allowed |
|---|---|
| Use the Software | β Yes |
| Modify & Create Derivatives | β Yes |
| Distribute & Sublicense | β Yes |
| Commercial Use | β Yes |
| Fork on GitHub | β Yes |
| Contribute Improvements | β Yes |
| Reverse Engineer | β Yes |
| Security Research | β Yes |
| SaaS/Cloud Hosting | β Yes |
When using, modifying, or distributing X-Scan, you must:
- Maintain Attribution - Include copyright notice:
Β© 2024-2025 alfanowski - Include License - Distribute this Community License with all copies
- Document Changes - Include a changelog noting your modifications
- Keep it Open - If distributing derivatives, license under this same Community License
- Link Original - Include a link to the original repository
- alfanowski retains ownership of the original X-Scan source code
- The Creator has final say on what gets merged into the main project
- All contributors retain ownership of their contributions
- Contributors grant the Creator a royalty-free license to use their work
- Free to use - No fees, royalties, or compensation required
- Free to modify - Create and distribute derivatives at no cost
- Free to commercialize - Build commercial products using X-Scan
The Community License encourages:
- π΄ Forking and maintaining alternative versions
- π§ Creating and sharing improvements
- π€ Contributing bug fixes and features
- π Publishing research and findings
- πΌ Building commercial products
- π¬ Security research and analysis
See the LICENSE file for complete legal terms.
- Added: Auto-Update mechanism (optional) β secure, signed update checks and automatic apply/rollback support.
- Improved: NVD API resilience and retry behavior.
- Fixed: Several minor parsing and reporting edge cases.
Upgrade notes: After updating to v1.1, review the configuration section to control automatic update behavior and verify access to the update channel if you're running in restricted environments.
alfanowski
- GitHub: @alfanoandrea
- NIST National Vulnerability Database (NVD) for vulnerability data
- Nmap project for outstanding network security tools
- Python community for excellent libraries
Have questions or found a bug?
- π Report Bugs - GitHub Issues
- π‘ Feature Requests - GitHub Discussions
- π§ Security Issues - Contact directly via GitHub (do not use public issues)
- Metasploit Framework - Penetration testing
- OpenVAS - Vulnerability scanner
- Qualys VMDR - Enterprise scanning
- Shodan - Internet search engine for devices