$ cat writeup.md…
$ cat writeup.md…
HackTheBox
"Survivors find a battered laptop in the rubble. Powering it up, they discover a cryptic software interface from an ancient architecture firm, hinting at vital blueprints. They must crack its security protocols. Undeterred, they race against time."
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
"Survivors find a battered laptop in the rubble. Powering it up, they discover a cryptic software interface from an ancient architecture firm, hinting at vital blueprints. They must crack its security protocols. Undeterred, they race against time."
Target: http://154.57.164.69:31117
users and documents tablesSingle Express application with the following route structure:
/login, /register) — user registration and login with cookie-based auth/document/*) — CRUD for markdown documents, content sanitized via sanitize-html/document/export/:id, /document/debug/export) — PDF generation from markdown/HTMLKey security middleware:
isAuthenticated — validates cookie signature using HMAC with random SECRETisAdmin — checks req.user.username === "admin"Access code system:
rotatePass() generates a 4-digit code (0000-9999) via crypto.randomBytes(2).readUInt16BE() % 10000verifyPass() checks the pass; on failure, calls rotatePass() to generate a new coderotatePass() is called on startup — no admin user is pre-createdThe isAdmin middleware checks req.user.username === "admin", but the application never creates an admin user at startup. Only rotatePass() is called in src/index.js. The /register endpoint has no restriction on the username "admin", so anyone can register as admin.
...
$ grep --similar