start	end	text
0	940	Let's get to it.
940	5220	Noah Moshe from Clarity Team, turning camera surveillance on this accident.
10560	12060	Yeah, good job winning.
12060	14000	Yeah, we kicked their asses.
14000	17280	So, before I start, let me introduce myself.
17280	21800	My name is Noah Moshe and I am the team lead and lead vulnerability researcher at Clarity 2.
21800	31560	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.
31600	37540	Here you can see one of, I think, six, seven racks in our lab where essentially this is my playground.
37540	50740	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.
50740	55520	And of course, my personal favorite and today's topic, IoT devices.
55540	59640	So without further ado, let's jump right in and start our talk.
60680	63900	So, my goal at the beginning of the day was quite simple.
63900	69980	I wanted to see how I can hack my way into the internal networks of big companies around the world.
69980	79480	And when attackers and pen testers alike have this task, they usually go with the usual suspects of Internet exposed services.
79640	88740	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.
89100	92720	In it, I saw the usual suspects, VPN, file sharings.
92720	99520	However, soon enough I discovered one service that I was completely unaware of which is called access remoting.
99640	102600	At this point I said, oh, a cool new service.
102600	110020	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.
110200	117520	Now, before we try and see what is access remoting, what is the protocol, we first need to understand what is access.
117520	123420	You see, access is an IP camera manufacturer that is geared toward enterprise solutions.
123420	130980	You'll see access cameras in big companies, educational institutions, medical devices and of course government agencies.
131120	143920	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.
144100	149480	However, the problem arises when a company has more than one cameras.
149480	165660	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.
165660	172420	And to do that, access implemented a very cool services that enable one centralized control solution.
172520	183500	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.
183500	189920	This is essentially the server that controls and manages your entire access fleet of cameras.
190360	197340	In addition to that, at the end of the day, the main use case of these cameras is to have video surveillance.
197340	205540	Meaning allowing administrators, guards, all that sort of fun to be able to view the actual camera feed of your cameras.
205540	210160	And to do that in a centralized location, access offers the access camera station.
210360	212660	This is essentially how it looks like.
212660	222260	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.
223260	236200	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.
236200	238820	And you need to have remote access to your servers.
238820	241800	You want to be able to view your camera feeds remotely.
241800	245040	You want to make sure that everything is fine, your cameras are working.
245220	251260	And to do that, access implemented their own proprietary protocol called access remoting.
251260	258000	Now this protocol is fully encrypted, fully authenticated, fully secure, or maybe not so much.
258000	269560	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.
270140	274380	In addition to that, access has a cloud solution called access secure access.
274380	278120	It's not the same as access remoting but it has one major con.
278120	285080	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.
285200	297340	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.
298020	299680	So this is the use case.
299680	309800	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.
310020	311640	And this was my goal in this research.
311640	318660	My goal was to simply take over, take full control of the server and to be able to execute remote code on the servers.
318880	328840	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.
328840	337460	Giving us full visibility, full network access, and of course the ability to do James Bond style of uh, interfering with camera surveillance.
338020	349640	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.
350000	353940	So let's deep dive and see what kind of vulnerabilities we managed to uncover.
354240	356780	First of all, we need to understand what is the setup.
356780	362240	You see, access device manager conversations are Windows native applications.
362240	364760	They are for client and server applications.
364980	370200	Everything is written in dot net which makes the actual researching process a little bit easier.
370480	379960	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.
380100	384220	And of course the first thing that the protocol requires is valid authentication.
384920	394560	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.
394560	401820	Because I wanted to uncover vulnerabilities and because it is a proprietary protocol, there is no documentation, no known clients, no nada.
402060	411400	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.
411540	422180	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.
422860	424340	And this is how it looks like.
424340	434640	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.
434640	440000	This way the server is able to make sure that a valid access client connects to it.
440000	445760	We then have immediately NTLM SSP authentication, meaning NTLM challenge and response.
445760	451740	And this way access is able to verify that only allowed users are interacting with their servers.
452260	463360	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.
463360	467500	Meaning we are able to glimpse a lot of information about the server setup.
468000	482840	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.
482840	490340	Essentially allowing the client to invoke different functionalities on the server using the JSON format.
490440	502180	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.
502660	511880	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.
511880	516820	And after some digging around I discovered that access uses the service contract.
516820	532240	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.
532240	535500	Super common, super trivial in .NET.
535500	546780	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.
546940	552000	Sometimes functions have more complicated types as their arguments.
552440	559240	Let's say for example take a look at this log on async function that is exposed by the access server.
559280	573520	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.
573740	579740	Now in order to actually create this on the server's back end some sort of deserialization must occur.
579740	587500	Meaning the server must create the class of client information DTO in order to actually execute the method.
587500	595100	And to do that access used JSON deserialization and to make matters worse they actually used the type name handling auto.
595100	605460	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.
605460	614140	Now this is super dangerous deserialization vulnerability and in .NET this immediately leads to code execution due to a known gadget.
614140	621420	Meaning this is essentially a fully deserialization vulnerability leading to a remote code execution.
621680	632960	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.
632960	636120	In this case Windows client API class.
636780	637280	Cool.
637280	639060	So we have a deserialization vulnerability.
639060	643000	Let's see what we need to do in order to fully exploit it.
643040	647700	And essentially what we need to do is to pass along and follow the access remoting protocol.
647700	650260	We first need to initiate an MTLS connection.
650260	653620	We need to send the user agent so the server won't kick us off.
653620	662620	We need to pass the MTL MSSP challenge response and wha-bam we are sending access remoting JSON payloads which has a deserialization vulnerability.
662720	663560	That's it right?
663560	667820	Well there is only one problem and this is that this is essentially all.
667820	674640	We need to pass the auth and we need to have proper authentication credentials in order to send access remoting credentials.
675280	679560	So we do have an RCA vulnerability however it is not pre-auth.
679560	683260	It has some pre-shared knowledge that we need to know which is the credentials.
683400	685760	However let's see how it's still exploitable.
685900	691500	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.
691740	695600	All we need to do is pass along the MTLM challenge and response.
695600	704900	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.
704960	715720	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.
715720	732500	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.
732780	741460	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.
741460	749540	Meaning we can pass it along a serialized object that is malicious which will trigger remote code execution on the client as well.
750060	753500	However once we control the server we can do more.
753500	759080	You see we can actually execute code on the cameras themselves using legitimate features.
759300	764920	So in order to allow modularity for system administrators access supports what's called packages.
764920	768200	Essentially allowing you to change your camera's behavior.
768240	773280	Of course access has their own packages however they allow anyone to create their package.
773280	778260	All you need to do is use the access ACAP SDK and you can build your own package.
778260	794600	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.
794600	799420	Meaning we add the app, we run it and we also have code execution on the server.
799440	802840	Meaning at this point we basically executed code everywhere.
802840	806740	We executed code on the client, the server and the cameras themselves.
807240	809720	However, that's not good enough.
809720	816220	Because like I've told you at the beginning I want to have full remote code execution pre-authenticated.
816460	819440	And at this point I need to have a man in the middle set up.
819440	827060	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.
827200	831140	This is not full remote code execution and this is our goal.
831140	833640	So let's see how we can actually exploit it.
833800	837460	So after a lot of time I've actually reached a dead end.
837460	841680	I could not bypass the authentication on the access remoting protocol.
841880	849040	Simply because it was immediately requiring us to pass the NTLM challenge response upon socket creation.
849040	858060	However, luckily after sometimes consulting with the documentation of access I discovered this tidbit of information which is a fallback protocol.
858060	865280	When the main TCP port is not accessible by the client there is a fallback protocol using a different port.
865280	873900	And when I've read it I saw this weird description about the protocol being HTTP with AES encryption which sounded super, super weird.
873900	882400	However, since it was HTTP all I did was put on this port in my browser and sadly I immediately got this credential requirement.
882660	890300	However, even when I've placed my credentials in this box the server just kept load loading, looping in this white screen.
890980	895900	Nothing was presented to me, I was not able to use it, something was weird.
895900	902140	And at this point I realized that this is not regular HTTP and something weirder is going on behind the scenes.
902140	906640	So I began reverse engineering this proprietary fallback protocol.
906940	912600	And this is how it essentially looks like and it does use HTTP however only vaguely.
912600	919720	The first thing a client does is it connects to the access server and you're sending an HTTP get request.
919720	922720	And the server responds with a channel ID.
922880	931060	Now this initial connection must be kept alive for the throughout of the communication as it will be used later.
931220	938080	Then the client creates a new connection on a new socket using the get slash channel ID it just received.
938140	944600	And we now have two channels, two communication streams that enable us to communicate with the server.
944620	954300	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.
954660	963340	After we have these two channels each side now begins the key exchange.
963340	976560	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.
976560	990840	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.
991180	993160	Now at this point I was like why?
993160	995320	Why have such a complicated protocol?
995320	999400	Why use this weird protocol over HTTP?
999400	1004140	Because essentially they created sockets over HTTP.
1004140	1011400	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.
1011700	1018560	However they do use both symmetric and asymmetric communication so the question is, is it more secure?
1018560	1020900	Because they are using encryption, maybe it is.
1020900	1022640	And the sad truth is no.
1022640	1034740	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.
1034860	1043160	Meaning if we bypass the auth we still are able to execute our code using the deserialization vulnerability we discovered before.
1044080	1048180	And next my goal was to try and see how we can actually bypass the auth.
1048180	1053780	And to do that I've went and noticed what kind of authentication schemas this server supports.
1053780	1060980	Because I saw that immediately when I connect to this HTTP port I am presented with a form telling me hey please authenticate.
1060980	1081380	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.
1081380	1095200	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.
1095200	1098540	Meaning we don't need to authenticate and we are able to use it.
1098540	1099980	So let's see our game plan.
1099980	1107380	First we use the slash underscore slash secret path and this way we are able to start communicating in access remotely.
1107380	1114540	We then need to implement the read communication protocol over this HTTP channel because it's not immediately playing our PC immediately.
1114540	1126500	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.
1126660	1128220	Super duper cool.
1128220	1139160	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.
1140080	1140420	Amazing right?
1140440	1145600	So we have pre-auth RCE but let's see what kind of effect we've actually managed to gain.
1146200	1161780	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.
1161940	1168600	Now we need to remember this server manages up to 10,000 cameras meaning the effect is actually quite vast.
1168600	1178060	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.
1178080	1183860	And to do that I remembered that access actually use NTLM SSP to authenticate the users.
1183860	1190100	And in the NTLM SSP there is the host name and domain like I've just showed you before.
1190100	1202780	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.
1202780	1213460	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.
1214220	1216740	Next I asked myself why?
1216740	1221120	Why there are so many instances exposed online?
1221140	1231280	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.
1231340	1235620	Meaning in the US, in Europe, Chinese based companies are not allowed.
1235620	1239640	And this leaves users with less and less options to pick from.
1239640	1246140	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.
1246380	1255320	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.
1255980	1259700	And before I'm going to finish I just want to give credit where credit is due.
1259700	1274160	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.
1274160	1279480	So credit to them for taking their product security in a responsible manner.
1279720	1281220	So thank you everyone.
1281220	1281940	Thank you very much.
1281940	1286720	I hope you understand the risk with the Extranautic Protocol and thank you.
