Challenge / Hardware

Defusal

Defusal 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-15Sanitized local writeup

Scenario

Defusal attack path

Defusal 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.

Defusal sanitized attack graph

Walkthrough flow

01

Extract the AVR ELF and confirm debug...

02

Use strings and DWARF to identify the print_flag...

03

Correlate dot, keyByte, xorValue, and setColumn debug...

04

Use the full defusal access-code string as the XOR...

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.

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

Technical Walkthrough

Writeup

Challenge

  • Name: Defusal
  • Category: Hardware
  • Difficulty: Medium
  • Mode: file

Summary

The firmware was an AVR/Arduino binary with debug metadata still present. The circuit image showed a keypad, LCD, and LED matrix, and the binary strings exposed access-code material plus print_flag and XOR-related variable names. DWARF confirmed a local byte[37][8] flag matrix inside print_flag; decoding those 37 LED glyphs with the full code-derived XOR key recovered the challenge flag.

Artifact Inventory

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

  • Defusal: AVR ELF, statically linked, debug info present, not stripped.
  • circuit.png: schematic/blueprint showing the Arduino, keypad, LCD, and LED matrix.
  • C4-BOMB.mp4: short device-output video; useful for context, but the decisive evidence came from firmware metadata.

Analysis

  1. strings exposed the keypad map, access-code strings, display text, and symbol names including print_flag, keyByte, xorValue, and setColumn.
  2. dwarfdump confirmed print_flag contains a local flag variable of type byte[37][8].
  3. The .data section contains the glyph initializer bytes at address 0x80021e.
  4. The print_flag debug metadata names the display loop variables as dot, keyByte, and xorValue, which matches an XOR-per-column decode before writing each byte to the LED matrix.
  5. XORing each glyph byte with the full defusal access-code bytes yields readable 8-byte glyphs in row-wise MSB orientation. The ambiguous single-stem glyph is the digit 1, not a capital I.

Solve

Run:

bash
python3 Hardware/Defusal/solve/solve.py --workspace Hardware/Defusal
python3 scripts/challenge_harness.py capture-flag Hardware/Defusal --from loot/flag.txt

The solver parses the AVR ELF .data section with objdump, extracts the 37 8-byte glyph matrix, applies the XOR key, maps the decoded LED glyphs to characters, and writes the recovered flag to loot/flag.txt.

Flag

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

Lessons

  • Hardware challenges can still be solved mostly as firmware reversing when debug metadata is present.
  • Circuit/video artifacts should be used to interpret output devices, but local firmware evidence should drive the final solve.
  • Preserve raw flags in loot/ only; keep writeups and memory summaries sanitized.

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: Defusal
  • Category: Hardware
  • Difficulty: Medium
  • Mode: file
  • Remote instance: none
  • Start time: 2026-06-11T13:00:23Z
  • 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/a12c7343-e6e5-4c6e-b4e5-275a4c30ebb9.zip7455232<hash redacted>Zip archive data, at least v1.0 to extract, compression method=storezip entries: 4 shown in artifact inventory JSON

Evidence Ledger

TimeActionOutput/FileFindingConfidenceNext
2026-06-11T13:00:23Zharness initchallenge-state.jsonWorkspace initialized with deterministic state fileHighInventory artifacts
2026-06-11T13:00:38Zartifact inventoryanalysis/artifact-inventory.json1 artifact(s) inventoriedHighBuild or update hypotheses
2026-06-11T13:00:57Zhypothesis recordedhypothesis-board.mdCorrelate binary firmware logic with circuit.png and C4-BOMB.mp4 output to recover the hidden defusal flagMediumIdentify binary format, inspect strings/static logic, extract representative video frames, and map visible outputs to circuit labels
2026-06-11T13:00:57Zcheckpoint recordedanalysis/checkpoint-analysis-20260611T130057414878Z-8eeab919.mdCheckpoint for ANALYSISHighUse checkpoint to drive next decision
2026-06-11T13:00:57Zresearch taskanalysis/research/task-20260611T130057416483Z-fc551543.mdResearch task created for advisory investigationMediumRecord research output
2026-06-11T13:15:06Zsource auditanalysis/source-audit.mdSource audit recordedHighGate before exploit
2026-06-11T13:15:06Zinstrumentation plananalysis/instrumentation-plan.mdRecover the hidden flag from AVR firmware LED-matrix output logic.HighStop if the glyph matrix range, XOR key relationship, or glyph mapping conflicts with DWARF evidence or does not produce an HTB-format value.
2026-06-11T13:15:31ZRAG queryanalysis/rag/rag-query-20260611T131520090063Z-b055a247.txtRAG helper exited 0; output savedMediumRecord retrieval tag and validation
2026-06-11T13:15:46ZRAG recordanalysis/rag-records.mdRetrieved memory tagged GENERICMediumValidate or reject with live evidence
2026-06-11T13:15:58Zevaluatoranalysis/evaluator-20260611T131558086100Z-d8ce1a1d.mdProceedHighCapture flag through harness and complete.
2026-06-11T13:16:25Zflag captureloot/flag.txtHTB-format flag captured; raw value kept in loot onlyHighWrite solution and run completion gate
2026-06-11T13:16:34Zresearch recordanalysis/research/research-records.mdResearch tagged GENERICMediumValidate against current evidence
2026-06-11T13:18:04Zcompletion gatechallenge-state.jsonCompletion gate passed; state marked COMPLETEHighOptional sanitized memory summary approval
2026-06-11T13:34:57Zflag captureloot/flag.txtHTB-format flag captured; raw value kept in loot onlyHighWrite solution and run completion gate
2026-06-11T13:35:10Zcompletion gatechallenge-state.jsonCompletion gate passed; state marked COMPLETEHighOptional sanitized memory summary approval

Key Findings

-

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: Defusal
  • 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. Extract the AVR ELF and confirm debug metadata/symbols are present.
  2. Use strings and DWARF to identify the print_flag routine and the local byte[37][8] LED glyph matrix.
  3. Correlate dot, keyByte, xorValue, and setColumn debug metadata with a per-column XOR decode.
  4. Use the full defusal access-code string as the XOR key and render/map the decoded glyphs into the HTB flag format.

Reusable Lessons

  • For AVR/Arduino hardware challenges, inspect DWARF before deep disassembly if the binary is not stripped.
  • LED matrix output is often stored as 8-byte glyphs and may need orientation testing against the display library call (setColumn vs setRow).
  • Password strings in firmware may be reused as obfuscation keys for hidden output.
  • In simple LED fonts, distinguish capital I from digit 1; the cleaned full-key decode can resolve this.

Dead Ends

  • The video and circuit image were useful context but did not directly contain the flag.
  • Treating the raw glyph matrix as plaintext produced noisy output until the XOR step was applied.

Tool Quirks

  • Apple objdump can dump AVR ELF sections and symbols but may not disassemble AVR instructions.
  • dwarfdump was sufficient to recover source-level variable names and types.

Evidence Paths

  • analysis/firmware-audit.md
  • analysis/dwarfdump-full.txt
  • analysis/defusal-data-section.txt
  • analysis/solve-run-redacted.json
  • analysis/flag-correction-20260611.md
  • solve/solve.py

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
1Correlate binary firmware logic with circuit.png and C4-BOMB.mp4 output to recover the hidden defusal flagArchive contains Defusal binary, circuit schematic image, and device-output videoIdentify binary format, inspect strings/static logic, extract representative video frames, and map visible outputs to circuit labelsMediumActive

Closed Branches

BranchEvidence TestedFailure OutputReason ClosedRevisit Condition

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 Defusal, 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.