Defusal
Defusal is a sanitized challenge note from the local HTB archive, organized for quick review by category, difficulty, evidence flow, and reusable operator
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.
Walkthrough flow
Extract the AVR ELF and confirm debug...
Use strings and DWARF to identify the print_flag...
Correlate dot, keyByte, xorValue, and setColumn debug...
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.
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
stringsexposed the keypad map, access-code strings, display text, and symbol names includingprint_flag,keyByte,xorValue, andsetColumn.dwarfdumpconfirmedprint_flagcontains a localflagvariable of typebyte[37][8].- The
.datasection contains the glyph initializer bytes at address0x80021e. - The
print_flagdebug metadata names the display loop variables asdot,keyByte, andxorValue, which matches an XOR-per-column decode before writing each byte to the LED matrix. - 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 capitalI.
Solve
Run:
python3 Hardware/Defusal/solve/solve.py --workspace Hardware/Defusal
python3 scripts/challenge_harness.py capture-flag Hardware/Defusal --from loot/flag.txtThe 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
| File | Size | SHA256 | Type | Notes |
|---|---|---|---|---|
files/a12c7343-e6e5-4c6e-b4e5-275a4c30ebb9.zip | 7455232 | <hash redacted> | Zip archive data, at least v1.0 to extract, compression method=store | zip entries: 4 shown in artifact inventory JSON |
Evidence Ledger
| Time | Action | Output/File | Finding | Confidence | Next |
|---|---|---|---|---|---|
| 2026-06-11T13:00:23Z | harness init | challenge-state.json | Workspace initialized with deterministic state file | High | Inventory artifacts |
| 2026-06-11T13:00:38Z | artifact inventory | analysis/artifact-inventory.json | 1 artifact(s) inventoried | High | Build or update hypotheses |
| 2026-06-11T13:00:57Z | hypothesis recorded | hypothesis-board.md | Correlate binary firmware logic with circuit.png and C4-BOMB.mp4 output to recover the hidden defusal flag | Medium | Identify binary format, inspect strings/static logic, extract representative video frames, and map visible outputs to circuit labels |
| 2026-06-11T13:00:57Z | checkpoint recorded | analysis/checkpoint-analysis-20260611T130057414878Z-8eeab919.md | Checkpoint for ANALYSIS | High | Use checkpoint to drive next decision |
| 2026-06-11T13:00:57Z | research task | analysis/research/task-20260611T130057416483Z-fc551543.md | Research task created for advisory investigation | Medium | Record research output |
| 2026-06-11T13:15:06Z | source audit | analysis/source-audit.md | Source audit recorded | High | Gate before exploit |
| 2026-06-11T13:15:06Z | instrumentation plan | analysis/instrumentation-plan.md | Recover the hidden flag from AVR firmware LED-matrix output logic. | High | Stop 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:31Z | RAG query | analysis/rag/rag-query-20260611T131520090063Z-b055a247.txt | RAG helper exited 0; output saved | Medium | Record retrieval tag and validation |
| 2026-06-11T13:15:46Z | RAG record | analysis/rag-records.md | Retrieved memory tagged GENERIC | Medium | Validate or reject with live evidence |
| 2026-06-11T13:15:58Z | evaluator | analysis/evaluator-20260611T131558086100Z-d8ce1a1d.md | Proceed | High | Capture flag through harness and complete. |
| 2026-06-11T13:16:25Z | flag capture | loot/flag.txt | HTB-format flag captured; raw value kept in loot only | High | Write solution and run completion gate |
| 2026-06-11T13:16:34Z | research record | analysis/research/research-records.md | Research tagged GENERIC | Medium | Validate against current evidence |
| 2026-06-11T13:18:04Z | completion gate | challenge-state.json | Completion gate passed; state marked COMPLETE | High | Optional sanitized memory summary approval |
| 2026-06-11T13:34:57Z | flag capture | loot/flag.txt | HTB-format flag captured; raw value kept in loot only | High | Write solution and run completion gate |
| 2026-06-11T13:35:10Z | completion gate | challenge-state.json | Completion gate passed; state marked COMPLETE | High | Optional sanitized memory summary approval |
Key Findings
-
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: 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.
- Extract the AVR ELF and confirm debug metadata/symbols are present.
- Use strings and DWARF to identify the
print_flagroutine and the localbyte[37][8]LED glyph matrix. - Correlate
dot,keyByte,xorValue, andsetColumndebug metadata with a per-column XOR decode. - 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 (
setColumnvssetRow). - Password strings in firmware may be reused as obfuscation keys for hidden output.
- In simple LED fonts, distinguish capital
Ifrom digit1; 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
objdumpcan dump AVR ELF sections and symbols but may not disassemble AVR instructions. dwarfdumpwas sufficient to recover source-level variable names and types.
Evidence Paths
analysis/firmware-audit.mdanalysis/dwarfdump-full.txtanalysis/defusal-data-section.txtanalysis/solve-run-redacted.jsonanalysis/flag-correction-20260611.mdsolve/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.
| Rank | Path | Evidence | Missing Proof | Cheapest Validation | Confidence | Status |
|---|---|---|---|---|---|---|
| 1 | Correlate binary firmware logic with circuit.png and C4-BOMB.mp4 output to recover the hidden defusal flag | Archive contains Defusal binary, circuit schematic image, and device-output video | Identify binary format, inspect strings/static logic, extract representative video frames, and map visible outputs to circuit labels | Medium | Active |
Closed Branches
| Branch | Evidence Tested | Failure Output | Reason Closed | Revisit 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.