Skip to content

About

Timing side-channel lab with zero error feedback: recover a secret from HTTP codes and milliseconds alone.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

timing-gate-lab

battle-tested Difficulty: 3.5/5 (held after calibration) · Docker Compose · 2 services

A timing side-channel with no code leak: the API never throws, never 500s, never tells you why it said no. You get HTTP codes and milliseconds — recover a secret from the difference.

EN (this file) · 日本語 · 中文

The story

AccessGate ("the gate") guards a facility with a four-segment numeric token. The gate checks segments sequentially and short-circuits — and ops refuses to add jitter because "the variance is acceptable". The internal beacon service holds the master secret. You are outside the fence with a stopwatch.

Quick start

./RESET.sh                      # generates gate secret + seeds flags
# gate API: http://127.0.0.1:18920  (bind 0.0.0.0)

Endpoints (self-documenting):

route what
GET /status token-segments required, latency budget — free recon
POST /gate probe a candidate (token=12-34-56-7890)
POST /audit authenticated — needs the master secret
GET /metrics response-time histogram (free)

The objective

  1. Learn how the gate leaks time (segment-wise? whole-token? how many ms?).
  2. Recover the master secret well enough to pass POST /audit.
  3. Read /opt/beacon/flag.txt (mounted inside the beacon service — reachable once you can drive the audit-side surface) — the flag file is what you hand in.

Tooling included

tools/dump_samples.py — high-rate latency sampler with per-code separation; tools/sample_stats.py — median/MAD trimming and peak analysis. (These are the same instruments used in the calibration run.)

Reset

./RESET.sh — regenerates the gate secret deterministically, re-seeds flags, health-gates on /status.

Notes on "realness"

The vulnerability is structural, not simulated: secrets.compare_digest for the real comparison, time.perf_counter budgets, and an nginx front that never buffers the timing signal away. The double-peak you will find in the histogram is exactly where you expect it — the hard part is recovering the tail (last segment) against noise, at a 70 % false-positive budget.

License / series

MIT. Part of the <target>-lab pentest series — field-calibrated by an AI pentest agent (see DIFFICULTY.md).

About

Timing side-channel lab with zero error feedback: recover a secret from HTTP codes and milliseconds alone.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages