Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ctf-hardware

БесплатноБез исполняемых скриптовНе проверен

Provides hardware, firmware and embedded attack techniques for CTF challenges. Use when the challenge ships a firmware blob, router or IoT image, an…

jiayaoqijiaот jiayaoqijia★ 81 звезда на GitHub

Об этом скилле

CTF Hardware & Firmware

Most "hardware" CTF challenges never need a soldering iron: they hand you a dump, a capture, or an IQ file. Decide which of those you have before touching a pinout.

Scope and safety

Only work on hardware the challenge or the user owns. Do not connect to live production devices, and never reflash a device you cannot afford to brick. Keep dumps and scripts under ctf-solver/workspaces/<challenge>/.

Step 1: Identify the artifact

Artifact Path
firmware.bin, .img, vendor update file Firmware extraction
.sr / .sal / .vcd, sigrok/PulseView capture Logic analysis
.iq, .cf32, .cs16, .cu8, .wav from SDR SDR — see ../ctf-misc/rf-sdr.md
.log, candump output, DBC file CAN bus
Photo of a board, "find the UART" UART / JTAG
"power trace", CSV of samples, timing measurements Side channel
.elf for ARM/MIPS/Xtensa, no hardware given Firmware reversing — ../ctf-reverse/platforms.md

Firmware extraction

file firmware.bin
binwalk firmware.bin                 # signatures first
binwalk -Me firmware.bin             # recursive extract (installed in the image)
unsquashfs -l squashfs-root.sqfs     # SquashFS listing
jefferson -d out jffs2.img           # JFFS2 (pip install jefferson)
ubidump ubi.img --extract-file       # UBI volumes (pip install ubidump)
7z x firmware.bin -oextracted        # catches many vendor containers

Then mine the filesystem, which is where the flag usually is:

grep -rniE 'flag|passwd|secret|token|admin' squashfs-root/etc 2>/dev/null | head
cat squashfs-root/etc/shadow            # crack weak hashes with hashcat -m 1800/500
cat squashfs-root/etc/init.d/*          # boot scripts reveal services and keys
find squashfs-root -name '*.conf' -o -name 'nvram*' -o -name '*.pem'

Watch for: encrypted or XOR-obfuscated sections (entropy near 8 means compressed or encrypted), a header with a key, nvram defaults containing Wi-Fi PSKs, and firmware that ships its own private key.

Architecture check before emulating:

readelf -h ./bin/busybox | grep -E 'Machine|Class|Data'
qemu-arm -L /usr/arm-linux-gnueabihf ./bin 2>/dev/null
qemu-mipsel -L /usr/mipsel-linux-gnu ./bin

apt install qemu-user qemu-user-static gdb-multiarch gives you the cross-arch path. The container currently has no qemu at all (binwalk and unsquashfs are present), so install before planning an emulation step.

UART

  1. Find the pads — usually a 3- or 4-pin header near the SoC. GND is continuous with the shield/ground plane; VCC reads ~3.3 V. TX/RX are the remaining two.
  2. Sniff first, do not transmit. Connect only GND and the pad that emits data at boot. A USB-TTL adapter at 3.3 V, never 5 V.
  3. Baud — 115200 8N1 is the default on most routers; 57600 and 9600 are next. If you see garbage, try the neighbouring rates before rewiring.
ls /dev/tty.usbserial* /dev/ttyUSB*
picocom -b 115200 /dev/ttyUSB0        # Ctrl-A Ctrl-X to exit
screen /dev/ttyUSB0 115200

What you are looking for in the boot log: a U-Boot prompt (=>), a login prompt, or a shell. From U-Boot:

printenv
setenv bootargs 'console=ttyS0,115200 init=/bin/sh'
boot

A U-Boot prompt with fatload/md can also read raw flash without a shell. If the boot log prints the flag during init, you only needed the sniff.

JTAG / SWD / SPI flash

openocd -f interface/ftdi/ft2232h.cfg -f target/stm32f1x.cfg
# in the openocd console:
#   halt; dump_image flash.bin 0x08000000 0x100000
  • SWD (Cortex-M) needs SWDIO, SWCLK, GND, and often NRST — four wires, more reliable than JTAG on small boards.
  • SPI flash in-circuit with a SOIC-8 clip and CH341A: flashrom -p ch341a_spi -r dump.bin, then binwalk -Me dump.bin. Read-only first; writing risks bricking.
  • If the chip is read-protected, look for the flag in the bootloader's UART output or in a second, unprotected chip instead of attacking the lock bits.

Logic analysis (sigrok / PulseView)

A .sr capture is usually SPI, I2C, or UART between an MCU and a peripheral.

sigrok-cli -i capture.sr -P uart:baudrate=115200:rx=D0 -A uart=rx_data
sigrok-cli -i capture.sr -P spi:cs=D0:clk=D1:mosi=D2:miso=D3 -A spi=mosi-data
sigrok-cli -i capture.sr -P i2c:scl=D0:sda=D1 -A i2c=data-read
sigrok-cli -d fx2lafw --config samplerate=1m --channels D0,D1 -o live.sr   # live capture

sigrok-cli is not installed in the container — apt install sigrok-cli (or use PulseView locally) before promising a decode. Practical order: guess the protocol from the channel count and clock regularity, decode with defaults, then adjust baud/polarity/bit order until the bytes look like ASCII. A flag written to an LCD or EEPROM shows up as a run of printable bytes in the decode.

CAN bus

candump -L can0                    # log with timestamp
Полный SKILL.md на GitHub

Установить ctf-hardware в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash
Read
Write
Edit
Glob
Grep
Task
WebFetch
WebSearch
Skill

Вложенные файлы

LICENSESOURCE.mdTRUST.auto.yaml

FAQ

Что делает скилл ctf-hardware?

Provides hardware, firmware and embedded attack techniques for CTF challenges. Use when the challenge ships a firmware blob, router or IoT image, an ESP32/STM32/ARM/MIPS dump, a logic-analyzer capture (.sr, .sal, VCD), an SDR/IQ recording, a CAN bus log, a PCB photo with test pads, or asks for UART, JTAG, SWD, SPI flash, side-channel or fault-injection work. Also use when a flag is "in the device" and you must extract, reflash, sniff or emulate it. Do not use it for pure disk, memory or network forensics, or for ordinary binary exploitation with no hardware layer.

Как установить скилл ctf-hardware?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ctf-hardware запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ctf-hardware с