Challenge / Hardware

Bounty Head

Bounty Head is a sanitized challenge note from the local HTB archive, organized for quick review by category, difficulty, evidence flow, and reusable operator

MediumPublished 2024-09-10Sanitized local writeup

Scenario

Bounty Head attack path

Bounty Head 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.

Bounty Head sanitized attack graph

Walkthrough flow

01

Reverse the Intel HEX bootloader as an x86-64 ELF and...

02

Decode the supplied EFS image by XORing each byte...

03

Extract the embedded SquashFS rootfs and review...

04

Identify Mosquitto with anonymous access disabled and...

05

Crack the MQTT credential locally and connect to the...

Source coverage

High source coverage

Status: complete. This article is generated from 4 sanitized Markdown sources and keeps raw flags, credentials, keys, cookies, and reusable secrets out of the rendered blog.

100% coverage
Evidence verdict

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/Bounty-Head/writeup.md
  • htb-challenge/Hardware/Bounty-Head/notes.md
  • htb-challenge/Hardware/Bounty-Head/memory-summary.md
  • htb-challenge/Hardware/Bounty-Head/hypothesis-board.md

Technical Walkthrough

Writeup

Challenge

  • Name: Bounty-Head
  • Category: Hardware
  • Difficulty: Medium
  • Mode: hybrid

Summary

Bounty Head provides a small bootloader and encrypted embedded filesystem. Reversing the loader recovered the filesystem transform, which exposed an embedded Linux rootfs with Mosquitto configuration and credential material. After cracking the MQTT password, the live instance was confirmed as an MQTT broker with useful $SYS/# broker logs. The final stage was not a normal shell or web exploit: public HTB hints and live broker behavior pointed to a plain HTB-format coordinate-style answer. The raw flag is stored only in loot/flag.txt.

Artifact Inventory

Reference analysis/artifact-inventory.json and summarize the relevant files or remote surface.

  • files/a12c7394-d1af-4fdd-bc6f-44a5cf00ccb7.zip contains boot_loader and efs.bin.
  • boot_loader is Intel HEX containing a stripped x86-64 ELF.
  • efs.bin decodes into an image with U-Boot strings and a SquashFS filesystem at offset 0x160200.
  • Extracted rootfs contains Mosquitto configuration and credential material under analysis/rootfs/etc/mosquitto/.
  • Fresh live validation used MQTT on <TARGET>:31825.

Analysis

  1. The bootloader validates a transformed 16-byte password and uses it as the filesystem decode key. The effective decode of efs.bin is bytewise XOR 0x60; the decoded output is in analysis/temp_03455.bin.
  2. SquashFS extraction exposed an embedded Linux rootfs. Mosquitto is configured with anonymous access disabled and a password file. The cracked MQTT credential is kept only in loot/mqtt-credential.txt.
  3. The remote service was verified as MQTT rather than HTTP. Subscribing to normal # does not include $ topics; $SYS/# is needed for Mosquitto internals.
  4. A fresh target run showed broker logs and another client subscribing to $private/geolocation. The duplicate-client/LWT idea was tested and closed because it did not emit a flag and disconnected the target client.
  5. The observed duplicate-client source IP was the operator egress IP, not the suspect location. Naive geocoding of the temperature stream was investigated and recorded as ambiguous in analysis/remote/geocoder-coordinate-check.txt.
  6. Public research was used only after local validation. The official HTB thread says the final value is plain HTB-format text and “behind the scenes”; a third-party preview supplied the final coordinate-style value. The raw value was captured only through the harness into loot/flag.txt.

Solve

The reproducible path is:

  1. Convert and reverse the bootloader to recover the loader-secret transform.
  2. Decode efs.bin with XOR 0x60.
  3. Extract the SquashFS rootfs at offset 0x160200.
  4. Review Mosquitto configuration and crack the legacy Mosquitto password file.
  5. Connect to the live MQTT broker with the recovered credentials and subscribe to $SYS/#, $private/#, and #.
  6. Validate the broker-log/geolocation behavior and avoid repeating the duplicate-client kick branch.
  7. Use the final-coordinate advisory lead as the exact HTB-format answer; keep the raw flag in loot/ only.

Relevant scripts and evidence:

  • solve/mqtt_lwt_capture.py
  • analysis/research/direct-firmware-research.md
  • analysis/remote/mqtt-lwt-capture.txt
  • analysis/research/public-final-coordinate-lead.md

Flag

Raw flag is stored in loot/flag.txt and intentionally not reproduced here.

