Welcome to DEF CON. Alright, we got Laura, water meter security analysis. This is your presenter, Jimmy. Give him a warm welcome. Thank you everyone. First, I'd like to clarify that this work is not only done by myself. It was done by me, done by my team. My team members. And one of the members, because the U.S. consulate rejected him of his visa, so he cannot be here. So, yeah. Every year we got speakers rejected of the visa. I think this young man might be a big national security threat for the U.S. consulate. Okay, I'm going to record a short video for him to get him what he feels to a present. In front of such a huge bunch of hackers. So, everybody. Oh, just, oh, sorry, sorry, sorry. Okay. Let's shout out for Deng Yintao. His name is Yintao. Okay. Okay, thank you. Yeah, every year I got many friends rejected. So, let me quickly introduce my company and our team. My team is called Yunkun Team. We are doing wireless security, hardware security, and so on. And we are from the largest security company called 360 Security Technology in China. And today I'm going to present how the process we took to analyze this so-called smart water meter. So, this how it looks like in real life. And what we did is we used the On the left, you can see that it just looks like a normal water meter, but there is a dial, a red circle, so that's just like a magnet. So when the water meter runs, the magnet will rotate and there will be a magnet sensor on another cover on the next slides I will show you. And on the right is a solar panel-powered gateway, which just like relays the water meter data to the server via the GPRS. But the communication between this water meter and the gateway is using LoRa, which is kind of a private protocol. And this is a camera of the water meter. There is a circuit board, and there is an antenna, and also this is a gateway, which you can see there is a GPRS module and a LoRa transmission module. So this is actually the parameters and the models of the chips. So you can see there is an MCU, which is used to configure the LoRa chip every time. Every time it pops out, because this might be... So we will later introduce how we can attack the communication between the MCU and the LoRa module. And we have the antenna parameter and the battery. So this, the way, why they are going to use this LoRa communication, because it is low power. So this little battery can power it up to 10 years. So that's why they are using this. And there is a hard sensor to detect the rotation of the magnet, as I said, here. I don't know if you can see it. There is a pointer or something? No. So there is a magnet sensor called TMR3O1 that can detect the water meter when it's running. And there is a MCU. So configure... MCU is here to configure this LoRa chip. And this is a gateway discipline. So there is a GPRS module here, the white rectangle. And there is a LoRa module. So it's just like very typical architecture for an IoT device. And there is an EPROM. So to store the data, maybe, to when it's in the GPRS, to maybe buffer the water meter data. And actually, the gateway, they usually implement the gateway using a different chip. But they are using the same chip as the water meter. So they have to use... Because this is cheaper than to use another, like, chip data. So it's dedicated for the gateway. Now let's talk about how we can fix the water meter data. So you can... As we said, they're just detecting the mutation of the magnet. So we can use a strong magnet to put it near the sensor TMR3O1 sensor to just to interfere the signal. So you can see. When the magnet rotates, the voltage produced on the water meter, the sensor, will change. So we can use... You can see if the... There's no... Okay. So you can see that this... When the magnet is in this angle, there is a 400 millivolt voltage. And when the angle changes, the voltage changes accordingly. So this is how they can detect the water meter when it's running. So we use a strong magnet to interfere with this magnetic field. So because the cover is a plastic, so it's still working. So you can... So essentially, that's to say that we are not using any water. But this can be caught if they go to... Come to your house and actually take a look at the water meter. So that's one way to spoof the sensor data. And another way is just to disassemble it and use a voltage regulator to spoof the sensor voltage. It's the same effect. So the LoRa frequency is different in each country. So this is, for example, in the U.S., it's 915 megahertz. So in other countries, it's different. So when you're trying to, like, do research on this kind of mid-LoRa-based device, you have to... Maybe tune your HDR device to that frequency in order to catch the signal. So this is the format of the packets. So you have this preamble, which will notify the receiver that there's a packet coming. And you have this up-chip, down-chip encoding data. So... Actually, there is a pretty complex set of parameters that you need to configure. So when we do wireless security research, we often use, like, HDR. So we have to configure the parameters for the receiver or for the decoder. So there are many sets of configurations. So actually, researchers from the U.S. company in Boston, they are doing wireless security. So they did something to, like... To decode the LoRa traffic. But they're... We tried their code, but it's not working. I guess it's because the configuration of the parameters are different. So we have to wrote our own decoding code for this traffic. So... Actually, we... One of our team members wrote the code to... Using MATLAB to decode the traffic. And we uploaded this module to our GitHub. So if you are interested in doing some LoRa research in the future, you can go to look at the code. But this is still not very easy to use. So we switched to another method. So... Actually, because I said... As I said, there is an MCU used to configure the LoRa module every time it's powered on. So... So what it does is using SPI, serial communication, to configure the LoRa module, all the parameters, which frequency, the different description factors, something like that. So we used this logic analyzer to capture the traffic on the serial communication interface. And we got... We can figure out how this LoRa front and LoRa transceiver is configured. So... And then we just go and buy another LoRa module and use the same configuration in order to receive the... To decode the traffic. So... It's... It's pretty smart, this kind of... So... You have... Once you've got all the traffic on the serial communication, you have to figure out... Figure out what those traffic means. So we got this... We figured out it by looking at the documentation where this is what kind of instruction means what. So, for example, there are this... When you see this traffic, it means it sets the frequency to the 492.25 megahertz. That's the frequency we mentioned in the previous slides where we say that... They say that different countries are using different frequencies. So you can see this is the Chinese frequency. Okay. We... Now we got the configuration. So we use another module to configure it the same way. And we can see the traffic. Okay. So now we got the traffic. We have to reverse engineer the communication protocol and see... To see what... How they can, like, transmit the data. Yeah. Surprisingly, we find it not encoded. It's just instant in plain text. Perhaps they think that SNORA communication is... By itself, it's very hard to decode. So this... They are using kind of, like... There is a prime oratory protocol. So there is a unique ID of each water meter. And actually, we can scroll for the traffic here. And they are transmitting the water usage data and also the temperature. So let's see if the privacy risks... For example, if I say that there is no water usage... Because the water usage data is sent in... Is transmitted in plain text. So we can actually save the data to say if somebody is at home using their water meter. And... Or... So we can actually profile the habits of this user. So to save his working routine when he comes home and when he leaves for work. Something like that. And we can also, like... Explode the data. To make somebody, like, seeing... Where we can see that they are using a lot of water and get overcharged. And... We can also forge the... Forge the... Gateway to each instructions. For example, you... Because this is, like, the... This is, like, a two-way communication. So not only the water meter have to... Upload water usage data. But also the server might... Issue some command to the... To the water meter. So... We... And... And also the DORA is not only used in water meter. So... They are used to control gas wafts or other, like... Just like you can think of it, like... Similar... Like GPRS or ZB. They can be used anywhere to... To build a connected device. So we... If we can, like... Get traffic or shrewd the traffic... We can cause other chaotic... Consequences. So this is... All... Who... Like how the... The communication links works. So the water meter... Actually... Send the data to the gateway. And the... To transmit... Send the data to the server using GPRS. And GPRS... Everybody knows that the traffic is... That... That... That... That... That communication link is not safe. Everybody maybe can't sleep or... Prove the traffic. So we can use, like... Base station to... To... To... To... To... To... To... To... To... To... To... To... To... To... To... The gateway . Ptuhh.. Ptuhh... So this is... High quality trying to... Uh... Uh... My colleagues... T... Usually the... T... 2 Knent... So we set up this... Ptuhh... Base station over using BT... Ptuhhm... Ptuhhm... Open BTS ... And… Ptuhh... And... We... Managed to get this... uh... Main... gateway to communicate to our fake base station. And actually this is very common kind of attack in, especially in China. So people are using maybe like this GPRs to unlock shared bikes. So people are trying to spoof the unlock command to make the bike open itself. Yeah, so we are doing that and this is kind of very common techniques. So when we got the basic base station setup and the gate we connect to our base station we can see what data is sending into the server. And then we will analyze this using wireshop and the reverse engineer the connection. the protocol used between the gateway and the server. So this is how the traffic looks like. So you can see there's a gateway ID, there's a header and a counter code. And also payload, so all kinds of information. Again, it's not encrypted, it's just using a CRC to check the integrity of this packet. So we can actually, as I said, we can explore the gateway to transmit big water meter data, water usage data to the server. So let's take a look at the overall communication link. The water meter to the gateway, gateway to the server, and so we have reverse engineered the tool communication link and they're using all kinds of prep, two prep primary communication protocol. So the one is over LoRa protocol, another one is over GPRS. So let's once again see this whole testing environment. So we have this because we have reverse engineered the configuration process of the MCU to the LoRa module. So we can use Antilo to configure our module to sleep, the traffic. traffic. And the next step is to, like, using OpenBTS to reverse, to analyze the communication between the server and the gateway. So, in conclusion, we can see that the, so there are, once again, we can, like, sleep in your privacy data to profile this user, and we can actually to forge the data in each stage, the Nora stage, where the water meter is communicating with the gateway. We can scroll traffic between the gateway and the server. So, actually, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, we, as they say, we have to, like, every time, like we break something, we have to figure out, all the way to actually remediate, or if just to remediate. So, this, he is using Nora, Nora protocol. This protocol is brought up by Nora Alliance, and he's got, um, So we can use, for example, to prevent the data from being spoofed or forged. We can use message integrity, maybe like HatchMap, based on some kind of encryption key to check the integrity of the packets. We can also use some encryption. I think why didn't they use encryption in the first place is because this is quite a no-power application. The encryption may consume a lot of power, so that's why they didn't encrypt the order in the first place, or they just think obscurity, like security, something like that. They think the LoRa is hard to decode. It's not like the GPRS that you can easily to speed the traffic. So, we proved that this is not possible. We can still get to traffic, so they have to improve the security by encrypting the traffic in each state. So, we have this. This is actually the LoRa standard by LoRa Alliance, and everybody can look at it. There are security measures, but it seems that they are not following it. So, anybody have any questions? This is a reference. The past year's research, they have done a great job by providing people with the code to decode the LoRa traffic, and we have this, all kind of resources. So, anybody has questions, or no? Okay, you, you. Okay, I will try my best to answer your question, yeah. Sure. . How can we protect it right now? How can the company protect their infrastructure? How can the company protect their infrastructure? . You know, already deployed infrastructure, how can they protect that? Yes. Yeah, I don't think they can actually do that, because usually when you use this kind of communication, you don't implement some kind of over-the-air update mechanism, so you have to, like, maybe replace it. And then you can change the infrastructure. So, you have to think of security in the first place. Or, you know, just like, for example, the magnet stuff, you can change the plastic cover into, like, metal cover, or just change the plastic cover into a metal cover, so that will be prevent somebody to interfere with the magnet sensor using a strong magnet. So, if somebody don't want to pay water fees, they just put this magnet on the water meter so it's not running, so yeah. So, anybody else has question? Okay, thank you.