Hardware Hacking 101: Bsides Munich 2019 Radek Domanski, Johannes Wagner
Hardware Hacking 101: Bsides Munich 2019 Radek Domanski, Johannes Wagner
Radek Domanski
@RabbitPro
Johannes Wagner
@ickyphuz
Course Structure
Group A
• 2 sessions - morning && afternoon
Target
• Working in teams of 2
172.16.0.10/24
Gifts!!!
• Every participant receives a
Hydrabus as a gift. Yes! You
can take it home and
continue hacking!
• Dumping firmware
• Glitching
• Hardware implants
Inside a Router
Scenario
Exercise 1: Inspect the Router
Exercise 2:
Exercise 3:
Exercise 4:
Hydrabus
• OpenSource multi-tool
hardware
• STM32F415 32bits@168MHz
(40x faster than an Arduino)
• website: https://hydrabus.com/
Hydrabus
Hydrabus
(how to connect)
• Sometimes it is required to
reset the device by a RESET
button
UART
Universal Asynchronous Receiver/Transmiter
• Serial communication
• Synchronized by software
• No clock signal is needed only RX,TX, VCC (power) and GND (ground)
• On the RX pin you should see fluctuating values around 3,14 V - 3,3 V with the multimeter (incoming data)
• You can also use a logic analyzer but multimeter is way faster
• WARNING! Some UART connectors use 5V instead of 3,3 for High value. In that case, you need a so called „logic level
converter“ which basically converts the 5V to a 3,3V signal or you may brick your hydrabus/buspirate/shikra/etc. . But
the most common ones are using 3,3 V
src: http://www.circuitbasics.com/basics-uart-communication/
UART
Universal Asynchronous Receiver/Transmiter
src: http://www.circuitbasics.com/basics-uart-communication/
Multimeter
don’t brick it!
• 2 modes we need today
• One test-pin to ground (enclosure metal) and one test-pin to the board pin
• Voltage measurement
• One test-pin to ground pin and one to the board pin you want to test
• Q: Why do we need it? A: With the wrong baud, we get weird stuff on
the terminal which nobody can read. Try it!
Baudrate
What is it?
src: http://www.circuitbasics.com/basics-uart-communication/
Exercise 1: Inspect the Router
Exercise 2: UART
Exercise 3:
Exercise 4:
POST- Power On Selftest
Loading the boot code
from flash over SPI to the RAM
SquashFS mounted
NVRAM NOR
EEPROM eMMC
EPROM
Rom PROM
Masked
Flash memory types
MASTER
NOR to Hydrabus
SPI Protocol
Read Data from NOR Flash
Exercise 1: Inspect the Router
Exercise 2: UART
Exercise 4:
NAND Flash
source: https://www.blackhat.com/docs/us-14/materials/us-14-Oh-Reverse-Engineering-
Flash-Memory-For-Fun-And-Benefit-WP.pdf
NAND + Controller
https://www.youtube.com/watch?v=7VahHWI3pT8
NAND firmware extraction
Exercise 1: Inspect the Router
Exercise 2: UART
src: www.microchip.com
JTAG
Joint Test Action Group
• Finding the right pins is not trivial.
• Good indicators are labels on the PCB such as: TMS,TCK or TDI
• JTAGulator/JTAGenum/Hydrabus are devices to find the right pin layout from a lot of
provided input pins
src: grandideastudio.com/jtagulator/
JTAG
Joint Test Action Group
after connecting with the correct configuration it is recomended to set the adapters
clock speed, enable single core debugging etc. a great guide for the configuration can be found on openocd.org
(http://www.openocd.org/doc/html/Config-File-Guidelines.html) and a complete guideline with openocd features etc.
can be found at (https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/jtag-debugging/index.html#jtag-debugging-configuring-esp32-
target).
TEXT
THANK YOU!