Challenge / AI-ML

AI Space

AI Space is a sanitized challenge note from the local HTB archive, organized for quick review by category, difficulty, evidence flow, and reusable operator

EasyPublished 2024-01-06Sanitized local writeup

Scenario

AI Space attack path

AI Space is a sanitized challenge note from the local HTB archive, organized for quick review by category, difficulty, evidence flow, and reusable operator

Objective

Challenge walkthrough focused on AI-ML evidence, validation, and reusable operator lessons.

AI Space sanitized attack graph

Walkthrough flow

01

Artifact review

02

Hypothesis

03

Validated solve path

04

Proof captured

Source coverage

High source coverage

Status: complete. This article is generated from 6 sanitized Markdown sources and keeps raw flags, credentials, keys, cookies, and reusable secrets out of the rendered blog.

94% coverage
Evidence verdict

High confidence: the page is reconstructed from a primary walkthrough plus multiple supporting notes or evidence sources. Treat the chain as source-backed, while still checking the listed source files for sensitive values.

  • AI-ML/AI-Space/writeup.md
  • htb-challenge/AI-ML/AI-Space/notes.md
  • htb-challenge/AI-ML/AI-Space/memory-summary.md
  • htb-challenge/AI-ML/AI-Space/hypothesis-board.md
  • HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/challenge__AI-ML__AI-Space__memory-summary.md.c86cfb0a67.md
  • HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/challenge__AI-ML__AI-Space__notes.md.0baeb09cc7.md

Technical Walkthrough

Writeup

Challenge

  • Name: AI-Space
  • Category: AI-ML
  • Difficulty: Easy
  • Mode: file

Summary

The challenge archive contains one NumPy pairwise distance matrix. The matrix encodes a set of 2D points whose layout is recoverable with classical multidimensional scaling. Once projected back into two dimensions and plotted, the points visually spell the flag.

Artifact Inventory

  • files/a12c733a-a7dd-47d2-872e-2f7ab5569df6.zip: original challenge archive.
  • files/extracted/distance_matrix.npy: extracted 1808 x 1808 float64 pairwise distance matrix.
  • analysis/artifact-inventory.json: archive hash, size, and contents.
  • analysis/matrix-overview.txt: matrix invariants and nearest-neighbor statistics.
  • analysis/mds-overview.txt: classical MDS eigenvalue and coordinate summary.

Analysis

The scenario talks about coordinates and signal origins, and the only extracted artifact is a distance matrix. Initial inspection showed a finite symmetric matrix with a zero diagonal, which is the expected shape for pairwise distances.

Classical multidimensional scaling was the natural validation path. Double-centering the squared distances produced a Gram matrix with two dominant positive eigenvalues and only numerical noise afterward, confirming the data is effectively two-dimensional. Plotting those two recovered dimensions produced readable HTB-format text.

Because the rendered plot visibly contains the flag, generated images were stored under loot/ rather than analysis/.

Solve

Run:

bash
cd <local workspace>
AI-ML/AI-Space/.venv/bin/python AI-ML/AI-Space/solve/solve.py

The solver loads distance_matrix.npy, reconstructs coordinates with classical MDS, and writes a readable scatter plot to loot/reconstructed-flag.png. The OCR result from that plot was captured through the harness into loot/flag.txt.

Flag

Raw flag is stored in loot/flag.txt and intentionally not reproduced here.

Lessons

When an AI/ML challenge provides only a distance matrix, inspect matrix invariants before assuming a trained model is involved. A rank-2 Euclidean distance matrix is often enough to recover hidden coordinates directly with classical MDS, and the resulting scatter may encode the answer visually.

Source-Backed Dossier

The sections below are merged from companion Markdown notes for the same case. They are rendered after sanitization so the article stays precise without publishing raw flags, credentials, or target-specific secrets.

Notes

Scope

  • Challenge: AI-Space
  • Category: AI-ML
  • Difficulty: Easy
  • Mode: file
  • Remote instance: none
  • Start time: 2026-06-09T08:18:07Z
  • Operator: harness
  • State file: challenge-state.json

Harness Status

  • Current phase: see challenge-state.json
  • Next allowed actions: see next-action.json
  • Raw flags and sensitive material stay in loot/ only. Do not paste them here.

Artifact Inventory

FileSizeSHA256TypeNotes
files/a12c733a-a7dd-47d2-872e-2f7ab5569df6.zip24631248<hash redacted>Zip archive data, at least v2.0 to extract, compression method=deflatezip entries: 1 shown in artifact inventory JSON

Evidence Ledger

TimeActionOutput/FileFindingConfidenceNext
2026-06-09T08:18:07Zharness initchallenge-state.jsonWorkspace initialized with deterministic state fileHighInventory artifacts
2026-06-09T08:18:07Zartifact inventoryanalysis/artifact-inventory.json1 artifact(s) inventoriedHighBuild or update hypotheses
2026-06-09T08:18:39Zhypothesis recordedhypothesis-board.mdRecover a hidden path or ordering from distance_matrix.npy, likely by treating it as a graph/distance matrix and mapping the resulting route or clusters to ASCII/flag text.MediumLoad the NumPy matrix, inspect shape/symmetry/value distribution, then test nearest-neighbor/MST/TSP-style ordering and decode candidate route outputs.
2026-06-09T08:22:36Zflag captureloot/flag.txtHTB-format flag captured; raw value kept in loot onlyHighWrite solution and run completion gate
2026-06-09T08:23:15Zresearch recordanalysis/research/research-records.mdResearch tagged MATCHEDMediumValidate against current evidence
2026-06-09T08:23:16Zcompletion gatechallenge-state.jsonCompletion gate passed; state marked COMPLETEHighOptional sanitized memory summary approval

