https://www.elttam.com.au/blog/intro-sdr-and-rf-analysis/
This is not a commonly used frequency for these types of devices anymore, in fact the antenna length needed for this is bigger than my telescopic antenna can go, however this is not too much of an issue. The internals of this device reveal it includes the ability to set a code via DIP switches in order to pair it with the garage door receiver, shown below.
Note: That big cylinder in the centre is a ferrite coil antenna, and clearly this device was made in an era where electronic components were much bigger
Again, without doing any further OSINT, we take a look at the signal this produces with the help of HackRF and baudline. The first thing to notice is that the signal only transmits while the remote’s button is held, and will transmit constantly. This can be seen below.
Again, no apparent change in frequency, and a narrow bandwidth signal. Taking a look at the waveform, we can see the following.
Looking at this, there is no change in phase but appears to have subtle changes in amplitude. So this is most likely ASK. Within baudline I modified the aperture color in order to see the changes in amplitude more clearly on the waterfall plot, but was unsuccessful. I decided to save this signal and load it into Inspectrum, where I was more successful in viewing the amplitude changes. Fiddling with the Power Max and Power Min settings I was able to eliminate all but the highest amplitude, and started to see a repeating pattern of packets. One of these packets can be seen below.
Each repeating packet was the same, and there was no change with repeated presses of the garage remote button. Enabling the cursors functionality helped here to discern the high and low amplitudes, along with the symbol rate. Assuming a low amplitude represents a 0 and a high amplitude represents a 1, the packet data appeared to be
There are sixteen DIP switches, in two sets of eight, which I thought might relate directly to the 16+1 apparent symbols. I set all the DIP switches to their lower positions, which I will call the 0 setting, and take another look at the signal. This time we get the following.
OK, so we’ve added some 1’s, and the seventeenth symbol remained a 1. Let’s try setting the first DIP to its high setting. We get the following.
Alright, so symbol position two went to a 0, and again the seventeenth symbol remains the same. Let’s try the first DIP in the second set of eight DIP switches.
There is no change from all the DIP switches off, in fact changing any of the second set of eight DIPs would produce the same result.
Again, trying just the first DIP, and adding the second DIP, we get the following.
Now we are seeing some relationship, the first DIP seems to relate to the second symbol position, while the second DIP seemed to relate to the twelfth position. Trying each DIP switch of the first set of eight DIPs, which I will call set A, I am able to determine the following relationship to the symbols.
At this point, this seemed to be a simple mapping of the DIP to a symbol, however when trying DIP A1, with the first DIP of the second set of eight, which I will call set B, the relationship seemed to become a little more complex. This is shown below.
Notice now, we have a 1 in the first symbol position, and also in the second position, which we were expecting to be 0. It seemed the DIP B1 modified the resulting value of DIP A1. Trying this with the other corresponding A and B DIPs produced the same respective result.
After playing around with this, I realised I could describe this modification, and the result of the symbol position with respect to the A and B DIP switch pairs, with some discrete mathematics. This can be seen in the following table.
To explain this table, A and B refer to the respective DIP switch positions, 1 being high and 0 being low.
With the original DIP positions of
Given a captured signal from this garage remote, I am now reliably able to determine each of the sixteen DIP switch positions without ever seeing them. From here I would have liked to attempt to transmit this signal in a similar manner to the doorbell, however the YardStick One is unable to transmit on that particular frequency. However, as the transmitted data never changes, this garage door system should be vulnerable to a replay attack, in which the signal is simply recorded and retransmitted. The HackRF has the ability to do this.
In this case the, the key did not blatantly display the operating frequency of the device, however it was very simple to discover in the RF spectrum, as it operated in the 433 MHz range, similar to the doorbell remote, which is common for these types of remotes.
Having a look at the signal in baudline, we see the following.
Observing this there again seems to be a number of packets sent with each click of the disarm button, however each signal seems much shorter and quicker than the doorbell remote. It is a little difficult to see, but pausing the output and zooming in to the time domain in the waterfall plot, we are able to better discern the signal. This is shown below.
From this, we are able to determine the frequency, see that it has a narrow bandwidth, and is looking very similar to the doorbell remote signal. Taking a look at the at the waveform, we see the following.
This is now much easier to see a complete packet, and the modulation is again PDM. The packet appears to be more well-formed than the doorbell, and appears to have a preamble, the initial seven long pulses, and a trailing sequence of short pulses. The data in between must represent the button pressed, as there are separate buttons for arm and disarm, along with a few others.
Each packet in the sequence that is sent with a click of the disarm button is the same, but one would expect that this packet would be different to packet sent in another key press. Let’s take a look at another press of the same disarm button.
Exactly the same.
This security system suffers from the same security vulnerability with both the doorbell and garage door remotes, I can simply record and replay this signal in a replay attack to disarm the security system of the home, business, or wherever this system is implemented. To prevent this issue, this should really be a rolling code system, where the coding of the signal changes on each press of the remote’s button.
This could be further analysed by trying different buttons and observing the changes, however for the purpose of this discussion, I went no further.
Using baudline again to observe a portion of the WiFi frequency range, we can see the following.
From this we can see flashes of wireless packets in four distinct channels. Peak Smoothing was enabled to show the wide bandwidth of each channel in the spectrum display at the bottom of the image. This wide frequency bandwidth of each signal is due to WiFi using spread spectrum schemes such as DSSS.
Decimating the input to view one channel, then looking at the waveform of the signal, we see the following.
This is an example of a signal that is much more difficult to determine the modulation in use visually. OSINT would be necessary in this case, and looking up WiFi modulation will show you that the more complex forms of QAM is used.
Although this discussion is not exactly a deep guide on reversing RF signals with SDR, hopefully you have learned something, or at least found it an interesting read.
An Old and Weird Garage Door Remote
Another device looked at was a very old and as you will see, strange, wireless garage door remote. Looking at the device, we can again quickly determine the operating frequency, 26.995 MHz, as shown in the image below.This is not a commonly used frequency for these types of devices anymore, in fact the antenna length needed for this is bigger than my telescopic antenna can go, however this is not too much of an issue. The internals of this device reveal it includes the ability to set a code via DIP switches in order to pair it with the garage door receiver, shown below.
Note: That big cylinder in the centre is a ferrite coil antenna, and clearly this device was made in an era where electronic components were much bigger
Again, without doing any further OSINT, we take a look at the signal this produces with the help of HackRF and baudline. The first thing to notice is that the signal only transmits while the remote’s button is held, and will transmit constantly. This can be seen below.
Again, no apparent change in frequency, and a narrow bandwidth signal. Taking a look at the waveform, we can see the following.
Looking at this, there is no change in phase but appears to have subtle changes in amplitude. So this is most likely ASK. Within baudline I modified the aperture color in order to see the changes in amplitude more clearly on the waterfall plot, but was unsuccessful. I decided to save this signal and load it into Inspectrum, where I was more successful in viewing the amplitude changes. Fiddling with the Power Max and Power Min settings I was able to eliminate all but the highest amplitude, and started to see a repeating pattern of packets. One of these packets can be seen below.
Each repeating packet was the same, and there was no change with repeated presses of the garage remote button. Enabling the cursors functionality helped here to discern the high and low amplitudes, along with the symbol rate. Assuming a low amplitude represents a 0 and a high amplitude represents a 1, the packet data appeared to be
00001100111101001
. However, I was more interested in how this related to the DIP switch positions inside the device.There are sixteen DIP switches, in two sets of eight, which I thought might relate directly to the 16+1 apparent symbols. I set all the DIP switches to their lower positions, which I will call the 0 setting, and take another look at the signal. This time we get the following.
OK, so we’ve added some 1’s, and the seventeenth symbol remained a 1. Let’s try setting the first DIP to its high setting. We get the following.
Alright, so symbol position two went to a 0, and again the seventeenth symbol remains the same. Let’s try the first DIP in the second set of eight DIP switches.
There is no change from all the DIP switches off, in fact changing any of the second set of eight DIPs would produce the same result.
Again, trying just the first DIP, and adding the second DIP, we get the following.
Now we are seeing some relationship, the first DIP seems to relate to the second symbol position, while the second DIP seemed to relate to the twelfth position. Trying each DIP switch of the first set of eight DIPs, which I will call set A, I am able to determine the following relationship to the symbols.
At this point, this seemed to be a simple mapping of the DIP to a symbol, however when trying DIP A1, with the first DIP of the second set of eight, which I will call set B, the relationship seemed to become a little more complex. This is shown below.
Notice now, we have a 1 in the first symbol position, and also in the second position, which we were expecting to be 0. It seemed the DIP B1 modified the resulting value of DIP A1. Trying this with the other corresponding A and B DIPs produced the same respective result.
After playing around with this, I realised I could describe this modification, and the result of the symbol position with respect to the A and B DIP switch pairs, with some discrete mathematics. This can be seen in the following table.
To explain this table, A and B refer to the respective DIP switch positions, 1 being high and 0 being low.
A*B
refers to each odd symbol, and is the binary AND of DIP A and B. Whilst ~A+B
refers to each even symbol, and is the binary OR of NOT A and B.With the original DIP positions of
11110111 01010010
, we see the result of 00110011010011001
, however this does not correspond to what we saw when analysing the signal, which was 00001100111101001
. This because we still need to apply the previous relationship we first noted between the A
DIPs and their symbol position. Doing this, shown by the blue arrows
above, we can now see the result of our discrete math now corresponds
correctly.Given a captured signal from this garage remote, I am now reliably able to determine each of the sixteen DIP switch positions without ever seeing them. From here I would have liked to attempt to transmit this signal in a similar manner to the doorbell, however the YardStick One is unable to transmit on that particular frequency. However, as the transmitted data never changes, this garage door system should be vulnerable to a replay attack, in which the signal is simply recorded and retransmitted. The HackRF has the ability to do this.
A Common Home and Business Security System
Another system that we will take a look at is a very common security system that seems to be used for many homes, and businesses. This is a relatively modern system, that incorporates multiple sensors, alarms, and a polling to the security company’s monitoring service. This system includes a keypad to arm and disarm the alarm, however it also includes a number of remotes that allow the arming and disarming of the security system from outside the building. This is what we will briefly look at.In this case the, the key did not blatantly display the operating frequency of the device, however it was very simple to discover in the RF spectrum, as it operated in the 433 MHz range, similar to the doorbell remote, which is common for these types of remotes.
Having a look at the signal in baudline, we see the following.
Observing this there again seems to be a number of packets sent with each click of the disarm button, however each signal seems much shorter and quicker than the doorbell remote. It is a little difficult to see, but pausing the output and zooming in to the time domain in the waterfall plot, we are able to better discern the signal. This is shown below.
From this, we are able to determine the frequency, see that it has a narrow bandwidth, and is looking very similar to the doorbell remote signal. Taking a look at the at the waveform, we see the following.
This is now much easier to see a complete packet, and the modulation is again PDM. The packet appears to be more well-formed than the doorbell, and appears to have a preamble, the initial seven long pulses, and a trailing sequence of short pulses. The data in between must represent the button pressed, as there are separate buttons for arm and disarm, along with a few others.
Each packet in the sequence that is sent with a click of the disarm button is the same, but one would expect that this packet would be different to packet sent in another key press. Let’s take a look at another press of the same disarm button.
Exactly the same.
This security system suffers from the same security vulnerability with both the doorbell and garage door remotes, I can simply record and replay this signal in a replay attack to disarm the security system of the home, business, or wherever this system is implemented. To prevent this issue, this should really be a rolling code system, where the coding of the signal changes on each press of the remote’s button.
This could be further analysed by trying different buttons and observing the changes, however for the purpose of this discussion, I went no further.
WiFi 2.4GHz
Just out of curiosity let’s take a look at 2.4 GHz WiFi to see some more complex signals and modulation.Using baudline again to observe a portion of the WiFi frequency range, we can see the following.
From this we can see flashes of wireless packets in four distinct channels. Peak Smoothing was enabled to show the wide bandwidth of each channel in the spectrum display at the bottom of the image. This wide frequency bandwidth of each signal is due to WiFi using spread spectrum schemes such as DSSS.
Decimating the input to view one channel, then looking at the waveform of the signal, we see the following.
This is an example of a signal that is much more difficult to determine the modulation in use visually. OSINT would be necessary in this case, and looking up WiFi modulation will show you that the more complex forms of QAM is used.
Demodulation
Ultimately to conduct a proper reverse engineering effort on an RF signal using SDR, requires some better understanding of RF engineering and the use of GNU Radio Companion to properly demodulate the signal. Other possibilities are to find already made GNU Radio workflows, or other software, that can demodulate the RF signal with its particular characteristics. This leaves the initial digital data, which may be further analysed using regular software reverse engineering techniques.What Have We Learned?
We looked at some RF theory to get a good basic understanding of what RF is, how data is transmitted using RF signals, and discussed some common analogue and digital modulation schemes that are the basis of more complex modulation. We briefly described SDR, including some hardware and software SDR tools that are useful for RF signal analysis and reverse engineering, along with tips for using those tools to capture and view RF signals. We identified a good methodology for attempting to reverse engineer and understand wireless protocols, and finally, we looked at the RF signals produced by some common devices in an effort to determine their characteristics, and identified some security issues along the way.Although this discussion is not exactly a deep guide on reversing RF signals with SDR, hopefully you have learned something, or at least found it an interesting read.
Comments
Post a Comment