Cobblestone
Cobblestone is a sanitized machine note from the local HTB archive, organized for quick review by category, difficulty, evidence flow, and reusable operator
Scenario
Cobblestone attack path
Cobblestone 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.
Walkthrough flow
External scan exposed only SSH and HTTP.
HTTP vhosts included cobblestone.htb, vote, deploy,...
vote app had authenticated second-order SQL injection...
SQL () was useful for source/config recovery, but...
Source review of the main app found stored XSS in...
Source coverage
High source coverage
Status: complete. This article is generated from 7 sanitized Markdown sources and keeps raw flags, credentials, keys, cookies, and reusable secrets out of the rendered blog.
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>-Cobblestone/walkthrough.md
- HTB/<TARGET>-Cobblestone/notes.md
- HTB/<TARGET>-Cobblestone/attack-map.md
- HTB/<TARGET>-Cobblestone/memory-summary.md
- HTB/<TARGET>-Cobblestone/session-resume.md
- HTB/<TARGET>-Cobblestone/custom-exploit-notes.md
- HTB/<TARGET>-Cobblestone/dead-ends.md
Technical Walkthrough
Cobblestone Walkthrough
This file will be written from live evidence as the engagement progresses. Public research is not evidence until reproduced against the live target.
Phase 0 - Setup
- Workspace created.
- Memory files loaded:
MEMORY.md,htb_web_attack_patterns.md,htb_quick_wins.md,htb_file_transfer_tunneling.md,htb_hard_insane_state.md,htb_lightrag_context.md. - Start-of-case LightRAG query completed.
Phase 1 - Validation Gate
Matched core public anchors:
- Full TCP scan found only
22/tcpand80/tcp. - HTTP service redirects direct IP traffic to
cobblestone.htb. - Service scan identifies OpenSSH 9.2p1 Debian and Apache 2.4.62 on Debian.
- Base page links
deploy.cobblestone.htb,vote.cobblestone.htb, andmc.cobblestone.htb. - Vhost fuzzing confirmed
voteanddeploy;mcredirects to base and is linked from the page. voteexposes login/register and authenticatedsuggest.php.
The advisory chain is valid enough to proceed, but SQL injection and file-write/RCE are not evidence yet.
Phase 2 - Vote SQLi And Source Recovery
- Registered a controlled
voteaccount and validated authenticated access tosuggest.php. - Confirmed second-order SQL injection in
vote.cobblestone.htb/suggest.phpPOSTurl, triggered throughdetails.php. - Enumerated DBMS context: MariaDB, current DB
vote, current uservoteuser@localhost, and globalFILEprivilege. - Used SQL file-read to recover Apache vhost config and PHP/Twig source for both
voteand maincobblestone.htb. - Rejected SQL file-write after live checks showed
@@secure_file_privasNULL; this made the public FILE-write webshell path stale for this instance.
Phase 3 - Main App XSS To Twig SSTI
- Source review identified:
- suggest_skin.php: authenticated users can insert skin suggestions.
- templates/suggest.html.twig: suggestion fields are rendered with | raw.
- preview_banner.php: admin-only endpoint renders attacker input through Twig::createTemplate().
- Submitted a harmless stored-XSS callback and confirmed the admin reviewer executed it.
- Proved the Twig sink with
{{7*7}}, which rendered as49. - Proved command execution as
www-datausing Twig filters such asfilter('system').
Phase 4 - Stable User Foothold
- Public advisory credential for
cobblewas treated as a hypothesis and validated live over SSH. - Captured user flag from the live target and stored it in
loot/user.txt. - Confirmed
cobbleis constrained by restrictedrbash/jail behavior, but SSH port forwarding still works.
Phase 5 - Cobbler Root
- Created SSH local forward from Pwnbox
<TARGET>:25151to target<TARGET>:25151. - Confirmed Cobbler XML-RPC version
3.3.6. - Used Cobbler XML-RPC auth bypass to obtain an admin-capable token.
- Created controlled
cdx_*Cobbler distro/profile/autoinstall template objects. - Rendered a Cheetah autoinstall template that executed a root command and returned output.
- Captured root flag from live root execution and stored it in
loot/root.txt.
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
- Platform: HackTheBox Machine
- Target: <TARGET>
- Name: Cobblestone
- OS: Linux
- Difficulty: Insane
- Creator: c1sc0
- Pwnbox: profex0r@<TARGET>
- Started: 2026-05-07 AEST
- Rules: Public pre-research and LightRAG are advisory only. Live target evidence is source of truth. Store raw flags/secrets in
loot/only.
Evidence Ledger
| Timestamp | Command / Action | Output File | Finding | Confidence | Next Action |
|---|---|---|---|---|---|
| 2026-05-07 | Workspace initialized; memory and advisory research loaded | notes.md, research.md, attack-map.md, session-resume.md | Insane state files created before touching target | High | Verify Pwnbox/VPN and run validation gate |
| 2026-05-07 | Pwnbox baseline over SSH | remote inline, scope.txt | Pwnbox SSH works; VPN IP <TARGET>/23; target reachable by ICMP; key tools present: nmap, curl, ffuf, whatweb, sqlmap, mysql, tmux, python3 | High | Run live TCP/HTTP validation gate |
| 2026-05-07 | Full TCP scan | nmap/allports.txt | Only 22/tcp and 80/tcp open | High | Service scan and HTTP validation |
| 2026-05-07 | Service scan | nmap/service-22-80.txt | 22 OpenSSH 9.2p1 Debian; 80 Apache 2.4.62, redirect to cobblestone.htb | High | Validate vhosts |
| 2026-05-07 | HTTP/vhost validation | enum/http-known-vhosts.txt, enum/ffuf-vhosts.json | cobblestone.htb, vote, deploy, mc all live/linked; vote and deploy found by ffuf | High | Validate vote workflow |
| 2026-05-07 | Vote workflow check | enum/vote-known-paths.txt, enum/ffuf-vote-dirs.json | login.php, register.php, suggest.php, details.php, db/, vendor/, templates/ discovered; suggest.php requires auth | High | Register test user and inspect authenticated workflow |
| 2026-05-07 | Authenticated SQLi validation | enum/sqlmap-suggest-url.txt | suggest.php POST url is second-order SQLi, 5-column UNION, boolean/time-based; DBMS MariaDB | High | Enumerate DB context and file capabilities |
| 2026-05-07 | DB/file-read/source validation | enum/sqlmap-db-context.txt, loot/sqlmap-users-query.txt, enum/sqlmap-file-read-batch-summary.txt | DB user voteuser@localhost, DB vote, not DBA; file-read works; Apache config and PHP source recovered; users include admin with bcrypt hash | High | Test controlled file-write proof |
| 2026-05-07 | SQL FILE-write and secure_file_priv validation | enum/outfile-variant-summary.txt, enum/union-securefile-details.html, dead-ends.md | Automated and manual INTO OUTFILE attempts did not create a web shell; live union probe showed secure_file_priv is NULL | High | Pivot away from SQL file-write to main app stored-XSS path |
| 2026-05-07 | Main app source review via SQL file-read | enum/sqlmap-suggest/vote.cobblestone.htb/files/_var_www_html_preview_banner.php, enum/sqlmap-suggest/vote.cobblestone.htb/files/_var_www_html_suggest_skin.php | Authenticated users can plant raw suggestions; admin-only preview_banner.php renders attacker-controlled Twig via createTemplate() | High | Validate admin review and SSTI execution |
| 2026-05-07 | Stored XSS admin review validation | logs/xss-callback-8001.log, enum/main-xss-ssti-probe-status.txt | Admin reviewer executed stored JavaScript from suggestions; Twig probe rendered {{7*7}} as 49 | High | Use admin session to trigger Twig command execution |
| 2026-05-07 | Twig command execution validation | logs/xss-callback-8001.log | filter('system') and map('system') executed id as www-data through preview_banner.php | High | Stabilize foothold or validate SSH credential path |
| 2026-05-07 | SSH foothold validation | enum/cobble-ssh-validation.txt, enum/cobble-rbash-probes.txt, loot/<password redacted> | cobble SSH credential validated live; shell is restricted rbash/jail; user flag captured and stored in loot/user.txt | High | Establish SSH local forward to Cobbler |
| 2026-05-07 | Cobbler XML-RPC exploitation | enum/cobbler-version.xml, enum/cobbler-render-root.redacted.txt, exploits/cobbler_render_exec.py | SSH forward reached Cobbler 3.3.6; XML-RPC auth bypass allowed rendering a Cheetah template as root; root flag stored in loot/root.txt | High | Cleanup and write final summary |
Pre-Research Validation Gate
| Public Claim | Status | Evidence | Notes |
|---|---|---|---|
| Only SSH and HTTP exposed externally | MATCHED | nmap/allports.txt | 22/tcp, 80/tcp only |
HTTP redirects or resolves to cobblestone.htb | MATCHED | enum/http-ip-index-timeout.txt, nmap/service-22-80.txt | Direct IP redirects to http://cobblestone.htb/ |
Vhosts: deploy, vote, mc | MATCHED | enum/http-known-vhosts.txt, enum/ffuf-vhosts.json | vote and deploy discovered by ffuf; mc linked from base page and redirects to base |
vote app permits registration and has suggestion flow | MATCHED | enum/vote-known-paths.txt, enum/ffuf-vote-dirs.json | Login/register form exists; suggest.php discovered and redirects when unauthenticated |
| SQL injection can lead to file read/write or web execution | PARTIAL | enum/sqlmap-file-read-batch-summary.txt, enum/outfile-variant-summary.txt, enum/union-securefile-details.html | File read matched; file write/web execution did not because live secure_file_priv is NULL |
| Main app stored XSS and Twig SSTI chain | MATCHED | logs/xss-callback-8001.log, preview_banner.php, suggest_skin.php | Admin review plus Twig createTemplate() gave www-data command execution |
Local Cobbler XML-RPC on <TARGET>:25151 after foothold | MATCHED | enum/cobbler-version.xml, enum/cobbler-render-root.redacted.txt | SSH local forward confirmed Cobbler 3.3.6 and root-level template rendering |
Current Status
- Access: root achieved through Cobbler XML-RPC template rendering.
- Active tunnels/listeners: Pwnbox tmux
cobble:tunnel,cobble:callback, andcobble:shellwere used during exploitation; no further interaction required. - Flags: user and root captured from live target and stored under
loot/.
Attack Map
Hosts
| IP | Hostname | OS | Status | Reachable From |
|---|---|---|---|---|
| <TARGET> | unknown | Linux (claimed) | In scope | Pwnbox |
| <TARGET> | cobblestone.htb | Debian/Linux | Live | Pwnbox |
| <TARGET> | vote.cobblestone.htb | Debian/Linux | Live | Pwnbox |
| <TARGET> | deploy.cobblestone.htb | Debian/Linux | Live | Pwnbox |
| <TARGET> | mc.cobblestone.htb | Debian/Linux | Live | Pwnbox |
Services
| Host | Port | Service | Version | Auth | Notes |
|---|---|---|---|---|---|
| <TARGET> | 22 | SSH | OpenSSH 9.2p1 Debian 2+deb12u7 | unknown | External |
| <TARGET> | 80 | HTTP | Apache 2.4.62 Debian | app auth on vote | Base redirects to cobblestone.htb; vhosts identified |
| vote.cobblestone.htb | 80 | PHP web app | Billy template 1.9.2 | login/register | suggest.php, details.php, db/, vendor/ |
| cobblestone.htb | 80 | PHP/Twig web app | Billy template 1.9.2 | login/register | Stored XSS in suggestions; admin-only Twig preview sink |
| <TARGET> | 25151 | Cobbler XML-RPC | 3.3.6 | bypassed | Reached through SSH local forward as cobble |
Credentials
| Source | Username | Secret | Type | Tested On | Result |
|---|---|---|---|---|---|
| Public advisory, live validated | cobble | Stored in loot/<password redacted> | SSH password | <TARGET>:22 | Success, restricted shell |
Attack Paths
| # | Path | Status | Evidence |
|---|---|---|---|
| 1 | HTTP vhost -> vote app -> SQLi file-read -> source review -> main app stored XSS -> Twig SSTI as www-data | validated | enum/sqlmap-suggest-url.txt, preview_banner.php, logs/xss-callback-8001.log |
| 2 | Advisory credential -> live SSH as cobble -> SSH local forward -> Cobbler XML-RPC auth bypass -> Cheetah template render as root | complete | enum/cobble-ssh-validation.txt, enum/cobbler-version.xml, enum/cobbler-render-root.redacted.txt |
| 3 | SQLi INTO OUTFILE web shell | rejected | enum/outfile-variant-summary.txt, enum/union-securefile-details.html |
Trust Edges
None yet.
Memory Summary
Status: Pending user approval before ingestion.
Metadata
- Platform: HackTheBox
- Content type: Machine
- Name: Cobblestone
- OS: Linux
- Difficulty: Insane
- Workspace:
<local workspace><TARGET>-Cobblestone
Verified Chain
- External scan exposed only SSH and HTTP.
- HTTP vhosts included
cobblestone.htb,vote,deploy, andmc. voteapp had authenticated second-order SQL injection through storedurlvalues rendered bydetails.php.- SQL
<secret redacted>()was useful for source/config recovery, butINTO OUTFILEwas blocked on the live instance becausesecure_file_privresolved toNULL. - Source review of the main app found stored XSS in user-submitted skin suggestions and an admin-only Twig
createTemplate()sink inpreview_banner.php. - Stored XSS executed in an admin reviewer session and triggered Twig SSTI as
www-data. - A live-validated SSH credential gave access as
cobble, restricted byrbash/jail behavior. - SSH local forwarding exposed Cobbler XML-RPC on
<TARGET>:25151. - Cobbler 3.3.6 XML-RPC auth bypass plus Cheetah autoinstall rendering produced root command execution.
Reusable Lessons
- Treat public SQL file-write chains as volatile: validate
@@secure_file_privearly and pivot if export is disabled. - Source-read from SQLi can be more valuable than shell upload on Insane Linux web chains.
- For stored-XSS admin bots, use a short external script loader instead of trying to fit long JavaScript into application fields.
- If a browser-based payload navigates away too early, serve callback endpoints with HTTP 204 to keep the page active.
rbashmay block interactive command execution but still permit SSH local forwarding, which is enough for internal-only services.- Cobbler XML-RPC exploitation can avoid reverse shells by rendering command output directly through Cheetah templates.
Do Not Ingest
- Raw flags
- Raw <password redacted>
- Cookies
- Full callback logs containing transient session artifacts
Session Resume
Last updated: 2026-05-07 AEST
Current Access
- User flag and root flag captured from the live target and stored in
loot/. - Validated SSH as
cobblewith credential stored inloot/<password redacted>; shell is restrictedrbash/jail. - Root achieved through Cobbler XML-RPC on
<TARGET>:25151via SSH local forward.
Session Registry
| Name | Host | Command | Pane | Local Port | Remote Target | Status |
|---|---|---|---|---|---|---|
| callback | Pwnbox | python3 -u exploits/callback_204_server.py | cobble:callback | 8001 | stored-XSS callbacks | Stopped after solve |
| tunnel | Pwnbox | ssh -N -L <TARGET>:25151:<TARGET>:25151 cobble@<TARGET> | cobble:tunnel | 25151 | target Cobbler XML-RPC | Stopped after solve |
| shell | Pwnbox | nc -lnvp 9002 | cobble:shell | 9002 | attempted reverse shell | Stopped after solve |
Next Three Actions
- Optional cleanup: remove stored XSS suggestion rows and
cdx_*Cobbler objects if desired. - Write post-solve sanitized memory summary for approval before LightRAG ingestion.
- Keep
memory-summary.mdout of LightRAG until user approves ingestion.
Blockers
- SQL
INTO OUTFILEpath was stale/blocked bysecure_file_priv=NULL; documented indead-ends.md.
Cleanup
- Stored XSS suggestion rows were created.
- Cobbler
cdx_*distro/profile/template objects were created.
Notes
Track exploit scripts, payload versions, state mutations, and rollback commands here.
State Mutations
| Timestamp | Target | Attribute / File | Old Value | New Value | Rollback |
|---|---|---|---|---|---|
| 2026-05-07 | Webroot via SQLi FILE write | /var/www/html/cdx_<random>.php or /var/www/vote/cdx_<random>.php | Did not exist | Harmless PHP proof marker if write succeeds | Delete proof file after foothold/root, or overwrite with empty if delete unavailable |
| 2026-05-07 | Main app suggestions table | New suggestion rows | Did not exist | Stored XSS probes and loader rows | Remove rows from suggestions table if DB access is available |
| 2026-05-07 | Cobbler XML-RPC | New distro/profile/template objects | Did not exist | cdx_* distro/profile/autoinstall template objects | Remove cdx_* Cobbler objects through XML-RPC if cleanup is required |
Exploit Iterations
| Timestamp | File | Purpose | Expected | Observed | Next |
|---|---|---|---|---|---|
| 2026-05-07 | exploits/write_vote_webshell.sh | Manual second-order UNION ... INTO OUTFILE webshell attempt | PHP file in /var/www/vote | Failed; live secure_file_priv was NULL | Rejected path |
| 2026-05-07 | exploits/main_xss_ssti_probe.sh / main_xss_ssti_submit_short.sh | Validate stored XSS and admin-only Twig SSTI | Admin browser renders Twig payload and exfiltrates result | {{7*7}} rendered to 49; id executed as www-data | Foothold path validated |
| 2026-05-07 | exploits/cobbler_render_exec.py | Exploit Cobbler XML-RPC auth bypass and template rendering | Root command output through rendered autoinstall template | id ran as root and root flag was stored | Complete |
Dead Ends
SQLi FILE Write To Webroot
- Evidence:
enum/outfile-variant-summary.txt,enum/sqlmap-file-write-proof-summary.txt,enum/sqlmap-file-write-alias-summary.txt - Result: Automated sqlmap writes and manual
UNION ... INTO OUTFILEvariants did not create a reachable PHP file. - Root cause: live union probe showed
@@secure_file_privresolves toNULL, so read via<secret redacted>()worked but export/write was blocked. - Decision: Treat public writeup FILE-write claims as stale for this live instance and pivot to source-assisted main-app XSS/SSTI.
Reverse Shell Through Twig
- Evidence:
logs/xss-callback-8001.log,logs/www-data-shell-9002.log - Result: Twig command execution worked, but reverse-shell payloads were unreliable through the admin bot queue and field-length constraints.
- Decision: Prefer stable SSH credential validation and Cobbler API exploitation over continuing to fight browser-driven shell orchestration.