Key Findings

-

RAG / Advisory Memory

RAG output is advisory only. Record evaluated retrievals with:

bash
scripts/challenge_harness.py rag-record <workspace> --query "..." --tag MATCHED|PARTIAL|MISSING|<secret redacted>|GENERIC --validation "..."

Secrets/Flags

Raw flags and sensitive material stay in loot/ only. Use scripts/challenge_harness.py capture-flag to validate and record flag capture without printing the value.

Memory Summary

Metadata

  • Platform: HackTheBox Challenges
  • Category: AI-ML
  • Challenge: AI-Space
  • Difficulty: Easy
  • Source workspace: <local workspace>

Validated Solve Chain

Concepts only. Do not include raw flags, reusable credentials, tokens, cookies, private keys, or live secrets.

1.

Reusable Lessons

-

Dead Ends

-

Tool Quirks

-

Evidence Paths

-

Ingestion Decision

  • Proposed for LightRAG: yes/no
  • Requires user approval before ingestion: yes

Hypothesis Board

Keep no more than 3 active hypotheses on Easy/Medium and 5 on Hard unless the user explicitly asks for breadth.

RankPathEvidenceMissing ProofCheapest ValidationConfidenceStatus
1Recover a hidden path or ordering from distance_matrix.npy, likely by treating it as a graph/distance matrix and mapping the resulting route or clusters to ASCII/flag text.Challenge scenario mentions coordinates, signal origins, hideouts, and tracking algorithms; ZIP contains only distance_matrix.npy.Load the NumPy matrix, inspect shape/symmetry/value distribution, then test nearest-neighbor/MST/TSP-style ordering and decode candidate route outputs.MediumActive

Closed Branches

BranchEvidence TestedFailure OutputReason ClosedRevisit Condition

Memory Summary

approval_required: true

Sanitized Memory Summary

Metadata

  • Platform: HackTheBox Challenges
  • Category: AI-ML
  • Challenge: AI-Space
  • Difficulty: Easy
  • Source workspace: <local workspace>

Validated Solve Chain

Concepts only. Do not include raw flags, reusable credentials, tokens, cookies, private keys, or live secrets.

1.

Reusable Lessons

-

Dead Ends

-

Tool Quirks

-

Evidence Paths

-

Ingestion Decision

  • Proposed for LightRAG: yes/no
  • Requires user approval before ingestion: yes

Notes

Notes

Scope

  • Challenge: AI-Space
  • Category: AI-ML
  • Difficulty: Easy
  • Mode: file
  • Remote instance: none
  • Start time: 2026-06-09T08:18:07Z
  • Operator: harness
  • State file: challenge-state.json

Harness Status

  • Current phase: see challenge-state.json
  • Next allowed actions: see next-action.json
  • Raw flags and sensitive material stay in loot/ only. Do not paste them here.

Artifact Inventory

FileSizeSHA256TypeNotes
files/a12c733a-a7dd-47d2-872e-2f7ab5569df6.zip24631248<hash redacted>Zip archive data, at least v2.0 to extract, compression method=deflatezip entries: 1 shown in artifact inventory JSON

Evidence Ledger

TimeActionOutput/FileFindingConfidenceNext
2026-06-09T08:18:07Zharness initchallenge-state.jsonWorkspace initialized with deterministic state fileHighInventory artifacts
2026-06-09T08:18:07Zartifact inventoryanalysis/artifact-inventory.json1 artifact(s) inventoriedHighBuild or update hypotheses
2026-06-09T08: <REDACTED>, likely by treating it as a graph/distance matrix and mapping the resulting route or clusters to ASCII/flag text.MediumLoad the NumPy matrix, inspect shape/symmetry/value distribution, then test nearest-neighbor/MST/TSP-style ordering and decode candidate route outputs.
2026-06-09T08: <REDACTED>
2026-06-09T08:23:15Zresearch recordanalysis/research/research-records.mdResearch tagged MATCHEDMediumValidate against current evidence
2026-06-09T08:23:16Zcompletion gatechallenge-state.jsonCompletion gate passed; state marked COMPLETEHighOptional sanitized memory summary approval

Key Findings

-

RAG / Advisory Memory

RAG output is advisory only. Record evaluated retrievals with:

bash
scripts/challenge_harness.py rag-record <workspace> --query "..." --tag MATCHED|PARTIAL|MISSING|<secret redacted>|GENERIC --validation "..."

Secrets/Flags

Raw flags and sensitive material stay in loot/ only. Use scripts/challenge_harness.py capture-flag to validate and record flag capture without printing the value.

Technical analogy

How to remember this solve

Think of the challenge as a small system with one rule that matters more than the rest. The solve is finding that rule, validating it, and using it carefully enough to reach the final proof.

For AI Space, keep the mental model simple: identify the trusted assumption, prove it with the smallest safe test, then automate or repeat only the part that directly leads to the flag.