# vanhoefm/airsnitch architecture

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

- Interactive diagram: https://gitdiagram.com/vanhoefm/airsnitch
- Repository: https://github.com/vanhoefm/airsnitch

## Overview

AirSnitch is a Wi-Fi client-isolation security-testing tool. The documented user goal is to test a network for isolation bypasses; the README identifies GTK group-key abuse, gateway bouncing, and port stealing as its principal attack categories. The tree also exposes measurement, host-control, and server-triggered port-restoration code, but their runtime wiring is not shown in the excerpts, so those relationships are left unverified rather than inferred.

Main entry points: [`airsnitch/research/airsnitch.py`](https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py) (AirSnitch tests), [`hostap.py`](https://github.com/vanhoefm/airsnitch/blob/main/hostap.py) (Host control), [`server_triggered_port_restoration/client_ping.py`](https://github.com/vanhoefm/airsnitch/blob/main/server_triggered_port_restoration/client_ping.py) (Port restoration trigger), [`airsnitch/research/airsnitch_measure.py`](https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch_measure.py) (Test measurement)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tests["Isolation tests"]
  node_airsnitch["AirSnitch tests<br/>[airsnitch.py]"]
  node_gtk["GTK abuse<br/>[airsnitch.py]"]
  node_gateway["Gateway bouncing<br/>[airsnitch.py]"]
  node_portsteal["Port stealing<br/>[airsnitch.py]"]
  node_measure["Test measurement"]
end

subgraph group_control["Host control"]
  node_hostctl["Host control<br/>[hostap.py]"]
  node_daemon["Daemon interface<br/>[daemon.py]"]
  node_station["Station interface<br/>[station.py]"]
end

subgraph group_restoration["Traffic restoration"]
  node_trigger["Port restoration trigger<br/>[client_ping.py]"]
end

node_operator(("Guest tester"))
node_network(("Wi-Fi network"))

node_operator -->|"runs tests"| node_airsnitch
node_airsnitch -->|"tests for"| node_gtk
node_airsnitch -->|"tests for"| node_gateway
node_airsnitch -->|"tests for"| node_portsteal
node_airsnitch -.->|"may measure"| node_measure
node_hostctl -.->|"may use"| node_daemon
node_hostctl -.->|"may use"| node_station
node_trigger -.->|"may restore"| node_network
node_airsnitch -->|"tests isolation"| node_network

click node_airsnitch "https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py"
click node_gtk "https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py"
click node_gateway "https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py"
click node_portsteal "https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py"
click node_measure "https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch_measure.py"
click node_hostctl "https://github.com/vanhoefm/airsnitch/blob/main/hostap.py"
click node_daemon "https://github.com/vanhoefm/airsnitch/blob/main/library/daemon.py"
click node_station "https://github.com/vanhoefm/airsnitch/blob/main/library/station.py"
click node_trigger "https://github.com/vanhoefm/airsnitch/blob/main/server_triggered_port_restoration/client_ping.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_airsnitch,node_gtk,node_gateway,node_portsteal,node_measure toneBlue
class node_hostctl,node_daemon,node_station toneAmber
class node_trigger toneMint
class node_operator,node_network toneIndigo
```

## Components

### Isolation tests

- [AirSnitch tests](https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py): `airsnitch/research/airsnitch.py`
- [GTK abuse](https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py): `airsnitch/research/airsnitch.py`
- [Gateway bouncing](https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py): `airsnitch/research/airsnitch.py`
- [Port stealing](https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch.py): `airsnitch/research/airsnitch.py`
- [Test measurement](https://github.com/vanhoefm/airsnitch/blob/main/airsnitch/research/airsnitch_measure.py): `airsnitch/research/airsnitch_measure.py`

### Host control

- [Host control](https://github.com/vanhoefm/airsnitch/blob/main/hostap.py): `hostap.py`
- [Daemon interface](https://github.com/vanhoefm/airsnitch/blob/main/library/daemon.py): `library/daemon.py`
- [Station interface](https://github.com/vanhoefm/airsnitch/blob/main/library/station.py): `library/station.py`

### Traffic restoration

- [Port restoration trigger](https://github.com/vanhoefm/airsnitch/blob/main/server_triggered_port_restoration/client_ping.py): `server_triggered_port_restoration/client_ping.py`

### Other components

- **Guest tester**
- **Wi-Fi network**

## Connections

- Guest tester → AirSnitch tests: runs tests
- AirSnitch tests → GTK abuse: tests for
- AirSnitch tests → Gateway bouncing: tests for
- AirSnitch tests → Port stealing: tests for
- AirSnitch tests → Test measurement: may measure
- Host control → Daemon interface: may use
- Host control → Station interface: may use
- Port restoration trigger → Wi-Fi network: may restore
- AirSnitch tests → Wi-Fi network: tests isolation
