A Python-based automated vulnerability scanner that performs network reconnaissance using Nmap, identifies running services and software versions, searches for publicly disclosed CVEs using the National Vulnerability Database (NVD) API, and generates detailed vulnerability reports.
Disclaimer: This tool is intended for educational purposes and authorized security assessments only. Always obtain permission before scanning any network or system.
- 🔎 Scan a target host using Nmap
- 🌐 Detect open ports and running services
- 🏷️ Identify software products and versions
- 🔍 Search for related CVEs using the NVD API
- 🚨 Categorize vulnerabilities by severity (Low, Medium, High, Critical)
- 📄 Generate structured JSON reports
- 🧩 Modular project architecture for easy maintenance and extension
- Python 3
- Nmap
- python-nmap
- Requests
- Jinja2 (for future HTML reporting)
- Colorama
python-vulnerability-scanner/
│
├── scanner.py
├── requirements.txt
├── README.md
│
├── modules/
│ ├── network_scan.py
│ ├── cve_lookup.py
│ ├── report.py
│ └── utils.py
│
├── reports/
│ └── report.json
│
└── screenshots/
git clone https://github.com/YOUR_USERNAME/python-vulnerability-scanner.git
cd python-vulnerability-scannerUbuntu/Debian
sudo apt update
sudo apt install nmappython3 -m venv venvActivate it
Linux/macOS
source venv/bin/activateWindows
venv\Scripts\activatepip install -r requirements.txtpython-nmap
requests
jinja2
colorama
Run the scanner
python scanner.pyEnter the target when prompted
Enter Target IP:
scanme.nmap.org
Enter Target IP: 127.0.0.1
Scanning ipp CUPS 2.4
Report saved in reports/report.json
[
{
"host": "127.0.0.1",
"port": 631,
"service": "ipp",
"product": "CUPS",
"version": "2.4",
"cve": "CVE-2023-32324",
"severity": "High",
"score": 7.5
},
{
"host": "127.0.0.1",
"port": 631,
"service": "ipp",
"product": "CUPS",
"version": "2.4",
"cve": "CVE-2023-34241",
"severity": "Medium",
"score": 5.3
},
{
"host": "127.0.0.1",
"port": 631,
"service": "ipp",
"product": "CUPS",
"version": "2.4",
"cve": "CVE-2023-4504",
"severity": "High",
"score": 7.0
}- Accepts a target IP address or hostname.
- Performs service and version detection using Nmap (
-sV). - Extracts discovered services and software versions.
- Queries the NVD API for matching CVEs.
- Calculates vulnerability severity using CVSS scores.
- Generates a JSON report containing all findings.
- Performs network scanning using Nmap
- Detects open ports and running services
- Queries the National Vulnerability Database (NVD)
- Retrieves matching CVEs and CVSS scores
- Converts CVSS scores into severity levels
- Generates and saves the vulnerability report in JSON format
- Main application
- Coordinates scanning, CVE lookup, severity calculation, and report generation
- HTML report generation
- PDF report export
- CSV report generation
- Multi-threaded scanning
- Progress bar
- Banner grabbing
- Port filtering
- Multiple target support
- Subnet scanning
- Logging
- Docker support
- Unit tests
- GitHub Actions CI/CD
Contributions are welcome.
- Fork the repository.
- Create a new feature branch.
- Commit your changes.
- Open a Pull Request.
This project is licensed under the MIT License.
Pritesh Godase
- Cybersecurity Engineer
- Python Automation Enthusiast
- Passionate about Penetration Testing, Threat Detection, and Security Automation
If you found this project useful, consider giving it a ⭐ on GitHub. It helps others discover the project and supports future improvements.