# wpscanteam/wpscan architecture

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

- Interactive diagram: https://gitdiagram.com/wpscanteam/wpscan
- Repository: https://github.com/wpscanteam/wpscan

## Overview

WPScan is a WordPress security scanner. A user supplies a target and scan options; the CLI controller prepares the scan, and the scanner detects WordPress components and enumerates requested users, plugins, themes, and other exposures. Findings can be checked against the vulnerability service and emitted in several formats. The README documents these capabilities, while the excerpts show CLI setup, enumeration dispatch, and finding aggregation; some internal runtime calls are not shown, so uncertain links are omitted.

Main entry points: [`app/controllers/core.rb`](https://github.com/wpscanteam/wpscan/blob/master/app/controllers/core.rb) (Core controller), [`app/controllers/enumeration.rb`](https://github.com/wpscanteam/wpscan/blob/master/app/controllers/enumeration.rb) (Enumeration controller), [`app/finders/interesting_findings.rb`](https://github.com/wpscanteam/wpscan/blob/master/app/finders/interesting_findings.rb) (Interesting findings), [`app/finders/interesting_findings/xml_rpc.rb`](https://github.com/wpscanteam/wpscan/blob/master/app/finders/interesting_findings/xml_rpc.rb) (XML-RPC check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Scan entry"]
  node_core["Core controller<br/>[core.rb]"]
  node_options["CLI options<br/>[cli_options.rb]"]
end

subgraph group_discovery["Target discovery"]
  node_target["WordPress target<br/>[wordpress.rb]"]
  node_version["Version detection<br/>[wp_version.rb]"]
  node_theme["Theme detection<br/>[main_theme.rb]"]
  node_findings["Interesting findings"]
  node_xmlrpc["XML-RPC check<br/>[xml_rpc.rb]"]
end

subgraph group_inventory["Enumeration"]
  node_enum["Enumeration controller<br/>[enumeration.rb]"]
  node_enumopts["Enumeration options<br/>[cli_options.rb]"]
  node_enummethods["Enumeration methods<br/>[enum_methods.rb]"]
  node_plugins["Plugin inventory<br/>[plugins.rb]"]
  node_themes["Theme inventory<br/>[themes.rb]"]
  node_users["User enumeration<br/>[users.rb]"]
end

subgraph group_intelligence["Vulnerability data"]
  node_vulncontroller["Vulnerability controller<br/>[vuln_api.rb]"]
  node_vulndb["Vulnerability database<br/>[vuln_api.rb]"]
  node_localdb[("Local scan database<br/>[updater.rb]")]
end

subgraph group_results["Results"]
  node_findingmodel["Finding model"]
  node_wpitem["WordPress item model<br/>[wp_item.rb]"]
  node_wporgdata["WordPress.org data"]
  node_wpversionmodel["Version model<br/>[wp_version.rb]"]
  node_xmlrpcmodel["XML-RPC model<br/>[xml_rpc.rb]"]
  node_theme_model["Theme model<br/>[theme.rb]"]
  node_timthumbmodel["TimThumb model<br/>[timthumb.rb]"]
  node_cli["CLI output<br/>[cli.rb]"]
  node_sarif["SARIF output<br/>[sarif.rb]"]
  node_json["JSON output<br/>[json.rb]"]
  node_jsonl["JSONL output<br/>[jsonl.rb]"]
end

node_user(("Scan operator"))
node_api{{"WPScan API"}}

node_user -->|"starts scan"| node_core
node_user -->|"sets options"| node_options
node_core -->|"defines options"| node_options
node_core -->|"checks target"| node_target
node_core -->|"updates database"| node_localdb
node_core -.->|"detects version"| node_version
node_core -.->|"detects theme"| node_theme
node_core -.->|"checks exposures"| node_findings
node_findings -->|"aggregates checks"| node_xmlrpc
node_xmlrpc -.->|"creates finding"| node_xmlrpcmodel
node_core -.->|"runs enumeration"| node_enum
node_enum -->|"uses options"| node_enumopts
node_enum -->|"dispatches methods"| node_enummethods
node_enum -.->|"enumerates plugins"| node_plugins
node_enum -.->|"enumerates themes"| node_themes
node_enum -.->|"enumerates users"| node_users
node_core -.->|"checks vulnerabilities"| node_vulncontroller
node_vulncontroller -.->|"requests vulnerability data"| node_vulndb
node_vulndb -->|"queries API"| node_api
node_core -.->|"emits results"| node_cli
node_core -.->|"emits results"| node_json
node_core -.->|"emits results"| node_jsonl
node_core -.->|"emits results"| node_sarif
node_sarif -->|"transforms JSON"| node_json
node_core -.->|"reports findings"| node_findingmodel
node_core -.->|"reports components"| node_wpitem
node_wpitem -.->|"uses metadata"| node_wporgdata
node_core -.->|"reports version"| node_wpversionmodel
node_core -.->|"reports theme"| node_theme_model
node_core -.->|"reports TimThumb"| node_timthumbmodel

click node_core "https://github.com/wpscanteam/wpscan/blob/master/app/controllers/core.rb"
click node_options "https://github.com/wpscanteam/wpscan/blob/master/app/controllers/core/cli_options.rb"
click node_target "https://github.com/wpscanteam/wpscan/blob/master/lib/wpscan/target/platform/wordpress.rb"
click node_version "https://github.com/wpscanteam/wpscan/blob/master/app/finders/wp_version.rb"
click node_theme "https://github.com/wpscanteam/wpscan/blob/master/app/finders/main_theme.rb"
click node_findings "https://github.com/wpscanteam/wpscan/blob/master/app/finders/interesting_findings.rb"
click node_xmlrpc "https://github.com/wpscanteam/wpscan/blob/master/app/finders/interesting_findings/xml_rpc.rb"
click node_enum "https://github.com/wpscanteam/wpscan/blob/master/app/controllers/enumeration.rb"
click node_enumopts "https://github.com/wpscanteam/wpscan/blob/master/app/controllers/enumeration/cli_options.rb"
click node_enummethods "https://github.com/wpscanteam/wpscan/blob/master/app/controllers/enumeration/enum_methods.rb"
click node_plugins "https://github.com/wpscanteam/wpscan/blob/master/app/finders/plugins.rb"
click node_themes "https://github.com/wpscanteam/wpscan/blob/master/app/finders/themes.rb"
click node_users "https://github.com/wpscanteam/wpscan/blob/master/app/finders/users.rb"
click node_vulncontroller "https://github.com/wpscanteam/wpscan/blob/master/app/controllers/vuln_api.rb"
click node_vulndb "https://github.com/wpscanteam/wpscan/blob/master/lib/wpscan/db/vuln_api.rb"
click node_localdb "https://github.com/wpscanteam/wpscan/blob/master/lib/wpscan/db/updater.rb"
click node_findingmodel "https://github.com/wpscanteam/wpscan/blob/master/app/models/interesting_finding.rb"
click node_wpitem "https://github.com/wpscanteam/wpscan/blob/master/app/models/wp_item.rb"
click node_wporgdata "https://github.com/wpscanteam/wpscan/blob/master/app/models/wp_item/wordpress_org_data.rb"
click node_wpversionmodel "https://github.com/wpscanteam/wpscan/blob/master/app/models/wp_version.rb"
click node_xmlrpcmodel "https://github.com/wpscanteam/wpscan/blob/master/app/models/xml_rpc.rb"
click node_theme_model "https://github.com/wpscanteam/wpscan/blob/master/app/models/theme.rb"
click node_timthumbmodel "https://github.com/wpscanteam/wpscan/blob/master/app/models/timthumb.rb"
click node_cli "https://github.com/wpscanteam/wpscan/blob/master/app/formatters/cli.rb"
click node_sarif "https://github.com/wpscanteam/wpscan/blob/master/app/formatters/sarif.rb"
click node_json "https://github.com/wpscanteam/wpscan/blob/master/app/formatters/json.rb"
click node_jsonl "https://github.com/wpscanteam/wpscan/blob/master/app/formatters/jsonl.rb"

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_core,node_options toneBlue
class node_target,node_version,node_theme,node_findings,node_xmlrpc toneAmber
class node_enum,node_enumopts,node_enummethods,node_plugins,node_themes,node_users,node_api toneMint
class node_vulncontroller,node_vulndb,node_localdb toneRose
class node_findingmodel,node_wpitem,node_wporgdata,node_wpversionmodel,node_xmlrpcmodel,node_theme_model,node_timthumbmodel,node_cli,node_sarif,node_json,node_jsonl,node_user toneIndigo
```

## Components

### Scan entry

- [Core controller](https://github.com/wpscanteam/wpscan/blob/master/app/controllers/core.rb): `app/controllers/core.rb`
- [CLI options](https://github.com/wpscanteam/wpscan/blob/master/app/controllers/core/cli_options.rb): `app/controllers/core/cli_options.rb`

### Target discovery

- [WordPress target](https://github.com/wpscanteam/wpscan/blob/master/lib/wpscan/target/platform/wordpress.rb): `lib/wpscan/target/platform/wordpress.rb`
- [Version detection](https://github.com/wpscanteam/wpscan/blob/master/app/finders/wp_version.rb): `app/finders/wp_version.rb`
- [Theme detection](https://github.com/wpscanteam/wpscan/blob/master/app/finders/main_theme.rb): `app/finders/main_theme.rb`
- [Interesting findings](https://github.com/wpscanteam/wpscan/blob/master/app/finders/interesting_findings.rb): `app/finders/interesting_findings.rb`
- [XML-RPC check](https://github.com/wpscanteam/wpscan/blob/master/app/finders/interesting_findings/xml_rpc.rb): `app/finders/interesting_findings/xml_rpc.rb`

### Enumeration

- [Enumeration controller](https://github.com/wpscanteam/wpscan/blob/master/app/controllers/enumeration.rb): `app/controllers/enumeration.rb`
- [Enumeration options](https://github.com/wpscanteam/wpscan/blob/master/app/controllers/enumeration/cli_options.rb): `app/controllers/enumeration/cli_options.rb`
- [Enumeration methods](https://github.com/wpscanteam/wpscan/blob/master/app/controllers/enumeration/enum_methods.rb): `app/controllers/enumeration/enum_methods.rb`
- [Plugin inventory](https://github.com/wpscanteam/wpscan/blob/master/app/finders/plugins.rb): `app/finders/plugins.rb`
- [Theme inventory](https://github.com/wpscanteam/wpscan/blob/master/app/finders/themes.rb): `app/finders/themes.rb`
- [User enumeration](https://github.com/wpscanteam/wpscan/blob/master/app/finders/users.rb): `app/finders/users.rb`

### Vulnerability data

- [Vulnerability controller](https://github.com/wpscanteam/wpscan/blob/master/app/controllers/vuln_api.rb): `app/controllers/vuln_api.rb`
- [Vulnerability database](https://github.com/wpscanteam/wpscan/blob/master/lib/wpscan/db/vuln_api.rb): `lib/wpscan/db/vuln_api.rb`
- [Local scan database](https://github.com/wpscanteam/wpscan/blob/master/lib/wpscan/db/updater.rb): `lib/wpscan/db/updater.rb`

### Results

- [Finding model](https://github.com/wpscanteam/wpscan/blob/master/app/models/interesting_finding.rb): `app/models/interesting_finding.rb`
- [WordPress item model](https://github.com/wpscanteam/wpscan/blob/master/app/models/wp_item.rb): `app/models/wp_item.rb`
- [WordPress.org data](https://github.com/wpscanteam/wpscan/blob/master/app/models/wp_item/wordpress_org_data.rb): `app/models/wp_item/wordpress_org_data.rb`
- [Version model](https://github.com/wpscanteam/wpscan/blob/master/app/models/wp_version.rb): `app/models/wp_version.rb`
- [XML-RPC model](https://github.com/wpscanteam/wpscan/blob/master/app/models/xml_rpc.rb): `app/models/xml_rpc.rb`
- [Theme model](https://github.com/wpscanteam/wpscan/blob/master/app/models/theme.rb): `app/models/theme.rb`
- [TimThumb model](https://github.com/wpscanteam/wpscan/blob/master/app/models/timthumb.rb): `app/models/timthumb.rb`
- [CLI output](https://github.com/wpscanteam/wpscan/blob/master/app/formatters/cli.rb): `app/formatters/cli.rb`
- [SARIF output](https://github.com/wpscanteam/wpscan/blob/master/app/formatters/sarif.rb): `app/formatters/sarif.rb`
- [JSON output](https://github.com/wpscanteam/wpscan/blob/master/app/formatters/json.rb): `app/formatters/json.rb`
- [JSONL output](https://github.com/wpscanteam/wpscan/blob/master/app/formatters/jsonl.rb): `app/formatters/jsonl.rb`

### Other components

- **Scan operator**
- **WPScan API**

## Connections

- Scan operator → Core controller: starts scan
- Scan operator → CLI options: sets options
- Core controller → CLI options: defines options (evidence: `app/controllers/core.rb`)
- Core controller → WordPress target: checks target (evidence: `app/controllers/core.rb`)
- Core controller → Local scan database: updates database (evidence: `app/controllers/core.rb`)
- Core controller → Version detection: detects version
- Core controller → Theme detection: detects theme
- Core controller → Interesting findings: checks exposures
- Interesting findings → XML-RPC check: aggregates checks (evidence: `app/finders/interesting_findings.rb`)
- XML-RPC check → XML-RPC model: creates finding
- Core controller → Enumeration controller: runs enumeration
- Enumeration controller → Enumeration options: uses options (evidence: `app/controllers/enumeration.rb`)
- Enumeration controller → Enumeration methods: dispatches methods (evidence: `app/controllers/enumeration.rb`)
- Enumeration controller → Plugin inventory: enumerates plugins
- Enumeration controller → Theme inventory: enumerates themes
- Enumeration controller → User enumeration: enumerates users
- Core controller → Vulnerability controller: checks vulnerabilities
- Vulnerability controller → Vulnerability database: requests vulnerability data
- Vulnerability database → WPScan API: queries API
- Core controller → CLI output: emits results (evidence: `app/app.rb`)
- Core controller → JSON output: emits results (evidence: `app/app.rb`)
- Core controller → JSONL output: emits results (evidence: `app/app.rb`)
- Core controller → SARIF output: emits results (evidence: `app/app.rb`)
- SARIF output → JSON output: transforms JSON (evidence: `app/formatters/sarif.rb`)
- Core controller → Finding model: reports findings
- Core controller → WordPress item model: reports components
- WordPress item model → WordPress.org data: uses metadata
- Core controller → Version model: reports version
- Core controller → Theme model: reports theme
- Core controller → TimThumb model: reports TimThumb
