Volumes and databases
When you investigate an attack you want to see what the service actually stored: the files in its volumes (uploads, SQLite files, flag stores) and the rows in its database. The Files and Database tabs of the hub's Containers screen let a player look without SSH access to the vulnbox:
- the volume browser lists a container's root filesystem and mounts, previews files as text or hex, downloads them, and opens SQLite files in the database view;
- the database browser connects from the vulnbox to the service's own databases — PostgreSQL, MySQL/MariaDB, SQLite, MSSQL, MongoDB, Redis, ClickHouse and Memcached — lists schemas, tables, collections and keys, pages through rows, runs queries, exports results, and keeps each player's query history;
- Adminer is the fallback for what the database browser does not cover, kept confirmed working by an end-to-end test.
Everything goes through the agent's connection to the hub. Nothing listens on the vulnbox for it.
What you read is the attacker's
File names, file contents and table rows come from a service an attacker may control. The hub shows them as text only, never as HTML, and cuts them at fixed sizes. Exported CSV files are data: open them in a spreadsheet with care, since a cell starting with = is kept as it is.
Queries run against the live database
A query runs on the database the checker is using. Sessions are read-only unless you ask for writes, and every statement has a time limit and a row limit, but a heavy read still costs the database time.
The volume browser
Pick a service, then one of its containers: the browser starts at the container's root (/) and lists its mounts (volumes, bind mounts, tmpfs) as places to start.
The agent reads the files through /proc/<pid>/root of the container's main process, with the same rules as file pulls:
- the container must be one vulnboxd runs for that service, running; its main process is pinned and checked against the container's cgroup, so a reused process id is refused;
- every path resolves inside the container's root (
openat2withRESOLVE_IN_ROOT): a symbolic link on the way, absolute or climbing with.., stays inside the container, and magic links (/proc/*/fd/*and the like) are refused; /proc,/sys,/devand the kernel's other filesystems are never listed or read;- only regular files are read, and a symbolic link as the file itself is refused.
Each entry shows its name, type, size, permissions, owner and group (by number, and by name from the container's own /etc/passwd and /etc/group), modification time, inode and link count. A symbolic link is described, never followed: its target is shown as text, and you can browse to it yourself. Directories are sorted by name and shown a page at a time (1000 entries at most per page); a directory with more than 100 000 names is listed from its first 100 000, and says so.
Preview shows up to 1 MiB of a file from any offset, as text when it is UTF-8 and in a hex view otherwise. Download pulls the file through the existing file pull path: the hub stores it with its BLAKE3 hash and when it was read, so it stays as it was even if the service changes it afterwards. Open in database view opens a SQLite file (see below).
The database browser
Finding the databases
The browser lists the service's databases with the credentials found for them, and you choose one (or type your own):
- database containers, recognised by their image (
postgres,mysql,mariadb,mongo,redis,valkey,memcached,clickhouse,mssql, …) or by the port they expose, with the credentials their image takes from the environment:POSTGRES_USER/POSTGRES_PASSWORD/POSTGRES_DB,MYSQL_ROOT_PASSWORD,MYSQL_USER/MYSQL_PASSWORD, theMARIADB_*ones,MONGO_INITDB_ROOT_USERNAME/_PASSWORD,MSSQL_SA_PASSWORD,CLICKHOUSE_USER/_PASSWORD, the*_FILEvariants (read from inside the container), and Redis's--requirepasson its command line; - the other containers' environment: connection URLs (
DATABASE_URL=postgres://user:pass@db/app) and the usualDB_HOST/DB_USER/DB_PASSWORD/DB_NAMEgroups (and libpq'sPGHOST, …), matched to the service's container they name; - SQLite files in the containers' mounts, by their header;
- what the database decoders captured on the wire (database decoding): users and databases from logins, and the password where the protocol sends it as it is (PostgreSQL's cleartext authentication, MSSQL's login, Redis's
AUTH).
The environment is read from each container's main process (/proc/<pid>/environ), which is what compose gave it, and filled in from the container's configuration in Docker (Config.Env) for what the process no longer shows: PostgreSQL, for one, rewrites its environment for its process title, so its POSTGRES_PASSWORD comes from Docker's (shown with the source docker-env:<container>:<variable>). Where both have a variable, the process's own value wins. Credentials are shown as found, never masked. Service configuration files are not parsed; type such credentials in by hand.
The agent connects only to the service's own containers, at their address on the service's network — never to an address the hub names.
Sessions
Each player has one session at a time: opening one closes the one they had. A session is read-only unless you tick "allow writes" when you open it, and the vulnbox can forbid writable sessions altogether (agent.browser_db_writes).
| Database | Driver | Read-only is enforced by | A query is |
|---|---|---|---|
| PostgreSQL | tokio-postgres | the server: default_transaction_read_only, and every statement in a BEGIN READ ONLY transaction rolled back afterwards; the server refuses to prepare more than one statement | one SQL statement |
| MySQL, MariaDB | mysql_async | the server: SET SESSION TRANSACTION READ ONLY; the agent takes only single reading statements (no SET, no START TRANSACTION, no executable comments, no INTO OUTFILE, no locking reads), so the session cannot be switched back | one SQL statement |
| SQLite | rusqlite (SQLite bundled) | a copy: the file (and its -wal) is copied out of the container and the copy opened with query_only; ATTACH is refused | one SQL statement |
| MSSQL | tiberius | the agent: only single reading statements, run inside a transaction that is always rolled back, with XACT_ABORT on | one SQL statement |
| MongoDB | mongodb | the agent: only reading commands (find, aggregate without $out/$merge, count, distinct, list*, stats, …) | a command document as JSON: {"find": "users", "filter": {"name": "admin"}}; "$db" picks the database |
| Redis, Valkey | redis | the agent: only reading commands (GET, HGETALL, LRANGE, SCAN, …; not KEYS, which blocks a large server) | a command line, quoted like a shell's: HGETALL "user:1" |
| ClickHouse | the agent's own HTTP client | the server: readonly=2 on every query | one SQL statement |
| Memcached | the agent's own client | the agent: only get, gets, stats, version | a command line; a storage command's data on the lines after it |
Why SQLite is opened from a copy: a reader holding SQLite's lock on the live file would make the service's next write fail with "database is locked". The copy is taken when the session opens; open the session again to see newer rows. A copy is only taken if it leaves the spool's free-space minimum (agent.min_free) on the disk, and copies an agent left behind (a crash) are deleted when it starts.
To keep the database the checker depends on usable:
- every statement has a time limit (10 s by default, at most 45 s, set per query in the editor): it is given to the database where it takes one (
statement_timeout,max_execution_time,max_statement_time,maxTimeMS,max_execution_time), and the agent cancels a statement that runs past it (PostgreSQL's cancel request, MySQL'sKILL QUERY, SQLite's interrupt) and closes the session, so nothing half-done stays on the connection; - lock waits are short (
lock_timeout,lock_wait_timeout,LOCK_TIMEOUTof 2 s), so a query never waits long behind the service's own transactions; - results are cut at a row limit (500 by default, at most 10 000) and at 1.5 MiB, and single values at 16 KiB, and the view says when it cut;
- the agent works on at most 4 requests at once (
agent.browser_running) and answers more with "busy" at once, keeps at most 8 sessions open across all players, and closes a session unused for 10 minutes; each player runs one request at a time.
A player with a writable session can change anything the credentials allow. Read-only stops writes to the data; it does not stop everything a database superuser can do from a query (PostgreSQL's pg_terminate_backend, for example, is refused by the agent, but a superuser has other ways). Use a less privileged user where the service has one.
Browsing, queries, history and export
The catalog lists, level by level, what is in the database: PostgreSQL's schemas, tables and columns; MySQL's, ClickHouse's and MSSQL's databases (and MSSQL's schemas), tables and columns; SQLite's tables and columns; MongoDB's databases and collections; Redis's databases (db0, …) and their keys (with SCAN, filtered by a pattern like user:*, with each key's type); Memcached's keys (where the server allows listing them). A table, collection or key opens as pages of rows; a Redis key is read by its type (a string's value, a hash's fields, a list's items, a sorted set's members and scores, a stream's entries).
The query editor runs a query in your session. Cells are shown as text, numbers, booleans and null; bytes that are not text are shown as hex; a MongoDB document's cells show nested objects as JSON with their keys sorted. Every query is recorded in your history (the text, the database, how many rows and how long, or the error) and in the audit log. Export runs the query again, or reads a table, up to 10 000 rows, and downloads it as CSV or JSON.
A query the decoders captured on the wire opens straight in the editor: from a flow's queries, Open in browser fills in the database the flow went to, with the flow's login where it was captured, and the statement as it was sent.
Adminer
Adminer is the fallback for databases or features the database browser does not cover yet, or when it fails. It runs on the vulnbox, in a container of its own, on demand:
- the agent starts the official Adminer image, pinned by digest (Adminer 6.1.2), on the network of the database's container, so Adminer reaches the database by its container name;
- no port is published on the vulnbox: the agent reaches Adminer at its address on that network, and the hub's requests for Adminer's pages travel over the agent's connection, as tunnelled HTTP;
- the container runs with every capability dropped, no new privileges, a read-only root filesystem (a small tmpfs for PHP's sessions), and 256 MiB of memory, half a CPU and 64 processes at most;
- it is stopped after 10 minutes without a request, and when the agent starts again; one runs per service, and a second start while one is starting is answered busy;
- it joins only an ordinary network of the database's container: a service on the host's network (
network_mode: host), with no network, or sharing another container's network is refused, so Adminer is never reachable on the vulnbox's own interfaces. Use the database browser for those; - Open in Adminer signs you in with the chosen database's credentials already filled in: you land logged in.
Adminer can write to the database, whatever the session would allow, so starting it needs the adminer, db.read and db.write permissions, and every request on the Adminer host checks them again.
Adminer is confirmed to work with PostgreSQL, MySQL, MariaDB and MSSQL (the image has their PHP extensions). SQLite files live in the service's volumes, not in Adminer's container, and the image has no MongoDB or Redis extension: those stay with the database browser.
Why Adminer needs an origin of its own
Adminer is a PHP application that renders what the database holds, and its pages run its scripts. Served from the hub's own origin, a script injection in Adminer (it has had some) would run with the player's hub session and could use the hub's API as them. Sandboxing the page without allow-same-origin does not work either: Adminer's own forms would then reach the hub cross-site, without the session cookie and with Origin: null, and fail.
So the hub serves Adminer on a second host name that points at the same API, set with HUB_ADMINER_ORIGIN, for example https://adminer.hub.example.org:
- the hub's session cookie is host-only and never sent there; that origin accepts only a cookie of its own, good for one service's Adminer, and the hub's API is never served on it;
- Open in Adminer gives the player a sign-in link there, good for 60 seconds, sealed with AES-256-GCM (the credentials it carries are not readable in the URL), which the Adminer origin trades for its cookie before logging Adminer in;
- every answer there carries a Content-Security-Policy added to Adminer's own (no framing, forms and connections to the Adminer origin only, no plugins, no
<base>),nosniff, no referrer, andCross-Origin-Opener-Policy: same-origin. Adminer opens in a tab of its own.
A script on the Adminer origin can do what the player can do in Adminer anyway, and nothing else. Without HUB_ADMINER_ORIGIN, Adminer is off; the database browser works without it.
Every SQL statement posted to Adminer is audit-logged with the player, like the database browser's.
Confirmed working
The hub's test suite has an end-to-end test (adminer_e2e_against_each_database) that, with Docker, starts PostgreSQL, MySQL, MariaDB and MSSQL containers, has a real agent start the pinned Adminer through the tunnel on their network, signs in through the hub's Adminer origin with the credentials pre-filled, and runs a query in each, checking the result on the page. The pinned version is only changed when that test passes with the new one.
Licence
Adminer is dual-licensed under the Apache License 2.0 and the GNU GPL 2.0 (either, at the user's choice). vulnboxd does not include or ship Adminer: the agent pulls the official image at run time and talks to it over HTTP, as a separate program, which raises no licensing question for vulnboxd's AGPL-3.0. Were adminer.php ever bundled, its Apache-2.0 option is compatible with the AGPL-3.0 (the GPL-2.0-only option would not be).
In the hub
The Files and Database tabs of the Containers screen (/browser?svc=<service>) are the browser.
Files:


- Pick a container, then start from its root or one of its mounts.
- Directories are listed 200 entries at a time.
- A symbolic link shows its target as text. "go to target" works out the path in the page and looks it up there: the agent never follows links.
- A file opens as text, or as a hex dump for binary data, 64 KiB at a time.
- "Download" pulls the file.
- A
*.dbor*.sqlitefile has "Open in database view", which opens it read-only.
Database:


- Lists the targets with their credentials as found, logins captured on the wire marked as such. Open one read-only, or edit it in the form first.
- "allow writes" asks for confirmation before it opens a writable session, and the session bar then says WRITABLE.
- The catalog tree opens tables, collections and keys in a rows grid that you page through.
- The query editor runs with Ctrl+Enter. When a write is refused it says so and offers to reopen the session with writes.
- Results export as CSV or JSON.
- The History tab puts an earlier query back into the editor. The Audit tab lists everyone's browsing.
- On a database flow's Queries tab, "open in browser" opens that database read-only with the statement in the editor. It does not run the statement.
Adminer: "Open … in Adminer" opens the one-time sign-in link in a new tab on the Adminer origin. If your browser blocks the tab, the link is offered again while it is still valid. Without HUB_ADMINER_ORIGIN, the panel explains why Adminer is off.
Setting it up
On the hub, the browser uses the same internal relay as containers and shells (HUB_INGEST_RELAY_LISTEN and HUB_RELAY_TOKEN for ingest, HUB_RELAY and HUB_RELAY_TOKEN for the API). For Adminer, give the hub a second host name. With the Helm chart, set api.adminerOrigin:
api:
adminerOrigin: https://adminer.hub.example.orgWith gateway.create or gateway.parentRefs, the chart adds that host to the Gateway's listeners, its certificate and the HTTPRoute by itself; it must differ from the hub's own host. Without the chart, route the host name to the API like the hub's own and tell the API:
# api
HUB_ADMINER_ORIGIN=https://adminer.hub.example.orgThe Adminer sign-in links and cookies are sealed with a key derived from HUB_SESSION_KEY (or, with --auth proxy, from HUB_RELAY_TOKEN), so every API replica accepts them. With an authenticating proxy in front, let the proxy cover the Adminer host name too.
On the vulnbox, what the hub may do is decided in the agent's settings, which the hub cannot change:
agent:
browser_files: true # list and read the containers' files
browser_db: true # open database sessions (and Adminer)
browser_db_writes: true # let a player ask for a session that may write
browser_sessions: 8 # sessions open at once, all players
browser_running: 4 # requests worked on at once; more are "busy"
browser_timeout: 10 # a query's time limit unless the player sets one, in seconds
browser_max_timeout: 60 # the most a player may set (the hub caps every query at 45 s)
browser_idle: 600 # unused sessions are closed after this, in seconds
browser_sqlite_max: 256M # the largest SQLite file copied to be opened
browser_adminer: true # let the hub start Adminer
browser_adminer_idle: 600 # Adminer is stopped after this, in secondsAdminer is started with the docker command, so the vulnbox needs it (vulnboxd does anyway) and the pinned image (docker pull it beforehand if the vulnbox cannot reach Docker Hub during the game).
Building the agent with fewer drivers
Each database driver is a Cargo feature of the agent crate, all on by default, so a smaller agent can be built without the ones a game does not need; a kind of database without its driver is answered with "unsupported".
| Feature | Database | Crate |
|---|---|---|
postgres | PostgreSQL | tokio-postgres |
mysql | MySQL, MariaDB | mysql_async (pure-Rust compression, no TLS) |
sqlite | SQLite | rusqlite with SQLite bundled |
mssql | MSSQL | tiberius (TDS 7.3, no TLS: servers that force encryption are not reached) |
mongodb | MongoDB | mongodb (no DNS resolver) |
redis | Redis, Valkey | redis |
clickhouse | ClickHouse | none: the agent's own HTTP client |
Memcached and the Adminer tunnel need no crate either.
Accountability
Every listing, file read, download, session, query (with its text), export, Adminer start and stop, Adminer sign-in and SQL statement posted to Adminer is in the hub's audit log with the player and the time; the Audit view of the browser lists them. The agent logs every request too, with who asked and how it ended (never a password or a query's text).