# jorgbot/php2shell architecture

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

- Interactive diagram: https://gitdiagram.com/jorgbot/php2shell
- Repository: https://github.com/jorgbot/php2shell

## Overview

PHP2Shell is a defensive PHP vulnerability reconnaissance and audit CLI. Users provide a URL, target list, or local-audit option; the suite assesses remote targets or local PHP configuration, reports findings, and can export or notify. The README documents capabilities, but the source excerpt is partial, so internal call ownership and several implementation details cannot be verified; documented relationships use README evidence.

Main entry points: [`audit_php2shell.py`](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py) (Remote auditor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Inputs and orchestration"]
  node_cli["Audit CLI<br/>[audit_php2shell.py]"]
  node_target_sources["URL or target list"]
  node_remote_auditor["Remote auditor<br/>[audit_php2shell.py]"]
end

subgraph group_remote["Remote reconnaissance"]
  node_version_check["PHP exposure check<br/>[audit_php2shell.py]"]
  node_ecosystem["Ecosystem fingerprinting<br/>[audit_php2shell.py]"]
  node_sapi["SAPI detection<br/>[audit_php2shell.py]"]
  node_cms["CMS and framework detection<br/>[audit_php2shell.py]"]
  node_os["OS fingerprinting<br/>[audit_php2shell.py]"]
  node_waf["WAF and CDN detection<br/>[audit_php2shell.py]"]
  node_tls["TLS certificate inspection<br/>[audit_php2shell.py]"]
end

subgraph group_local["Local audit"]
  node_local_audit["Local PHP audit<br/>[audit_php2shell.py]"]
end

subgraph group_outputs["Findings and outputs"]
  node_findings["Audit findings<br/>[audit_php2shell.py]"]
  node_json_report["JSON report<br/>[audit_php2shell.py]"]
  node_csv_report["CSV report<br/>[audit_php2shell.py]"]
  node_sarif_report["SARIF report<br/>[audit_php2shell.py]"]
  node_html_dashboard["HTML dashboard<br/>[audit_php2shell.py]"]
  node_webhook["Webhook notifier<br/>[audit_php2shell.py]"]
end

node_operator(("Operator"))
node_remote_site["Remote PHP site"]
node_php_runtime["PHP runtime and php.ini"]
node_notification_service["Webhook destination"]

node_operator -->|"starts audit"| node_cli
node_operator -->|"provides targets"| node_target_sources
node_target_sources -->|"selects remote audit"| node_remote_auditor
node_cli -->|"runs remote audit"| node_remote_auditor
node_remote_auditor -->|"audits remotely"| node_remote_site
node_remote_auditor -->|"checks exposure"| node_version_check
node_remote_auditor -->|"fingerprints"| node_ecosystem
node_ecosystem -->|"detects"| node_sapi
node_ecosystem -->|"detects"| node_cms
node_ecosystem -->|"detects"| node_os
node_ecosystem -->|"detects"| node_waf
node_remote_auditor -->|"inspects certificates"| node_tls
node_cli -->|"selects local audit"| node_local_audit
node_local_audit -->|"audits configuration"| node_php_runtime
node_remote_auditor -->|"produces results"| node_findings
node_local_audit -->|"produces findings"| node_findings
node_findings -->|"exports JSON"| node_json_report
node_findings -->|"exports CSV"| node_csv_report
node_findings -->|"exports SARIF"| node_sarif_report
node_findings -->|"renders dashboard"| node_html_dashboard
node_findings -->|"dispatches alerts"| node_webhook
node_webhook -->|"sends notification"| node_notification_service

click node_cli "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_remote_auditor "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_version_check "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_ecosystem "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_sapi "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_cms "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_os "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_waf "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_tls "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_local_audit "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_findings "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_json_report "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_csv_report "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_sarif_report "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_html_dashboard "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py"
click node_webhook "https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.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_cli,node_target_sources,node_remote_auditor toneBlue
class node_version_check,node_ecosystem,node_sapi,node_cms,node_os,node_waf,node_tls toneAmber
class node_local_audit,node_notification_service toneMint
class node_findings,node_json_report,node_csv_report,node_sarif_report,node_html_dashboard,node_webhook toneRose
class node_operator,node_remote_site,node_php_runtime toneIndigo
```

## Components

### Inputs and orchestration

- [Audit CLI](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- **URL or target list**
- [Remote auditor](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`

### Remote reconnaissance

- [PHP exposure check](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [Ecosystem fingerprinting](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [SAPI detection](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [CMS and framework detection](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [OS fingerprinting](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [WAF and CDN detection](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [TLS certificate inspection](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`

### Local audit

- [Local PHP audit](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`

### Findings and outputs

- [Audit findings](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [JSON report](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [CSV report](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [SARIF report](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [HTML dashboard](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`
- [Webhook notifier](https://github.com/jorgbot/php2shell/blob/main/audit_php2shell.py): `audit_php2shell.py`

### Other components

- **Operator**
- **Remote PHP site**
- **PHP runtime and php.ini**
- **Webhook destination**

## Connections

- Operator → Audit CLI: starts audit (evidence: `README.md`)
- Operator → URL or target list: provides targets (evidence: `README.md`)
- URL or target list → Remote auditor: selects remote audit (evidence: `README.md`)
- Audit CLI → Remote auditor: runs remote audit (evidence: `README.md`)
- Remote auditor → Remote PHP site: audits remotely (evidence: `README.md`)
- Remote auditor → PHP exposure check: checks exposure (evidence: `README.md`)
- Remote auditor → Ecosystem fingerprinting: fingerprints (evidence: `README.md`)
- Ecosystem fingerprinting → SAPI detection: detects (evidence: `README.md`)
- Ecosystem fingerprinting → CMS and framework detection: detects (evidence: `README.md`)
- Ecosystem fingerprinting → OS fingerprinting: detects (evidence: `README.md`)
- Ecosystem fingerprinting → WAF and CDN detection: detects (evidence: `README.md`)
- Remote auditor → TLS certificate inspection: inspects certificates (evidence: `README.md`)
- Audit CLI → Local PHP audit: selects local audit (evidence: `README.md`)
- Local PHP audit → PHP runtime and php.ini: audits configuration (evidence: `README.md`)
- Remote auditor → Audit findings: produces results (evidence: `README.md`)
- Local PHP audit → Audit findings: produces findings (evidence: `README.md`)
- Audit findings → JSON report: exports JSON (evidence: `README.md`)
- Audit findings → CSV report: exports CSV (evidence: `README.md`)
- Audit findings → SARIF report: exports SARIF (evidence: `README.md`)
- Audit findings → HTML dashboard: renders dashboard (evidence: `README.md`)
- Audit findings → Webhook notifier: dispatches alerts (evidence: `README.md`)
- Webhook notifier → Webhook destination: sends notification (evidence: `README.md`)
