# andrvv/gapcast architecture

> Architecture diagram of the GitHub repository andrvv/gapcast, 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/andrvv/gapcast
- Repository: https://github.com/andrvv/gapcast

## Overview

Gapcast is a Linux 802.11 scanner, analyzer, and packet injector. Users launch it with interface, channel, filter, capture, or restore options; the runtime prepares the interface, captures and analyzes packets, and presents network data. Its other documented capabilities include deep scanning with distance estimates, an injection table, and an Evil Twin captive portal. The main control flow and packet processing are visible in excerpts; portal integration and some feature details are documented only in the README, so those links rely on that evidence.

Main entry points: [`gapcast.go`](https://github.com/andrvv/gapcast/blob/main/gapcast.go) (Gapcast runtime), [`libs/RadarRSSI/RadarRSSI.go`](https://github.com/andrvv/gapcast/blob/main/libs/RadarRSSI/RadarRSSI.go) (Distance estimation), [`EvilTwin/models`](https://github.com/andrvv/gapcast/tree/main/EvilTwin/models) (Portal templates), [`libs/mon/monitorchoice.go`](https://github.com/andrvv/gapcast/blob/main/libs/mon/monitorchoice.go) (Monitor mode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and scanning"]
  node_app["Gapcast runtime<br/>[gapcast.go]"]
  node_runtime_lib["Runtime utilities<br/>[libs.go]"]
  node_checks["Checks and validation<br/>[checker.go]"]
  node_live_capture["Live capture<br/>[gapcast.go]"]
  node_pcap["PCAP restore and save<br/>[gapcast.go]"]
end

subgraph group_analysis["Analysis and radar"]
  node_analysis["Device analysis<br/>[gapcast.go]"]
  node_deep_scan["Deep scanning<br/>[gapcast.go]"]
  node_radar["Distance estimation<br/>[RadarRSSI.go]"]
  node_radar_parse["Radio parsing<br/>[radiotap.go]"]
end

subgraph group_injection["Injection and portal"]
  node_injection_ui["Injection table<br/>[gapcast.go]"]
  node_packet_craft["802.11 packet crafting<br/>[packets.go]"]
  node_portal["Portal templates"]
  node_credential_capture["Credential capture<br/>[post2.php]"]
end

subgraph group_interface["Interface support"]
  node_monitor["Monitor mode<br/>[monitorchoice.go]"]
  node_drivers["Driver commands<br/>[chipset.go]"]
end

node_operator(("Operator"))
node_wireless["Wireless interface"]

node_operator -->|"starts with options"| node_app
node_app -->|"uses utilities"| node_runtime_lib
node_app -->|"checks inputs"| node_checks
node_app -->|"prepares interface"| node_monitor
node_monitor -->|"selects commands"| node_drivers
node_drivers -->|"configures mode"| node_wireless
node_app -->|"runs scan"| node_live_capture
node_live_capture -->|"updates device data"| node_analysis
node_live_capture -->|"writes packets"| node_pcap
node_app -->|"loads saved capture"| node_pcap
node_app -->|"runs target scan"| node_deep_scan
node_deep_scan -->|"estimates distance"| node_radar
node_radar -->|"parses radiotap"| node_radar_parse
node_operator -->|"selects attack"| node_injection_ui
node_app -->|"handles injection"| node_injection_ui
node_injection_ui -.->|"crafts frames"| node_packet_craft
node_injection_ui -.->|"starts Evil Twin"| node_portal
node_portal -.->|"submits credentials"| node_credential_capture

click node_app "https://github.com/andrvv/gapcast/blob/main/gapcast.go"
click node_runtime_lib "https://github.com/andrvv/gapcast/blob/main/libs/libs.go"
click node_checks "https://github.com/andrvv/gapcast/blob/main/libs/checker.go"
click node_live_capture "https://github.com/andrvv/gapcast/blob/main/gapcast.go"
click node_pcap "https://github.com/andrvv/gapcast/blob/main/gapcast.go"
click node_analysis "https://github.com/andrvv/gapcast/blob/main/gapcast.go"
click node_deep_scan "https://github.com/andrvv/gapcast/blob/main/gapcast.go"
click node_radar "https://github.com/andrvv/gapcast/blob/main/libs/RadarRSSI/RadarRSSI.go"
click node_radar_parse "https://github.com/andrvv/gapcast/blob/main/libs/RadarRSSI/libs/radiotap.go"
click node_injection_ui "https://github.com/andrvv/gapcast/blob/main/gapcast.go"
click node_packet_craft "https://github.com/andrvv/gapcast/blob/main/libs/injpacket/packets.go"
click node_portal "https://github.com/andrvv/gapcast/tree/main/EvilTwin/models"
click node_credential_capture "https://github.com/andrvv/gapcast/blob/main/EvilTwin/models/GoogleLogIn/html/post2.php"
click node_monitor "https://github.com/andrvv/gapcast/blob/main/libs/mon/monitorchoice.go"
click node_drivers "https://github.com/andrvv/gapcast/blob/main/libs/mon/chipset/chipset.go"

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_app,node_runtime_lib,node_checks,node_live_capture,node_pcap toneBlue
class node_analysis,node_deep_scan,node_radar,node_radar_parse toneAmber
class node_injection_ui,node_packet_craft,node_portal,node_credential_capture toneMint
class node_monitor,node_drivers toneRose
class node_operator,node_wireless toneIndigo
```

## Components

### Runtime and scanning

- [Gapcast runtime](https://github.com/andrvv/gapcast/blob/main/gapcast.go): `gapcast.go`
- [Runtime utilities](https://github.com/andrvv/gapcast/blob/main/libs/libs.go): `libs/libs.go`
- [Checks and validation](https://github.com/andrvv/gapcast/blob/main/libs/checker.go): `libs/checker.go`
- [Live capture](https://github.com/andrvv/gapcast/blob/main/gapcast.go): `gapcast.go`
- [PCAP restore and save](https://github.com/andrvv/gapcast/blob/main/gapcast.go): `gapcast.go`

### Analysis and radar

- [Device analysis](https://github.com/andrvv/gapcast/blob/main/gapcast.go): `gapcast.go`
- [Deep scanning](https://github.com/andrvv/gapcast/blob/main/gapcast.go): `gapcast.go`
- [Distance estimation](https://github.com/andrvv/gapcast/blob/main/libs/RadarRSSI/RadarRSSI.go): `libs/RadarRSSI/RadarRSSI.go`
- [Radio parsing](https://github.com/andrvv/gapcast/blob/main/libs/RadarRSSI/libs/radiotap.go): `libs/RadarRSSI/libs/radiotap.go`

### Injection and portal

- [Injection table](https://github.com/andrvv/gapcast/blob/main/gapcast.go): `gapcast.go`
- [802.11 packet crafting](https://github.com/andrvv/gapcast/blob/main/libs/injpacket/packets.go): `libs/injpacket/packets.go`
- [Portal templates](https://github.com/andrvv/gapcast/tree/main/EvilTwin/models): `EvilTwin/models`
- [Credential capture](https://github.com/andrvv/gapcast/blob/main/EvilTwin/models/GoogleLogIn/html/post2.php): `EvilTwin/models/GoogleLogIn/html/post2.php`

### Interface support

- [Monitor mode](https://github.com/andrvv/gapcast/blob/main/libs/mon/monitorchoice.go): `libs/mon/monitorchoice.go`
- [Driver commands](https://github.com/andrvv/gapcast/blob/main/libs/mon/chipset/chipset.go): `libs/mon/chipset/chipset.go`

### Other components

- **Operator**
- **Wireless interface**

## Connections

- Operator → Gapcast runtime: starts with options (evidence: `README.md`)
- Gapcast runtime → Runtime utilities: uses utilities (evidence: `gapcast.go`)
- Gapcast runtime → Checks and validation: checks inputs (evidence: `gapcast.go`)
- Gapcast runtime → Monitor mode: prepares interface
- Monitor mode → Driver commands: selects commands (evidence: `libs/mon/monitorchoice.go`)
- Driver commands → Wireless interface: configures mode (evidence: `libs/mon/chipset/chipset.go`)
- Gapcast runtime → Live capture: runs scan (evidence: `gapcast.go`)
- Live capture → Device analysis: updates device data (evidence: `gapcast.go`)
- Live capture → PCAP restore and save: writes packets (evidence: `gapcast.go`)
- Gapcast runtime → PCAP restore and save: loads saved capture (evidence: `gapcast.go`)
- Gapcast runtime → Deep scanning: runs target scan (evidence: `gapcast.go`)
- Deep scanning → Distance estimation: estimates distance (evidence: `gapcast.go`)
- Distance estimation → Radio parsing: parses radiotap (evidence: `libs/RadarRSSI/RadarRSSI.go`)
- Operator → Injection table: selects attack (evidence: `README.md`)
- Gapcast runtime → Injection table: handles injection (evidence: `gapcast.go`)
- Injection table → 802.11 packet crafting: crafts frames
- Injection table → Portal templates: starts Evil Twin (evidence: `README.md`)
- Portal templates → Credential capture: submits credentials (evidence: `README.md`)
