# mohitpaddhariya/snoop architecture

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

- Interactive diagram: https://gitdiagram.com/mohitpaddhariya/snoop
- Repository: https://github.com/mohitpaddhariya/snoop

## Overview

Investigators submit an APK through the dashboard; the API creates a case and invokes the analysis orchestrator, which extracts static evidence, optionally runs controlled dynamic analysis, parses network captures, correlates signals into C2 priorities, maps behavior to MITRE ATT&CK, and produces plain-language findings. Results are stored and exposed for case review and PDF evidence reports. The README documents enrichment, AI narration, and legal worksheet capabilities; dynamic execution is fail-closed/code-only in the sampled backend excerpt. Unshown subsystem links are omitted where invocation evidence is unavailable.

Main entry points: [`backend/app/pipeline/orchestrator.py`](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/orchestrator.py) (Analysis orchestrator), [`backend/app/api/routes.py`](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/api/routes.py) (Case routes), [`engine/dynamic/analyzer.py`](https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/analyzer.py) (Dynamic analyzer), [`frontend/app/page.tsx`](https://github.com/mohitpaddhariya/snoop/blob/main/frontend/app/page.tsx) (Case dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Investigator dashboard"]
  node_dashboard["Case dashboard<br/>[page.tsx]"]
  node_upload["Upload interface<br/>[Uploader.tsx]"]
  node_client_api["API client<br/>[api.ts]"]
  node_analysis_route["Analysis route<br/>[route.ts]"]
end

subgraph group_case["Case API and evidence"]
  node_case_api["Case routes<br/>[routes.py]"]
  node_case_store[("Case database<br/>[db.py]")]
  node_case_models["Case records<br/>[models.py]"]
  node_evidence_trace["Evidence trace<br/>[tracing.py]"]
  node_pdf_route["PDF route<br/>[route.ts]"]
end

subgraph group_analysis["APK analysis pipeline"]
  node_orchestrator["Analysis orchestrator<br/>[orchestrator.py]"]
  node_static["Static APK analysis<br/>[static_engine.py]"]
  node_ioc["IOC extraction<br/>[ioc_extractor.py]"]
  node_network["PCAP analysis<br/>[pcap_engine.py]"]
  node_enrichment["Threat enrichment<br/>[enrichment.py]"]
  node_scoring["C2 scoring<br/>[c2_scorer.py]"]
  node_mitre["MITRE mapping<br/>[mitre.py]"]
  node_ai_summary["AI summaries<br/>[ai_summarizer.py]"]
  node_contract["Result schemas<br/>[schemas.py]"]
end

subgraph group_dynamic["Dynamic sandbox"]
  node_dynamic_engine["Dynamic analyzer<br/>[analyzer.py]"]
  node_dynamic_capture["Sandbox capture<br/>[capture.py]"]
  node_dynamic_backend["Emulator backend<br/>[backends.py]"]
  node_normalizer["Behavior normalizer<br/>[normalizer.py]"]
end

subgraph group_report["Results and reporting"]
  node_result_view["Case results<br/>[CaseReport.tsx]"]
  node_correlation_view["Correlation view"]
  node_pdf_report["Evidence PDF<br/>[builder.py]"]
end

node_investigator(("Investigator"))

node_investigator -->|"reviews cases"| node_dashboard
node_dashboard -.->|"starts upload"| node_upload
node_upload -.->|"submits APK"| node_client_api
node_client_api -->|"sends request"| node_analysis_route
node_analysis_route -.->|"calls backend"| node_case_api
node_case_api -->|"runs analysis"| node_orchestrator
node_case_api -->|"persists cases"| node_case_store
node_case_store -->|"stores records"| node_case_models
node_case_api -->|"records custody"| node_evidence_trace
node_orchestrator -->|"analyzes APK"| node_static
node_static -->|"extracts indicators"| node_ioc
node_orchestrator -->|"parses capture"| node_network
node_orchestrator -->|"runs optionally"| node_dynamic_engine
node_dynamic_engine -.->|"drives emulator"| node_dynamic_backend
node_dynamic_engine -.->|"collects behavior"| node_dynamic_capture
node_dynamic_engine -.->|"normalizes events"| node_normalizer
node_orchestrator -->|"enriches findings"| node_enrichment
node_orchestrator -->|"scores evidence"| node_scoring
node_orchestrator -->|"maps behavior"| node_mitre
node_orchestrator -->|"adds narration"| node_ai_summary
node_case_api -->|"builds report"| node_pdf_report
node_case_api -.->|"serves results"| node_result_view
node_result_view -.->|"shows correlations"| node_correlation_view
node_pdf_route -.->|"requests report"| node_case_api
node_orchestrator -->|"builds result"| node_contract
node_pdf_report -->|"renders findings"| node_contract

click node_dashboard "https://github.com/mohitpaddhariya/snoop/blob/main/frontend/app/page.tsx"
click node_upload "https://github.com/mohitpaddhariya/snoop/blob/main/frontend/components/Uploader.tsx"
click node_client_api "https://github.com/mohitpaddhariya/snoop/blob/main/frontend/lib/api.ts"
click node_analysis_route "https://github.com/mohitpaddhariya/snoop/blob/main/frontend/app/api/analyze/route.ts"
click node_case_api "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/api/routes.py"
click node_case_store "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/db.py"
click node_case_models "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/models.py"
click node_evidence_trace "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/tracing.py"
click node_orchestrator "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/orchestrator.py"
click node_static "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/static_engine.py"
click node_ioc "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/ioc_extractor.py"
click node_network "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/pcap_engine.py"
click node_enrichment "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/enrichment.py"
click node_scoring "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/c2_scorer.py"
click node_mitre "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/mitre.py"
click node_ai_summary "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/ai_summarizer.py"
click node_dynamic_engine "https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/analyzer.py"
click node_dynamic_capture "https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/capture.py"
click node_dynamic_backend "https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/backends.py"
click node_normalizer "https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/normalizer.py"
click node_result_view "https://github.com/mohitpaddhariya/snoop/blob/main/frontend/components/CaseReport.tsx"
click node_correlation_view "https://github.com/mohitpaddhariya/snoop/blob/main/frontend/components/CorrelationView.tsx"
click node_pdf_report "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/report/builder.py"
click node_pdf_route "https://github.com/mohitpaddhariya/snoop/blob/main/frontend/app/api/cases/%5Bid%5D/report.pdf/route.ts"
click node_contract "https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/schemas.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_dashboard,node_upload,node_client_api,node_analysis_route toneBlue
class node_case_api,node_case_store,node_case_models,node_evidence_trace,node_pdf_route toneAmber
class node_orchestrator,node_static,node_ioc,node_network,node_enrichment,node_scoring,node_mitre,node_ai_summary,node_contract toneMint
class node_dynamic_engine,node_dynamic_capture,node_dynamic_backend,node_normalizer toneRose
class node_result_view,node_correlation_view,node_pdf_report,node_investigator toneIndigo
```

## Components

### Investigator dashboard

- [Case dashboard](https://github.com/mohitpaddhariya/snoop/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Upload interface](https://github.com/mohitpaddhariya/snoop/blob/main/frontend/components/Uploader.tsx): `frontend/components/Uploader.tsx`
- [API client](https://github.com/mohitpaddhariya/snoop/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Analysis route](https://github.com/mohitpaddhariya/snoop/blob/main/frontend/app/api/analyze/route.ts): `frontend/app/api/analyze/route.ts`

### Case API and evidence

- [Case routes](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/api/routes.py): `backend/app/api/routes.py`
- [Case database](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/db.py): `backend/app/db.py`
- [Case records](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/models.py): `backend/app/models.py`
- [Evidence trace](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/tracing.py): `backend/app/tracing.py`
- [PDF route](https://github.com/mohitpaddhariya/snoop/blob/main/frontend/app/api/cases/%5Bid%5D/report.pdf/route.ts): `frontend/app/api/cases/[id]/report.pdf/route.ts`

### APK analysis pipeline

- [Analysis orchestrator](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/orchestrator.py): `backend/app/pipeline/orchestrator.py`
- [Static APK analysis](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/static_engine.py): `backend/app/pipeline/static_engine.py`
- [IOC extraction](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/ioc_extractor.py): `backend/app/pipeline/ioc_extractor.py`
- [PCAP analysis](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/pcap_engine.py): `backend/app/pipeline/pcap_engine.py`
- [Threat enrichment](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/enrichment.py): `backend/app/pipeline/enrichment.py`
- [C2 scoring](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/c2_scorer.py): `backend/app/pipeline/c2_scorer.py`
- [MITRE mapping](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/mitre.py): `backend/app/pipeline/mitre.py`
- [AI summaries](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/pipeline/ai_summarizer.py): `backend/app/pipeline/ai_summarizer.py`
- [Result schemas](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Dynamic sandbox

- [Dynamic analyzer](https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/analyzer.py): `engine/dynamic/analyzer.py`
- [Sandbox capture](https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/capture.py): `engine/dynamic/capture.py`
- [Emulator backend](https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/backends.py): `engine/dynamic/backends.py`
- [Behavior normalizer](https://github.com/mohitpaddhariya/snoop/blob/main/engine/dynamic/normalizer.py): `engine/dynamic/normalizer.py`

### Results and reporting

- [Case results](https://github.com/mohitpaddhariya/snoop/blob/main/frontend/components/CaseReport.tsx): `frontend/components/CaseReport.tsx`
- [Correlation view](https://github.com/mohitpaddhariya/snoop/blob/main/frontend/components/CorrelationView.tsx): `frontend/components/CorrelationView.tsx`
- [Evidence PDF](https://github.com/mohitpaddhariya/snoop/blob/main/backend/app/report/builder.py): `backend/app/report/builder.py`

### Other components

- **Investigator**

## Connections

- Investigator → Case dashboard: reviews cases (evidence: `README.md`)
- Case dashboard → Upload interface: starts upload
- Upload interface → API client: submits APK
- API client → Analysis route: sends request (evidence: `frontend/lib/api.ts`)
- Analysis route → Case routes: calls backend
- Case routes → Analysis orchestrator: runs analysis (evidence: `backend/app/api/routes.py`)
- Case routes → Case database: persists cases (evidence: `backend/app/api/routes.py`)
- Case database → Case records: stores records (evidence: `backend/app/db.py`)
- Case routes → Evidence trace: records custody (evidence: `backend/app/api/routes.py`)
- Analysis orchestrator → Static APK analysis: analyzes APK (evidence: `backend/app/pipeline/orchestrator.py`)
- Static APK analysis → IOC extraction: extracts indicators (evidence: `backend/app/pipeline/static_engine.py`)
- Analysis orchestrator → PCAP analysis: parses capture (evidence: `backend/app/pipeline/orchestrator.py`)
- Analysis orchestrator → Dynamic analyzer: runs optionally (evidence: `backend/app/pipeline/orchestrator.py`)
- Dynamic analyzer → Emulator backend: drives emulator
- Dynamic analyzer → Sandbox capture: collects behavior
- Dynamic analyzer → Behavior normalizer: normalizes events
- Analysis orchestrator → Threat enrichment: enriches findings (evidence: `backend/app/pipeline/orchestrator.py`)
- Analysis orchestrator → C2 scoring: scores evidence (evidence: `backend/app/pipeline/orchestrator.py`)
- Analysis orchestrator → MITRE mapping: maps behavior (evidence: `backend/app/pipeline/orchestrator.py`)
- Analysis orchestrator → AI summaries: adds narration (evidence: `backend/app/pipeline/orchestrator.py`)
- Case routes → Evidence PDF: builds report (evidence: `backend/app/api/routes.py`)
- Case routes → Case results: serves results
- Case results → Correlation view: shows correlations
- PDF route → Case routes: requests report
- Analysis orchestrator → Result schemas: builds result (evidence: `backend/app/pipeline/orchestrator.py`)
- Evidence PDF → Result schemas: renders findings (evidence: `backend/app/report/builder.py`)
