Advent Of Cyber 2022 | Day 19 | TryHackMe

Advent Of Cyber 2022 | Day 19 | TryHackMe

Hello everybody, welcome back to yet another blog on the Advent of cyber 2022. It's day 19 and I am really excited for today's task. I hope you all are enjoying my blogs. So, without any further delay, let's move to today's task.

Wiggles go brrr

So this room is mainly focusing on how data is sent via electrical wires in low-level hardware and on some hardware communication protocols. This task contains a lot of theory so I would recommend reading the theory first. I will give you a glimpse of some theories of today's task.

If you have electricity, how can you generate a digital signal? As you know computers only understand machine language which is 0 and 1. So we can first switch on the computer hardware and the computer will take it as 1. After that we can switch off the hardware and the computer will take it 0. To perform communication, we simply turn the power on and off in a specific sequence to transmit a bunch of 0s and 1s. If we send 8 bits, we are sending a single byte! I guess it's clear to you. We can transmit text data by using the ASCII table. Sending the binary representation of each character, we can transmit data! But this process was slow and both hardware chips agree to a specific digital protocol and configuration that will be used to transmit data. Here comes the use of some protocols.

USART

Universal Synchronous/Asynchronous Receiver-Transmitter (USART) communication, or as it is better known, serial communication, is a protocol that uses two wires. One wire is used to transmit (TX) data from device A to device B, and the other wire is used to receive (RX) data on device A from device B. In essence, we connect the transmit port from one device to the receive port from the other device and vice versa. But it has some disadvantages too. The devices don't have a way to determine if the other device is ready for communication. To solve this, some USART connections will use two additional lines called Clear To Send (CTS) and Request to Send (RTS) to communicate to the other device whether it is ready to receive or ready to transmit. Furthermore, to agree upon what voltage level is a binary 1 or 0, a third wire called the Ground (GND) wire is required to allow the devices to have the same voltage reference. But this protocol is really slow, so we need a faster protocol.

SPI

The Serial Peripheral Interface (SPI) communication protocol is mainly used for communication between microprocessors and small peripherals such as a sensor or an SD card. While USART communication has the clock built into the TX and RX lines, SPI uses a separate clock wire. Separating the clock (SCK) from the data (DATA) line allows for synchronous communication, which is faster and more reliable.

SPI communication is a fair bit more complex than USART, but having a dedicated clock line increases the speed at which we can communicate and improves reliability.

I2C

The Inter-Integrated Circuit (I2C) communication protocol was created to deal with the drawbacks of both the USART and SPI communication protocols. Because USART is asynchronous and has the clock built into the transmit and receive lines, devices have to agree ahead of time on the configuration of communication. Furthermore, speeds are reduced to ensure communication remains reliable. On the other hand, while SPI is faster and more reliable, it requires many more wires for communication, and every single additional peripheral requires one more Chip Select wire.I2C attempts to solve these problems. Similar to USART, I2C only makes use of two lines for communication. I2C uses a Serial Data (SDA) line and Serial Clock (SCL) line for communication. However, instead of using a Chip Select wire to determine which peripheral is being communicated to, I2C uses an Address signal that is sent on the SDA wire. This Address tells all controllers and peripherals which device is trying to communicate and to which device it is trying to communicate to. Once the signal is sent, a Data signal can be used to send the actual communication. To notify other controllers and peripherals that communication is taking place and prevent these devices from talking over each other, a Start and Stop signal is used. Each device can monitor these Start and Stop signals to determine if the lines are busy with communication.

In this task, we are going to use Logic Analyser.

Let's move to the question of today's task.

Question1

The answer is Logic Analyser

Question2

The main disadvantage of USART was it was very slow. So the answer is nay.

Question3

As you know, SPI is more complex than USART so it will have more wires.

Question4

Just like in question 2, USART is slow.

Question5

I2C overcomes the problem of SPI which was SPI uses more wires. So I2C uses less wire than SPI. So the answer is no.

Question6

Even if SPI uses more wires, it was still faster than the other two protocols.

Question7

If you have read the theory of today's task, you must know the answer. It's 1008

Question8

Now comes the practical part. Open your attackbox and start the application logic analyser. Drag and drop the Santa file which is present on the Desktop. It will take some time to load the file inside the tool. You can see this type of interface.

I am directly moving to how to do this task because my attackbox's limit is expiring.

Move to the analyzers tab

Click on the Async serial.

The channel we are inputting will be channel 1. The bit rate will be 4800.

Click on save. In the terminal tab, you can see something like this.

Okay, so let's change the channel. Go to plus sign and click on Async serial.

Now change the channel to channel 0.

You can see something in terminal.

It's giving us the new baud rate which is 9600.

Question9

Let's change the baud rate. Again go to the plus sign and change the rate. Channel will remain the same which is channel 0. The Baud rate will be 9600 this time.

Scroll down in terminal and you will get your flag.

Question 10

They are recommending you to complete Recent Threats module!

Congratulations !! we completed this task. New task will be added tomorrow. Till then you can follow me here for upcoming blogs on the advent of cyber 2022. In the end, you will get a certificate from tryhackme for completing this challenge.

Keep learning and keep spreading Knowledge.

Did you find this article valuable?

Support Tanya Goyal by becoming a sponsor. Any amount is appreciated!