# ghosttroops/scan4all architecture

> Architecture diagram of the GitHub repository ghosttroops/scan4all, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ghosttroops/scan4all
- Repository: https://github.com/ghosttroops/scan4all

## Overview

scan4all is an automated multi-target security scanner. The main workflow accepts targets and scan options, performs port discovery, follows with HTTP probing and fingerprinting, then runs web checks and vulnerability tests before reporting findings. Other documented capabilities include subdomain enumeration, credential auditing, sensitive-file fuzzing, request-smuggling checks, crawler support, and configurable result storage. Source excerpts establish the startup, port-scan, event-dispatch, and selected PoC relationships; several additional branches are documented in the README but their wiring was not sampled.

Main entry points: [`pocs_go/go_poc_check.go`](https://github.com/ghosttroops/scan4all/blob/main/pocs_go/go_poc_check.go) (Go vulnerability checks), [`lib/api/main.go`](https://github.com/ghosttroops/scan4all/blob/main/lib/api/main.go) (Scan API), [`pkg/httpx/runner/runner.go`](https://github.com/ghosttroops/scan4all/blob/main/pkg/httpx/runner/runner.go) (HTTP probing), [`brute/filefuzz.go`](https://github.com/ghosttroops/scan4all/blob/main/brute/filefuzz.go) (Sensitive-file fuzz)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Scan entry"]
  node_cli["CLI startup<br/>[main.go]"]
  node_api["Scan API<br/>[main.go]"]
  node_engine["Event engine<br/>[engineImp.go]"]
end

subgraph group_discovery["Target discovery"]
  node_domain["Subdomain enum<br/>[domain.go]"]
  node_subfinder["Subfinder adapter<br/>[subfinder.go]"]
  node_portscan["Port discovery<br/>[runner.go]"]
  node_nmap["Nmap integration<br/>[nmapScan.go]"]
end

subgraph group_web["Web assessment"]
  node_httpx["HTTP probing<br/>[runner.go]"]
  node_fingerprint["Web fingerprinting<br/>[fingerScan.go]"]
  node_crawler["Web crawler<br/>[crawlergo.go]"]
  node_filefuzz["Sensitive-file fuzz<br/>[filefuzz.go]"]
  node_webscan["Web checks<br/>[webScanUrls.go]"]
end

subgraph group_checks["Security checks"]
  node_hydra["Service auditing<br/>[runner.go]"]
  node_gopoc["Go vulnerability checks<br/>[go_poc_check.go]"]
  node_yamlpoc["YAML PoC checks<br/>[check.go]"]
  node_smuggling["HTTP smuggling<br/>[CheckSmuggling.go]"]
  node_log4j["Log4j checks<br/>[check.go]"]
  node_jndi["JNDI listener<br/>[server.go]"]
end

subgraph group_results["Results and state"]
  node_storage[("Scan storage<br/>[db.go]")]
  node_output["Scan output<br/>[sv2es.go]"]
end

node_operator(("Operator"))
node_target(("Target services"))
node_elasticsearch[("Elasticsearch")]

node_operator -->|"starts"| node_cli
node_cli -->|"starts scan"| node_api
node_api -->|"runs enumeration"| node_portscan
node_api -->|"imports Nmap results"| node_hydra
node_api -->|"runs HTTP probing"| node_httpx
node_portscan -.->|"scans ports"| node_target
node_api -.->|"supports Nmap input"| node_nmap
node_domain -->|"uses enumeration"| node_subfinder
node_domain -.->|"resolves targets"| node_target
node_httpx -.->|"probes HTTP"| node_target
node_httpx -.->|"fingerprints services"| node_fingerprint
node_httpx -.->|"crawls sites"| node_crawler
node_engine -->|"dispatches checks"| node_gopoc
node_gopoc -->|"calls fuzzing"| node_filefuzz
node_engine -.->|"dispatches checks"| node_yamlpoc
node_webscan -.->|"checks pages"| node_target
node_filefuzz -->|"requests paths"| node_target
node_hydra -.->|"audits credentials"| node_target
node_gopoc -->|"tests vulnerabilities"| node_target
node_gopoc -.->|"runs Log4j checks"| node_log4j
node_log4j -.->|"uses callback listener"| node_jndi
node_gopoc -.->|"supports smuggling checks"| node_smuggling
node_gopoc -->|"emits findings"| node_output
node_output -.->|"stores results"| node_elasticsearch
node_filefuzz -->|"reports findings"| node_output
node_webscan -.->|"uses shared state"| node_storage

click node_cli "https://github.com/ghosttroops/scan4all/blob/main/main.go"
click node_api "https://github.com/ghosttroops/scan4all/blob/main/lib/api/main.go"
click node_engine "https://github.com/ghosttroops/scan4all/blob/main/engine/engineImp.go"
click node_domain "https://github.com/ghosttroops/scan4all/blob/main/pkg/domain.go"
click node_subfinder "https://github.com/ghosttroops/scan4all/blob/main/projectdiscovery/subfinder/subfinder.go"
click node_portscan "https://github.com/ghosttroops/scan4all/blob/main/pkg/naabu/v2/pkg/runner/runner.go"
click node_nmap "https://github.com/ghosttroops/scan4all/blob/main/pkg/portScan/nmapScan.go"
click node_hydra "https://github.com/ghosttroops/scan4all/blob/main/pkg/hydra/runner.go"
click node_httpx "https://github.com/ghosttroops/scan4all/blob/main/pkg/httpx/runner/runner.go"
click node_fingerprint "https://github.com/ghosttroops/scan4all/blob/main/pkg/fingerprint/fingerScan.go"
click node_crawler "https://github.com/ghosttroops/scan4all/blob/main/lib/crawlergo/crawlergo.go"
click node_filefuzz "https://github.com/ghosttroops/scan4all/blob/main/brute/filefuzz.go"
click node_webscan "https://github.com/ghosttroops/scan4all/blob/main/webScan/webScanUrls.go"
click node_gopoc "https://github.com/ghosttroops/scan4all/blob/main/pocs_go/go_poc_check.go"
click node_yamlpoc "https://github.com/ghosttroops/scan4all/blob/main/pocs_yml/check/check.go"
click node_smuggling "https://github.com/ghosttroops/scan4all/blob/main/lib/Smuggling/CheckSmuggling.go"
click node_log4j "https://github.com/ghosttroops/scan4all/blob/main/pocs_go/log4j/check.go"
click node_jndi "https://github.com/ghosttroops/scan4all/blob/main/pkg/jndi/server.go"
click node_storage "https://github.com/ghosttroops/scan4all/blob/main/lib/util/db.go"
click node_output "https://github.com/ghosttroops/scan4all/blob/main/lib/util/sv2es.go"

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_cli,node_api,node_engine toneBlue
class node_domain,node_subfinder,node_portscan,node_nmap,node_elasticsearch toneAmber
class node_httpx,node_fingerprint,node_crawler,node_filefuzz,node_webscan toneMint
class node_hydra,node_gopoc,node_yamlpoc,node_smuggling,node_log4j,node_jndi toneRose
class node_storage,node_output,node_operator,node_target toneIndigo
```

## Components

### Scan entry

- [CLI startup](https://github.com/ghosttroops/scan4all/blob/main/main.go): `main.go`
- [Scan API](https://github.com/ghosttroops/scan4all/blob/main/lib/api/main.go): `lib/api/main.go`
- [Event engine](https://github.com/ghosttroops/scan4all/blob/main/engine/engineImp.go): `engine/engineImp.go`

### Target discovery

- [Subdomain enum](https://github.com/ghosttroops/scan4all/blob/main/pkg/domain.go): `pkg/domain.go`
- [Subfinder adapter](https://github.com/ghosttroops/scan4all/blob/main/projectdiscovery/subfinder/subfinder.go): `projectdiscovery/subfinder/subfinder.go`
- [Port discovery](https://github.com/ghosttroops/scan4all/blob/main/pkg/naabu/v2/pkg/runner/runner.go): `pkg/naabu/v2/pkg/runner/runner.go`
- [Nmap integration](https://github.com/ghosttroops/scan4all/blob/main/pkg/portScan/nmapScan.go): `pkg/portScan/nmapScan.go`

### Web assessment

- [HTTP probing](https://github.com/ghosttroops/scan4all/blob/main/pkg/httpx/runner/runner.go): `pkg/httpx/runner/runner.go`
- [Web fingerprinting](https://github.com/ghosttroops/scan4all/blob/main/pkg/fingerprint/fingerScan.go): `pkg/fingerprint/fingerScan.go`
- [Web crawler](https://github.com/ghosttroops/scan4all/blob/main/lib/crawlergo/crawlergo.go): `lib/crawlergo/crawlergo.go`
- [Sensitive-file fuzz](https://github.com/ghosttroops/scan4all/blob/main/brute/filefuzz.go): `brute/filefuzz.go`
- [Web checks](https://github.com/ghosttroops/scan4all/blob/main/webScan/webScanUrls.go): `webScan/webScanUrls.go`

### Security checks

- [Service auditing](https://github.com/ghosttroops/scan4all/blob/main/pkg/hydra/runner.go): `pkg/hydra/runner.go`
- [Go vulnerability checks](https://github.com/ghosttroops/scan4all/blob/main/pocs_go/go_poc_check.go): `pocs_go/go_poc_check.go`
- [YAML PoC checks](https://github.com/ghosttroops/scan4all/blob/main/pocs_yml/check/check.go): `pocs_yml/check/check.go`
- [HTTP smuggling](https://github.com/ghosttroops/scan4all/blob/main/lib/Smuggling/CheckSmuggling.go): `lib/Smuggling/CheckSmuggling.go`
- [Log4j checks](https://github.com/ghosttroops/scan4all/blob/main/pocs_go/log4j/check.go): `pocs_go/log4j/check.go`
- [JNDI listener](https://github.com/ghosttroops/scan4all/blob/main/pkg/jndi/server.go): `pkg/jndi/server.go`

### Results and state

- [Scan storage](https://github.com/ghosttroops/scan4all/blob/main/lib/util/db.go): `lib/util/db.go`
- [Scan output](https://github.com/ghosttroops/scan4all/blob/main/lib/util/sv2es.go): `lib/util/sv2es.go`

### Other components

- **Operator**
- **Target services**
- **Elasticsearch**

## Connections

- Operator → CLI startup: starts (evidence: `main.go`)
- CLI startup → Scan API: starts scan (evidence: `main.go`)
- Scan API → Port discovery: runs enumeration (evidence: `lib/api/main.go`)
- Scan API → Service auditing: imports Nmap results (evidence: `lib/api/main.go`)
- Scan API → HTTP probing: runs HTTP probing (evidence: `lib/api/main.go`)
- Port discovery → Target services: scans ports (evidence: `README.md`)
- Scan API → Nmap integration: supports Nmap input (evidence: `README.md`)
- Subdomain enum → Subfinder adapter: uses enumeration (evidence: `pkg/domain.go`)
- Subdomain enum → Target services: resolves targets (evidence: `README.md`)
- HTTP probing → Target services: probes HTTP (evidence: `README.md`)
- HTTP probing → Web fingerprinting: fingerprints services (evidence: `README.md`)
- HTTP probing → Web crawler: crawls sites (evidence: `README.md`)
- Event engine → Go vulnerability checks: dispatches checks (evidence: `engine/engineImp.go`)
- Go vulnerability checks → Sensitive-file fuzz: calls fuzzing (evidence: `pocs_go/go_poc_check.go`)
- Event engine → YAML PoC checks: dispatches checks
- Web checks → Target services: checks pages (evidence: `README.md`)
- Sensitive-file fuzz → Target services: requests paths (evidence: `brute/filefuzz.go`)
- Service auditing → Target services: audits credentials (evidence: `README.md`)
- Go vulnerability checks → Target services: tests vulnerabilities (evidence: `pocs_go/go_poc_check.go`)
- Go vulnerability checks → Log4j checks: runs Log4j checks (evidence: `README.md`)
- Log4j checks → JNDI listener: uses callback listener (evidence: `README.md`)
- Go vulnerability checks → HTTP smuggling: supports smuggling checks (evidence: `README.md`)
- Go vulnerability checks → Scan output: emits findings (evidence: `pocs_go/go_poc_check.go`)
- Scan output → Elasticsearch: stores results (evidence: `README.md`)
- Sensitive-file fuzz → Scan output: reports findings (evidence: `brute/filefuzz.go`)
- Web checks → Scan storage: uses shared state
