# collapsar-s/shadow2 architecture

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

- Interactive diagram: https://gitdiagram.com/collapsar-s/shadow2
- Repository: https://github.com/collapsar-s/shadow2

## Overview

This repository is a heterogeneous penetration-testing archive, not one integrated application. Its clearest runtime workflow is the bundled sqlmap tool: a user supplies a target, the controller checks it for injectable parameters, request/technique modules perform tests, and target utilities handle results. The archive also includes XSS-testing software, vulnerability-specific exploits, privilege-escalation programs, and SQL-injection exercises. The README and tree establish those separate capabilities; unsampled components are represented as subsystems, without guessed internal call chains.

Main entry points: [`渗透工具/sqlmap GUI/lib/controller/checks.py`](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/controller/checks.py) (Injection Checks), [`渗透工具/sqlmap GUI/lib/controller/controller.py`](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/controller/controller.py) (Scan Controller), [`渗透工具/sqlmap GUI/lib/core/data.py`](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/data.py) (Core State), [`渗透工具/sqlmap GUI/lib/core/common.py`](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/common.py) (Core Utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sqlmap["SQLMap Scanner"]
  node_scan_controller["Scan Controller<br/>[controller.py]"]
  node_injection_checks["Injection Checks<br/>[checks.py]"]
  node_sql_agent["SQL Agent<br/>[agent.py]"]
  node_core_state["Core State<br/>[data.py]"]
  node_core_common["Core Utilities<br/>[common.py]"]
  node_core_constants["Core Definitions<br/>[enums.py]"]
  node_core_settings["Scanner Settings<br/>[settings.py]"]
  node_core_errors["Scanner Exceptions<br/>[exception.py]"]
  node_http_connect["HTTP Connection<br/>[connect.py]"]
  node_injection_transport["Injection Transport<br/>[inject.py]"]
  node_sql_techniques["Injection Techniques"]
  node_target_results["Target Results<br/>[target.py]"]
end

subgraph group_xss["XSS Testing"]
  node_xss_suite["XSS Project Suite"]
  node_xss_capture["Browser Capture<br/>[Browser.class.php]"]
end

subgraph group_exploits["Exploit Archive"]
  node_web_exploits["Web Exploit Scripts"]
  node_cms_exploits["CMS Exploit Scripts"]
  node_web_scanner["Web Scan Assistant"]
end

subgraph group_privilege["Privilege Escalation"]
  node_linux_escalation["Linux Escalation Exploits"]
  node_server_escalation["Server Escalation Tools"]
end

subgraph group_practice["SQL Practice"]
  node_sql_lessons["SQL Injection Lessons"]
  node_lesson_database[("Lesson Database Connection<br/>[sql-connect.php]")]
end

node_operator(("Operator"))

node_operator -.->|"selects targets"| node_scan_controller
node_scan_controller -->|"runs checks"| node_injection_checks
node_scan_controller -->|"uses shared state"| node_core_state
node_scan_controller -->|"uses utilities"| node_core_common
node_injection_checks -->|"builds payloads"| node_sql_agent
node_injection_checks -->|"sends requests"| node_http_connect
node_injection_checks -->|"uses injection"| node_injection_transport
node_injection_checks -->|"dispatches tests"| node_sql_techniques
node_sql_agent -->|"uses utilities"| node_core_common
node_sql_agent -->|"reads state"| node_core_state
node_core_state -->|"uses data types"| node_core_common
node_core_settings -->|"uses definitions"| node_core_constants
node_target_results -->|"uses utilities"| node_core_common
node_target_results -->|"uses shared state"| node_core_state
node_sql_lessons -->|"connects database"| node_lesson_database
node_operator -.->|"uses XSS tests"| node_xss_suite
node_operator -.->|"selects exploit"| node_web_exploits
node_operator -.->|"selects exploit"| node_cms_exploits
node_operator -.->|"runs scans"| node_web_scanner
node_operator -.->|"selects exploit"| node_linux_escalation
node_operator -.->|"uses tools"| node_server_escalation
node_operator -.->|"practices injection"| node_sql_lessons

click node_scan_controller "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/controller/controller.py"
click node_injection_checks "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/controller/checks.py"
click node_sql_agent "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/agent.py"
click node_core_state "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/data.py"
click node_core_common "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/common.py"
click node_core_constants "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/enums.py"
click node_core_settings "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/settings.py"
click node_core_errors "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/exception.py"
click node_http_connect "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/request/connect.py"
click node_injection_transport "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/request/inject.py"
click node_sql_techniques "https://github.com/collapsar-s/shadow2/tree/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/techniques"
click node_target_results "https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/target.py"
click node_xss_suite "https://github.com/collapsar-s/shadow2/tree/master/xss/xss%E5%AE%8C%E6%95%B4%E7%89%88%E6%8F%92%E4%BB%B6keepsenins/xss%E5%AE%8C%E6%95%B4%E7%89%88%E6%8F%92%E4%BB%B6keepsenins/apps/index"
click node_xss_capture "https://github.com/collapsar-s/shadow2/blob/master/xss/xss%E5%AE%8C%E6%95%B4%E7%89%88%E6%8F%92%E4%BB%B6keepsenins/xss%E5%AE%8C%E6%95%B4%E7%89%88%E6%8F%92%E4%BB%B6keepsenins/uauc/class/Browser.class.php"
click node_web_exploits "https://github.com/collapsar-s/shadow2/tree/master/PHP%E7%A8%8B%E5%BA%8F0day"
click node_cms_exploits "https://github.com/collapsar-s/shadow2/tree/master/0day%20%26%20exp"
click node_web_scanner "https://github.com/collapsar-s/shadow2/tree/master/%E5%AE%89%E5%85%A8%E6%89%AB%E6%8F%8F/web%E6%B8%97%E9%80%8F%E8%BE%85%E5%8A%A9%E5%B7%A5%E5%85%B7v1.0/WindowsApplication5"
click node_linux_escalation "https://github.com/collapsar-s/shadow2/tree/master/%E6%8F%90%E6%9D%83%E5%88%A9%E5%99%A8/linux"
click node_server_escalation "https://github.com/collapsar-s/shadow2/tree/master/%E6%8F%90%E6%9D%83%E5%88%A9%E5%99%A8"
click node_sql_lessons "https://github.com/collapsar-s/shadow2/tree/master/%E6%B3%A8%E5%85%A5%E7%BB%83%E4%B9%A0"
click node_lesson_database "https://github.com/collapsar-s/shadow2/blob/master/%E6%B3%A8%E5%85%A5%E7%BB%83%E4%B9%A0/sql-connections/sql-connect.php"

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_scan_controller,node_injection_checks,node_sql_agent,node_core_state,node_core_common,node_core_constants,node_core_settings,node_core_errors,node_http_connect,node_injection_transport,node_sql_techniques,node_target_results toneBlue
class node_xss_suite,node_xss_capture toneAmber
class node_web_exploits,node_cms_exploits,node_web_scanner toneMint
class node_linux_escalation,node_server_escalation toneRose
class node_sql_lessons,node_lesson_database,node_operator toneIndigo
```

## Components

### SQLMap Scanner

- [Scan Controller](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/controller/controller.py): `渗透工具/sqlmap GUI/lib/controller/controller.py`
- [Injection Checks](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/controller/checks.py): `渗透工具/sqlmap GUI/lib/controller/checks.py`
- [SQL Agent](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/agent.py): `渗透工具/sqlmap GUI/lib/core/agent.py`
- [Core State](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/data.py): `渗透工具/sqlmap GUI/lib/core/data.py`
- [Core Utilities](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/common.py): `渗透工具/sqlmap GUI/lib/core/common.py`
- [Core Definitions](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/enums.py): `渗透工具/sqlmap GUI/lib/core/enums.py`
- [Scanner Settings](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/settings.py): `渗透工具/sqlmap GUI/lib/core/settings.py`
- [Scanner Exceptions](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/exception.py): `渗透工具/sqlmap GUI/lib/core/exception.py`
- [HTTP Connection](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/request/connect.py): `渗透工具/sqlmap GUI/lib/request/connect.py`
- [Injection Transport](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/request/inject.py): `渗透工具/sqlmap GUI/lib/request/inject.py`
- [Injection Techniques](https://github.com/collapsar-s/shadow2/tree/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/techniques): `渗透工具/sqlmap GUI/lib/techniques`
- [Target Results](https://github.com/collapsar-s/shadow2/blob/master/%E6%B8%97%E9%80%8F%E5%B7%A5%E5%85%B7/sqlmap%20GUI/lib/core/target.py): `渗透工具/sqlmap GUI/lib/core/target.py`

### XSS Testing

- [XSS Project Suite](https://github.com/collapsar-s/shadow2/tree/master/xss/xss%E5%AE%8C%E6%95%B4%E7%89%88%E6%8F%92%E4%BB%B6keepsenins/xss%E5%AE%8C%E6%95%B4%E7%89%88%E6%8F%92%E4%BB%B6keepsenins/apps/index): `xss/xss完整版插件keepsenins/xss完整版插件keepsenins/apps/index`
- [Browser Capture](https://github.com/collapsar-s/shadow2/blob/master/xss/xss%E5%AE%8C%E6%95%B4%E7%89%88%E6%8F%92%E4%BB%B6keepsenins/xss%E5%AE%8C%E6%95%B4%E7%89%88%E6%8F%92%E4%BB%B6keepsenins/uauc/class/Browser.class.php): `xss/xss完整版插件keepsenins/xss完整版插件keepsenins/uauc/class/Browser.class.php`

### Exploit Archive

- [Web Exploit Scripts](https://github.com/collapsar-s/shadow2/tree/master/PHP%E7%A8%8B%E5%BA%8F0day): `PHP程序0day`
- [CMS Exploit Scripts](https://github.com/collapsar-s/shadow2/tree/master/0day%20%26%20exp): `0day & exp`
- [Web Scan Assistant](https://github.com/collapsar-s/shadow2/tree/master/%E5%AE%89%E5%85%A8%E6%89%AB%E6%8F%8F/web%E6%B8%97%E9%80%8F%E8%BE%85%E5%8A%A9%E5%B7%A5%E5%85%B7v1.0/WindowsApplication5): `安全扫描/web渗透辅助工具v1.0/WindowsApplication5`

### Privilege Escalation

- [Linux Escalation Exploits](https://github.com/collapsar-s/shadow2/tree/master/%E6%8F%90%E6%9D%83%E5%88%A9%E5%99%A8/linux): `提权利器/linux`
- [Server Escalation Tools](https://github.com/collapsar-s/shadow2/tree/master/%E6%8F%90%E6%9D%83%E5%88%A9%E5%99%A8): `提权利器`

### SQL Practice

- [SQL Injection Lessons](https://github.com/collapsar-s/shadow2/tree/master/%E6%B3%A8%E5%85%A5%E7%BB%83%E4%B9%A0): `注入练习`
- [Lesson Database Connection](https://github.com/collapsar-s/shadow2/blob/master/%E6%B3%A8%E5%85%A5%E7%BB%83%E4%B9%A0/sql-connections/sql-connect.php): `注入练习/sql-connections/sql-connect.php`

### Other components

- **Operator**

## Connections

- Operator → Scan Controller: selects targets
- Scan Controller → Injection Checks: runs checks (evidence: `渗透工具/sqlmap GUI/lib/controller/controller.py`)
- Scan Controller → Core State: uses shared state (evidence: `渗透工具/sqlmap GUI/lib/controller/controller.py`)
- Scan Controller → Core Utilities: uses utilities (evidence: `渗透工具/sqlmap GUI/lib/controller/controller.py`)
- Injection Checks → SQL Agent: builds payloads (evidence: `渗透工具/sqlmap GUI/lib/controller/checks.py`)
- Injection Checks → HTTP Connection: sends requests (evidence: `渗透工具/sqlmap GUI/lib/controller/checks.py`)
- Injection Checks → Injection Transport: uses injection (evidence: `渗透工具/sqlmap GUI/lib/controller/checks.py`)
- Injection Checks → Injection Techniques: dispatches tests (evidence: `渗透工具/sqlmap GUI/lib/controller/checks.py`)
- SQL Agent → Core Utilities: uses utilities (evidence: `渗透工具/sqlmap GUI/lib/core/agent.py`)
- SQL Agent → Core State: reads state (evidence: `渗透工具/sqlmap GUI/lib/core/agent.py`)
- Core State → Core Utilities: uses data types (evidence: `渗透工具/sqlmap GUI/lib/core/data.py`)
- Scanner Settings → Core Definitions: uses definitions (evidence: `渗透工具/sqlmap GUI/lib/core/settings.py`)
- Target Results → Core Utilities: uses utilities (evidence: `渗透工具/sqlmap GUI/lib/core/target.py`)
- Target Results → Core State: uses shared state (evidence: `渗透工具/sqlmap GUI/lib/core/target.py`)
- SQL Injection Lessons → Lesson Database Connection: connects database (evidence: `注入练习/Less-21/index.php`)
- Operator → XSS Project Suite: uses XSS tests
- Operator → Web Exploit Scripts: selects exploit
- Operator → CMS Exploit Scripts: selects exploit
- Operator → Web Scan Assistant: runs scans
- Operator → Linux Escalation Exploits: selects exploit
- Operator → Server Escalation Tools: uses tools
- Operator → SQL Injection Lessons: practices injection
