DEF CON SG1 - CSIT Village - Eugene Lim - Mic Drop: Hacking into Enterprise Audiovisual Hardware
Transcript
Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.
Up next we have Eugene as really on stage. For those of you know him of course he's space raccoon. He's going to take us into enterprise audio visual systems conference cameras, meeting room gear, things we use everyday. In fact the very microphone that I'm using right now. And also really he also revealed the real vulnerabilities in these systems and why they are such an overlooked attack surface. So after this you may not look at a meeting room in the same way again. So anyway Eugene once again let's give him a big round of applause.
>> Thanks yeah that really helps for the applause. So really appreciate you guys all being here today and I'm really excited to share with you about some of the kind of hobby research I've been doing into what goes on in our meeting rooms. And I think I can probably skip the introduction because but I just wanted to show this cool space raccoon with the Singapore flag for Def Con Singapore. And jump straight into our topic today. So one of the things I've noticed in the past was that there's a lot of attack surface out there for organizations. Not just you know in what's deployed in our cloud in our applications in our IT space.
But one of the things that many people don't really think about but is often every every present is the meeting rooms and the audio visual systems that are built into our meeting rooms. For those of you who may have you know hopefully used one of these systems before. They can do all the things from running a video conferencing call to even controlling the booking systems as well as maybe even in building systems such as the air conditioning, the temperature as well as other pretty important hardware. So ironically I feel like it's one of the least monitored most insecurely configured pieces of hardware that an organization can use today.
One of the reasons is you know it's just not often monitored by cyber security teams. It's often deployed by MSPs, managed service providers, third party vendors and you know it's kind of a set and forget but don't often update. So, today I'll just kind of talk to you two devices. Honestly, they have fairly simple vulnerabilities, but the second device I brought today, which is the Crestron device over here, I thought it would be a very interesting case study about how much of an attack surface you can walk through. The vulnerabilities I'm going to warn you are not very complex, but I think the story is pretty interesting.
So, let's start with maybe the agenda and I'm going to talk to you about the AVer PTC 320 UV 2. The thing about all
these devices is that the names are not really cool. But, fairly standard. I'm going to break down kind of talk through about one of the CVEs that were discovered in the past, why the CVE is incorrect or inaccurate, and how I was able to kind of unpack it further to really find the real vulnerability hiding behind that. And this is kind of the theme of the talk today. I want to kind of go beyond just the vulnerabilities and talk about things like where do we think the CVE ecosystem is at? How do we think about vulnerabilities? How do we build the attack surface mapping as well as the methodology between bug hunting and the mindset behind that?
And the next thing I'm going to talk about is the Crestron TSW-1060, which I have a demo here today, which as you can see earlier I couldn't ping it. So, we'll see whether the live demo will work or not, but if not then you can use your imagination and maybe we can hang out later and I'll show you how it actually works in person. Because as you can see it's kind of strung out all the way back there. But, I'm going to talk about a specific protocol that they have, which is the Crestron terminal protocol, and the custom protocol, how I was able to unpack it with the use of now you can use with cloud code and other agents, how I integrated that in my workflow, how I use it as a researcher, and I think that would be a good question and answer as well if you have questions about methodology and how you can use AI in your workflow. And finally, of course I got to talk about, you know, the good side, the challenges and the next steps for any one of you who has these devices at your organization, in your building, um, you can think about with that.
So, let's start with a really simple quick start. This is the simplest bug out there, which is the Ava um, device. And this is one of those really common uh, point, track, and zoom uh, video cameras that is used for video conferencing. As you're speaking in maybe Zoom or Teams, it's going to automatically track your face. Um, and you know, it is, you know, uh, available through multiple platforms, your web, your mobile browser, and it has a web interface accessible through the internet. So, I wanted to break down one of the past CVEs and talk about why that CVE was a little inaccurate and how you can break it down further for maybe your workflows in terms of variant analysis and maybe understanding the root causes better.
So, this is really interesting one because if you look at the um, CVE publication, it says that the issue was that it allows a remote attacker to execute arbitrary code via the send action function. Um, and this was the CVE MITRE listing, but as you can see, it links to the actual GitHub disclosure by the researcher. And the research is a little bit different. It's completely different from what is described in the CVE listing. It says, "Hey, there's actually an authentication bypass, right? Where you can actually leak the credentials through this API." So, both the CVE listing and the GitHub uh, disclosure kind of talk about completely different vulnerabilities. So, um, one of them talks about how there's remote code execution via send action function, whereas the other one talks about an authentication bypass. Um, and
if you actually look at the code of this system, send action is not a server-side
uh, function. It's actually something in the client-side JS. It's just really, really bad, really, really bad system design. Um, essentially, it just calls a client-side function that calls an API call, um, and then it will fetch the credentials. So, I think one of these things was that when I was reading this research and I was reading the disclosure, I kind of got the sense that maybe the researcher might not be fully aware of the root causes, and I decided to kind of take a look at the firmware instead to understand what was going on. And one of the most kind of common patterns when it comes to firmware is that their web interface isn't kind of like what you see in a cloud or standard application setup. They're not going to be multiple files. It's usually just one binary, you know, with all the routes hardcoded in there. And you can see quite clearly there is a command injection, right, in here where they use sprintf. It goes into this general string, and that's passed to popen.
And looking a bit closer into that, it calls this shell script, and it's pretty much a standard command injection, right? And you kind of get a sense of where the CVE listing is correct and where the GitHub listing is wrong. So, this is pretty straightforward. I'm not going to like dwell on this too much, but essentially it's an unauthenticated root RCE. I think one of the things to take away from this is that, you know, starting with something so simple with this like a PTZ software hardware, there are actually like a lot of vulnerabilities you can start from there. And actually I didn't put the screenshot here, but if you look at Shodan, there are actually some of these devices that are unfortunately connected to the internet.
So, there is a wide attack surface to start with here. But I just want to start from this, and then we'll now let's kind of dive a bit more into the Crestron TSW. So, the Crestron is the TSW-1060 is the room automation tablet that you see before you today. And this is something that you can see in all meeting rooms where you kind of press it, and you start your meeting. It breaks, and then you complain, and then you tell the person, "Oh, sorry, I've got to miss the meeting. I'm a bit late cuz it's not working, right?" And this is kind of in every single meeting room today. One of the interesting things is that a lot of these systems are discontinued. So, Crestron I think discontinued this a couple years ago. You can find it on eBay for less than $50. I got it from like Carousell, right? And there's an active home assistant community doing this. So, one of the things I like to explore when I'm doing hacking is like not just try to talk to other hackers, but you'll find that there are actually a lot of like random fanboys or like otaku in like different forums. In this case, it was the home automation forum where they're really really big on like, "Hey, how do I reuse this piece of hardware and turn it into like some kind of home automation tablet?" And they are actually doing hacking by themselves, but they may not necessarily call it cybersecurity. And in this case, I had some pretty good tips from a few people in this community including Cas Wolf, so just shout out to them. And one of the first risks I realized when I bought this device was that when I turned it on, it still had the original owner's like information on it.
And I thought they had made a mistake, but as it turns out, a lot of these devices when you perform a factory device wipe on them, it doesn't actually fully wipe all of the user files. In this case, I was able to kind of retrieve, you know, their own custom applications with their PIN code encoded in that. And you get a lot of information encoded in that. And this is something I was able to get off Crestron. So, I will not disclose which companies this was, but you know, I think we need to be a bit more careful about how we deal with it. But let's just dive right into how would you think about hacking a device like this? And the first step is always to think about the attack surface. For the Crestron, there's a lot of attack surface. I like to think about interesting ways to do attack surface.
Obviously, the web interface tends to be the first and most obvious one, but that also tends to be a little bit more hardened. But I'll just go through them here. So, for the Crestron, there is a lot of stuff you can do with it. It's meant to be very customizable. You can load all kinds of applications, custom applications on it. From the FTP server to the SSH port, there's Telnet. There's something called Crestron terminal protocol, which is on a specific port. There's the web interface, there's USB ports, and then there are Android apps, which is what you see on the screen here for this device. So, I'll try to I don't know if I can like wave it around later, but you guys can take a look. So, Crestron terminal protocol was pretty interesting. It's a restricted console accessible over various ports.
In this case, you can see you can only run specific commands. If you run help, it's going to tell you all the specific commands you can run, especially with the authorization needed as well as the functions of these commands. Some of these are actually locked behind a super user. And the super user you can see is CR super and super user. I'm going to assume that that is a factory Crestron um super user that can run specific very sensitive commands. And again, this is pretty useful to do some kind of variant analysis. Um so back in 2018, um it was found that this super user actually had a fixed deterministically generated password. Um this was pretty funny actually when you look at it and you look at the firmware, uh it does this really really weird protocol. It starts with the MAC address. It uses a SHA-1 hash with a a hard-coded salt. Um and this is just a random string, but it's the same for every single device. It does RC4 encryption. It does base 62 encoding and finally that's your password. So it's kind of like a CTF. It's kind of weird.
Um but the exploit script is out there. And when I was doing this and I was just doing some variant analysis just to understand what has changed since then, it was actually pretty funny because they didn't actually patch this hard-coded thing. They kept it hard-coded. Um but if you look at the pseudo code that was reverse engineered here, um there's only two things that they check for now. They check for an additional debug flag, which is a configuration flag, which actually you can set in various parts of the application. Um and it also checks whether your MAC address is dead beef 123, right? And um I don't know how
where that comes from, but I guess that's going to be set in the factory and that allows them to then modify it uh at the factory. But this is just a quick start. Um this is just like weird funny thing that I thought we could share. But um I thought I'd kind of unpack where I was going with the Ghidra um analysis with AI assisted. Unfortunately, I think Aether didn't come out um back then. Um but I thought I'd talk through my workflow here. Um, so, firstly, um, as anyone should probably take is that when you run help all and returns the list of functions that it can you run, you probably shouldn't trust that. A lot of these, um, restricted, um, consoles typically have secret commands that are not documented or available.
And I wanted to kind of dive into that. So, I kind of opened it up in Ghidra, went through individual functions, found out that there were certain strings that allowed me to figure out, uh, what these functions were. Um, and after that, I kind of used Claude code. So, in the way that we use Claude code, uh, I like to use it headless. So, I just kind of put a binary there and be like, "Hey, Claude, there's this, um, Ghidra binary. You can run Ghidra headless, um, write Ghidra scripts to run it on this system, and then, uh, unpack and rename all the functions for me." Um, and that helps me keep track of what Claude code is doing because it keeps a record of every single Java, um, script that it's writing for Ghidra at the same time, while I still get to benefit from the output. So, even though I might get the output, um, I can kind of reverse engineer and figure out how Claude code got there, and it's not, um, completely invisible or unexplainable to me.
The interesting thing here was that, um, actually, at first, Claude code was kind of going in circles because, uh, it it didn't actually reverse engineer it properly. Uh, it actually gave me a list of commands, but it was incomplete. It was only about 30% of the available commands. But, because I already manually reverse engineered it myself, I could be like, "Hey, Claude, like, you got it wrong. There's this additional command that you missed." Um, and then Claude can self-correct. Uh, so, I think a lot has been spoken about how you can use, uh, some of these tools and agents in your job, but one of the important functions is to be able to self-correct. Sometimes these agents can self-correct and correct their mistakes, but they need kind of a baseline of truth. So, if you give it a correct baseline of truth, um, in this case, I was able to kind of fix it. Uh, if not, then it's going to give you output that you might not even know is incorrect. Uh, it's incomplete. It's only 30% of all possible commands. But, in this case, when I gave it a correction, it's like, "Hey, oh, I got it wrong. Sorry." And I was like, "Yeah, you should be." And then it fixed it, and then it was able to then get the rest of the strings. So, in this case, I was able to keep a tracker of all the scripts he had been running in Java, I understand what he was doing, and what I understood here was that, "Hey, this is where I got it wrong." And of course, it was able to explain itself as well. So, I thought this was pretty interesting, but just a little kind of deep dive into methodology here.
So, what does these functions look like, right? So, every single console command that's available, starting with help, but then the rest are ones that you see here, are pretty self-explanatory. They kind of check for your authentication. They also have really helpful help string that tells you what kind of functions, arguments they expect, and then there's also some explanation of what it does. And from there, you can reverse engineer the pseudo code itself to understand the downstream code. So, in this case, uh what I did was that I was able to then go through it pretty systematically and find the hidden command injection. In this case, there was this HDCP2XLoad
command that did have a command injection, right? In this case, you can kind of see pretty obvious command injection occurring here. But I think what was cool was that firstly, it was not present in any of the help output. It was not present in any of the auto complete. It was essentially a secret like hidden command bonus finding, right? That you can get. And when I was talking to the home automation community, I was reading the forum, and none of them had actually discovered it because they were just referring to the help string and trying to get around that. There In the past, there were a few command injections in other commands, but those were only in the documented commands.
Yeah, so this is pretty straightforward. I was hoping to demonstrate it to you live, but I'm not sure if my ping is working, so let me just double check. One second. Yeah, I'm not able to ping to my device right now, but maybe later we can just hang out and I can just show it to you in person. Um but I can show you the rest of the uh the string the uh the attack flow. So, before we continue, I thought we can just pause here, right? Because at this point, you kind of think, "Hey, cool. I got like a root shell. Um that's pretty cool." But, one of the key things with a lot of these devices is that they come with a lot of hardening guides. And one of the things that Crestron said was that, like, "Hey, yeah, cool finding, but it's not actually unauthenticated because most of the time, uh even though it comes by default unauthenticated, we tell all of the people to set it up with authentication. Um you have to configure a few things, and then you can't access the uh terminal anymore because you need a password."
So, I thought I'd kind of take it a bit further because I want to expand the story of like, "Hey, maybe one day you invited someone as a guest to your meeting room, and you left them alone, you know, you're going to the toilet or something, and they had a few minutes alone with your uh meeting room systems. How far could they get?" And I wanted to show that they didn't just need a password anymore, but they could go way beyond that. So, let's talk about another attack surface, which is the Android applications that uh existing on this um device, right? You can run like Zoom, you can run Teams. And one of the ones that you can run is Ginkgo Room Scheduler app. Um there are a lot of these strange scheduling room booking apps that are built into Crestron that the companies have already like gone bankrupt, or they've been bought over, and a lot of them are actually pretty broken now.
In this case, this app allows you to then access a specific web page, uh which you can control through the settings um uh button. So, yeah, if you try to press the settings button over here, and um there's only a few of you guys can see, but I've got a screenshot as well, you're going to be prompted for a password. Um and that's going to be one of the first blockers before you can actually change the settings. Unfortunately, because all of these are basically APKs that are available to the update URL, I was able to just fetch it from Crestron, unpack every single APK, um and extract the hard-coded um password. Right? So, in this settings app, by default, it's going to be ginkgo. Let me just try it here.
Right. And now we have access the settings page of this application. But that's only the first step, right? Because Crestron has all of these um default applications that are Android applications built into the device. Um you can't install your own applications. You can only install a very limited set of uh HTML5 applications that they allow. Um so, this is probably your best entry point over here. So, where do you want to go from here, right? And if you notice that you can set a URL, but unfortunately, because this is a really old version of Android, the web view that is built into Android is not sandboxed. So, you can actually access specific files. So, if you're going to like just bear with me if I type on this thing, I'm going to just try to access a file uh location instead.
Okay. So, I've entered the file, and hopefully that works. And uh Okay. Well, I'll show you what it looks like. Um what it will show you actually on the screen then is you're going to see the actual password file itself. And this is, you know, an interesting set of hashes. Um but again, this is something that uh you can reverse engineer pretty easily. Uh again, it feels a bit like a weird ball CTF um because the way that these hashes are generated, if you can see, there's actually repeated CRCR um in the uh string. And this is actually just very weak uh DES encryption uh with
a fixed uh salt, which is CR.
Um and this because it's such a weak fixed salt and also a weak encryption, you can actually crack it in a couple of seconds. So, in the case of this, um this is how the uh actual script will look like in terms of generating the hash. Um and each breaks it up into seven-byte chunks. Yeah, so with Hashcat it's fairly straightforward. You can break it in a matter of seconds. In this case, I was just running on CPU only, but you can kind of assume that, you know, any kind of password is going to be pretty easy to crack. Um and so with that, I was able to then retrieve the password. And this is the attack flow, right? You start from the Android application as a unauthenticated user with some kind of physical access.
Um and then you're able to then extract the actual password of the admin user. And from there, you can also then access the Crestron terminal protocol. Yeah, so that's the phase one of the credential theft. You kind of start with an application, or you can even load your own custom user application. Access the hash password hash file. Crack the hash. And then from there, you can move on to exploitation. Right? Because now you know that there is this vulnerability in the CTP protocol, which you can access over SSH, Telnet, even over the CTP port itself. All of which do require your admin password. But once you have that, you can then escalate your privileges from an unprivileged admin user to full root system access.
Yeah, so this was pretty interesting. I thought the disclosure here was also fairly slow. They They have acknowledged it. There's no patch. So, I don't know whether they'll ever release a patch because this device is
currently discontinued. So, I think it's not going to be actually done anymore. So, I think one of the interesting things I want to talk about here is what's possible from root. And I'm not sure how many of you understand your current enterprise network setup. Do you guys know how that's set up? No, right? Because most of the time that is maybe not under the purview of the cybersecurity team. That might be under the purview of the AV team or the IT team. And that's somewhat treated separately. But there's a lot you can do here, right? You can do like network pivoting, persistence, um surveillance, lateral movement. Um You can install your own Android applications. Uh there's an Android debug shell that's running on the tablet itself. So, I was able to then start like apps like, you know, running a standard Android camera application, take pictures, take screenshots, and then exfiltrate it. So, I wanted to kind of like take some time to unpack here. I was obviously, you know, finding a bug is fun. Um but, I wanted to kind of think about this problem at a kind of higher scale, right? Um AV hardware is really hard to secure. Um it's actually when you run pen tests, it's one of the weakest spots in any kind of enterprise. There's a lot of complex legacy software. Um there's a lot of infrequent patching, and there's also minimal monitoring of these systems because they might exist in a completely separate subnet or virtual network.
Yeah, so number one I realized is that patching is actually strongly discouraged. If you look at like the Reddit forums for like Crestron, like all the sys admins are like, "Do not try to patch this thing." Right? Because firstly, it's pretty broken, it's discontinued, and there's no warranty left. So, they're really, really scared about this, but no company um is willing to kind of risk doing a patch and breaking it for the entire building, you know, for 1 day or more. Right? Um so, it's almost a uh paradoxical um thing where they're like, "Do Don't patch this." Right? Um and even if there's a vulnerability, I don't think it's going to motivate people to patch it because um the assumption is that they're supposed to put them in a separate network.
The second thing is really is that insecure by default. And one of my favorite quotes uh by Kelly Shortridge, who wrote uh uh security chaos engineering, is that every hardening guide recommendation is a missed opportunity for a safer default. If you need to produce a product and create like a 70-page hardening guide and tell people, "Hey, now it's your responsibility to harden it." I think you we've probably got it wrong. Um it should come out safe by default. So, there are a lot of manual steps in this hardening guide and most of the time a lot of AV or IT teams are not going to bother with this, right? Their job is to set it up, get your Zoom Rooms working.
No one's going to chase them whether they're secure or not, right? Unless you have a cyber security team going and talking with them. And then third is of course like poor visibility and monitoring. So, what I've observed in different like enterprise setups is that yes, there is some nominal network separation where the AV systems are separated from the rest of the corporate network, but there's often a hole that you can find most of the time maybe because you need to put it out to the internet to access like Zoom Rooms, but also like the rest of the corporate network. I think there's some connection there and you can of course always pivot to the edge devices into the network and also then move on into the rest of the enterprise.
And of course I think one of the key things here is that I don't think anyone is installing Splunk on the Crestron, right? No one's really doing this for the network. Most of the time the network is completely owned by the AV team and it almost exists on a separate dimension in terms of how much cyber security hardening and monitoring there is. And of course I mentioned there's a lot of additional risk. What I noticed with the Crestron and a lot of these apps is that while some of them are well maintained, a lot of them have been broken because I don't know that owning companies have been bought over or they went bankrupt. So, even like for Ginkgo, this application over here, I think the company has also gone bankrupt.
So, you can also then push out supply chain attacks and actually impact you know, everyone using this app across every organization. And one thing I've seen is also that there's poor application sandboxing. So, even if you are going to break this one application, you can pivot really really quickly remotely to the rest of the network. And of course I think it's physical access. So, I think you can maybe take a look and come up later and see how they have secured the Crestron. Most times it's a simple screw plate that you can take apart pretty easily. Um there's also like a LAN cable which you can then just unplug and plug in and pivot to the rest of the network. So, yeah, I just wanted to conclude here and talk about like this meeting room thing.
I'm just trying to yell about this and hope people care more about it um because um when I'm thinking back about like history, you know, like most of the time when we do pen tests or we are red teamers, we are asked to kind of look at servers or applications. Um but we're never really asked to look into some parts of these. Uh only I think some uh pen testers really care about it, but it's not often covered by even compliance. And so, real vulnerabilities, but the mitigations are pretty obvious. And one of the challenges here is that there are a lot of people who are not going to patch these vulnerabilities. So, you have to make sure that it's completely separate one way or another.
Yeah, so takeaways, um AV hardware is cool. All of you guys should like try to find this on Carousell and take it apart. Um it's often overlooked because it just works. Um disclosure is messy. Sometimes a lot of these products are, you know, either run by a white label companies or they are discontinued, so they're not going to be patched. Um AI-assisted firmware analysis, I did a lot of this uh in this research, so it's a good way to uh understand how it really works. And I'm happy to share more, you know, questions and answers if there are. Um and the last thing is really like just I don't know.
Just I don't know I if I if I walk in a meeting room and I see one of these tablets, I'm not sure if I'm going to stay um but I really hope that um they have been secured properly. Yeah. Um Crestron is a pretty big name, so I'm not sure whether you guys do have Crestron in your buildings, but you might want to take and check the version number next time and see the last time it was patched. Cool. Yeah, and that's uh that's all. So, thanks. I'm sorry about the live demo, but I will try to get it set up maybe in the uh Singapore community village and then uh if anyone wants to come by and try to hack into it, um I can show you how it works. But uh thank you very much.





