Skip to content

redteam: Phase 3 part 3 — S3 exfil with inherited creds + the artifact-poisoner rows - #324

Open
randomizedcoder wants to merge 2 commits into
mainfrom
redteam/phase3-part3
Open

randomizedcoder wants to merge 2 commits into
mainfrom
redteam/phase3-part3

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner

Phase 3 part 3 — the Garage/S3 + artifact rows (rt-3-2, rt-7-1..3)

Full matrix after this PR: 22 scenarios, 0 failed (~70 min).

scenario verdict the chain
rt-3-2 S3 exfil with inherited creds CONFIRMED (15/15) the attack Set leaves the S3 credential fields empty; Set's secret-preservation rule (grpc_configService.go — "empty means unchanged, not clear") inherits the running creds, so the daemon brings its own access/secret key to the attacker's endpoint. The attacker's permissive fake S3 accepts the probe + PUTs: 43 parquet objects (host=rt-victim keys, victim data in the column bytes) + the victim's access key id in every SigV4 Authorization header. Tier-4 blind: the victim's in-VM Garage froze (535→535). Only detector: the Set audit line. Restored + final Get.
rt-7-1 zstd decompression bomb BLOCKED (10/10) the plan's expected outcome holds: the 256 MiB cap (pkg/ipasn readZstdFile, io.LimitReader) refuses a 9361× bomb (1.1 MiB → 10 GiB) at the cap, the good table keeps serving, the daemon stays healthy, RSS bounded (~1.1 GiB peak incl. the read buffer); the under-cap 240 MiB bomb is refused at the parquet open; every refusal counted.
rt-7-2 bootstrap artifact swap CONFIRMED (16/16) the same-name file loads without complaint (no integrity check at load; the Nix deploy's answer is the build-time lock — nix/ipmeta-bootstrap-lock.json, documented). The poison is semantic: a one-row table over the remote dial target puts networkOwner=ATTACKER-NET into 22,784 reported record lines.
rt-7-3 poisoned prefix semantics BLOCKED (9/9) bounded by construction: 100k duplicate-/32 rows load in ~60 ms (garbage skipped, no panic, daemon healthy); the depth ladder (every prefix length 0..32) loads equally cleanly.

Product findings pinned by rt-7-2 (follow-up candidates)

  1. Bootstrap-only loads are invisible in metrics: loadInitialAsn calls ReloadArtifact directly, bypassing loadAsn's gauge publish — the table in service publishes no loadAsn gauges until a live load happens.
  2. The live refresh overwrites the bootstrap table within one tick when both are configured (measured: the poisoned bootstrap lasted exactly 5 s before the stale live artifact won).

Harness pieces

  • XTCP2_DEST (tcp | s3): s3 boots an in-VM Garage v2.1.0 fixture on the victim (bucket xtcp2-records, fixed imported key — mirrors nix/modules/garage-bucket-bootstrap.nix), and the daemon runs the §29 S3 sink shape with fast deterministic flush knobs.
  • XTCP2_ENRICH (none | asn): the ASN enricher with a bind-mounted artifact dir (-asnRefreshInterval 5s, -ipmetaBootstrapPath on the mount).
  • tools/ipfeed-fixture (static, rides the attacker tools tar): crafts collector-shaped parquet.zst artifacts (dup32/ladder/random24 shapes, arbitrary -prefix, interleaved garbage rows) and zstd bombs with a target decompressed size.
  • vm_pull in lib/ssh.sh (attacker → harness → victim artifact hops); four shell-lint hardening fixes along the way (URL-encoded object keys, grep -c exit codes, minio label order, garage v2 CLI/key formats).

Evidence: vagrant/redteam/evidence/20261124T0{63147,65747,83620,85513}-*; findings rows in vagrant/redteam/findings.md; plan rows amended with the verdicts in docs/redteam-plan.md.

Four scenarios (all in redteam-matrix; 22 scenarios, 0 failed):

rt-3-2 (CONFIRMED, 15/15) — S3 destination exfil with INHERITED creds:
the s3parquet twin of rt-3-1 with one twist stronger. The attack Set leaves
the S3 credential fields EMPTY, and Set's secret-preservation rule
('empty means unchanged, not clear') inherits the RUNNING creds — the
daemon brings its own access/secret key to the attacker's endpoint. The
attacker's permissive fake S3 (~60-line python server; signature
validation is up to the server's owner) accepts the BucketExists probe +
the PUTs: 43 parquet objects with host=rt-victim keys, victim data in
the parquet column bytes, and the victim's ACCESS KEY ID in every SigV4
Authorization header. The tier-4 blind rides the same Set: the victim's
in-VM Garage froze (objects 535 -> 535). Only detector: the Set audit
line. Restored + verified by final Get.

rt-7-1 (BLOCKED, 10/10) — the plan's expected outcome holds: the 256 MiB
cap (pkg/ipasn readZstdFile, io.LimitReader) refuses a 9361x bomb
(1.1 MiB on disk -> 10 GiB decompressed) at the cap with the log line
naming it, the good table keeps serving (gauge unchanged), the daemon
stays healthy, RSS bounded; the under-cap 240 MiB bomb is refused at the
parquet open with the same keep-table guarantee; every refusal counted.

rt-7-2 (CONFIRMED, 16/16) — bootstrap swap: the same-name file loads
WITHOUT complaint (no integrity check at load; the Nix deploy's answer
is the build-time lock, nix/ipmeta-bootstrap-lock.json, documented). The
poison is SEMANTIC: a one-row table over the remote dial target puts
networkOwner=ATTACKER-NET into 22,784 reported record lines — the
corrupted enrichment IS the telemetry. PRODUCT FINDINGS pinned: (a) a
bootstrap-only load publishes NO loadAsn gauges (loadInitialAsn bypasses
loadAsn's publish — the table in service is invisible in metrics until a
live load); (b) with a live artifact present, the live refresh overwrites
the bootstrap table within one 5s tick (measured).

rt-7-3 (BLOCKED, 9/9) — bounded by construction: 100k duplicate-/32
rows (the maximal row-to-entry ratio, one garbage row per 1000) load in
~60ms with garbage skipped, no panic, daemon healthy; the depth ladder
(every prefix length 0..32) loads equally cleanly.

Harness pieces:
- two new deploy-shape axes: XTCP2_DEST (tcp | s3 — s3 boots an in-VM
  Garage v2.1.0 fixture mirroring nix/modules/garage-bucket-bootstrap.nix,
  bucket xtcp2-records + a fixed imported key) and XTCP2_ENRICH (none |
  asn — the enricher with the bind-mounted artifact dir, 5s refresh)
- tools/ipfeed-fixture (static, rides the attacker tools tar): crafts
  collector-shaped parquet.zst artifacts (dup32/ladder/random24 shapes,
  arbitrary -prefix, interleaved garbage rows) and zstd bombs with a
  target decompressed size (10 GiB from 1.1 MiB, 9361x)
- vm_pull in lib/ssh.sh (attacker -> harness -> victim artifact hops)
- the victim daemon row for DEST=s3 sets fast deterministic flush knobs
  (s3FlushInterval 2s, threshold 4096, jitter 0) so object counts are
  assertable within a poll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant