A proof of concept of CVE-2020-15808 vulnerability exploit on STM32F4 Discovery board
- Firmware version older than 1.25.2
- Board with VCP (ex. STM32F4 discovery)
- arm-none-eabi toolchain
-
Move to VulnerableFirmwareF4 and compile through
make
Ignore warnings due to unused variable, they are needed to ensure the compiler does not omit the variable
-
Flash build/VulnerableFirmware.elf on the device
-
Connect the Virtual Com Port
-
Get the list of connected devices through
lsusb
Get the hex values corresponding to STM32 Virtual Com Port. They will be Vendor Id (VID) and Product Id (PID)
-
Edit main.c replacing to VID and PID macro with the found values. Default are for STM32F4 Discovery
-
Compile main.c
gcc main.c
-
Execute a.out with root permission
sudo ./a.out
-
In order to view the dump use
hexdump -C result.bin
Follow the same instruction for VulnerableFirmwareF4_cryptolib. The content of AESctx should start from 0x1b2c offset from dump