# maruthisarathchandra/port-scanner-and-vulnerability-detection architecture

> Architecture diagram of the GitHub repository maruthisarathchandra/port-scanner-and-vulnerability-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maruthisarathchandra/port-scanner-and-vulnerability-detection
- Repository: https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection

## Overview

This repository contains two command-line TCP port scanners: an interactive sequential version and a configurable threaded version. Both take a target and port range, probe ports, identify open services, and write a text report; the newer version also resolves the host first and optionally grabs banners and writes CSV. Source shows the newer version’s scan and reporting calls; the older version writes its report directly inside its entry point. No README documentation is present.

Main entry points: [`scanner2.0.py`](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py) (Configurable CLI), [`scanner.py`](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner.py) (Interactive CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line Scanning"]
  node_modern_main["Configurable CLI<br/>[scanner2.0.py]"]
  node_legacy_main["Interactive CLI<br/>[scanner.py]"]
end

subgraph group_probe["Probe and Identification"]
  node_resolve["Host Resolution<br/>[scanner2.0.py]"]
  node_modern_probe["Port Probe<br/>[scanner2.0.py]"]
  node_service["Service Lookup<br/>[scanner2.0.py]"]
  node_banner["Banner Grab<br/>[scanner2.0.py]"]
  node_legacy_probe["Port Probe<br/>[scanner.py]"]
end

subgraph group_reports["Scan Reports"]
  node_txt_report["Text Report<br/>[scanner2.0.py]"]
  node_csv_report["CSV Report<br/>[scanner2.0.py]"]
  node_legacy_report["Text Report<br/>[scanner.py]"]
end

node_user(("Operator"))
node_target(("Target Host"))
node_network(("TCP and DNS"))
node_files["Report Files"]

node_user -->|"configures scan"| node_modern_main
node_user -->|"enters scan"| node_legacy_main
node_modern_main -->|"resolves host"| node_resolve
node_resolve -->|"queries DNS"| node_network
node_modern_main -->|"dispatches probes"| node_modern_probe
node_modern_probe -->|"connects TCP"| node_network
node_modern_probe -->|"looks up service"| node_service
node_modern_probe -->|"optionally grabs"| node_banner
node_banner -->|"reads banner"| node_network
node_modern_main -->|"writes report"| node_txt_report
node_modern_main -->|"optionally writes"| node_csv_report
node_txt_report -->|"writes text"| node_files
node_csv_report -->|"writes CSV"| node_files
node_legacy_main -->|"scans sequentially"| node_legacy_probe
node_legacy_probe -->|"connects TCP"| node_network
node_legacy_main -->|"writes results"| node_legacy_report
node_legacy_report -->|"writes text"| node_files

click node_modern_main "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py"
click node_legacy_main "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner.py"
click node_resolve "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py"
click node_modern_probe "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py"
click node_service "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py"
click node_banner "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py"
click node_legacy_probe "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner.py"
click node_txt_report "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py"
click node_csv_report "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py"
click node_legacy_report "https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_modern_main,node_legacy_main toneBlue
class node_resolve,node_modern_probe,node_service,node_banner,node_legacy_probe toneAmber
class node_txt_report,node_csv_report,node_legacy_report toneMint
class node_user,node_target,node_network,node_files toneIndigo
```

## Components

### Command-line Scanning

- [Configurable CLI](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py): `scanner2.0.py`
- [Interactive CLI](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner.py): `scanner.py`

### Probe and Identification

- [Host Resolution](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py): `scanner2.0.py`
- [Port Probe](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py): `scanner2.0.py`
- [Service Lookup](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py): `scanner2.0.py`
- [Banner Grab](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py): `scanner2.0.py`
- [Port Probe](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner.py): `scanner.py`

### Scan Reports

- [Text Report](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py): `scanner2.0.py`
- [CSV Report](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner2.0.py): `scanner2.0.py`
- [Text Report](https://github.com/maruthisarathchandra/port-scanner-and-vulnerability-detection/blob/main/scanner.py): `scanner.py`

### Other components

- **Operator**
- **Target Host**
- **TCP and DNS**
- **Report Files**

## Connections

- Operator → Configurable CLI: configures scan
- Operator → Interactive CLI: enters scan
- Configurable CLI → Host Resolution: resolves host
- Host Resolution → TCP and DNS: queries DNS
- Configurable CLI → Port Probe: dispatches probes
- Port Probe → TCP and DNS: connects TCP
- Port Probe → Service Lookup: looks up service
- Port Probe → Banner Grab: optionally grabs
- Banner Grab → TCP and DNS: reads banner
- Configurable CLI → Text Report: writes report
- Configurable CLI → CSV Report: optionally writes
- Text Report → Report Files: writes text
- CSV Report → Report Files: writes CSV
- Interactive CLI → Port Probe: scans sequentially
- Port Probe → TCP and DNS: connects TCP
- Interactive CLI → Text Report: writes results
- Text Report → Report Files: writes text
