Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 Python-Based Vulnerability Scanner

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.


📌 Features

  • 🔎 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

🛠️ Technologies Used

  • Python 3
  • Nmap
  • python-nmap
  • Requests
  • Jinja2 (for future HTML reporting)
  • Colorama

📂 Project Structure

python-vulnerability-scanner/
│
├── scanner.py
├── requirements.txt
├── README.md
│
├── modules/
│   ├── network_scan.py
│   ├── cve_lookup.py
│   ├── report.py
│   └── utils.py
│
├── reports/
│   └── report.json
│
└── screenshots/

⚙️ Installation

1. Clone the repository

git clone https://github.com/YOUR_USERNAME/python-vulnerability-scanner.git

cd python-vulnerability-scanner

2. Install Nmap

Ubuntu/Debian

sudo apt update

sudo apt install nmap

3. Create a Virtual Environment

python3 -m venv venv

Activate it

Linux/macOS

source venv/bin/activate

Windows

venv\Scripts\activate

4. Install Dependencies

pip install -r requirements.txt

📦 Requirements

python-nmap
requests
jinja2
colorama

🚀 Usage

Run the scanner

python scanner.py

Enter the target when prompted

Enter Target IP:

scanme.nmap.org

📄 Sample Output

Enter Target IP: 127.0.0.1 

Scanning ipp CUPS 2.4
Report saved in reports/report.json

📊 Sample JSON Report

[
    {
        "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
    }

📚 How It Works

  1. Accepts a target IP address or hostname.
  2. Performs service and version detection using Nmap (-sV).
  3. Extracts discovered services and software versions.
  4. Queries the NVD API for matching CVEs.
  5. Calculates vulnerability severity using CVSS scores.
  6. Generates a JSON report containing all findings.

📁 Modules

network_scan.py

  • Performs network scanning using Nmap
  • Detects open ports and running services

cve_lookup.py

  • Queries the National Vulnerability Database (NVD)
  • Retrieves matching CVEs and CVSS scores

utils.py

  • Converts CVSS scores into severity levels

report.py

  • Generates and saves the vulnerability report in JSON format

scanner.py

  • Main application
  • Coordinates scanning, CVE lookup, severity calculation, and report generation

🔮 Future Improvements

  • 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

🤝 Contributing

Contributions are welcome.

  1. Fork the repository.
  2. Create a new feature branch.
  3. Commit your changes.
  4. Open a Pull Request.

📜 License

This project is licensed under the MIT License.


👨‍💻 Author

Pritesh Godase

  • Cybersecurity Engineer
  • Python Automation Enthusiast
  • Passionate about Penetration Testing, Threat Detection, and Security Automation

⭐ Support

If you found this project useful, consider giving it a ⭐ on GitHub. It helps others discover the project and supports future improvements.

About

Python-based vulnerability scanner that uses Nmap and the NVD CVE API to identify open ports, detect services, and generate detailed vulnerability reports.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages