# proofofbots/web-re-toolkit architecture

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

- Interactive diagram: https://gitdiagram.com/proofofbots/web-re-toolkit
- Repository: https://github.com/proofofbots/web-re-toolkit

## Overview

web-re-toolkit combines headless Akamai and Kasada protection clients with a Rust reverse-engineering toolkit. The primary workflow is to capture a browser run, analyze and execute vendor JavaScript in a V8 sandbox, then inspect or validate the resulting payload and behavior. Separate capabilities cover VM lifting, wire-format analysis, environment and device profiles, and cross-build identification. The README documents the workflows; sampled source confirms selected runtime and CLI entry points, but many subsystem internals were not inspected.

Main entry points: [`crates/wre-cli/src/main.rs`](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-cli/src/main.rs) (wre CLI), [`clients/akamai/src/session.rs`](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/session.rs) (Akamai client), [`clients/kasada/src/session.rs`](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/kasada/src/session.rs) (Kasada client), [`crates/wre-sandbox/src/install.rs`](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-sandbox/src/install.rs) (V8 browser surface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_protection["Protection clients"]
  node_akamai["Akamai client<br/>[session.rs]"]
  node_akasensor["Akamai sensors<br/>[sensor.rs]"]
  node_akamai_discovery["Akamai discovery<br/>[discover.rs]"]
  node_akacookies["Akamai cookies<br/>[cookies.rs]"]
  node_kasada["Kasada client<br/>[session.rs]"]
  node_kasada_discovery["Kasada discovery<br/>[discover.rs]"]
  node_kasada_report["Kasada reports<br/>[report.rs]"]
  node_altcha["ALTCHA client<br/>[lib.rs]"]
  node_transport["Browser transport<br/>[http.rs]"]
end

subgraph group_runtime["Browser runtime"]
  node_capture["Browser capture<br/>[collector.rs]"]
  node_cdp["Chrome CDP<br/>[session.rs]"]
  node_sandbox["V8 browser surface<br/>[install.rs]"]
  node_profiles["Device profiles<br/>[browser.rs]"]
  node_live["Embedded V8 realm<br/>[realm.rs]"]
end

subgraph group_reverse["Reverse engineering"]
  node_cli["wre CLI<br/>[main.rs]"]
  node_deobf["JavaScript deobfuscation<br/>[pipeline.rs]"]
  node_vm["VM lifting<br/>[lift.rs]"]
end

subgraph group_analysis["Analysis and validation"]
  node_pow["Proof of work<br/>[search.rs]"]
  node_wire["Wire analysis<br/>[payload.rs]"]
  node_ident["Build identification<br/>[locate.rs]"]
  node_variants["Variant sweeps<br/>[grouping.rs]"]
  node_oracle["Payload grading<br/>[fidelity.rs]"]
end

subgraph group_clientkit["Client SDK"]
  node_client_sdk["Headless client SDK<br/>[client.rs]"]
  node_client_host["Client host<br/>[hub.rs]"]
  node_codegen["Client codegen<br/>[lib.rs]"]
end

node_engineer(("Researcher"))

node_engineer -->|"runs commands"| node_cli
node_engineer -->|"uses client"| node_akamai
node_cli -->|"captures run"| node_capture
node_cli -->|"deobfuscates script"| node_deobf
node_cli -->|"lifts VM"| node_vm
node_cli -->|"inspects payload"| node_wire
node_cli -->|"locates builds"| node_ident
node_cli -->|"plans sweeps"| node_variants
node_cli -->|"grades payload"| node_oracle
node_cli -->|"captures profiles"| node_profiles
node_capture -->|"drives browser"| node_cdp
node_akamai -->|"discovers page"| node_akamai_discovery
node_akamai -->|"uses cookie jar"| node_akacookies
node_akamai -->|"runs sensor"| node_akasensor
node_akamai -->|"runs headlessly"| node_sandbox
node_kasada -->|"discovers page"| node_kasada_discovery
node_kasada -->|"collects reports"| node_kasada_report
node_kasada -->|"runs headlessly"| node_sandbox
node_altcha -->|"solves challenge"| node_pow
node_akamai -.->|"sends requests"| node_transport
node_kasada -.->|"sends requests"| node_transport
node_sandbox -.->|"hosts realm"| node_live
node_deobf -->|"mounts script"| node_live
node_engineer -->|"calls operations"| node_client_sdk
node_client_sdk -->|"uses sidecar"| node_client_host
node_codegen -->|"generates clients"| node_client_sdk

click node_cli "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-cli/src/main.rs"
click node_akamai "https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/session.rs"
click node_akasensor "https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/sensor.rs"
click node_akamai_discovery "https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/discover.rs"
click node_akacookies "https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/cookies.rs"
click node_kasada "https://github.com/proofofbots/web-re-toolkit/blob/main/clients/kasada/src/session.rs"
click node_kasada_discovery "https://github.com/proofofbots/web-re-toolkit/blob/main/clients/kasada/src/discover.rs"
click node_kasada_report "https://github.com/proofofbots/web-re-toolkit/blob/main/clients/kasada/src/report.rs"
click node_altcha "https://github.com/proofofbots/web-re-toolkit/blob/main/clients/altcha/src/lib.rs"
click node_pow "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-pow/src/search.rs"
click node_capture "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-capture/src/collector.rs"
click node_cdp "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-cdp/src/session.rs"
click node_sandbox "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-sandbox/src/install.rs"
click node_profiles "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-sandbox/src/browser.rs"
click node_live "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-live/src/realm.rs"
click node_deobf "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-js/src/pipeline.rs"
click node_vm "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-vm/src/lift.rs"
click node_wire "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-wire/src/payload.rs"
click node_ident "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-ident/src/locate.rs"
click node_variants "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-variants/src/grouping.rs"
click node_oracle "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-oracle/src/fidelity.rs"
click node_client_sdk "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-client/src/client.rs"
click node_client_host "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-clientd/src/hub.rs"
click node_codegen "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-codegen/src/lib.rs"
click node_transport "https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-net/src/http.rs"

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_akamai,node_akasensor,node_akamai_discovery,node_akacookies,node_kasada,node_kasada_discovery,node_kasada_report,node_altcha,node_transport toneBlue
class node_capture,node_cdp,node_sandbox,node_profiles,node_live toneAmber
class node_cli,node_deobf,node_vm toneMint
class node_pow,node_wire,node_ident,node_variants,node_oracle toneRose
class node_client_sdk,node_client_host,node_codegen,node_engineer toneIndigo
```

## Components

### Protection clients

- [Akamai client](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/session.rs): `clients/akamai/src/session.rs`
- [Akamai sensors](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/sensor.rs): `clients/akamai/src/sensor.rs`
- [Akamai discovery](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/discover.rs): `clients/akamai/src/discover.rs`
- [Akamai cookies](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/akamai/src/cookies.rs): `clients/akamai/src/cookies.rs`
- [Kasada client](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/kasada/src/session.rs): `clients/kasada/src/session.rs`
- [Kasada discovery](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/kasada/src/discover.rs): `clients/kasada/src/discover.rs`
- [Kasada reports](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/kasada/src/report.rs): `clients/kasada/src/report.rs`
- [ALTCHA client](https://github.com/proofofbots/web-re-toolkit/blob/main/clients/altcha/src/lib.rs): `clients/altcha/src/lib.rs`
- [Browser transport](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-net/src/http.rs): `crates/wre-net/src/http.rs`

### Browser runtime

- [Browser capture](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-capture/src/collector.rs): `crates/wre-capture/src/collector.rs`
- [Chrome CDP](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-cdp/src/session.rs): `crates/wre-cdp/src/session.rs`
- [V8 browser surface](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-sandbox/src/install.rs): `crates/wre-sandbox/src/install.rs`
- [Device profiles](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-sandbox/src/browser.rs): `crates/wre-sandbox/src/browser.rs`
- [Embedded V8 realm](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-live/src/realm.rs): `crates/wre-live/src/realm.rs`

### Reverse engineering

- [wre CLI](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-cli/src/main.rs): `crates/wre-cli/src/main.rs`
- [JavaScript deobfuscation](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-js/src/pipeline.rs): `crates/wre-js/src/pipeline.rs`
- [VM lifting](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-vm/src/lift.rs): `crates/wre-vm/src/lift.rs`

### Analysis and validation

- [Proof of work](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-pow/src/search.rs): `crates/wre-pow/src/search.rs`
- [Wire analysis](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-wire/src/payload.rs): `crates/wre-wire/src/payload.rs`
- [Build identification](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-ident/src/locate.rs): `crates/wre-ident/src/locate.rs`
- [Variant sweeps](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-variants/src/grouping.rs): `crates/wre-variants/src/grouping.rs`
- [Payload grading](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-oracle/src/fidelity.rs): `crates/wre-oracle/src/fidelity.rs`

### Client SDK

- [Headless client SDK](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-client/src/client.rs): `crates/wre-client/src/client.rs`
- [Client host](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-clientd/src/hub.rs): `crates/wre-clientd/src/hub.rs`
- [Client codegen](https://github.com/proofofbots/web-re-toolkit/blob/main/crates/wre-codegen/src/lib.rs): `crates/wre-codegen/src/lib.rs`

### Other components

- **Researcher**

## Connections

- Researcher → wre CLI: runs commands (evidence: `crates/wre-cli/src/main.rs`)
- Researcher → Akamai client: uses client (evidence: `README.md`)
- wre CLI → Browser capture: captures run (evidence: `README.md`)
- wre CLI → JavaScript deobfuscation: deobfuscates script (evidence: `README.md`)
- wre CLI → VM lifting: lifts VM (evidence: `README.md`)
- wre CLI → Wire analysis: inspects payload (evidence: `README.md`)
- wre CLI → Build identification: locates builds (evidence: `README.md`)
- wre CLI → Variant sweeps: plans sweeps (evidence: `README.md`)
- wre CLI → Payload grading: grades payload (evidence: `README.md`)
- wre CLI → Device profiles: captures profiles (evidence: `README.md`)
- Browser capture → Chrome CDP: drives browser (evidence: `README.md`)
- Akamai client → Akamai discovery: discovers page (evidence: `clients/akamai/src/session.rs`)
- Akamai client → Akamai cookies: uses cookie jar (evidence: `clients/akamai/src/session.rs`)
- Akamai client → Akamai sensors: runs sensor (evidence: `README.md`)
- Akamai client → V8 browser surface: runs headlessly (evidence: `README.md`)
- Kasada client → Kasada discovery: discovers page (evidence: `clients/kasada/src/session.rs`)
- Kasada client → Kasada reports: collects reports (evidence: `clients/kasada/src/session.rs`)
- Kasada client → V8 browser surface: runs headlessly (evidence: `README.md`)
- ALTCHA client → Proof of work: solves challenge (evidence: `clients/altcha/src/lib.rs`)
- Akamai client → Browser transport: sends requests
- Kasada client → Browser transport: sends requests
- V8 browser surface → Embedded V8 realm: hosts realm
- JavaScript deobfuscation → Embedded V8 realm: mounts script (evidence: `README.md`)
- Researcher → Headless client SDK: calls operations (evidence: `README.md`)
- Headless client SDK → Client host: uses sidecar (evidence: `README.md`)
- Client codegen → Headless client SDK: generates clients (evidence: `README.md`)
