# adamlbs/dohexftlk architecture

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

- Interactive diagram: https://gitdiagram.com/adamlbs/dohexftlk
- Repository: https://github.com/adamlbs/dohexftlk

## Overview

DoHExfTlk is a research toolkit for exercising DNS-over-HTTPS exfiltration and studying its detection. The main workflow configures and runs a client to encode and send file chunks as DoH queries; the server-side interceptor observes traffic and the exfiltration server reconstructs captured data. Separately, captured traffic is analyzed behaviorally and classified with trained ML models, with a threshold-based DoHxP detector as another analysis capability. The README documents infrastructure and analysis links not implemented in the sampled source; those relationships are cited as documented rather than source-verified.

Main entry points: [`ml_analyzer/predictor.py`](https://github.com/adamlbs/dohexftlk/blob/main/ml_analyzer/predictor.py) (ML Predictor), [`exfiltration/client/run_client.py`](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/run_client.py) (Scenario Runner), [`exfiltration/client/client.py`](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/client.py) (DoH Exfiltration Client), [`models`](https://github.com/adamlbs/dohexftlk/tree/main/models) (Trained Models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Exfiltration Client"]
  node_runner["Scenario Runner<br/>[run_client.py]"]
  node_config_loader["JSON Config Loader"]
  node_config_generator["Config Generator"]
  node_exfil_client["DoH Exfiltration Client<br/>[client.py]"]
end

subgraph group_infra["DoH Infrastructure"]
  node_tls_proxy["TLS Proxy"]
  node_doh_server["DoH Server"]
  node_resolver["DNS Resolver<br/>[unbound.conf]"]
end

subgraph group_capture["Capture And Reconstruction"]
  node_traffic_capture["Traffic Capture"]
  node_interceptor["DoH Interceptor"]
  node_exfil_server["Exfiltration Server<br/>[server.py]"]
  node_artifacts[("Reconstructed Files")]
end

subgraph group_analysis["Detection And Analysis"]
  node_dohlyzer["DoHLyzer Flow Analysis"]
  node_pattern_analysis["Pattern Analysis<br/>[detect_dohxp.py]"]
  node_flow_filter["Detection CSV Filter"]
  node_ml_trainer["ML Trainer<br/>[model_trainer.py]"]
  node_ml_predictor["ML Predictor<br/>[predictor.py]"]
  node_dohxp_trainer["DoHxP Trainer"]
  node_dohxp_evaluator["DoHxP Evaluator<br/>[evaluate_dohxp.py]"]
  node_model_store[("Trained Models")]
end

node_operator(("Operator"))

node_operator -->|"runs scenario"| node_runner
node_runner -->|"loads settings"| node_config_loader
node_runner -->|"starts transfer"| node_exfil_client
node_config_loader -->|"builds config"| node_exfil_client
node_operator -->|"creates config"| node_config_generator
node_exfil_client -->|"sends HTTPS DoH"| node_tls_proxy
node_tls_proxy -->|"forwards queries"| node_doh_server
node_doh_server -->|"sends DNS query"| node_resolver
node_traffic_capture -->|"provides traffic"| node_dohlyzer
node_traffic_capture -->|"provides flows"| node_pattern_analysis
node_dohlyzer -->|"provides flow data"| node_ml_predictor
node_pattern_analysis -.->|"provides findings"| node_ml_predictor
node_ml_predictor -->|"loads models"| node_model_store
node_ml_trainer -->|"saves models"| node_model_store
node_dohxp_trainer -.->|"trains classifier"| node_model_store
node_flow_filter -->|"filters input"| node_ml_predictor
node_operator -->|"monitors traffic"| node_interceptor
node_interceptor -.->|"dispatches queries"| node_exfil_server
node_exfil_server -->|"reconstructs files"| node_artifacts
node_operator -.->|"evaluates flows"| node_dohxp_evaluator

click node_runner "https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/run_client.py"
click node_config_loader "https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/json_config_loader.py"
click node_config_generator "https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/config_generator.py"
click node_exfil_client "https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/client.py"
click node_resolver "https://github.com/adamlbs/dohexftlk/blob/main/resolver/unbound.conf"
click node_traffic_capture "https://github.com/adamlbs/dohexftlk/tree/main/traffic_analyzer"
click node_interceptor "https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/server/traffic_interceptor.py"
click node_exfil_server "https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/server/server.py"
click node_pattern_analysis "https://github.com/adamlbs/dohexftlk/blob/main/classifier/dohxp/detect_dohxp.py"
click node_flow_filter "https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/filter_detection_csv.sh"
click node_ml_trainer "https://github.com/adamlbs/dohexftlk/blob/main/ml_analyzer/model_trainer.py"
click node_ml_predictor "https://github.com/adamlbs/dohexftlk/blob/main/ml_analyzer/predictor.py"
click node_dohxp_trainer "https://github.com/adamlbs/dohexftlk/blob/main/classifier/train_classifier.py"
click node_dohxp_evaluator "https://github.com/adamlbs/dohexftlk/blob/main/classifier/dohxp/evaluate_dohxp.py"
click node_model_store "https://github.com/adamlbs/dohexftlk/tree/main/models"

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_runner,node_config_loader,node_config_generator,node_exfil_client toneBlue
class node_tls_proxy,node_doh_server,node_resolver toneAmber
class node_traffic_capture,node_interceptor,node_exfil_server,node_artifacts toneMint
class node_dohlyzer,node_pattern_analysis,node_flow_filter,node_ml_trainer,node_ml_predictor,node_dohxp_trainer,node_dohxp_evaluator,node_model_store toneRose
class node_operator toneIndigo
```

## Components

### Exfiltration Client

- [Scenario Runner](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/run_client.py): `exfiltration/client/run_client.py`
- [JSON Config Loader](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/json_config_loader.py): `exfiltration/client/json_config_loader.py`
- [Config Generator](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/config_generator.py): `exfiltration/client/config_generator.py`
- [DoH Exfiltration Client](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/client.py): `exfiltration/client/client.py`

### DoH Infrastructure

- **TLS Proxy**
- **DoH Server**
- [DNS Resolver](https://github.com/adamlbs/dohexftlk/blob/main/resolver/unbound.conf): `resolver/unbound.conf`

### Capture And Reconstruction

- [Traffic Capture](https://github.com/adamlbs/dohexftlk/tree/main/traffic_analyzer): `traffic_analyzer`
- [DoH Interceptor](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/server/traffic_interceptor.py): `exfiltration/server/traffic_interceptor.py`
- [Exfiltration Server](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/server/server.py): `exfiltration/server/server.py`
- **Reconstructed Files**

### Detection And Analysis

- **DoHLyzer Flow Analysis**
- [Pattern Analysis](https://github.com/adamlbs/dohexftlk/blob/main/classifier/dohxp/detect_dohxp.py): `classifier/dohxp/detect_dohxp.py`
- [Detection CSV Filter](https://github.com/adamlbs/dohexftlk/blob/main/exfiltration/client/filter_detection_csv.sh): `exfiltration/client/filter_detection_csv.sh`
- [ML Trainer](https://github.com/adamlbs/dohexftlk/blob/main/ml_analyzer/model_trainer.py): `ml_analyzer/model_trainer.py`
- [ML Predictor](https://github.com/adamlbs/dohexftlk/blob/main/ml_analyzer/predictor.py): `ml_analyzer/predictor.py`
- [DoHxP Trainer](https://github.com/adamlbs/dohexftlk/blob/main/classifier/train_classifier.py): `classifier/train_classifier.py`
- [DoHxP Evaluator](https://github.com/adamlbs/dohexftlk/blob/main/classifier/dohxp/evaluate_dohxp.py): `classifier/dohxp/evaluate_dohxp.py`
- [Trained Models](https://github.com/adamlbs/dohexftlk/tree/main/models): `models`

### Other components

- **Operator**

## Connections

- Operator → Scenario Runner: runs scenario (evidence: `README.md`)
- Scenario Runner → JSON Config Loader: loads settings (evidence: `exfiltration/client/run_client.py`)
- Scenario Runner → DoH Exfiltration Client: starts transfer (evidence: `exfiltration/client/run_client.py`)
- JSON Config Loader → DoH Exfiltration Client: builds config (evidence: `exfiltration/client/json_config_loader.py`)
- Operator → Config Generator: creates config (evidence: `README.md`)
- DoH Exfiltration Client → TLS Proxy: sends HTTPS DoH (evidence: `README.md`)
- TLS Proxy → DoH Server: forwards queries (evidence: `README.md`)
- DoH Server → DNS Resolver: sends DNS query (evidence: `README.md`)
- Traffic Capture → DoHLyzer Flow Analysis: provides traffic (evidence: `README.md`)
- Traffic Capture → Pattern Analysis: provides flows (evidence: `README.md`)
- DoHLyzer Flow Analysis → ML Predictor: provides flow data (evidence: `README.md`)
- Pattern Analysis → ML Predictor: provides findings
- ML Predictor → Trained Models: loads models (evidence: `ml_analyzer/predictor.py`)
- ML Trainer → Trained Models: saves models (evidence: `README.md`)
- DoHxP Trainer → Trained Models: trains classifier
- Detection CSV Filter → ML Predictor: filters input (evidence: `README.md`)
- Operator → DoH Interceptor: monitors traffic (evidence: `README.md`)
- DoH Interceptor → Exfiltration Server: dispatches queries (evidence: `exfiltration/server/server.py`)
- Exfiltration Server → Reconstructed Files: reconstructs files (evidence: `README.md`)
- Operator → DoHxP Evaluator: evaluates flows
