Plug And Pray
Plug And Pray is a sanitized challenge note from the local HTB archive, organized for quick review by category, difficulty, evidence flow, and reusable operator
Scenario
Plug And Pray attack path
Plug And Pray is a sanitized challenge note from the local HTB archive, organized for quick review by category, difficulty, evidence flow, and reusable operator
Objective
Challenge walkthrough focused on Hardware evidence, validation, and reusable operator lessons.
Walkthrough flow
Fingerprint the exposed HTTP gateway page and...
Fetch /rootDesc.xml and map advertised UPnP services,...
Review the WANIPConnection SCPD and identify...
Use minimal SOAP requests to recover provisioning...
Use the recovered provisioning credential as the...
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.
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.
- Hardware/Plug-and-Pray/writeup.md
- htb-challenge/Hardware/Plug-and-Pray/notes.md
- htb-challenge/Hardware/Plug-and-Pray/memory-summary.md
- htb-challenge/Hardware/Plug-and-Pray/hypothesis-board.md
- HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/challenge__Hardware__Plug-and-Pray__memory-summary.md.bb96e224a0.md
- HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/challenge__Hardware__Plug-and-Pray__notes.md.8b7ae10459.md
Technical Walkthrough
Writeup
Challenge
- Name: Plug-and-Pray
- Category: Hardware
- Difficulty: Medium
- Mode: remote
Summary
The target exposed a fake cable gateway administration page. The important
lead was not a normal web login route but the advertised UPnP/IGD descriptor.
The descriptor exposed a WANIPConnection SOAP service with read-only
credential actions. Those credentials unlocked a custom diagnostic SOAP
service whose own SCPD disclosed an unsanitized shell sink in TargetHost.
That chain was used to read the challenge flag from the container.
Artifact Inventory
This was a remote-only challenge, so analysis/artifact-inventory.json
contains no local artifacts. The remote surface was:
http://<TARGET>:31846/- product page:
VortexLink GX3000 Cable Gateway - firmware:
4.2.1-RELEASE - server:
Werkzeug/3.1.8 Python/3.12.13
Analysis
Initial HTTP collection showed the status page and a link to /rootDesc.xml
in analysis/http/get-root.txt and analysis/http/root-surface.md.
/rootDesc.xml, saved in analysis/http/get-rootDesc.xml.txt, advertised
two UPnP services:
WANIPConnection:1, control URL/ctl/IPConn, SCPD/WANIPCn.xmlDiagnosticService:1, control URL/ctl/Diag, SCPD/diag.xml
analysis/http/get-WANIPCn.xml.txt showed non-standard sensitive actions:
GetUserName and GetPassword. A gated SOAP probe confirmed both returned
values; raw SOAP responses and recovered values are stored only in loot/.
analysis/http/get-diag.xml.txt showed the custom diagnostic service requires
X-Diag-Key: <ISP provisioning password>, and its comment states TargetHost
is passed directly to shell with sanitization deferred to firmware 4.3.x.
The recovered provisioning credential successfully authenticated to GetDeviceInfo, proving
the credential chain.
The first command-injection read tried /flag.txt; that branch was closed
because the file did not exist. A bounded read-only find located
/app/flag.txt, and a final diagnostic request read that path.
Solve
The reproducible SOAP client is [solve.py](<local workspace>).
From <local workspace>, the final solve flow is:
python3 Hardware/Plug-and-Pray/solve/solve.py \
--base-url http://<TARGET>:31846 \
--loot-dir Hardware/Plug-and-Pray/loot \
--analysis-dir Hardware/Plug-and-Pray/analysis \
--diag-check
python3 Hardware/Plug-and-Pray/solve/solve.py \
--base-url http://<TARGET>:31846 \
--loot-dir Hardware/Plug-and-Pray/loot \
--analysis-dir Hardware/Plug-and-Pray/analysis \
--diag-check \
--run-diag \
--run-label read-app-flag \
--target-host '<TARGET>; cat /app/flag.txt' \
--test-type ping \
--flag-out Hardware/Plug-and-Pray/loot/flag-candidate.txtThe harness then captured the flag with:
python3 scripts/challenge_harness.py capture-flag Hardware/Plug-and-Pray --from loot/flag-candidate.txtFlag
Raw flag is stored in loot/flag.txt and intentionally not reproduced here.
Lessons
- For router/gateway-themed hardware challenges with HTTP, inspect UPnP
descriptors and SCPD files before fuzzing generic web paths.
- Vendor extension comments in XML can be direct vulnerability documentation.
- Separate recovered provisioning credentials from public analysis; keep raw
SOAP and secrets under loot/.
- Gate command-injection attempts separately from read-only enumeration, even
when both are reachable through the same SOAP service.
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
- Challenge: Plug-and-Pray
- Category: Hardware
- Difficulty: Medium
- Mode: remote
- Remote instance: <TARGET>:31846
- Start time: 2026-06-10T20:41:37Z
- Operator: harness
- State file:
challenge-state.json
Harness Status
- Current phase: see
challenge-state.json - Next allowed actions: see
next-action.json - Raw flags and sensitive material stay in
loot/only. Do not paste them here.
Artifact Inventory
| File | Size | SHA256 | Type | Notes |
|---|---|---|---|---|
| — | 0 | — | remote-only or no provided files | No local artifacts found under files/ |
Evidence Ledger
| Time | Action | Output/File | Finding | Confidence | Next |
|---|---|---|---|---|---|
| 2026-06-10T20:41:37Z | harness init | challenge-state.json | Workspace initialized with deterministic state file | High | Inventory artifacts |
| 2026-06-10T20:41:46Z | artifact inventory | analysis/artifact-inventory.json | 0 artifact(s) inventoried | High | Build or update hypotheses |
| 2026-06-10T20:42:20Z | harness init | challenge-state.json | Workspace initialized with deterministic state file | High | Inventory artifacts |
| 2026-06-10T20:42:20Z | hypothesis recorded | hypothesis-board.md | Black-box HTTP gateway enumeration: identify GX3000 web routes, static assets, API endpoints, leaked configs, backups, or diagnostics exposing sensitive data. | Medium | Use curl/httpx-style low-impact requests for headers, redirects, robots, source, JS, common gateway paths, and route discovery before any mutation. |
| 2026-06-10T20:42:20Z | research task | analysis/research/task-20260610T204220288660Z-3a79364e.md | Research task created for advisory investigation | Medium | Record research output |
| 2026-06-10T20:42:32Z | artifact inventory | analysis/artifact-inventory.json | 0 artifact(s) inventoried | High | Build or update hypotheses |
| 2026-06-10T20:42:32Z | checkpoint recorded | analysis/checkpoint-triage-20260610T204232359130Z-f12abcc6.md | Checkpoint for TRIAGE | High | Use checkpoint to drive next decision |
| 2026-06-10T20:43:11Z | RAG query | analysis/rag/rag-query-20260610T204247383885Z-ff39e234.txt | RAG helper exited 0; output saved | Medium | Record retrieval tag and validation |
| 2026-06-10T20:44:34Z | RAG record | analysis/rag-records.md | Retrieved memory tagged GENERIC | Medium | Validate or reject with live evidence |
| 2026-06-10T20:42:50Z | HTTP fingerprint | analysis/http/get-root.txt | Root page is a VortexLink GX3000 gateway status page on Werkzeug/Python, firmware 4.2.1-RELEASE; it links to /rootDesc.xml | High | Fetch UPnP descriptor |
| 2026-06-10T20:43:45Z | UPnP descriptor | analysis/http/get-rootDesc.xml.txt | /rootDesc.xml exposes WANIPConnection at /ctl/IPConn and custom DiagnosticService at /ctl/Diag | High | Fetch SCPD files |
| 2026-06-10T20:44:19Z | SCPD review | analysis/http/get-WANIPCn.xml.txt, analysis/http/get-diag.xml.txt | WANIPConnection exposes GetUserName and GetPassword; DiagnosticService requires X-Diag-Key: <ISP provisioning password> and warns TargetHost reaches shell unsanitized | High | Gate before SOAP retrieval |
| 2026-06-10T20:45:51Z | local memory record | analysis/local-memory-records.md | Prior local notes reviewed as fallback/advisory context | Medium | Validate against current evidence |
| 2026-06-10T20:46:00Z | evaluator | analysis/evaluator-20260610T204600994304Z-e5d56b44.md | Proceed | High | Run gated SOAP retrieval against /ctl/IPConn, then evaluate whether returned password unlocks /ctl/Diag. |
| 2026-06-10T20:48:07Z | evaluator | analysis/evaluator-20260610T204807529660Z-8fce91ae.md | Proceed | High | Execute solve.py --run-diag with a single read-only cat /flag.txt payload, then capture the flag if an HTB value is returned. |
| 2026-06-10T20:49:06Z | branch closed | hypothesis-board.md | Command injection worked, but cat /flag.txt returned file-not-found. | High | Rerank hypotheses |
| 2026-06-10T20:49:56Z | flag capture | loot/flag.txt | HTB-format flag captured; raw value kept in loot only | High | Write solution and run completion gate |
| 2026-06-10T20:51:29Z | completion gate | challenge-state.json | Completion gate passed; state marked COMPLETE | High | Optional sanitized memory summary approval |
Key Findings
- Remote-only target:
http://<TARGET>:31846. - Product fingerprint:
VortexLink GX3000 Cable Gateway, firmware4.2.1-RELEASE. - HTTP server:
Werkzeug/3.1.8 Python/3.12.13. - The root status page exposes
/rootDesc.xml. /rootDesc.xmladvertises:
- WANIPConnection:1 with control URL /ctl/IPConn and SCPD /WANIPCn.xml;
- DiagnosticService:1 with control URL /ctl/Diag and SCPD /diag.xml.
/WANIPCn.xmldocuments read-onlyGetUserNameandGetPasswordactions. This directly matches the scenario's sensitive-data-exposure theme./diag.xmldocuments a custom diagnostic action requiringX-Diag-Key: <ISP provisioning password>and statesTargetHostis passed directly to shell, with sanitization deferred to firmware4.3.x.- SOAP calls to
/ctl/IPConnreturned a provisioning username and password; raw values are stored only inloot/. - The recovered provisioning credential unlocked
/ctl/DiagviaX-Diag-Key, confirmed byGetDeviceInfo. RunNetworkTestcommand injection worked throughTargetHost./flag.txtwas not present, but bounded file discovery found/app/flag.txt.- Reading
/app/flag.txtthrough the diagnostic injection returned the HTB flag, captured toloot/flag.txt.
RAG / Advisory Memory
RAG output is advisory only. Record evaluated retrievals with:
scripts/challenge_harness.py rag-record <workspace> --query "..." --tag MATCHED|PARTIAL|MISSING|<secret redacted>|GENERIC --validation "..."Secrets/Flags
Raw flags and sensitive material stay in loot/ only. Use scripts/challenge_harness.py capture-flag to validate and record flag capture without printing the value.
Memory Summary
Metadata
- Platform: HackTheBox Challenges
- Category: Hardware
- Challenge: Plug-and-Pray
- Difficulty: Medium
- Source workspace:
<local workspace>
Validated Solve Chain
Concepts only. Do not include raw flags, reusable credentials, tokens, cookies, private keys, or live secrets.
- Fingerprint the exposed HTTP gateway page and identify the UPnP descriptor link.
- Fetch
/rootDesc.xmland map advertised UPnP services, control URLs, and SCPD URLs. - Review the WANIPConnection SCPD and identify non-standard sensitive read actions.
- Use minimal SOAP requests to recover provisioning values; keep raw responses and secrets in
loot/. - Use the recovered provisioning password as the custom diagnostic service key.
- Review the diagnostic SCPD comment documenting an unsanitized
TargetHostshell sink. - Use a gated
RunNetworkTestpayload to locate the flag path, then read the flag file.
Reusable Lessons
- Router/gateway web challenges may hide the real attack surface in UPnP descriptors rather than visible navigation.
- SCPD files are both endpoint maps and action schemas; review actions, state variables, and vendor comments closely.
- Read-only SOAP actions can leak credentials that chain into more privileged diagnostic interfaces.
- Preserve raw SOAP responses and recovered credentials in
loot/; write only redacted summaries toanalysis/.
Dead Ends
- Reading
/flag.txtthrough the confirmed diagnostic command injection failed; bounded path discovery found the real flag path under the application directory.
Tool Quirks
- The root page includes a very large inline base64 image; avoid treating all
src=values as useful routes. challenge_exec.pyruns from the project root, so solve script paths and output directories need explicit workspace prefixes.- Generic RAG output was only useful as a checklist; live SCPD evidence drove the solve.
Evidence Paths
analysis/http/get-root.txtanalysis/http/root-surface.mdanalysis/http/get-rootDesc.xml.txtanalysis/http/get-WANIPCn.xml.txtanalysis/http/get-diag.xml.txtanalysis/wanip-soap-redacted.mdanalysis/diag-getdeviceinfo-redacted.mdanalysis/diag-runnetworktest-find-flag-path-redacted.mdanalysis/diag-runnetworktest-read-app-flag-redacted.mdsolve/solve.pyloot/flag.txt
Ingestion Decision
- Proposed for LightRAG: yes
- Requires user approval before ingestion: yes
Hypothesis Board
Keep no more than 3 active hypotheses on Easy/Medium and 5 on Hard unless the user explicitly asks for breadth.
| Rank | Path | Evidence | Missing Proof | Cheapest Validation | Confidence | Status |
|---|---|---|---|---|---|---|
| 1 | Black-box HTTP gateway enumeration: identify GX3000 web routes, static assets, API endpoints, leaked configs, backups, or diagnostics exposing sensitive data. | Scenario explicitly says a cable gateway exposes HTTP and vendor claims nothing sensitive is exposed; remote target is <TARGET>:31846. | Need live HTTP fingerprint, route map, and evidence of a sensitive exposed endpoint or artifact. | Use curl/httpx-style low-impact requests for headers, redirects, robots, source, JS, common gateway paths, and route discovery before any mutation. | Medium | Active |
Closed Branches
| Branch | Evidence Tested | Failure Output | Reason Closed | Revisit Condition |
|---|---|---|---|---|
| Assume flag at /flag.txt | analysis/diag-runnetworktest-redacted.md | Command injection worked, but cat /flag.txt returned file-not-found. | Only revisit if later evidence points to /flag.txt or container root changes. |
Memory Summary
approval_required: true
Sanitized Memory Summary
Metadata
- Platform: HackTheBox Challenges
- Category: Hardware
- Challenge: Plug-and-Pray
- Difficulty: Medium
- Source workspace:
<local workspace>
Validated Solve Chain
Concepts only. Do not include raw flags, reusable credentials, tokens, cookies, private keys, or live secrets.
- Fingerprint the exposed HTTP gateway page and identify the UPnP descriptor link.
- Fetch
/rootDesc.xmland map advertised UPnP services, control URLs, and SCPD URLs. - Review the WANIPConnection SCPD and identify non-standard sensitive read actions.
- Use minimal SOAP requests to recover provisioning values; keep raw responses and secrets in
loot/. - Use the recovered provisioning password as the custom diagnostic service key.
- Review the diagnostic SCPD comment documenting an unsanitized
TargetHostshell sink. - Use a gated
RunNetworkTestpayload to locate the flag path, then read the flag file.
Reusable Lessons
- Router/gateway web challenges may hide the real attack surface in UPnP descriptors rather than visible navigation.
- SCPD files are both endpoint maps and action schemas; review actions, state variables, and vendor comments closely.
- Read-only SOAP actions can leak credentials that chain into more privileged diagnostic interfaces.
- Preserve raw SOAP responses and recovered credentials in
loot/; write only redacted summaries toanalysis/.
Dead Ends
- Reading
/flag.txtthrough the confirmed diagnostic command injection failed; bounded path discovery found the real flag path under the application directory.
Tool Quirks
- The root page includes a very large inline base64 image; avoid treating all
src=values as useful routes. challenge_exec.pyruns from the project root, so solve script paths and output directories need explicit workspace prefixes.- Generic RAG output was only useful as a checklist; live SCPD evidence drove the solve.
Evidence Paths
analysis/http/get-root.txtanalysis/http/root-surface.mdanalysis/http/get-rootDesc.xml.txtanalysis/http/get-WANIPCn.xml.txtanalysis/http/get-diag.xml.txtanalysis/wanip-soap-redacted.mdanalysis/diag-getdeviceinfo-redacted.mdanalysis/diag-runnetworktest-find-flag-path-redacted.mdanalysis/diag-runnetworktest-read-app-flag-redacted.mdsolve/solve.pyloot/flag.txt
Ingestion Decision
- Proposed for LightRAG: yes
- Requires user approval before ingestion: yes
Notes
Notes
Scope
- Challenge: Plug-and-Pray
- Category: Hardware
- Difficulty: Medium
- Mode: remote
- Remote instance: <TARGET>:31846
- Start time: 2026-06-10T20:41:37Z
- Operator: harness
- State file:
challenge-state.json
Harness Status
- Current phase: see
challenge-state.json - Next allowed actions: see
next-action.json - Raw flags and sensitive material stay in
loot/only. Do not paste them here.
Artifact Inventory
| File | Size | SHA256 | Type | Notes |
|---|---|---|---|---|
| — | 0 | — | remote-only or no provided files | No local artifacts found under files/ |
Evidence Ledger
| Time | Action | Output/File | Finding | Confidence | Next |
|---|---|---|---|---|---|
| 2026-06-10T20:41:37Z | harness init | challenge-state.json | Workspace initialized with deterministic state file | High | Inventory artifacts |
| 2026-06-10T20:41:46Z | artifact inventory | analysis/artifact-inventory.json | 0 artifact(s) inventoried | High | Build or update hypotheses |
| 2026-06-10T20:42:20Z | harness init | challenge-state.json | Workspace initialized with deterministic state file | High | Inventory artifacts |
| 2026-06-10T20:42:20Z | hypothesis recorded | hypothesis-board.md | Black-box HTTP gateway enumeration: identify GX3000 web routes, static assets, API endpoints, leaked configs, backups, or diagnostics exposing sensitive data. | Medium | Use curl/httpx-style low-impact requests for headers, redirects, robots, source, JS, common gateway paths, and route discovery before any mutation. |
| 2026-06-10T20:42:20Z | research task | analysis/research/task-20260610T204220288660Z-3a79364e.md | Research task created for advisory investigation | Medium | Record research output |
| 2026-06-10T20:42:32Z | artifact inventory | analysis/artifact-inventory.json | 0 artifact(s) inventoried | High | Build or update hypotheses |
| 2026-06-10T20:42:32Z | checkpoint recorded | analysis/checkpoint-triage-20260610T204232359130Z-f12abcc6.md | Checkpoint for TRIAGE | High | Use checkpoint to drive next decision |
| 2026-06-10T20:43:11Z | RAG query | analysis/rag/rag-query-20260610T204247383885Z-ff39e234.txt | RAG helper exited 0; output saved | Medium | Record retrieval tag and validation |
| 2026-06-10T20:44:34Z | RAG record | analysis/rag-records.md | Retrieved memory tagged GENERIC | Medium | Validate or reject with live evidence |
| 2026-06-10T20:42:50Z | HTTP fingerprint | analysis/http/get-root.txt | Root page is a VortexLink GX3000 gateway status page on Werkzeug/Python, firmware 4.2.1-RELEASE; it links to /rootDesc.xml | High | Fetch UPnP descriptor |
| 2026-06-10T20:43:45Z | UPnP descriptor | analysis/http/get-rootDesc.xml.txt | /rootDesc.xml exposes WANIPConnection at /ctl/IPConn and custom DiagnosticService at /ctl/Diag | High | Fetch SCPD files |
2026-06-10T20: <REDACTED>, analysis/http/get-diag.xml.txt | WANIPConnection exposes GetUserName and GetPassword; DiagnosticService requires `X-Diag-Key: <REDACTED> | ||||
| 2026-06-10T20:45:51Z | local memory record | analysis/local-memory-records.md | Prior local notes reviewed as fallback/advisory context | Medium | Validate against current evidence |
| 2026-06-10T20: <REDACTED>, then evaluate whether returned password unlocks /ctl/Diag. | |||||
| 2026-06-10T20: <REDACTED>, then capture the flag if an HTB value is returned. | |||||
| 2026-06-10T20: <REDACTED>, but cat /flag.txt returned file-not-found. | High | Rerank hypotheses | |||
| 2026-06-10T20: <REDACTED> | |||||
| 2026-06-10T20:51:29Z | completion gate | challenge-state.json | Completion gate passed; state marked COMPLETE | High | Optional sanitized memory summary approval |
Key Findings
- Remote-only target:
http://<TARGET>:31846. - Product fingerprint:
VortexLink GX3000 Cable Gateway, firmware4.2.1-RELEASE. - HTTP server:
Werkzeug/3.1.8 Python/3.12.13. - The root status page exposes
/rootDesc.xml. /rootDesc.xmladvertises:
- WANIPConnection:1 with control URL /ctl/IPConn and SCPD /WANIPCn.xml;
- DiagnosticService:1 with control URL /ctl/Diag and SCPD /diag.xml.
/WANIPCn.xmldocuments read-onlyGetUserNameandGetPasswordactions. This directly matches the scenario's sensitive-data-exposure theme./diag.xmldocuments a custom diagnostic action requiringX-Diag-Key: <REDACTED>, with sanitization deferred to firmware4.3.x`.- SOAP calls to
/ctl/IPConnreturned a provisioning username and password; raw values are stored only inloot/. - The recovered provisioning credential unlocked
/ctl/DiagviaX-Diag-Key, confirmed byGetDeviceInfo. RunNetworkTestcommand injection worked throughTargetHost./flag.txtwas not present, but bounded file discovery found/app/flag.txt.- Reading
/app/flag.txtthrough the diagnostic injection returned the HTB flag, captured toloot/flag.txt.
RAG / Advisory Memory
RAG output is advisory only. Record evaluated retrievals with:
scripts/challenge_harness.py rag-record <workspace> --query "..." --tag MATCHED|PARTIAL|MISSING|<secret redacted>|GENERIC --validation "..."Secrets/Flags
Raw flags and sensitive material stay in loot/ only. Use scripts/challenge_harness.py capture-flag to validate and record flag capture without printing the value.
Technical analogy
How to remember this solve
Think of the hardware challenge like following copper tracks on a circuit board. The useful clue is usually where signals enter, where they are transformed, and which debug or storage path exposes hidden state.
For Plug And Pray, keep the mental model simple: identify the trusted assumption, prove it with the smallest safe test, then automate or repeat only the part that directly leads to the flag.