ECSC CTF 2021 - Serial

Hardware 1 - Serial
Challenge Description
We managed to eavesdrop on the serial communication of an Arduino-based door locks debugging interface. Can you find the password?
- This challenge has a downloadable part.
Steps
Unzip challenge files:
We get a file signal.txt
, which is the debugging dump of the arduino-based door lock. As we get from the challenge description the file will contain the Serial binary data that we have received from the Arduino. The serial protocol used is UART.
If we cat
its output:
The UART is a Universal Asynchronous Receiver-Transmitter. UART data is transmitted by a serial code in the following format.
As we noticed in the beginning we have a lot of 1
’s, which means there is no data transmission and when the first 0
is found it must be the Start Bit, so the next 8 bits are the Data Bits and then it continues with 1
’s until the next 0
is found.
It is a very easy protocol and we can separete the given binary data with the scheme we just explained:
If we delete the start-stop bits, we have the raw data bytes:
But these are the data that are being transmitted so we need to reverse each byte because we are receiving them with the opposite order:
These raw bytes can now by converted to ASCII characters, using like an online tool from Rapid Tables, and we get:
This is our flag.
Of course this task can be automated with a python script:
And we can run :
Flag
Flag: ECSC{532141_c0mmun1c4710n_15_3v32ywh323_1n_3m83dd3d!!d52}