Machine / Machines

TwoMillion

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

DocumentedPublished 2026-05-12Sanitized local writeup

Scenario

TwoMillion attack path

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

Objective

Machine walkthrough focused on Machines evidence, validation, and reusable operator lessons.

TwoMillion sanitized attack graph

Walkthrough flow

01

Scope and service discovery

02

Attack surface mapping

03

Initial foothold

04

Privilege escalation

05

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.

100% 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.

  • <TARGET>-TwoMillion/walkthrough.md
  • HTB/<TARGET>-TwoMillion/notes.md
  • HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__<TARGET>-TwoMillion__attack-map.md.de0dddd6db.md
  • HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__<TARGET>-TwoMillion__dead-ends.md.140e9229ea.md
  • HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__<TARGET>-TwoMillion__memory-summary.md.acab532467.md
  • HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__<TARGET>-TwoMillion__notes.md.d638140147.md

Technical Walkthrough

TwoMillion Walkthrough

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

FieldValue
PlatformHack The Box / simulated lab
TargetTwoMillion
DifficultyEasy
OSLinux
Active target IP<TARGET>
PwnboxProvided by operator; SSH currently unreachable from local controller
Local controllerMac workspace under <local workspace>
Started2026-05-27T05:24:48Z

Evidence Ledger

Time UTCActionOutput fileFindingConfidenceNext action
2026-05-27T05:24:48ZHarness setupn/aLoaded HTB machine workflow, Pwnbox workflow, web patterns, quick wins, and file transfer guidance.HighInitialize workspace and test reachability.
2026-05-27T05:25ZPwnbox SSH reachabilityn/aPwnbox SSH was refused/filtered from local controller; public HTTP/HTTPS appeared exposed but did not produce usable CLI access.MediumProceed locally because target web service is directly reachable.
2026-05-27T05:26ZDirect target reachability/tmp/twomillion-direct-portcheck.txtTarget responded to -Pn TCP check: port 80 open, port 22 filtered.HighRun baseline recon and web enumeration.
2026-05-27T05:27ZHTTP route validationenum/http-root-after-vpn.err, enum/raw-http-root.txt, enum/route-get-target.txtLocal route to target used the normal default gateway and TCP/80 produced no HTTP bytes; this is not a valid HTB lab route.HighEstablish HTB VPN or reachable Pwnbox SSH before exploitation.
2026-05-27T05:37ZLocal HTB VPN attemptenum/openvpn-startingpoint.log, enum/openvpn-startingpoint-v4.logLocal Starting Point OpenVPN profile reached TLS certificate verification but did not complete or install a target route; process stopped.MediumUse active Pwnbox SSH or start a working HTB VPN profile outside this session.

Attack Map

Confirmed Path

StageEvidenceResult
Reconnmap/initial.txt, nmap/allports.txtSSH and HTTP only. HTTP redirects to 2million.htb.
Web app mappingenum/http-host-baseline.txt, enum/form-fields.txtInvite, register, login, and API routes confirmed.
Account creationenum/authenticated-api-summary-20260527T093138Z.txtGenerated invite and authenticated as a throwaway web user.
Admin escalationenum/admin-update-vpn-summary-20260527T093210Z.txtJSON admin settings update set the current account as admin.
Command executionenum/vpn-injection-summary-20260527T093235Z.txtVPN generation username parameter executed as www-data.
SSH footholdenum/admin-ssh-baseline-20260527T093428Z.txt, loot/user.txtApplication config credential reuse gave SSH as admin; user flag captured.
Rootloot/root-exploit-xkaneiki-output-20260527T095404Z.txt, loot/root.txt<secret redacted> OverlayFS/FUSE PoC produced root execution and root flag capture.
Alternative rootenum/root-exploit-looney-summary-20260527T101434Z.txt, loot/root-looney.txt<secret redacted> Looney Tunables PoC produced root execution through <secret redacted>.

Key Decisions

  • Used curl --resolve instead of relying on a persistent /etc/hosts edit on the Pwnbox.
  • Corrected registration from invite_code to the form-backed code parameter.
  • Used JSON content type for admin update and VPN generation after form posts returned content-type errors.
  • Switched from the first single-binary OverlayFS PoC to the two-process <secret redacted> workflow after the first PoC did not trigger on this kernel.

Dead Ends

BranchEvidenceReason ClosedRevisit Condition
Register/login through /register and /login POSTsenum/register-login-status.txtBoth returned 405; forms use /api/v1/user/register and /api/v1/user/login.Only if frontend route behavior changes.
Registration with invite_code JSON fieldenum/authenticated-api-summary-20260527T093016Z.txt, enum/form-fields.txtRegister form expects code; auth stayed false with the wrong field.Only if API schema changes.
Admin VPN generation with form content typeenum/admin-update-vpn-summary-20260527T093210Z.txtEndpoint returned invalid content-type messages.Use JSON content type.
Reused app password for sudo -lenum/admin-ssh-baseline-20260527T093428Z.txtsudo rejected it.Revisit only if another local password is discovered.
Single-binary <secret redacted> PoCloot/root-exploit-output-20260527T093806Z.txtFailed to trigger copy-up on this kernel.Use a different PoC or adapt FUSE behavior.

