Hello, welcome back.
I will talk in this lesson about SPI exploitation, SPI stands for serial peripheral interface.
Serial peripheral interface is a synchronous serial communication interface specification used for
short distance communication, primarily in embedded systems.
The figure shows the product sheet of a Microchip microcontroller with SPI serial interface.
SPI flash memory, also known as flash storage, has become widespread in the embedded industry and
is commonly used for storage and data transfers in portable devices, common devices include phones,
tablets and media players, as well as industrial devices like security system and medical products.
And this figure in the slide shows a product sheet of a Microchip SPI flash memory.
Let's see now some features of SPI Communication Protocol, SPI is a full duplex communication protocol,
SPI devices communicate using a master slave architecture, usually with a single master, the master
or controller device originates
the frame for reading and writing. Multiple slave devices may be supported through selection with individual
chip select (CS), sometimes called slaves select lines.
SPI needs three wires to enable the data exchange, plus a slave selection line.
These lines are the MOSI line (Master Out Slave In) that's a data output from Master and MISO line
Master In Slave Out
that is a data output from slave,
and SCLK Serial clock output from master line, and Chip/Slave Select line, often active low that
outputs from master to indicate that data is being sent.
The two figures in the slide show graphics relating to read and write operations via the SPI interface.
In the write operation, the master sends the write command on the MOSI line, followed by the data
to be written. In the read operation
the master instead sends the read command on the MOSI line and then receives the data from the slave
on the MISO line.
Now let's see the steps to follow, to verify the safety of the SPI interface with respect, for example,
to the possibility of extracting data directly from an EEPROM memory via the SPI interface. First step
is to identify SPI pinouts of Iot device.
Consultation of the data sheet of the SPI device is very useful for this activity.
The second step is to connect the SPI pinouts to PC via a USB TTL converter interface.
There are two ways to connect the SPI pinouts to the USB TTL converter. You can unsolder or the SPI EEPROM
from the printed circuit board and insert it into an adapter suitable for the EPROM packaging.
Or you can directly connect the SPI EEPROM pinouts to the USB TTL converter using Soic clips without
unsolder the EPROM.
And here is reported a schematic connection of an EPROM of an Iot device connected to an analysis
PC through an Attify Badge interface.
Then next step, you can proceed to establish a connection between the PC and the Iot device through
the choosen connection interface, launching appropriate connection programs from the PC to read and
write data, such as the Python script spiflash.py, downloadable as a project from GitHub. So, if
the data is not securely managed on the device an attacker can read it or manipulate it.
OK, thank you for your attention, bye.