# t-raptor/school-honeypot-project architecture

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

- Interactive diagram: https://gitdiagram.com/t-raptor/school-honeypot-project
- Repository: https://github.com/t-raptor/school-honeypot-project

## Overview

This repository combines a PHP web environment for account access, administration, and intentionally vulnerable security challenges with a separate Python socket honeypot. The main user workflow is registration or login, access to the challenge list, and completion of challenges recorded against the user; administrators can manage accounts separately. The README also documents log analysis through Elasticsearch, Kibana, and Filebeat. Some integrations and challenge capabilities are documented but their implementation was not sampled, so those relationships are cited to the README rather than inferred from source.

Main entry points: [`challenges.php`](https://github.com/t-raptor/school-honeypot-project/blob/main/challenges.php) (Challenge List), [`challenges/challenge_SQLi.php`](https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_SQLi.php) (SQL Injection), [`util/login_check.php`](https://github.com/t-raptor/school-honeypot-project/blob/main/util/login_check.php) (Login Guard), [`admin_panel.php`](https://github.com/t-raptor/school-honeypot-project/blob/main/admin_panel.php) (Admin Panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts and Admin"]
  node_registration["Registration<br/>[register.php]"]
  node_login["Login<br/>[login.php]"]
  node_logout["Logout<br/>[logout.php]"]
  node_account_db_config["Account DB Config<br/>[config.php]"]
  node_admin_panel["Admin Panel<br/>[admin_panel.php]"]
  node_admin_config["Admin DB Config<br/>[admin_config.php]"]
  node_admin_actions["Account Actions"]
  node_avatar_upload["Avatar Upload"]
  node_account_store[("User Records")]
end

subgraph group_challenges["Security Challenges"]
  node_challenge_list["Challenge List<br/>[challenges.php]"]
  node_login_check["Login Guard<br/>[login_check.php]"]
  node_challenge_config["Challenge DB Config"]
  node_challenge_solutions["Solved Recorder"]
  node_sqli["SQL Injection<br/>[challenge_SQLi.php]"]
  node_xss["XSS Exercises<br/>[challenge_XSS.php]"]
  node_access_control["Access Control"]
  node_csrf["CSRF Exercise<br/>[challenge_CSRF.php]"]
  node_other_challenges["Additional Exercises"]
  node_challenge_store[("Challenge Records")]
end

subgraph group_honeypot["Network Honeypot"]
  node_honeypot_listener["Socket Listener<br/>[honeypot.py]"]
  node_honeypot_log["Attempt Log"]
end

subgraph group_observability["Log Monitoring"]
  node_filebeat["Filebeat"]
  node_elasticsearch[("Elasticsearch")]
  node_kibana["Kibana"]
end

node_user(("Visitor"))
node_attacker(("Network Prober"))

node_user -->|"registers"| node_registration
node_user -->|"authenticates"| node_login
node_registration -->|"loads config"| node_account_db_config
node_login -->|"loads config"| node_account_db_config
node_registration -->|"creates account"| node_account_store
node_login -.->|"authenticates"| node_account_store
node_user -->|"opens"| node_challenge_list
node_challenge_list -->|"checks session"| node_login_check
node_challenge_list -->|"loads config"| node_challenge_config
node_challenge_list -->|"reads progress"| node_challenge_store
node_challenge_list -->|"links challenge"| node_sqli
node_challenge_list -->|"links challenge"| node_xss
node_challenge_list -->|"links challenge"| node_access_control
node_challenge_list -->|"links challenge"| node_csrf
node_challenge_list -->|"links challenge"| node_other_challenges
node_sqli -->|"checks session"| node_login_check
node_sqli -->|"records solve"| node_sqli
node_sqli -->|"writes solution"| node_challenge_store
node_xss -->|"checks session"| node_login_check
node_access_control -->|"checks session"| node_login_check
node_access_control -->|"records solve"| node_challenge_solutions
node_csrf -->|"checks session"| node_login_check
node_csrf -->|"records solve"| node_challenge_solutions
node_challenge_solutions -->|"loads config"| node_challenge_config
node_challenge_solutions -->|"writes solution"| node_challenge_store
node_user -->|"manages accounts"| node_admin_panel
node_admin_panel -->|"loads config"| node_admin_config
node_admin_panel -->|"reads users"| node_account_store
node_admin_panel -->|"links actions"| node_admin_actions
node_admin_actions -.->|"updates accounts"| node_account_store
node_user -->|"uploads avatar"| node_avatar_upload
node_attacker -->|"connects"| node_honeypot_listener
node_honeypot_listener -->|"records attempts"| node_honeypot_log
node_honeypot_listener -->|"ships logs"| node_filebeat
node_account_store -.->|"ships web logs"| node_filebeat
node_filebeat -->|"ships events"| node_elasticsearch
node_elasticsearch -->|"powers dashboards"| node_kibana

click node_registration "https://github.com/t-raptor/school-honeypot-project/blob/main/register.php"
click node_login "https://github.com/t-raptor/school-honeypot-project/blob/main/login.php"
click node_logout "https://github.com/t-raptor/school-honeypot-project/blob/main/logout.php"
click node_account_db_config "https://github.com/t-raptor/school-honeypot-project/blob/main/util/config.php"
click node_admin_panel "https://github.com/t-raptor/school-honeypot-project/blob/main/admin_panel.php"
click node_admin_config "https://github.com/t-raptor/school-honeypot-project/blob/main/util/admin_config.php"
click node_admin_actions "https://github.com/t-raptor/school-honeypot-project/tree/main/admin_actions"
click node_avatar_upload "https://github.com/t-raptor/school-honeypot-project/blob/main/util/resizeAndUploadAvatar.js"
click node_challenge_list "https://github.com/t-raptor/school-honeypot-project/blob/main/challenges.php"
click node_login_check "https://github.com/t-raptor/school-honeypot-project/blob/main/util/login_check.php"
click node_challenge_config "https://github.com/t-raptor/school-honeypot-project/blob/main/util/challenge_check_config.php"
click node_challenge_solutions "https://github.com/t-raptor/school-honeypot-project/blob/main/util/save_solved_challenge.php"
click node_sqli "https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_SQLi.php"
click node_xss "https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_XSS.php"
click node_access_control "https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_Access_Control.php"
click node_csrf "https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_CSRF.php"
click node_other_challenges "https://github.com/t-raptor/school-honeypot-project/tree/main/challenges"
click node_honeypot_listener "https://github.com/t-raptor/school-honeypot-project/blob/main/honeypot/honeypot.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_registration,node_login,node_logout,node_account_db_config,node_admin_panel,node_admin_config,node_admin_actions,node_avatar_upload,node_account_store toneBlue
class node_challenge_list,node_login_check,node_challenge_config,node_challenge_solutions,node_sqli,node_xss,node_access_control,node_csrf,node_other_challenges,node_challenge_store toneAmber
class node_honeypot_listener,node_honeypot_log toneMint
class node_filebeat,node_elasticsearch,node_kibana toneRose
class node_user,node_attacker toneIndigo
```

## Components

### Accounts and Admin

- [Registration](https://github.com/t-raptor/school-honeypot-project/blob/main/register.php): `register.php`
- [Login](https://github.com/t-raptor/school-honeypot-project/blob/main/login.php): `login.php`
- [Logout](https://github.com/t-raptor/school-honeypot-project/blob/main/logout.php): `logout.php`
- [Account DB Config](https://github.com/t-raptor/school-honeypot-project/blob/main/util/config.php): `util/config.php`
- [Admin Panel](https://github.com/t-raptor/school-honeypot-project/blob/main/admin_panel.php): `admin_panel.php`
- [Admin DB Config](https://github.com/t-raptor/school-honeypot-project/blob/main/util/admin_config.php): `util/admin_config.php`
- [Account Actions](https://github.com/t-raptor/school-honeypot-project/tree/main/admin_actions): `admin_actions`
- [Avatar Upload](https://github.com/t-raptor/school-honeypot-project/blob/main/util/resizeAndUploadAvatar.js): `util/resizeAndUploadAvatar.js`
- **User Records**

### Security Challenges

- [Challenge List](https://github.com/t-raptor/school-honeypot-project/blob/main/challenges.php): `challenges.php`
- [Login Guard](https://github.com/t-raptor/school-honeypot-project/blob/main/util/login_check.php): `util/login_check.php`
- [Challenge DB Config](https://github.com/t-raptor/school-honeypot-project/blob/main/util/challenge_check_config.php): `util/challenge_check_config.php`
- [Solved Recorder](https://github.com/t-raptor/school-honeypot-project/blob/main/util/save_solved_challenge.php): `util/save_solved_challenge.php`
- [SQL Injection](https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_SQLi.php): `challenges/challenge_SQLi.php`
- [XSS Exercises](https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_XSS.php): `challenges/challenge_XSS.php`
- [Access Control](https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_Access_Control.php): `challenges/challenge_Access_Control.php`
- [CSRF Exercise](https://github.com/t-raptor/school-honeypot-project/blob/main/challenges/challenge_CSRF.php): `challenges/challenge_CSRF.php`
- [Additional Exercises](https://github.com/t-raptor/school-honeypot-project/tree/main/challenges): `challenges`
- **Challenge Records**

### Network Honeypot

- [Socket Listener](https://github.com/t-raptor/school-honeypot-project/blob/main/honeypot/honeypot.py): `honeypot/honeypot.py`
- **Attempt Log**

### Log Monitoring

- **Filebeat**
- **Elasticsearch**
- **Kibana**

### Other components

- **Visitor**
- **Network Prober**

## Connections

- Visitor → Registration: registers (evidence: `README.md`)
- Visitor → Login: authenticates (evidence: `README.md`)
- Registration → Account DB Config: loads config (evidence: `register.php`)
- Login → Account DB Config: loads config (evidence: `login.php`)
- Registration → User Records: creates account (evidence: `register.php`)
- Login → User Records: authenticates
- Visitor → Challenge List: opens (evidence: `README.md`)
- Challenge List → Login Guard: checks session (evidence: `challenges.php`)
- Challenge List → Challenge DB Config: loads config (evidence: `challenges.php`)
- Challenge List → Challenge Records: reads progress (evidence: `challenges.php`)
- Challenge List → SQL Injection: links challenge (evidence: `challenges.php`)
- Challenge List → XSS Exercises: links challenge (evidence: `challenges.php`)
- Challenge List → Access Control: links challenge (evidence: `challenges.php`)
- Challenge List → CSRF Exercise: links challenge (evidence: `challenges.php`)
- Challenge List → Additional Exercises: links challenge (evidence: `challenges.php`)
- SQL Injection → Login Guard: checks session (evidence: `challenges/challenge_SQLi.php`)
- SQL Injection → SQL Injection: records solve (evidence: `challenges/challenge_SQLi.php`)
- SQL Injection → Challenge Records: writes solution
- XSS Exercises → Login Guard: checks session (evidence: `challenges/challenge_XSS.php`)
- Access Control → Login Guard: checks session (evidence: `challenges/challenge_Access_Control.php`)
- Access Control → Solved Recorder: records solve (evidence: `challenges/challenge_Access_Control.php`)
- CSRF Exercise → Login Guard: checks session (evidence: `challenges/challenge_CSRF.php`)
- CSRF Exercise → Solved Recorder: records solve (evidence: `challenges/challenge_CSRF.php`)
- Solved Recorder → Challenge DB Config: loads config (evidence: `util/save_solved_challenge.php`)
- Solved Recorder → Challenge Records: writes solution (evidence: `util/save_solved_challenge.php`)
- Visitor → Admin Panel: manages accounts (evidence: `README.md`)
- Admin Panel → Admin DB Config: loads config (evidence: `admin_panel.php`)
- Admin Panel → User Records: reads users (evidence: `admin_panel.php`)
- Admin Panel → Account Actions: links actions (evidence: `admin_panel.php`)
- Account Actions → User Records: updates accounts
- Visitor → Avatar Upload: uploads avatar (evidence: `README.md`)
- Network Prober → Socket Listener: connects (evidence: `README.md`)
- Socket Listener → Attempt Log: records attempts (evidence: `README.md`)
- Socket Listener → Filebeat: ships logs (evidence: `README.md`)
- User Records → Filebeat: ships web logs (evidence: `README.md`)
- Filebeat → Elasticsearch: ships events (evidence: `README.md`)
- Elasticsearch → Kibana: powers dashboards (evidence: `README.md`)
