Okay, so my name is Hedlo Seek, Ricky Lausche, and this is my talk, Micro Hard More Like Micro Easy. Pause for laughter. And off to a great start. Okay, so yeah, first off, let me introduce myself. I'm a principal security researcher at Keysight Technologies. I'm based out of Austin, Texas. I focus mainly on offensive IOT research. And I've been doing this kind of stuff professionally since 2009. And I speak at conferences fairly regularly. I've spoken at DEF CON like five times on the actual stages and this is my first time speaking at IOT Village. And then I have several hobbies. Most of them involve me drinking whiskey. Okay. So that's who I am. Let's talk about who Micro Hard is. They're a Canadian based device manufacturer. They make basically cellular bridges for Ethernet and serial devices. They're used in lots of different environments that people really care about. Such as like, you know, power utilities. I see unmanned vehicles listed on their list of industries. You know, just basically everywhere you could possibly think of needing to remotely access a device. They claim to be involved in some way. Okay, so that's Micro Hard as a company. Let's talk about the device that we're going to be looking at today. It's called a Bullet LTE-NA2. NA is for North America. So yeah, this is an LTE bridge for adding cellular connectivity to serial and Ethernet devices. You know, it's meant for managing installations remotely. This is a quote from their website. Connect any device, old and new, serial or Ethernet and provide cellular remote access using the Bullet LTE-NA2. You know, what could possibly go wrong? So I actually got this device because I was doing a security audit for a utility company. And they were wanting to deploy a bunch of different devices and wanted us to check the security of the devices and this was one of them. And I did not end up recommending that they deploy this in the field. And you'll see why. Okay, so first off, from a hardware perspective, it's a 32-bit ARM Cortex A5 processor which you can see in the top view. This is kind of like the top of the board and the bottom of the board kind of picture. It's got down in the bottom of the top view next to that orange-ish, yellow-ish thing is expansion flash firmware chip, 128 megs. The it's also got 256 megs of RAM. And then on the underside of the board, they've got this QuekTel modem, EC25-AF. And then they've also got connections for a SIM card slot, PoE, Ethernet, USB and serial in addition to a couple of programmable I.O. ports. And then from the firmware perspective, the firmware updates are completely unsigned and unencrypted so you can pretty easily forge your own if you wanted to. And they were also easy to extract with bin walk. Inside the firmware updates, it's got the boot loader, it's got the Linux kernel and it's got a full squash FS file system. So basically you could fully emulate the system if you were so inclined pretty easily. And then the software itself, the OS is based loosely on open WRT running a Linux 3.6.9 kernel. In the version that I'm going to be demonstrating today, they were using UHTPD for web. They changed to that in the subsequent version and you'll see why they decided to change it. And then yeah, they use DropBear for SSH and TelnetD for Telnet, kind of. They actually have whenever you log in with one of those services, they end up dropping you into like a jailed debug environment which we'll talk about extensively later on. And then on the UDP side, they've got a discovery service that basically depending on the type of device you're using, will send out a discovery probe or will answer a discovery probe on one of these three ports and give you a lot of information back. So it wouldn't be one of my talks if I didn't discuss a discovery protocol because I love discovery protocols. So on this one, like I said, it listens for broadcast UDP messages. Port 2077 or 20,077 is for 3G devices. 87 is for IP based devices and 97 is for LTE devices. So this one would respond to broadcast messages it gets on port 20,097. The magic probe is the same across the board. And let's look at what that looks like. So you can see this is a scanner that I wrote where I just like send out that broadcast packet to each one of those three ports and then I listen for responses. And so this is what the response looks like on the wire. One kind of annoying thing is they will respond to you from a random port on their side to your source port but on the broadcast address which makes it really hard to correlate responses. There you go. Okay. So that discovery response contains a lot of useful info. It's got the MAC address and the IP address. It's also got the host name and the SSID for any kind of wireless stuff. And then it has the model name and the firmware version. And then it's got this thing called NMS. That's the network management software. It's like their cloud based thing where you can register all of your devices and track the GPS location of all of them. It's got the domain and password hash but I'm not going to be talking about NMS today because that's not part of this talk. Okay. So and yeah, I wrote a scanner and response parser and I'll put it up on my GitHub which I'll link to later. Okay. So let's actually get into the bones. So the web management portal, this was kind of the main focus of my audit when I was originally looking at these devices. Like I mentioned earlier, it's UHC2PD based on the version from open WRT in 2014. It's used for configuring basically every aspect of the device. And it is also reachable from LAN and WAN side. And that's enabled by default and you have to actually turn that off if you don't want it reachable from the WAN side. But the best part is it's all shell scripts. So like this is the directory listing and it's literally like every single page is a shell script wrapped with a GUI. So you know, of course, there are multiple command injections throughout this thing. They're all post off. So you need a valid user account in order to access these pages. So yeah, multiple command injections. My example that I'm showing today is with the diagnostics page because, of course, it implements ping and if it has ping, it has command injection every single time. Oh my God, is that really my time warning? Okay. I have to really book it. Okay. So yeah, it has ping. So they tried to sanitize input but it failed pretty horribly. They just sanitized the host name and didn't worry about any of the other arguments that you put in there. So yeah, just leave host name blank and then put whatever command you want all in the account parameter. And let's show a demo of that real quick. Okay. I'm not going to go into lots of the details of the exploits because I'm about to run out of time already. But yeah, so this is post off. So you need a valid user name and password. But then you run that and eventually you will, hey, you got a root shell. Because you injected, you know, whatever command you wanted to run and it has net cat on it so I was able to get a root shell pretty easily with that one. Okay. We're going to hurry up. Okay. So yeah, like I said, those phones were all post off. But I really wanted something that was pre off because that's so much sexier. So I started looking at the authentication, the way they handled authentication. And as far as logging in, it was vanilla open WRT. They used basic off. So basically base 64 encoded user colon pass. And so since this is, you know, UHC2PD that's part of open WRT, you'd think it would be very well vetted and everything. But it is an open source project so they were able to make their own modifications. And so logins were generic log outs was where they made a mistake. Basically they wanted to set the basic off header to log out colon log out. And then they did like a stir copy of that buffer to a statically sized buffer. And then they could compare what it was to log out log out and, you know, log the person out that way. But yeah, they didn't do any bounce checking or anything. So yeah, you can see, I'm just going to skip past this because I'm running out of time. But yeah, you can see, you know, stir copy and yeah. Okay. Let's do another demo. I am actually going to talk about the code of this one because it was a very pat myself on the back kind of thing. This was my first ever in the wild ARM ROP exploit. So basically, yeah, so they do have ASLR and I wasn't able to find like a memory leak or anything to leak the base address of lib C or UC lib C. So I, for the purposes of this demo, I disabled ASLR but it is the lame version of ASLR where they only randomize the top part. So in theory, you could brute force by just like picking an address for the base of UC lib C and then just trying over and over again and it will just crash the website if it doesn't work and if it, you know, if it eventually works, then you get a shell. But yeah, so basically just, you know, calling a system from UC lib C and passing this command as the argument to UC lib C. And this one, hey, that was really fast. So yeah, no authentication required for that one because it's exploiting the authentication protocol. So there's that one. And this one, and, okay. Okay, so I disclosed those back at the, when I was doing the audit originally. They fixed it in R1112 by adding more sanitization and then they switched from using UHT TPD to using light TPD. So they no longer use UHT TPD. But it's still all shell scripts. So yeah, that was the end of the audit and I kind of stopped thinking about the device. This release note still burns me to this day though because that was the extent of the release note that they used for fixing all of my critical vulnerabilities. It was miscellaneous housekeeping tasks that really, really bugged me. Okay, so cut to like a few months ago I decided to dig this device back out and look at it again. And this time around I was looking at the telnet portal. So like I mentioned before, it's a jailed environment but they give you lots of access to like QT commands for that, not QT, AT commands for the quick tail modem. So yeah, you can see they give you lots of commands. And that's handled by slash bin slash CLI test. That's spawned every time you log in as the admin user. And that defines all of the AT commands but not all of the AT commands were documented. Okay. So yeah, there was an undocumented command called ATM bash command that lets you run two bash commands. PS and cat. And that's it, supposedly. But the way they verified that is by using certain case compare. And they were using the length of what they were comparing from either PS or cat. So as long as the string like began with PS or cat, then you could put whatever you wanted at the end of it. So basically, yeah, you just do like PS semicolon and then another command and there you go. Okay, one last demo and then I'm basically done. Okay, so again, post off. All right, there you go. Okay, so let's just blast through these last couple of slides to wrap up. Okay, so that one was actually coincidentally fixed like the month before I found it, which was also kind of annoying. But the fix like I mean, it was it was basically just bash command, they removed that one and didn't touch anything else. And may have also added in some brand new command injection forms in the latest firmware. But yeah, so you can see where they were trying to secure things and then they just failed miserably every single time. They need actual like, you know, secure development processes. And also I get really pissed off about the vague release notes because in my opinion, it like minimizes the impact if I saw something that just said, you know, miscellaneous housekeeping tasks and I'm running in a critical environment, I'm going to completely ignore that update. Because it seems like it's something I don't have to install. And so it's just leaving me still vulnerable. But yeah, and then if it has command, or if it has ping, it has command injection. And that's how you get in touch with me on headless eek on most things. And that's my GitHub. And yeah, that is it. Sorry if I went over time. That's it.