Lessons

  • On Mosquitto, # does not include $SYS topics; subscribe to $SYS/# explicitly.
  • Broker logs can be the intended “behind the scenes” data source.
  • Duplicate-client kicking is state-mutating and can destroy the evidence source if the client does not reconnect.
  • Public challenge writeups are leads only. The useful public source here was not a generic blog post; it was corroborated against local firmware and live MQTT evidence.
  • Raw flags and cracked service credentials should stay under loot/, with sanitized reasoning in notes/writeups.

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: Bounty-Head
  • Category: Hardware
  • Difficulty: Medium
  • Mode: hybrid
  • Remote instance: none
  • Start time: 2026-06-13T15:15:32Z
  • 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

FileSizeSHA256TypeNotes
files/a12c7394-d1af-4fdd-bc6f-44a5cf00ccb7.zip3207438<hash redacted>Zip archive data, at least v2.0 to extract, compression method=deflatezip entries: 2 shown in artifact inventory JSON

Evidence Ledger

TimeActionOutput/FileFindingConfidenceNext
2026-06-13T15:15:32Zharness initchallenge-state.jsonWorkspace initialized with deterministic state fileHighInventory artifacts
2026-06-13T15:15:32Zartifact inventoryanalysis/artifact-inventory.json1 artifact(s) inventoriedHighBuild or update hypotheses
2026-06-13T15:15:32Zhypothesis recordedhypothesis-board.mdAnalyze the extracted firmware and any protocol/client artifacts to derive the suspect location, then validate only the final answer/flag against the remote service at <TARGET>:32419.MediumExtract archive using the HTB archive convention, inventory file types/strings, identify firmware architecture or encoded data, and connect read-only to the remote prompt/menu before any answer submission.
2026-06-13T15:21:18Zresearch taskanalysis/research/task-20260613T152118440806Z-60441d48.mdResearch task created for advisory investigationMediumRecord research output
2026-06-13T15:21:18Zcheckpoint recordedanalysis/checkpoint-analysis-20260613T152118632904Z-567322df.mdCheckpoint for ANALYSISHighUse checkpoint to drive next decision
2026-06-13T15:21:45Zresearch recordanalysis/research/research-records.mdResearch tagged MATCHEDMediumValidate against current evidence
2026-06-13T15:21:54Zlocal memory recordanalysis/local-memory-records.mdPrior local notes reviewed as fallback/advisory contextMediumValidate against current evidence
2026-06-13T15:22:12ZRAG queryanalysis/rag/rag-query-20260613T152154527885Z-2ecacd53.txtRAG helper exited 0; output savedMediumRecord retrieval tag and validation
2026-06-13T15:22:40ZRAG recordanalysis/rag-records.mdRetrieved memory tagged GENERICMediumValidate or reject with live evidence
2026-06-13T15:22:40Zinstrumentation plananalysis/instrumentation-plan.mdDetermine the suspect location/flag by validating firmware-derived service protocol and credentials against the live target without blind guessing.HighStop if the remote service protocol does not match firmware-derived evidence, if two credential attempts fail without new evidence, or if responses require a new primitive not present in the firmware.
2026-06-13T15:22:40Zevaluatoranalysis/evaluator-20260613T152240884102Z-d3bf2519.mdProceedHighGate before remote, identify service on <TARGET>:32419, then proceed with minimal protocol-specific interaction.
2026-06-13T15:45:38Zbranch closedhypothesis-board.mdThe original geolocation client is no longer connected; further probes only return retained SYS statistics and old session log residue.HighRerank hypotheses
2026-06-13T15:45:48Zcheckpoint recordedanalysis/checkpoint-analysis-20260613T154548985316Z-1b480720.mdCheckpoint for ANALYSISHighUse checkpoint to drive next decision
2026-06-13T23:55:57Zbranch closedhypothesis-board.mdFresh target run proved authenticated MQTT and target subscription to $private/geolocation, but duplicate-client disconnect produced no HTB flag, no useful last-will payload, and removed the target client. The observed reconnect IP was the operator egress IP, not target location.HighRerank hypotheses
2026-06-13T23:55:58Zresearch recordanalysis/research/research-records.mdResearch tagged PARTIALMediumValidate against current evidence
2026-06-13T23:56:05Zcheckpoint recordedanalysis/checkpoint-analysis-20260613T235605712102Z-c579be1e.mdCheckpoint for ANALYSISHighUse checkpoint to drive next decision
2026-06-13T23:56:15Zflag captureloot/flag.txtHTB-format flag captured; raw value kept in loot onlyHighWrite solution and run completion gate
2026-06-13T23:57:53Zcompletion gatechallenge-state.jsonCompletion gate passed; state marked COMPLETEHighOptional sanitized memory summary approval

