# saniamusliar/yara-live-hunt-final architecture

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

- Interactive diagram: https://gitdiagram.com/saniamusliar/yara-live-hunt-final
- Repository: https://github.com/saniamusliar/yara-live-hunt-final

## Overview

YARA Live Hunt is an educational ransomware-hunting demo: users simulate activity with harmless lab files, then inspect hash and YARA findings in a browser. The main paths are a browser-only guided demo and an optional local-terminal bridge; the bridge watches the lab and serves events and scan results to the page. The README documents the UI’s behavior, while the sampled agent confirms its local monitoring, authentication, hash checks, and fixed YARA invocation. The UI and setup scripts were not sampled, so their internal wiring is not shown.

Main entry points: [`agent/yara-hunt-agent.py`](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/agent/yara-hunt-agent.py) (Local agent), [`index.html`](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/index.html) (Hunt page), [`agent/connect.sh`](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/agent/connect.sh) (Shell connector), [`setup.sh`](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/setup.sh) (Lab setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browser experience"]
  node_browser["Hunt page<br/>[index.html]"]
  node_demo["Guided demo<br/>[index.html]"]
end

subgraph group_lab["Lab activity"]
  node_setup["Lab setup<br/>[setup.sh]"]
  node_simulation["Attack simulation<br/>[attack_sim.sh]"]
  node_shell["User shell"]
  node_labfiles[("Lab files")]
end

subgraph group_bridge["Local bridge"]
  node_connect["Shell connector<br/>[connect.sh]"]
  node_agent["Local agent<br/>[yara-hunt-agent.py]"]
  node_feed[("Activity logs")]
end

subgraph group_detection["Detection"]
  node_hashes["Known hashes"]
  node_rules["YARA rules<br/>[rules.yar]"]
  node_yara["YARA engine"]
end

node_user(("User"))

node_user -->|"uses"| node_browser
node_browser -->|"runs"| node_demo
node_user -->|"connects via"| node_shell
node_browser -->|"provides command"| node_connect
node_connect -->|"hooks"| node_shell
node_connect -->|"starts"| node_agent
node_setup -->|"builds"| node_labfiles
node_simulation -->|"simulates in"| node_labfiles
node_shell -->|"changes"| node_labfiles
node_agent -->|"watches"| node_labfiles
node_agent -->|"reads"| node_feed
node_agent -->|"checks"| node_hashes
node_agent -->|"runs scan"| node_yara
node_yara -->|"loads"| node_rules
node_browser -->|"polls"| node_agent
node_agent -->|"returns results"| node_browser

click node_browser "https://github.com/saniamusliar/yara-live-hunt-final/blob/main/index.html"
click node_demo "https://github.com/saniamusliar/yara-live-hunt-final/blob/main/index.html"
click node_setup "https://github.com/saniamusliar/yara-live-hunt-final/blob/main/setup.sh"
click node_simulation "https://github.com/saniamusliar/yara-live-hunt-final/blob/main/attack_sim.sh"
click node_connect "https://github.com/saniamusliar/yara-live-hunt-final/blob/main/agent/connect.sh"
click node_agent "https://github.com/saniamusliar/yara-live-hunt-final/blob/main/agent/yara-hunt-agent.py"
click node_rules "https://github.com/saniamusliar/yara-live-hunt-final/blob/main/rules/rules.yar"

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_browser,node_demo,node_user toneBlue
class node_setup,node_simulation,node_shell,node_labfiles toneAmber
class node_connect,node_agent,node_feed toneMint
class node_hashes,node_rules,node_yara toneRose
```

## Components

### Browser experience

- [Hunt page](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/index.html): `index.html`
- [Guided demo](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/index.html): `index.html`

### Lab activity

- [Lab setup](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/setup.sh): `setup.sh`
- [Attack simulation](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/attack_sim.sh): `attack_sim.sh`
- **User shell**
- **Lab files**

### Local bridge

- [Shell connector](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/agent/connect.sh): `agent/connect.sh`
- [Local agent](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/agent/yara-hunt-agent.py): `agent/yara-hunt-agent.py`
- **Activity logs**

### Detection

- **Known hashes**
- [YARA rules](https://github.com/saniamusliar/yara-live-hunt-final/blob/main/rules/rules.yar): `rules/rules.yar`
- **YARA engine**

### Other components

- **User**

## Connections

- User → Hunt page: uses (evidence: `README.md`)
- Hunt page → Guided demo: runs (evidence: `README.md`)
- User → User shell: connects via (evidence: `README.md`)
- Hunt page → Shell connector: provides command (evidence: `README.md`)
- Shell connector → User shell: hooks (evidence: `README.md`)
- Shell connector → Local agent: starts (evidence: `README.md`)
- Lab setup → Lab files: builds (evidence: `README.md`)
- Attack simulation → Lab files: simulates in (evidence: `README.md`)
- User shell → Lab files: changes (evidence: `README.md`)
- Local agent → Lab files: watches (evidence: `agent/yara-hunt-agent.py`)
- Local agent → Activity logs: reads (evidence: `agent/yara-hunt-agent.py`)
- Local agent → Known hashes: checks (evidence: `agent/yara-hunt-agent.py`)
- Local agent → YARA engine: runs scan (evidence: `agent/yara-hunt-agent.py`)
- YARA engine → YARA rules: loads
- Hunt page → Local agent: polls (evidence: `README.md`)
- Local agent → Hunt page: returns results (evidence: `README.md`)