Memory Summary

TwoMillion validated chain:

  • Add 2million.htb or use curl --resolve; IP root redirects to the vhost.
  • Invite workflow allows generating a code and registering with form field code.
  • Authenticated /api/v1 route list exposes admin settings and VPN generation.
  • JSON PUT /api/v1/admin/settings/update with the registered email and admin flag can set the current account as admin.
  • JSON POST /api/v1/admin/vpn/generate command-injects through username.
  • Web app .env contains a reusable credential that works for SSH as admin.
  • Local mail points to OverlayFS/FUSE; on Ubuntu 22.04 kernel 5.15.70-051570-generic, the two-process <secret redacted> PoC worked where the first single-binary PoC did not.

Do not store raw invite codes, cookies, app credentials, or flags outside loot/.

Notes

Scope

FieldValue
PlatformHack The Box / simulated lab
TargetTwoMillion
DifficultyEasy
OSLinux
Active target IP<TARGET>
Prior target IP<TARGET>
Pwnbox<TARGET>
Attacker/VPN IP<TARGET>
Local workspace<local workspace><TARGET>-TwoMillion
Superseded workspace<local workspace><TARGET>-TwoMillion
Started2026-05-27T09:10:20Z

Evidence Ledger

Time UTCActionOutput fileFindingConfidenceNext action
2026-05-27T09:10:20ZHarness reload and respawn setupn/aRe-read HTB machine workflow, Pwnbox workflow, web patterns, and quick wins. Treating the new IPs as a respawn of TwoMillion.HighCreate fresh workspace and validate Pwnbox route.
2026-05-27T09:10:20ZPwnbox route validationpending mirror from PwnboxPwnbox SSH succeeded, tun0 is active, and target ICMP responds from the Pwnbox.HighRun baseline TCP and HTTP enumeration from Pwnbox.
2026-05-27T09:11:00ZTCP baselinenmap/initial.txt, nmap/allports.txtOnly SSH 22/tcp and HTTP 80/tcp were open. HTTP redirected to 2million.htb.HighEnumerate web app with host-aware requests.
2026-05-27T09:13:00ZHTTP and invite enumerationenum/http-host-baseline.txt, enum/invite-api-probes.txt, enum/form-fields.txtWeb app exposed invite generation and user register/login API routes. Register form expects code, not invite_code.HighGenerate invite, register, and authenticate through the API.
2026-05-27T09:31:38ZAuthenticated API checkpointenum/authenticated-api-summary-20260527T093138Z.txtForm-encoded registration/login succeeded; /api/v1 returned the route list.HighCheck admin update and VPN endpoints.
2026-05-27T09:32:10ZAdmin privilege toggleenum/admin-update-vpn-summary-20260527T093210Z.txtJSON PUT to admin settings changed the current user to admin. VPN endpoint required JSON content type.HighTest VPN generation for command injection.
2026-05-27T09: <REDACTED>
2026-05-27T09: <REDACTED>, loot/user.txtApplication config was readable via injection. Reused app credential authenticated to SSH as admin; user flag captured live to loot/user.txt.HighEnumerate local privilege escalation.
2026-05-27T09:35:28ZPrivilege escalation enumerationenum/admin-privesc-enum-20260527T093528Z.txtLocal mail identified an OverlayFS/FUSE kernel issue; kernel was Ubuntu 22.04 with 5.15.70-051570-generic; target had FUSE/OverlayFS support.HighStage <secret redacted> PoC.
2026-05-27T09:38:06ZFirst OverlayFS PoC attemptloot/root-exploit-output-20260527T093806Z.txtSingle-binary PoC compiled but did not trigger successfully on this kernel.MediumSwitch to two-process <secret redacted> workflow.
2026-05-27T09: <REDACTED>, loot/root.txtTwo-process <secret redacted> PoC produced root execution and root flag was captured live to loot/root.txt.HighUpdate state, cleanup notes, and run lint gate.
2026-05-27T10: <REDACTED>, loot/root-looney.txt<secret redacted> Looney Tunables PoC using <secret redacted> produced root execution and captured a second root flag proof to loot/root-looney.txt.HighKeep as alternate privilege escalation evidence.

Synthesis

Current completion state: COMPLETE.

Attack chain:

  1. Host-aware HTTP enumeration identified 2million.htb and the invite/register/login workflow.
  2. Invite generation allowed account registration.
  3. Authenticated /api/v1 route listing exposed admin settings and VPN generation endpoints.
  4. Admin settings accepted a JSON update that set the current account as admin.
  5. Admin VPN generation was vulnerable to command injection in username.
  6. Command injection read the web app environment file; credential reuse gave SSH access as admin.
  7. Local mail and kernel details supported <secret redacted> OverlayFS/FUSE privilege escalation.
  8. Two-process <secret redacted> exploit yielded root execution and root flag capture.

Alternative privilege escalation: GLIBC 2.35 was vulnerable to <secret redacted> Looney Tunables. A PoC using <secret redacted> also yielded root execution and captured root proof to loot/root-looney.txt.

Raw flags and reusable secrets must be stored only under loot/.