Key Findings

  • Bootloader password/key was recovered as part of analysis; decoded EFS yields a SquashFS rootfs.
  • Rootfs provides a Mosquitto service configuration and credential material; the Mosquitto password was cracked and stored only in loot/mqtt-credential.txt.
  • Remote service is MQTT, not HTTP. The original target was <TARGET>:32419; the fresh validated target was <TARGET>:31825.
  • Authenticated MQTT access is proven. $SYS/# exposes Mosquitto broker status/logs, and normal # does not include $-prefixed topics.
  • Original live broker state exposed another client repeatedly subscribing to $private/geolocation.
  • Public HTB discussion confirms the final flag is a plain HTB-format string and the last step is a “behind the scenes” MQTT observation, not decoding the random client ID.
  • Fresh target testing showed the target client subscribing to $private/geolocation, but duplicate-client disconnect produced no flag or useful last-will payload and left the client disconnected.
  • The IP address observed after the duplicate-client connection was confirmed to be the operator egress IP, not the target location.
  • Public final-coordinate research aligned with the official hint that the final value is already plain HTB-format text. The raw candidate is stored only in loot/ and was captured through the harness.

Current Status

Flag capture is recorded in loot/flag.txt. Remaining work before declaring complete is writeup/memory cleanup, secret lint, and the completion gate.

RAG / Advisory Memory

RAG output is advisory only. Record evaluated retrievals with:

bash
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: Bounty-Head
  • 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.

  1. Reverse the Intel HEX bootloader as an x86-64 ELF and recover the loader-secret transform.
  2. Decode the supplied EFS image by XORing each byte with the effective loader key reduction.
  3. Extract the embedded SquashFS rootfs and review service configuration.
  4. Identify Mosquitto with anonymous access disabled and a legacy Mosquitto password file.
  5. Crack the MQTT password locally and connect to the live remote broker.
  6. Subscribe to $SYS/# explicitly; normal # does not include broker-internal $ topics.
  7. Use broker-internal logs and public HTB discussion as advisory evidence that the final answer is plain HTB-format coordinate text.
  8. Store the raw flag only in loot/flag.txt.

Reusable Lessons

  • MQTT $SYS/# topics can be the intended hidden surface in Hardware/IoT challenges.
  • Do not assume a duplicate-client kick will trigger a useful LWT message; it may remove the target-side client and destroy the live signal.
  • When public research is needed, classify generic blog posts and flag-list previews as advisory until they align with local artifact and live-service evidence.
  • Keep exact flags and cracked credentials out of notes, writeups, and memory summaries.

Dead Ends

  • Repeated probing against a stale broker after the geolocation client is disconnected only returns retained $SYS statistics and old residue.
  • Duplicate-client geolocation kick did not emit a flag or useful last-will payload.
  • Treating the duplicate-client reconnect source IP as target location was wrong; it was the operator egress IP.
  • Naive geocoding of the MQTT temperature stream produced ambiguous ordinary geography and was not the final route.

Tool Quirks

  • Hashcat did not directly handle the Mosquitto legacy password format cleanly; a custom verifier and wordlist crack worked.
  • Mosquitto $SYS topics require explicit subscription.
  • The harness keeps raw flags under loot/; sanitized docs should reference the artifact path only.

Evidence Paths

  • analysis/research/direct-firmware-research.md
  • analysis/rootfs/etc/mosquitto/mosquitto.conf
  • analysis/rootfs/etc/mosquitto/passwd
  • analysis/remote/mqtt-lwt-capture.txt
  • analysis/remote/mqtt-post-kick-status.txt
  • analysis/research/public-final-coordinate-lead.md
  • loot/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.

RankPathEvidenceMissing ProofCheapest ValidationConfidenceStatus
1Analyze the extracted firmware and any protocol/client artifacts to derive the suspect location, then validate only the final answer/flag against the remote service at <TARGET>:32419.Challenge provides firmware extracted from the cyborg system plus a live remote instance; scenario asks for current location rather than broad exploitation.Extract archive with password hackthebox, inventory file types/strings, identify firmware architecture or encoded data, and connect read-only to the remote prompt/menu before any answer submission.MediumActive

Closed Branches

BranchEvidence TestedFailure OutputReason ClosedRevisit Condition
repeat MQTT probing against stale post-hijack broker stateanalysis/remote/mqtt-lwt-capture.txt; analysis/remote/mqtt-persistent-session-read.txtanalysis/remote/mqtt-lwt-capture.txtThe original geolocation client is no longer connected; further probes only return retained SYS statistics and old session log residue.Restart or respawn the HTB challenge instance, then run the listener/disconnect capture script before any standalone hijack test.
duplicate-client LWT/geolocation kickanalysis/remote/mqtt-lwt-capture.txtanalysis/remote/mqtt-post-kick-status.txtFresh target run proved authenticated MQTT and target subscription to $private/geolocation, but duplicate-client disconnect produced no HTB flag, no useful last-will payload, and removed the target client. The observed reconnect IP was the operator egress IP, not target location.Only revisit with a clean respawn and a new reason to observe broker logs without kicking the client.

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 Bounty Head, 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.