Welcome to the TwelveSec Firmware Extraction Workshop presented at BSides Athens 2025! This hands-on session teaches participants how to extract firmware from embedded devices for security research and analysis.
This repository contains instructions, tools, and references for:
-
Using Arduino as an ISP programmer
-
Dumping firmware from ATmega microcontrollers
-
Analyzing firmware with tools like AVRDUDE,
strings, and Ghidra
-
Arduino Nano
-
Target device (e.g., ATmega168 or compatible)
-
Jumper wires
-
Computer with:
-
Arduino IDE
-
AVRDUDE
-
Ghidra
-
If you're interested in ordering and building your own badge, be sure to check out the instructions provided in our related project:
There you'll find detailed guidance on assembling your badge, and getting everything up and running.
-
Open Arduino IDE.
-
Connect your Arduino Nano via USB.
-
Load the
ArduinoISPsketch from File > Examples. -
Set board:
Arduino Nano, processor:ATmega168. -
Upload the sketch.
Connect the Arduino Nano to the target device using SPI:
-
D10 (CS) ➜ RESET of target chip
-
D11 (MOSI) ➜ MOSI
-
D12 (MISO) ➜ MISO
-
D13 (SCK) ➜ SCK
-
GND ➜ GND
-
5V ➜ VCC (double-check voltage requirements)
⚠️ Never connect or disconnect wires while the device is powered.
avrdude -C/etc/avrdude.conf -v -V -patmega168p -carduino -P/dev/ttyUSB0 -b19200 -D -Uflash:r:firmware.bin:r -Favrdude -C/etc/avrdude.conf -v -V -patmega168p -carduino -P/dev/ttyUSB0 -b19200 -D -Uflash:r:firmware.hex:i -Fobjcopy --input-target=ihex --output-target=binary firmware.hex firmware.binstrings firmware.bin | less-
Analyze extracted firmware
-
Locate hardcoded credentials, keys, or debug info
-
Open Ghidra and create a new project
-
Import
firmware.bin -
Select processor:
atmega328(or appropriate AVR) -
Use Search > For Strings to locate readable content
💡 Add support for AVR in Ghidra by editing
avr8.ldefsunderGhidra/Processors/Atmel/data/languages/if needed.
Check out our hardware hacking tools and other resources:
https://github.com/twelvesec/PwnPad
Presented by TwelveSec – Offensive Security Experts
Questions? Open an issue or start a discussion right here on GitHub!
