Skip to content

Repository files navigation

NetSentinel

NetSentinel is a modular network vulnerability scanner developed in Python to demonstrate the fundamental stages of network reconnaissance and basic security analysis.

The project follows a modular architecture where each component is responsible for a single task. Instead of placing the entire scanning logic inside one large script, the scanner is divided into independent modules that communicate with one another. This design makes the application easier to understand, maintain, debug, and extend.

The objective of NetSentinel is not simply to scan a network, but to demonstrate how a vulnerability scanner can be designed using software engineering principles.


Project Architecture

                    User Input
                         │
                         ▼
                 Host Discovery
                         │
                         ▼
                  Live Host List
                         │
                         ▼
                   Port Scanner
                         │
                         ▼
           Open Ports & Services
                         │
                         ▼
            Vulnerability Checker
                         │
                         ▼
              Security Findings
                         │
                         ▼
                Report Generator
                         │
                         ▼
                   JSON Report

Every stage receives the output of the previous module, processes it, and passes structured data to the next stage.

No module performs another module's responsibility.


Design Philosophy

NetSentinel follows a modular architecture based on the Single Responsibility Principle.

Each module is responsible for one specific task.

Module Responsibility
host_discovery.py Discovers live hosts on the network
port_scanner.py Scans ports and identifies running services
vulnerability_checker.py Analyzes detected services for common security risks
report_generator.py Exports scan results as a JSON report
scanner.py Coordinates every module and controls the scanning workflow

Because every module performs only one responsibility, changes to one component have minimal impact on the rest of the project.


Scanner Workflow

The scanner follows five sequential stages.

Stage 1 — Host Discovery

The scanning process begins by identifying live hosts on the target network.

Host discovery performs a ping scan to determine which systems are currently reachable. Offline systems are ignored, ensuring that subsequent scans only target active devices.

The module returns a list containing every discovered IP address.

Example

[
    "192.168.1.10",
    "192.168.1.15"
]

Stage 2 — Port Scanning

Every discovered host is passed to the Port Scanner.

For each host, NetSentinel identifies open TCP ports and gathers additional service information.

Each detected service contains

  • Port Number
  • Transport Protocol
  • Service Name
  • Version Information

Example

{
    80: {
        "protocol": "tcp",
        "service": "http",
        "version": "Apache 2.4.49"
    },
    3306: {
        "protocol": "tcp",
        "service": "mysql",
        "version": "MySQL 8.0"
    }
}

Instead of printing information immediately, the Port Scanner returns structured data to the next module.


Stage 3 — Vulnerability Analysis

The Vulnerability Checker receives the discovered services from the Port Scanner.

Instead of searching online vulnerability databases, NetSentinel performs rule-based analysis using an internal risk database.

If a detected service exists inside the database, the scanner generates a security finding.

Each finding contains

  • Port
  • Protocol
  • Service
  • Severity
  • Risk Description
  • Recommendation

Example

{
    "port": 80,
    "protocol": "tcp",
    "service": "http",
    "severity": "Medium",
    "reason": "HTTP traffic is transmitted without encryption.",
    "recommendation": "Enable HTTPS."
}

The module returns a list of findings instead of directly displaying them.

This separation allows the findings to be reused by different reporting formats in the future.


Stage 4 — Report Generation

After every host has been scanned, the collected information is passed to the Report Generator.

The Report Generator has only one responsibility:

Export the complete scan into a structured JSON document.

The report contains

  • Scan Timestamp
  • Target
  • Hosts
  • Open Ports
  • Security Findings

Because the reporting system is isolated from the scanning logic, additional formats such as HTML or PDF can be implemented without modifying the scanner itself.


Data Flow

The modules communicate through Python dictionaries and lists.

Host Discovery
        │
        ▼
list[hosts]
        │
        ▼
Port Scanner
        │
        ▼
dict[ports]
        │
        ▼
Vulnerability Checker
        │
        ▼
list[findings]
        │
        ▼
Report Generator

Every module receives structured input and produces structured output.

This keeps the code independent and easy to extend.


Why Modular Architecture?

Separating the scanner into independent modules provides several advantages.

  • Easier debugging
  • Better code readability
  • Independent testing of each component
  • Simplified maintenance
  • Reusable modules
  • Easier feature expansion

Future functionality such as UDP scanning, OS detection, CVE lookup, HTML reporting, banner grabbing, or multi-threading can be added without redesigning the existing architecture.


Current Capabilities

NetSentinel currently supports

  • Live host discovery
  • TCP port scanning
  • Service identification
  • Basic vulnerability assessment
  • JSON report generation
  • Modular software architecture

Future Scope

The project has been intentionally designed so that additional modules can be integrated with minimal modification.

Planned improvements include

  • UDP Port Scanning
  • Banner Grabbing
  • CVE Database Integration
  • Service Fingerprinting
  • OS Detection
  • Multi-threaded Scanning
  • HTML Reports
  • PDF Reports
  • Graphical Dashboard

License

This project is licensed under the MIT License.

About

A modular Python-based network vulnerability scanner for host discovery, port scanning, service detection, and JSON report generation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages