$ cat writeup.md…
$ cat writeup.md…
hackthebox
Task: Given a symmetric pairwise distance matrix (1808×1808) in a .npy file. Solution: Applied Classical MDS (Multidimensional Scaling) with eigendecomposition to reconstruct 2D coordinates from the distance matrix; plotting the points revealed the flag text.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
You are assigned the important mission of locating and identifying the infamous space hacker. Your investigation begins by analyzing the data patterns and breach points identified in the latest cyber-attacks. Use the provided coordinates of the last known signal origins to narrow down his potential hideouts. Utilize advanced tracking algorithms to follow the digital footprint left by the hacker.
Files: challenge.zip (password: hackthebox) → distance_matrix.npy
The file distance_matrix.npy contains a 1808×1808 (float64) matrix — a symmetric pairwise distance matrix between 1808 points:
Key observation: Given a distance matrix, we can reconstruct the original point coordinates using Multidimensional Scaling (MDS). If the points were in 2D, eigendecomposition of matrix B will yield only 2 significant eigenvalues.
import numpy as np dm = np.load('distance_matrix.npy') print(f"Shape: {dm.shape}") # (1808, 1808) print(f"Symmetric: {np.allclose(dm, dm.T)}") # True print(f"Min: {dm.min()}, Max: {dm.max()}") # 0.0, ~7.2
Classical MDS reconstructs point coordinates from a distance matrix via eigendecomposition:
import numpy as np import matplotlib.pyplot as plt dm = np.load('distance_matrix.npy') n = dm.shape[0] # Centering matrix H = np.eye(n) - np.ones((n, n)) / n # Double centering B = -0.5 * H @ (dm ** 2) @ H # Eigendecomposition eigenvalues, eigenvectors = np.linalg.eigh(B) ...
$ grep --similar