Let's get to it. Noah Moshe from Clarity Team, turning camera surveillance on this accident. Yeah, good job winning. Yeah, we kicked their asses. So, before I start, let me introduce myself. My name is Noah Moshe and I am the team lead and lead vulnerability researcher at Clarity 2. Now, my day job, and I believe it's one of the coolest there is, is to essentially find vulnerabilities in all sorts of devices and responsibly disclose them to the vendor. Here you can see one of, I think, six, seven racks in our lab where essentially this is my playground. I get to connect and play and find vulnerabilities in all sorts of devices including OT like PLCs, HMIs, medical devices like DNA sequencers, patient monitors, all of that sort of fun. And of course, my personal favorite and today's topic, IoT devices. So without further ado, let's jump right in and start our talk. So, my goal at the beginning of the day was quite simple. I wanted to see how I can hack my way into the internal networks of big companies around the world. And when attackers and pen testers alike have this task, they usually go with the usual suspects of Internet exposed services. Now, I went to show them census and basically search for that company's IP addresses and saw what kind of services they exposed to the Internet. In it, I saw the usual suspects, VPN, file sharings. However, soon enough I discovered one service that I was completely unaware of which is called access remoting. At this point I said, oh, a cool new service. Let's see what's going on under the hood and maybe we can find vulnerabilities in it to try and uncover new attack surface on these devices. Now, before we try and see what is access remoting, what is the protocol, we first need to understand what is access. You see, access is an IP camera manufacturer that is geared toward enterprise solutions. You'll see access cameras in big companies, educational institutions, medical devices and of course government agencies. All the cameras are running custom proprietary OS called access OS which is a Linux fork that is based with a lot of modification and they all offer vast ways to control the cameras. However, the problem arises when a company has more than one cameras. You see, most companies have dozens of floors, many different physical locations, offices, all sorts of different locations that need to have video surveillance and this makes it a huge hassle to actually manage and control your entire camera fleet. And to do that, access implemented a very cool services that enable one centralized control solution. The first one is DAX device manager which essentially allows you to control, manage, configure, backup, do firmware upgrade, all that sort of fun in one centralized location. This is essentially the server that controls and manages your entire access fleet of cameras. In addition to that, at the end of the day, the main use case of these cameras is to have video surveillance. Meaning allowing administrators, guards, all that sort of fun to be able to view the actual camera feed of your cameras. And to do that in a centralized location, access offers the access camera station. This is essentially how it looks like. It's a matrix of different camera feeds, live views, and this is where you find in your guard rail posts, basically in your guard station. Now, most cases there is need for remote access because companies has various different physical location, offices, floors, they are not all sitting in the same network. And you need to have remote access to your servers. You want to be able to view your camera feeds remotely. You want to make sure that everything is fine, your cameras are working. And to do that, access implemented their own proprietary protocol called access remoting. Now this protocol is fully encrypted, fully authenticated, fully secure, or maybe not so much. And this way users are instructed to simply open this port and to be able to connect to their servers remotely and to be able to manage, control, and view the camera feeds of your entire camera's fleet. In addition to that, access has a cloud solution called access secure access. It's not the same as access remoting but it has one major con. You see it costs a lot, it's pay as per traffic, and most organizations opt out of it because the costs are very high. And to do that, access offers the on prem installations which basically enable you to build, to have your own servers, install the software on them, and then you have full control, full visibility over your cameras. So this is the use case. We have our server that is owned by a certain big company and we have our client that connects to it via the proprietary protocol and controls the entire camera fleet. And this was my goal in this research. My goal was to simply take over, take full control of the server and to be able to execute remote code on the servers. And of course because the server's main purpose is to actually to manage cameras, we can move laterally from the server and actually execute code on the cameras themselves. Giving us full visibility, full network access, and of course the ability to do James Bond style of uh, interfering with camera surveillance. And because so many companies are using it, I mean access is one of the biggest vendors there is, we can cause an effect that will affect dozens and thousands of different servers, different companies around the globe. So let's deep dive and see what kind of vulnerabilities we managed to uncover. First of all, we need to understand what is the setup. You see, access device manager conversations are Windows native applications. They are for client and server applications. Everything is written in dot net which makes the actual researching process a little bit easier. In addition to that, to make the protocol fully secure, the entire protocol is wrapped with MTLS, meaning both endpoints need to have a TLS certificate. And of course the first thing that the protocol requires is valid authentication. So my first step in this research was first to be able to dissect and view clear text traffic about how this proprietary protocol actually looks like. Because I wanted to uncover vulnerabilities and because it is a proprietary protocol, there is no documentation, no known clients, no nada. So all I did was set up a simple man in the middle cell that supports MTLS, meaning it exposes an MTLS cell and creates a new connection to an access cell. And then I connected my client to my cell which forwarded the request to the real access cell and I was able to see clear text communication between the client and the cell. And this is how it looks like. This is the proper way to initiate an access communication and we see that after initializing the MTLS communication, we have the first user agent. This way the server is able to make sure that a valid access client connects to it. We then have immediately NTLM SSP authentication, meaning NTLM challenge and response. And this way access is able to verify that only allowed users are interacting with their servers. Now an important tidbit of information is that because access uses NTLM, they actually expose the host name and domain name of the server immediately during protocol handshake. Meaning we are able to glimpse a lot of information about the server setup. Now after we see, well past the NTLM challenge response, we get to the bread and butter which is the actual access communication, access remoting communication protocol which is a JSON based protocol composed of regular RPC. Essentially allowing the client to invoke different functionalities on the server using the JSON format. Now in order to invoke functionality the server, the client must pass along what kind of method they want to execute on the server's end point in order to understand what they want to invoke on the server's back end. My goal was to try and understand how this is implemented and how this RPC communication is actually implemented behind the scenes on the server's end point. And after some digging around I discovered that access uses the service contract. Now this is a very , very common way of handling RPC in .NET application and essentially it allows the server to expose a certain list of classes and methods they want to allow clients to invoke remotely on the server's back end. Super common, super trivial in .NET. However, while this is super simple when it has simple structures, meaning they want to pass along for a function primitive types like string, integers, longs. Sometimes functions have more complicated types as their arguments. Let's say for example take a look at this log on async function that is exposed by the access server. And we can see that it does not have primitive types as its argument but instead it has the client information DTO which we can obviously see it is a complicated class composed of different primitive members. Now in order to actually create this on the server's back end some sort of deserialization must occur. Meaning the server must create the class of client information DTO in order to actually execute the method. And to do that access used JSON deserialization and to make matters worse they actually used the type name handling auto. This essentially tells the server that the client fully controls what kind of classes will be created on the server's back end allowing the classes to create arbitrary classes. Now this is super dangerous deserialization vulnerability and in .NET this immediately leads to code execution due to a known gadget. Meaning this is essentially a fully deserialization vulnerability leading to a remote code execution. Now this is an example of a request and we can see that the client passes along this dollar sign type which basically tells the server what kind of class they want to create on the server's back end. In this case Windows client API class. Cool. So we have a deserialization vulnerability. Let's see what we need to do in order to fully exploit it. And essentially what we need to do is to pass along and follow the access remoting protocol. We first need to initiate an MTLS connection. We need to send the user agent so the server won't kick us off. We need to pass the MTL MSSP challenge response and wha-bam we are sending access remoting JSON payloads which has a deserialization vulnerability. That's it right? Well there is only one problem and this is that this is essentially all. We need to pass the auth and we need to have proper authentication credentials in order to send access remoting credentials. So we do have an RCA vulnerability however it is not pre-auth. It has some pre-shared knowledge that we need to know which is the credentials. However let's see how it's still exploitable. And to do that we'll go back to our man in the middle setup where we are man in the middle connection between a client and a server. All we need to do is pass along the MTLM challenge and response. Essentially doing a pass the hash, pass the challenge vulnerability allowing the client to authenticate to the server and do and pass the authentication requirement. Now because access has no sort of signing, message signing or anything of that sort, we are able to inject and use the actual client session in order to inject our own payloads. Which once the client passes the authentication we simply replace their payload with a malicious deserialization payload and we generate it using ysoserial.net and whabam we have code execution on the access server giving us full code execution. And to make matters worse because both the client and server uses the access remoting protocol we can do the same on the client end point as well. Meaning we can pass it along a serialized object that is malicious which will trigger remote code execution on the client as well. However once we control the server we can do more. You see we can actually execute code on the cameras themselves using legitimate features. So in order to allow modularity for system administrators access supports what's called packages. Essentially allowing you to change your camera's behavior. Of course access has their own packages however they allow anyone to create their package. All you need to do is use the access ACAP SDK and you can build your own package. So what we did was we built a backdoored package, signed it using our key, used our docker to actually compile it because it is native CPP code and we have the ability to upload it to a camera using the server we've just spawned. Meaning we add the app, we run it and we also have code execution on the server. Meaning at this point we basically executed code everywhere. We executed code on the client, the server and the cameras themselves. However, that's not good enough. Because like I've told you at the beginning I want to have full remote code execution pre-authenticated. And at this point I need to have a man in the middle set up. I need to have user interaction, it's a one click vulnerability and I need to somehow trick the user into connecting to my own malicious server. This is not full remote code execution and this is our goal. So let's see how we can actually exploit it. So after a lot of time I've actually reached a dead end. I could not bypass the authentication on the access remoting protocol. Simply because it was immediately requiring us to pass the NTLM challenge response upon socket creation. However, luckily after sometimes consulting with the documentation of access I discovered this tidbit of information which is a fallback protocol. When the main TCP port is not accessible by the client there is a fallback protocol using a different port. And when I've read it I saw this weird description about the protocol being HTTP with AES encryption which sounded super, super weird. However, since it was HTTP all I did was put on this port in my browser and sadly I immediately got this credential requirement. However, even when I've placed my credentials in this box the server just kept load loading, looping in this white screen. Nothing was presented to me, I was not able to use it, something was weird. And at this point I realized that this is not regular HTTP and something weirder is going on behind the scenes. So I began reverse engineering this proprietary fallback protocol. And this is how it essentially looks like and it does use HTTP however only vaguely. The first thing a client does is it connects to the access server and you're sending an HTTP get request. And the server responds with a channel ID. Now this initial connection must be kept alive for the throughout of the communication as it will be used later. Then the client creates a new connection on a new socket using the get slash channel ID it just received. And we now have two channels, two communication streams that enable us to communicate with the server. At this point we have a TX and an RX meaning we are able to have one channel for transmission and one for receiving similar to signaling over the line. After we have these two channels each side now begins the key exchange. Each side first sends their public key and then each side generates a random AES key and takes the public key that it was just given and encrypts the AES key with the public key. And at this point each endpoint has their own AES key that enables them to communicate over an encrypted channel and any message that will send onwards will be fully encrypted using the AES keys they've just exchanged. Now at this point I was like why? Why have such a complicated protocol? Why use this weird protocol over HTTP? Because essentially they created sockets over HTTP. And not only that they've used two sockets, two channels for TX and RX which is super weird because socket is two way communication. However they do use both symmetric and asymmetric communication so the question is, is it more secure? Because they are using encryption, maybe it is. And the sad truth is no. This is still vulnerable, this is the same access remoting protocol behind the scenes and once you create this secure channel we are back to sending serialized JSON based communication for our PC. Meaning if we bypass the auth we still are able to execute our code using the deserialization vulnerability we discovered before. And next my goal was to try and see how we can actually bypass the auth. And to do that I've went and noticed what kind of authentication schemas this server supports. Because I saw that immediately when I connect to this HTTP port I am presented with a form telling me hey please authenticate. Sadly on the main web server we see that they've set up a negotiate web schema, authentication schema which essentially limits the client into using Kerberos or NTLM authentication which means we are back to having required to use NTLM SSP to actually authenticate to the server. However after some more digging around I found this super, super secret end point which is slash underscore slash which for some reason, I'm not sure why, supports the anonymous authentication schema. Meaning we don't need to authenticate and we are able to use it. So let's see our game plan. First we use the slash underscore slash secret path and this way we are able to start communicating in access remotely. We then need to implement the read communication protocol over this HTTP channel because it's not immediately playing our PC immediately. However once we do that we are able to talk with access remoting and we are able to send our secure, our deserialization payload giving us full pre-auth RCE on the access server. Super duper cool. And of course once we do that we are back, back again to hacking away into the cameras giving us full pre-auth RCE on both the server and the cameras it manages. Amazing right? So we have pre-auth RCE but let's see what kind of effect we've actually managed to gain. After finding these vulnerabilities I went once again to census and wanted to search what kind of users have this server exposed online and sadly I discovered almost 6500 different servers around the world, most of which are in the US. Now we need to remember this server manages up to 10,000 cameras meaning the effect is actually quite vast. However I don't want to attack anonymous users on the internet and instead I want to be able to pinpoint targets and actually know who uses this service. And to do that I remembered that access actually use NTLM SSP to authenticate the users. And in the NTLM SSP there is the host name and domain like I've just showed you before. Meaning all we need to do is to implement a very basic client that connects to a server's endpoint, waits for the NTLM SSP challenge and we have the full host name and domain name of the server. So we've composed a very big list of all the targets and in it we found many, many educational institutions, government agencies, medical institutions and huge companies. Next I asked myself why? Why there are so many instances exposed online? And to do that we've realized that in recent years more and more IP camera brands are being banned from use in Western countries. Meaning in the US, in Europe, Chinese based companies are not allowed. And this leaves users with less and less options to pick from. In addition to that there is a very big need to expose this service because you want to be able to access your cameras remotely. And simply because the service is fully encrypted people think it's secure, however it doesn't mean there are vulnerabilities that allow us to bypass it. And before I'm going to finish I just want to give credit where credit is due. We've worked with Access and we responsibly disclosed all the vulnerabilities to them and they were super cool, super helpful, super professional and implemented patches in amped time and wanted to make sure their clientele is secure. So credit to them for taking their product security in a responsible manner. So thank you everyone. Thank you very much. I hope you understand the risk with the Extranautic Protocol and thank you.