Data path
The live page does not use simulated data. A Linux VM on Vercel connects to real sites. tcpdump records the packets. The C++ sensor reads the packets and the engine decides.
Live page
You type 3 to 8 sites and push Learn or Run test. The page shows each handshake when it arrives.
/api/live
It checks the sites, starts the VM and sends commands to it. It sends one line of JSON for each event.
10.9.0.2
A network namespace. curl sends one HTTPS request to each site. tcpdump records this link.
10.9.0.1
It forwards the traffic to the internet. In a test it can add routers or send a site to mitmproxy.
Real sites
Each site keeps one IPv4 address for the session, so the two visits go to the same server.
Step 1. Learn
One time for each VM.
- The function starts a new VM from a snapshot. This takes 1 to 3 seconds.
- The VM makes the client network and finds one IPv4 address for each site.
- tcpdump starts. It is a program that records network packets and saves them in a file (a PCAP). Then the client visits each site one time.
- After each visit, zerohour show reads the PCAP and gives JA4S, certificate key and TTL.
- These handshakes are the baseline. You can download learn.pcap.
Step 2. Test
One test for each VM. Then the VM stops.
- The scenario sets the change for each site: none, new route, new TLS settings, or mitmproxy.
- The client visits each site again. tcpdump records test-N.pcap.
- The engine compares each handshake with the baseline: checks A (JA4S), B (key), D (TTL).
- The tuned TRW adds one step for each site. At +4.60 it alerts.
- Each notice and verdict goes into the BLAKE2b-256 hash chain in the VM.
Tools and libraries
All parts run on Vercel. We did not add a server of our own.
| Tool | Version | Where it runs | What it does |
|---|---|---|---|
| Vercel Sandbox (@vercel/sandbox) | 3.9.1 | Vercel function | Starts a Firecracker Linux VM from our snapshot, runs commands in it, reads files from it. |
| Ubuntu and Linux kernel | 26.04.1, 6.18 | VM | The VM. Root access lets us use network namespaces and raw packet capture. |
| iproute2 (ip netns, veth, ip rule) | Ubuntu package | VM | Makes the client network, the gateway and the 3 extra routers for a route change. |
| iptables (nat) | 1.8.11 | VM gateway | NAT to the internet. REDIRECT sends port 443 of a site to mitmproxy. |
| tcpdump (libpcap) | Ubuntu package | VM client | A program that records network packets. It saves them in a PCAP file that Wireshark can open. Options: -i any -y LINUX_SLL --immediate-mode. |
| curl | Ubuntu package | VM client | One HTTPS request for each site. --tls-max 1.2 makes the "new TLS settings" change. |
| mitmproxy (mitmdump, transparent mode) | 12.3.1 | VM gateway | The interceptor. It ends the client's TLS with its own certificate and opens a new TLS link to the site. |
| zerohour sensor (C++17: OpenSSL 3, libpcap, libsodium) | f857a6a | VM | Built from our repo in the snapshot. zerohour show --json reads each handshake from the PCAP. |
| Engine (site/lib/engine.js, tuned TRW) | this repo | Vercel function | The same engine as the rest of the site. A parity test checks it against the C++ sensor. |
| blakejs (BLAKE2b-256) | 1.2.1 | Function and browser | Makes the hash chain of the evidence log. Your browser computes each hash again to verify the log. |
| NDJSON over fetch (TextDecoderStream) | web platform | Function and browser | Sends one JSON line for each handshake, so the score and the progress update live. |
Changes for live capture
What we added to the project for live capture.
What we added
| Change | File |
|---|---|
| A snapshot with tcpdump, mitmproxy and the sensor. The sensor is built from our GitHub repo. A new VM starts from it in 1 to 3 s. | scripts/snapshot.mjs |
| VM commands: setup, start, visit, stop, route (mitmproxy), hops (route change), lock. | lib/capture.sh |
| Learn and test in one VM, with a stream of events. The VM stops after the test. The next test learns the sites again in a new VM. | lib/live.js, api/live.js |
| Scenarios. Direct: normal, one change, many changes. Through mitmproxy: attack. | assets/live.js |
| An evidence log for the live page. The demo page and the live page use the same code. | assets/log.js |
| Safety: private addresses are refused. Maximum 4 VMs. A VM stops after its test. A VM without a test stops after 5 minutes, or when you close the page. | lib/live.js |