# debang5hu/wushi architecture

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

- Interactive diagram: https://gitdiagram.com/debang5hu/wushi
- Repository: https://github.com/debang5hu/wushi

## Overview

Wushi runs two honeypot services: a Go supervisor starts and retries the HTTP and SSH processes, while signal handling coordinates shutdown. HTTP requests are enriched with geolocation and user-agent details, and login submissions are recorded; SSH captures authentication attempts and offers an interactive shell after authentication. The README also describes HTTPS, CAPTCHA, jailed-shell behavior, persistent keys, and separate service logs. The graph uses documented behavior where source excerpts do not show supervisor subprocess targets importing one another.

Main entry points: [`honey/wushi.go`](https://github.com/debang5hu/wushi/blob/main/honey/wushi.go) (Go supervisor), [`honey/honeyssh.py`](https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py) (SSH service), [`honey/honeyhttp.py`](https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py) (Request capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_supervision["Process supervision"]
  node_supervisor["Go supervisor<br/>[wushi.go]"]
  node_signal["Shutdown signals<br/>[wushi.go]"]
end

subgraph group_http["HTTP honeypot"]
  node_http_service["HTTP service<br/>[honeyhttp.py]"]
  node_request_capture["Request capture<br/>[honeyhttp.py]"]
  node_geo_lookup["Geolocation lookup<br/>[honeyhttp.py]"]
  node_agent_parse["Agent parsing<br/>[honeyhttp.py]"]
  node_login_captcha["Login and CAPTCHA<br/>[honeyhttp.py]"]
end

subgraph group_ssh["SSH honeypot"]
  node_ssh_service["SSH service<br/>[honeyssh.py]"]
  node_ssh_auth["SSH authentication<br/>[honeyssh.py]"]
  node_ssh_shell["Interactive shell<br/>[honeyssh.py]"]
  node_ssh_key[("Persistent RSA key<br/>[honeyssh.py]")]
end

subgraph group_logging["Event logging"]
  node_http_log[("HTTP event log<br/>[honeyhttp.py]")]
  node_ssh_log[("SSH event log<br/>[honeyssh.py]")]
  node_monitor_log[("Monitor log<br/>[wushi.go]")]
end

node_operator(("Operator"))
node_geo_api["Geolocation API"]
node_attacker(("Remote attacker"))

node_operator -->|"starts"| node_supervisor
node_supervisor -->|"starts and retries"| node_http_service
node_supervisor -->|"starts and retries"| node_ssh_service
node_supervisor -->|"handles shutdown"| node_signal
node_supervisor -->|"writes status"| node_monitor_log
node_attacker -.->|"sends requests"| node_http_service
node_http_service -->|"handles requests"| node_request_capture
node_request_capture -->|"looks up IP"| node_geo_lookup
node_request_capture -->|"parses agent"| node_agent_parse
node_request_capture -->|"writes request data"| node_http_log
node_geo_lookup -->|"queries"| node_geo_api
node_http_service -->|"routes login"| node_login_captcha
node_login_captcha -->|"enriches login"| node_geo_lookup
node_login_captcha -->|"parses agent"| node_agent_parse
node_login_captcha -->|"records credentials"| node_http_log
node_attacker -.->|"opens connection"| node_ssh_service
node_ssh_service -->|"loads key"| node_ssh_key
node_ssh_service -->|"starts transport"| node_ssh_auth
node_ssh_auth -->|"records attempts"| node_ssh_log
node_ssh_service -->|"opens channel shell"| node_ssh_shell
node_ssh_shell -->|"logs shell events"| node_ssh_log

click node_supervisor "https://github.com/debang5hu/wushi/blob/main/honey/wushi.go"
click node_signal "https://github.com/debang5hu/wushi/blob/main/honey/wushi.go"
click node_http_service "https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py"
click node_request_capture "https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py"
click node_geo_lookup "https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py"
click node_agent_parse "https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py"
click node_login_captcha "https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py"
click node_http_log "https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py"
click node_ssh_service "https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py"
click node_ssh_auth "https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py"
click node_ssh_shell "https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py"
click node_ssh_key "https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py"
click node_ssh_log "https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py"
click node_monitor_log "https://github.com/debang5hu/wushi/blob/main/honey/wushi.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_supervisor,node_signal toneBlue
class node_http_service,node_request_capture,node_geo_lookup,node_agent_parse,node_login_captcha toneAmber
class node_ssh_service,node_ssh_auth,node_ssh_shell,node_ssh_key,node_geo_api toneMint
class node_http_log,node_ssh_log,node_monitor_log toneRose
class node_operator,node_attacker toneIndigo
```

## Components

### Process supervision

- [Go supervisor](https://github.com/debang5hu/wushi/blob/main/honey/wushi.go): `honey/wushi.go`
- [Shutdown signals](https://github.com/debang5hu/wushi/blob/main/honey/wushi.go): `honey/wushi.go`

### HTTP honeypot

- [HTTP service](https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py): `honey/honeyhttp.py`
- [Request capture](https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py): `honey/honeyhttp.py`
- [Geolocation lookup](https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py): `honey/honeyhttp.py`
- [Agent parsing](https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py): `honey/honeyhttp.py`
- [Login and CAPTCHA](https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py): `honey/honeyhttp.py`

### SSH honeypot

- [SSH service](https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py): `honey/honeyssh.py`
- [SSH authentication](https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py): `honey/honeyssh.py`
- [Interactive shell](https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py): `honey/honeyssh.py`
- [Persistent RSA key](https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py): `honey/honeyssh.py`

### Event logging

- [HTTP event log](https://github.com/debang5hu/wushi/blob/main/honey/honeyhttp.py): `honey/honeyhttp.py`
- [SSH event log](https://github.com/debang5hu/wushi/blob/main/honey/honeyssh.py): `honey/honeyssh.py`
- [Monitor log](https://github.com/debang5hu/wushi/blob/main/honey/wushi.go): `honey/wushi.go`

### Other components

- **Operator**
- **Geolocation API**
- **Remote attacker**

## Connections

- Operator → Go supervisor: starts (evidence: `README.md`)
- Go supervisor → HTTP service: starts and retries (evidence: `README.md`)
- Go supervisor → SSH service: starts and retries (evidence: `README.md`)
- Go supervisor → Shutdown signals: handles shutdown (evidence: `honey/wushi.go`)
- Go supervisor → Monitor log: writes status (evidence: `honey/wushi.go`)
- Remote attacker → HTTP service: sends requests (evidence: `README.md`)
- HTTP service → Request capture: handles requests (evidence: `honey/honeyhttp.py`)
- Request capture → Geolocation lookup: looks up IP (evidence: `honey/honeyhttp.py`)
- Request capture → Agent parsing: parses agent (evidence: `honey/honeyhttp.py`)
- Request capture → HTTP event log: writes request data (evidence: `honey/honeyhttp.py`)
- Geolocation lookup → Geolocation API: queries (evidence: `honey/honeyhttp.py`)
- HTTP service → Login and CAPTCHA: routes login (evidence: `honey/honeyhttp.py`)
- Login and CAPTCHA → Geolocation lookup: enriches login (evidence: `honey/honeyhttp.py`)
- Login and CAPTCHA → Agent parsing: parses agent (evidence: `honey/honeyhttp.py`)
- Login and CAPTCHA → HTTP event log: records credentials (evidence: `honey/honeyhttp.py`)
- Remote attacker → SSH service: opens connection (evidence: `README.md`)
- SSH service → Persistent RSA key: loads key (evidence: `honey/honeyssh.py`)
- SSH service → SSH authentication: starts transport (evidence: `honey/honeyssh.py`)
- SSH authentication → SSH event log: records attempts (evidence: `honey/honeyssh.py`)
- SSH service → Interactive shell: opens channel shell (evidence: `honey/honeyssh.py`)
- Interactive shell → SSH event log: logs shell events (evidence: `honey/honeyssh.py`)
