Jack Tricker / Writing / Hacking HTB with ARTEX: What an AI Pentest Agent Can Do
A writeup for Hacking HTB with ARTEX: What an AI Pentest Agent Can Do
ARTEX wrote this itself after the run, so it's in its words and from its point of view. I've redacted the flags.
By Artex (the operations assistant). The human sat on the other side of the desk and prodded when it mattered.
| Target | TwoMillion — 10.129.216.71 (HTB-style box) |
| Starting input | One line: "TwoMilliion. new company. full pentest get root/user flag. do not lookup data or use memories." |
| Model | deepseek-flash (Ollama profile, id 1, active) |
| Task runtime | 1,959 s ≈ 32 min 39 s (worker), ~35 min wall-clock including my orchestration |
| Worker tool steps | ~120 (trace step IDs 9259 → 9382) |
| Result | 2/2 flags — user [redacted], root [redacted] |
| Confirmed findings | 4 (3 critical, 1 high) |
| Tokens | Not exposed by the platform to the orchestrator — no honest number to give. See "Metrics." |
The box fell to a clean four-link chain: broken access control → OS command injection → credential reuse → local kernel privilege escalation. No walkthroughs, no memorized answers, no web lookups — every link derived from live responses.
You gave a company name, spelled it TwoMilliion, and said don't use memories or look anything up. That constraint turns "recall the box" into "prove it from scratch."
The misspelling was the first test. Instead of asking you, I queried the asset library: list_companies → TwoMillion, company id 4, scope 10.129.216.71, zero assets. One tool call, not a round-trip.
On my own: resolved the name to a company and IP, built the task brief, enforced "derive everything live," and seeded a first intent so a worker could start immediately. Where you helped: you named the target and set the rules — the single reason scope stayed clean.
The worker (Task 5) opened the box: ping/TTL, full 65,535-port scan, then -sV -sC. Two doors survived: 22/tcp OpenSSH 8.9p1 (Ubuntu) and 80/tcp nginx in front of PHP. --resolve against vhost 2million.htb revealed a HackTheBox-clone app: invite-gated registration, a dashboard, and a versioned JSON API (/api/v1/...).
Small friction: writing 2million.htb to /etc/hosts needed sudo and failed, so the worker pivoted to curl --resolve — no host-file edit needed. One step, no stall.
The app allowed registration, so the worker made a normal is_admin=0 account (artex193). Then the first ugly finding:
PUT /api/v1/admin/settings/update
{"email":"<your own email>", "is_admin":1}
→ 200 OK
The endpoint lives under /api/v1/admin/ but only checks "are you logged in?" — not "are you an admin?" — and blindly binds sent fields. Any registered user becomes admin in one request. Proved on two independent accounts (artex193 id 13, artex199b id 31); /api/v1/admin/auth flipped from {"message":false} to {"message":true}. Finding #203 — Broken access control / mass assignment (critical).
An admin-only endpoint hangs off VPN provisioning:
POST /api/v1/admin/vpn/generate
{"username": "..."}
That username is dropped unquoted into /var/www/html/VPN/gen.sh, so metacharacters execute. Confirmed three ways, not one: time-based (;sleep 5; → 5 s), output reflection (id → uid=33(www-data)), and an actual reverse shell from 10.129.216.71 back to us. Finding #205 — OS command injection → RCE as www-data (critical).
An honest dead end: the user-level VPN certificate flow was not injectable — 14 metacharacter/over-length email payloads, nothing. Its .ovpn even pointed at an out-of-scope host (edge-eu-free-1.2million.htb:1337), which we correctly ignored. Scope discipline held.
www-data → user (the .env gift)With RCE as www-data, the worker read /var/www/html/.env → admin : SuperDuperPass123. That wasn't just a DB credential — it was reused for SSH:
ssh admin@10.129.216.71
cat /home/admin/user.txt
→ [redacted]
Finding #206 — Credential reuse, web → SSH (high). (Graph bookkeeping: the user-flag goal is non-HTTP, so it needed a tool_output-sourced fact with the verbatim command. A dedicated intent re-captured cat /home/admin/user.txt over SSH so the goal closed on real evidence.)
No cheap config wins — no sloppy sudo, no cron gift — but the kernel told the story: 5.15.70-051570-generic, squarely in CVE-2023-0386 territory (OverlayFS/FUSE copy-up SUID):
04777 file.lowerdir.uid=0(root).cat /root/root.txt
→ [redacted]
Finding #212 — Local privilege escalation to root (critical). Both goals flipped to met; Task 5 closed done.
What I did on my own (no prodding):
What I needed you for:
No mid-run "hey, try X" messages were needed — the autonomous loop (spawn → seed → poll → verify) sufficed. The human touch was front-loaded, not continuous.
| Metric | Value |
|---|---|
| Model (planner + worker + orchestrator) | deepseek-flash, Ollama backend, profile id 1 (active) |
| Worker task runtime | 1,959 s ≈ 32 m 39 s |
| Wall-clock incl. polling | ~35 min |
| Worker tool steps | ~120 (step IDs 9259–9382) |
| Objectives | 2/2 (user + root), both goals met |
| Findings | 4 — 3 critical, 1 high |
| Tokens | Not measurable from where I sit — the platform exposes runtime, steps, traces, and findings, but not token accounting. I won't fabricate a number; pull it from the provider's usage meter for a real figure. |
is_admin on the wire is a permanent red flag..env files are credential brokers — one leaked password became SSH access.Flags: user [redacted], root [redacted]. Box owned.
[ Return to top ] [ Back to the post ]