start	end	text
0	5360	And I guess with no further ado, Adam Crosser is going to talk about covert channels and web conferencing.
5360	6480	So let's hear it for Adam.
9000	10040	All right.
10460	11780	Happy to be here today, everyone.
11780	13940	Thank you for coming to my presentation.
14360	18220	This is Ghost Calls Abusing Web Conferencing for Covert Command and Control.
19380	22760	To start off with just a brief introduction, I'm Adam Crosser.
22760	25060	I'm a staff security engineer at Praetorian.
25160	33380	I do a lot of different things from vulnerability research to helping to build offensive security tooling that we can use on things like red team engagements.
35680	44880	And to start things off, I just want to create a bit of a common terminology that we can use on the different types of command and control channels and how I typically think about them.
45800	51240	And so the first type is basically what I would refer to as like a short term command and control channel.
51240	56360	So this would be maybe you're doing SOX proxying, tunneling different tools through the end point.
56400	60360	Maybe remote port forwarding for like NTM relaying on the internal network or stuff like that.
60360	61520	Data exfiltration.
61520	67040	Shorter duration, maybe a couple of hours that you're using for things like, for those types of things.
67040	71180	Generally I would describe it as low latency, high throughput communication.
71720	74340	The second type is what I consider like a long term C2.
74340	79820	So that would be whatever is going to kick off again whenever your system reboots and you log back in.
79920	81400	That's going to be your long term C2.
81400	84560	A lot of people actually use the same short term and long term C2.
84560	89760	There are some what I consider to be disadvantages of that that I'm going to talk about later on.
89760	92280	And then the other type is backup C2.
92280	95480	So you can get really creative here.
95480	98220	Basically backup access vectors that you've put in place.
98220	103980	So if there is some sort of incident response event, you have multiple TTPs that you're using, different backup systems.
103980	105180	You can get really creative here.
105180	109080	Like I found like credentials for like forklifts that weren't domain joined.
109080	112120	It didn't have EDR on them that I set up backup C2 on.
112120	114500	They take like a Windows tablet running on them.
114820	116640	And you can get really creative there.
117000	119640	And the final type is peer to peer communication.
119640	127660	So imagine like you have one system you've compromised that's on like a PCI environment and it has a lot of internal connectivity to a PCI environment.
127660	130440	But it doesn't have any sort of egress out to the internet.
130540	133840	You can set up a channel with another system on the network.
133840	137960	Maybe it's like an end point laptop that has more direct internet access.
137960	145620	And then you can link those two together maybe like ICMP or SMB communicating with each other in order to kind of tunnel into that PCI environment.
146520	160080	And so I wanted to just talk about the problem that we're trying to solve today which is we didn't feel like we had a good channel for that short term command and control channel that a couple of hours you might be using a SOX proxy or something to access an internal confluence page or stuff like that.
160080	163360	We didn't really have a good channel that we really liked for this mechanism.
163360	170100	And so I'm going to, we kind of made this model of what would the ideal attributes of this channel actually look like.
170100	172080	And so we came up with four things.
172080	173160	One of them is latency.
173160	178700	So latency being, you know, if you send a message and when that message is received, how long does that take?
178800	180620	But there's another thing here which is throughput.
180880	186700	And one of the things that you might notice is that a lot of, there are a lot of channels that have low latency but then they have low throughput.
186700	188000	You can't send much data through them.
188000	192920	And there are a lot of other channels where they have very high throughput but they also have relatively high latency.
194380	195960	The third one is reach of course.
195960	202980	Like if you're using say IRC or Tor for a command and control channel, that's not going to be common on most large enterprise networks.
203440	204620	And the fourth one would be trust.
204620	212140	Ideally if you're going to be using something for C2, I would recommend using something where it's going to be trusted within the environment.
212140	214720	So maybe allow listed, excluded from inspection.
214720	218860	And so that would be what I would consider to be an ideal short term command and control channel.
220220	228620	So we came up with some selection criteria here which were basically, we wanted to focus kind of first on services egressing from end user devices.
228620	232380	So on these types of engagements, we don't always actually run code on end points.
232380	236980	We might do things with CICD infrastructure in the cloud or with identity based attacks.
237200	244300	But often when we are getting an initial foothold into many environments, we're actually egressing from end user devices and so that's kind of what we focused on here.
244380	248420	We wanted to focus on services that would be widely used across most enterprise users.
248420	250940	So not services that would only be used by developers.
251020	254540	And we wanted to think through common workflows and services that might be used.
254540	258160	And so using the selecting criteria, we came up with a few ideas.
258360	265880	And I'm going to kind of run through and talk about how we can use this rubric to then think about different channels we could use for short term command and control.
266460	268360	So one option is DNS over HTTP.
268360	270220	I think the latency there would be quite low.
270220	272260	But we had two concerns on the throughput side.
272260	275880	One of them is we weren't sure that we would be able to send a large amount of data through it.
275880	281640	And even if we did, if you're sending, you know, 10 gigs of data through like a Google DNS server or something, it's going to look kind of weird.
281860	287180	From a reach perspective, a lot of large enterprises, they have their own internal DNS resolution infrastructure.
287180	291540	So it's not uncommon for them to not be using DNS over HTTP.
291540	293980	More common on consumer devices for sure.
294240	297340	And from a trust perspective, we thought that would be good.
298160	300800	Another option was kind of cloud file storage.
300800	302420	This would solve the throughput issue.
302420	305040	But generally you're going to be chunking large amounts of data.
305040	311980	So it would introduce some more latency that wouldn't be acceptable for kind of realtime communication, RDP, web browsing, stuff like that.
313040	322380	The trust wouldn't be ideal because a lot of companies, if they're not using a specific solution like Box or Dropbox, they actually might have it blocked internally for most of their users.
323980	329160	Another classic one is just you register a domain, maybe age it for three years, get it classified as like finance.
329460	331460	You could use like a WebSockets connection.
331560	334500	That would be good from a low latency, high throughput perspective.
334500	336260	You could get decent speeds there.
336260	339860	But anything communicating with that would be compromised assets.
340060	343500	And it wouldn't necessarily be trusted within most environments.
344620	347500	So another idea was kind of e‑mail and messaging applications.
347500	351520	And so depending on what you're using like e‑mail or Slack, there would be some more latency there.
351520	353700	The throughput would be not ideal.
353700	356020	But they would be widely used and trusted.
356540	363740	And so then we kind of came to this one which is web conferencing solutions where when we applied our criteria, it kind of overlapped perfectly.
363740	367740	We're looking for something that is used for realtime communication.
367740	377600	And so these systems kind of from the ground up are designed for that because you're sending say multiple video streams to a channel that requires a decent amount of data even with modern video compression.
377880	382800	And from a latency perspective, even a small amount of latency on a video call could make it unusable .
382800	390100	And so every part of this infrastructure is kind of designed for realtime low latency communication which is what we needed in a channel.
390100	396780	And it's going to be sending enough data that if we sent a decent amount of data through that channel, it wouldn't necessarily stick out relative to normal use cases.
396780	401920	And especially after things like, you know, the pandemic, these solutions are widely used.
402460	408900	You know, a lot of people are actually using all of them because they're kind of interfacing with different companies that use different products.
409000	411220	And they're generally going to be trusted in a lot of environments.
411220	415160	And so you can actually see this in a lot of the vendor recommendations.
415520	428440	Microsoft recommends, for example, configuring split tunneling so you're not routing traffic to their infrastructure for teams through your VPN appliance because that would introduce an unacceptable amount of latency and throughput issues in many cases.
428560	432260	They also recommend excluding their infrastructure from things like TLS inspection.
432420	441200	And if you look at other vendors like Zoom, they make similar recommendations around split tunneling and disabling TLS inspection for domains like zoom.us.
442540	447300	And so just a quick disclaimer, you know, this isn't like a mistake that these providers are making or anything.
447300	452080	It's just when you have these types of systems, they need to be designed in a way to facilitate realtime communication.
452080	457000	Any system that does additional inspection or rerouting of traffic is going to introduce latency.
457000	459080	But from an attacker perspective, it's also useful.
459080	463140	And so it's more of a, this is just how these solutions work and how they need to work to function.
463140	470980	It's not an issue that the vendor is making bad recommendations or anything like someone recommending their service account via DA when it doesn't need it or anything like that.
471100	473840	It's just how these systems need to work.
474000	485160	And so now that we figured out what we wanted to actually look at, the kind of obvious next step is we need to figure out how they work and what are potential entry points that we could use for routing traffic through this infrastructure.
485320	497240	And from a lot of research that I've done, I think you could say that a lot of these solutions use a very similar architecture, similar protocols, similar design in how they actually function overall across multiple solutions.
498120	508240	And so of course the first part is just, you know, you have an end user device that's using the service and they're maybe talking to like a main SaaS application and that application lets you do things like create or join meetings.
508480	512640	And when you join a meeting, there's different information that gets looked up or you create a meeting.
513080	516400	Each meeting has a media server allocated to it usually.
516880	524400	So if you're creating a meeting , it's going to find a media server and allocate that server to that meeting and then everyone will send audio and video traffic to that server.
524900	529600	There's another operating mode that many of these solutions support, which is peer to peer communication .
529600	533900	So you can either have a direct centralized server or you can use peer to peer communication between endpoints .
533900	537280	And in some cases it can be faster to use peer to peer communication .
537280	538400	In some cases it won't be.
538400	540500	And I'll talk about that a little bit later on.
540960	544580	And there's a third piece of infrastructure that's often used, which is turn infrastructure.
544640	547000	And it's basically, it acts as a relay.
547000	555400	So imagine you want to establish a peer to peer connection but you're not able to establish that connection using stun with things like net hole punching for direct peer to peer communication.
555480	563140	You can use the turn infrastructure as a way to communicate between two devices that want to make a peer to peer communication connection.
563140	569640	Or as we'll see later, it can also be used when a device is running into egress issues and it's not able to egress out through normal channels.
569640	578160	It can try to use the turn infrastructure to communicate with the media server to do more of a centralized, sending that video stream to a centralized server.
579680	585360	And as I mentioned before, there's a lot of very common protocols that are used with web conferencing.
585360	586640	And one of this is WebRTC.
586740	589300	And I've got some stuff in the resources section.
589300	592040	There's some like 60‑minute talks that just talk about WebRTC.
592040	594460	So I don't have a whole lot of time to talk about it today.
594460	604780	But you will see across many solutions they're using different protocols like WebRTC or SRTP, even if they're using custom protocols, they're often using a lot of the same building blocks under the hood.
606160	618640	But the one thing I want to kind of emphasize today and that you'll need to understand for this talk is the concept of like a WebRTC handshake where basically in this example we have two users, Alice and Bob, and they need to communicate with each other over a WebRTC channel.
619020	622580	Alice, for example, will generate something called an offer that gets sent to Bob.
622640	625260	It can be done through, say, a third party signaling server.
625260	630260	Bob would then take that offer value, generate an answer from that and send it back to Alice.
630260	633760	And again, I don't have time today to really deep dive into all of that functions.
633760	639500	But just understanding that that handshake process exists is an important part of understanding what we're doing today.
640640	644560	And so we started this by doing some reverse engineering of different products like Zoom.
644560	647800	And I'll talk about why we picked the products that we focused on a little bit later.
648100	655160	But we used basically a custom wire shark analyzer and were able to look at the traffic generated from the desktop client in this scenario.
655160	659380	And so we see that it's egressing to Zoom infrastructure on 80 to 1 UDP.
659760	664180	And basically it's using a custom header with some different values in it.
664240	667460	And it's kind of a wrapper around the RTP protocol.
667540	676620	And so for this research , we did find an existing wire shark analyzer from some researchers at Princeton where they reverse engineered the Zoom desktop client and actually published that analyzer.
676620	681420	So if you're interested more in their research , I definitely recommend checking out these two resources .
682700	689820	And so like if you look at something like Google Meet, for example, you see it's also say using UDP traffic outbound on 3478 UDP.
690300	700740	And it's also using RTP protocol, but it's using stock WebRTC where it's using DTLS for key exchange and SRTP protocol for the audio and video streams.
701820	708080	And so the other point I wanted to highlight, which is basically that these solutions are very resilient and are able to egress in many different types of environments.
708080	721220	So even if they're running or being used in an environment where it has very strict egress controls or is blocking a lot of different connections out to different services, they can still function in a pretty diverse set of environments.
721220	727980	And so when I was doing my research, I would basically spin up different environments with different egress controls and then see how different products would behave.
727980	742700	And so I'm going to run through a quick example today with just the Zoom desktop and web client just showing how if I have an environment where the only way to egress outbound is through a web proxy that does mandatory TLS inspection and only allows HTTP outbound and all other connections outbound or blocked,
742700	746520	it's still able to adapt and function properly and actually get you on the call.
747540	757020	And so to start off with the desktop version, it will start by basically trying to make a connection to something called a zone controller on 443UDP using a custom protocol over TLS.
757080	758240	And that would fail.
758860	771900	And so then it's going to switch over and try a web socket connection connecting through the web proxy over HTTPS on 443TCP and it's going to send that custom protocol over the web socket's channel to be able to egress through the proxy and so that would work.
772960	778760	And then it's going to basically try to make connections to the media server where it's going to send audio and video data.
778820	787340	It's going to try to make a connection over 443TCP and 801UDP and these would then fail again because of the configuration in our environment.
787640	795420	And so then it's going to actually make a web socket connection again and send that same data through a, the web socket connection as well.
796820	799880	And then on the web client side, it does something similar.
799880	806820	It talks to something called a real time web gateway over a web socket connection and it gets a lot of the same information it gets from the zone controller.
807120	812280	And it makes a web RTC connection outbound over 801UDP to the media server.
812680	815580	But that's going to fail due to the egress controls within our environment.
815580	819040	So then it's going to try to then use the turn infrastructure I mentioned before.
819040	829600	It's going to try to use something called turns or turn over TLS where basically it will make a connection over 443TCP over TLS running the turn protocol under that.
829600	835600	And it will use the turn server as basically a proxy to communicate with the media server infrastructure.
836180	839040	But then again, this would fail because of the egress controls.
839040	851360	I will say, these types of controls it's very rare to see on endpoints where you actually need to explicitly be configured to use a proxy to egress unless it's like, I've only seen it in financial institutions on some of their very sensitive VDI infrastructure.
852420	856180	So then it's going to then fall back and make a web socket connection to the realtime web gateway.
856180	861400	Actually makes multiple to then talk to the media server kind of using the realtime web gateway as a proxy .
861400	870940	And so these solutions are basically able to operate in a wide variety of different environments when different controls are in place that can prevent different components of the service from functioning properly.
872320	874140	And this is also highly adaptable .
874140	886180	I did notice as you go down that chain of degrading the connection, the speed generally tends to go down like in my lab environment, if I was forcing it to use that web socket channel, it would not always send the video stream.
886180	887300	It would get a little bit backlogged.
887300	889640	It would just send audio only.
889680	896300	It can do stuff like adapting, different products can do things like adapting the actual video quality or they can prioritize certain video streams.
896300	902300	Like if someone's screen sharing, they might prioritize that over, you know, other video streams on the call that they could subscribe to.
902840	912320	And so overall, I would say that these are some of the most resilient solutions in many environments in terms of being able to successfully egress and adapt to different scenarios that they might be running with them.
913720	917500	So now the next step, of course, is we have a bit of an understanding of how they function.
917500	921900	Let's work on designing a capability and defining what we wanted to actually do.
923040	926620	And so we started just by looking at, you know, vendor market share.
926740	930580	And we actually did this earlier in the research project.
930580	935320	And so you probably noticed that I'm talking about two companies in particular, Zoom and Microsoft Teams.
935320	940260	And this is just because they, if you look at, the data is different depending on the source that you look at.
940260	943900	But it's basically, these two are basically always atop no matter what the percentages are.
944340	957960	And so we decided to focus on these products because even if you're say using Google Meet or go to a meeting internally, it's likely that you have a large number of people that are using Microsoft Teams and Zoom to communicate with external parties that are actually using those products within their organizations.
959660	961380	So we started by reverse engineering Zoom.
961380	963440	We looked at both the desktop and the web client.
963560	969800	We like looking at the web client a bit more because it's easier than reverse engineering like C++ code.
970020	977500	And we found there's basically turn server credentials that get returned through that web socket connection with the real time web gateway that you can use.
977500	987020	And so this isn't a vulnerability, it's just these credentials are provided to the client so it can use them to try to egress outbound in scenarios where it's not able to egress outbound say on UDP.
987400	995600	And so we thought this was an interesting and potentially interesting vector for tunneling traffic because they recommend disabling TLS inspection on Zoom.us subdomains.
995600	1006540	And when we looked at actually where this infrastructure is hosted and we looked at the documentation, it was also within IP ranges that they recommend allow listing within your infrastructure for running Zoom itself.
1006540	1018740	And so it met that requirement if we want to route traffic through trusted infrastructure that won't be subject to the normal amount of inspection or kind of other controls that might be in place within the infrastructure.
1019880	1022600	And so when we looked at Microsoft Teams, we found something similar.
1022600	1028920	Instead of sending that over a web socket connection, they actually just have an authenticated endpoint you can hit to get turn credentials.
1028920	1030680	And so again, it's not a vulnerability.
1030680	1032600	It's just how these solutions actually function.
1032600	1037440	And so we had made a few observations around how these credentials actually function .
1037480	1041220	One of them is that they're usually valid for a couple of days.
1041240	1045800	And so the idea was we wanted to build something that would complement an existing long-term channel.
1045800	1047820	So maybe you're using like Nighthawk or Cobalt Strike.
1047880	1057360	You have an existing long-term channel in place, but that long -term channel has limitations on it either on the amount of data you can send or if you send a lot of data through that channel, it would look very weird.
1057360	1059600	Some channels are very, very good covert channels.
1059600	1065440	But once you start trying to send five gigs of like web browsing traffic through them, it starts to like look very weird at the network level.
1065920	1068780	And so these observations applied to both Zoom and Microsoft Teams.
1068880	1072140	And once we obtain these credentials, there's no requirement on the victim side.
1072140	1073720	They don't need to have, say, Zoom installed.
1073920	1082220	If we just run our tooling on their systems, we can use that infrastructure without any dependencies on the actual victim side as well.
1083400	1086800	And so now the next step comes actually building the tool.
1086820	1092100	And the first question is, of course, you know, what is it that we actually want to build?
1092100	1100800	And so the idea was, again, we're going to build an implant that we can run through an existing long-term channel that's meant to spin up a short-term channel that you would use for a couple of hours.
1100800	1114360	And so at the network level, it would just look like the user is joining a video call for three hours, but we're actually using that infrastructure as a covert channel to browse internal web applications or perform different types of enumeration running different offensive security tooling through that implant.
1114880	1118060	And so it's meant to run in parallel with a long-term C2.
1118100	1123820	And I'll talk a little bit about why I believe it's often useful to split your C2 between short-term and long-term.
1123820	1124880	And I can use an example.
1124880	1127880	This is from a couple of years ago back when you could domain front through Fastly.
1127880	1131500	And I was on a project and I was domain fronting through a banking website.
1131500	1133080	I'm just using somebank.com.
1133080	1141000	And this customer, they had a lot of SAP infrastructure and the objective was to show that we could pull different types of data or modify information within the ERP systems.
1141000	1151760	And so we needed to proxy the SAP desktop application through our implants quite a bit to access different things, RDP into different servers to basically really prove out the attack paths that we were demonstrating once we had the access.
1151760	1163960	And then after the project, we did some looking at some of their dashboards and other things and we noticed that the website that we were domain fronting through was, you know, on some of their most top visited domains because we were hitting it so much for actually routing traffic.
1164360	1169780	And once you dug into it, it was like a handful of systems actually in the network that were actually making that communication.
1169780	1178100	It shows that, you know, this was a good long-term channel, but once we started sending too much data through it over a short period of time, it starts to look very weird to anyone that's paying attention.
1178100	1184720	And that's why I recommend splitting your channel between short-term and long-term and having a tool like this is actually useful.
1185860	1187140	And so we developed a tool.
1187140	1192080	I'm going to show this QR code and URL later in the presentation, but it's called Turrent or Turntunneler.
1192080	1194320	It's a tool for short-term command and control.
1195360	1196860	And so it has a couple of use cases.
1196860	1209420	And one of them is I think a little bit interesting of a lot of red teams are actually shifting more toward an assumed breach model just because once you've done, you know, a red team for someone for say two or three years, they know that you can actually get in and actually get a foothold in the environment.
1209420	1213920	They don't want to pay you a lot of money to, you know, call people on the phone and send them emails and stuff.
1214160	1215860	We know that you can do that.
1215860	1219580	We're going to give you a laptop or a VDI infrastructure that you can actually start from .
1219840	1225720	And so this tool is useful for that scenario because you don't need to set up any other infrastructure to use it once you have turn credentials.
1225820	1227960	You can do C2 in an entirely decentralized manner.
1227960	1235560	So maybe you have an operator laptop that you're running off of and you have like a victim VDI or laptop that you're using for the assumed breach exercise.
1235560	1239380	You can basically connect those with the tool without needing to spin up any backend infrastructure.
1239380	1241380	So that would save you time on your project.
1241380	1248120	And then you can then proxy offensive security tooling from your operator laptop through the victim system without needing to run it directly on the endpoint.
1248120	1260980	And I think increasingly we've been switching from like running tooling on endpoints themselves to proxying them through endpoints a lot of the time because it has a little bit of a smaller attack surface from a detection perspective on the endpoint side.
1262680	1265400	And so there's a couple other capabilities.
1265400	1270140	And just because not everyone is going to understand what these terms mean, I just wanted to define them really quickly.
1270500	1272440	And so one of them is this concept of remote port forwarding.
1272440	1275540	So imagine you have a tool like NTL relay X and it's a Python based tool .
1275540	1277100	It has a decent number of dependencies.
1277220	1279660	It would be very difficult to run it on a victim system.
1280200	1282000	So what you can do is take your attacker system.
1282000	1283000	You can run that tool.
1283000	1284480	Have a listen on a local port.
1284520	1287160	And then on your victim system you can figure something called a remote port forward.
1287160	1299800	So whenever someone connects to that port on the victim system on say the internal network, then it will route through Microsoft Teams turn infrastructure, for example, to the attacker system and then route that traffic to the local NTL relay instance.
1299800	1311060	So you can basically run a tool locally but expose it on an internal network that you wouldn't have access to normally to run different tooling that would be difficult to run on the endpoint or you just wouldn't want to from a detection perspective.
1311060	1314240	So that can be really useful on a variety of different engagement types.
1314880	1317580	Another thing I like to do is something called local port forwarding.
1317580	1320320	So I mentioned that use case before with SAP where it's a thick client.
1320320	1321860	It doesn't support SOX proxying.
1322020	1336540	If you want to connect to like a specific SAP server, for example, you can bind to a local port on your attacker system, connect to that with the thick client application and then that will route connections that port through the turn infrastructure to the victim system and it will make that connection to internal infrastructure .
1336540	1343160	So one of the ways I like to use this is using things like Citrix where a lot of times from the external it requires MFA but from the internal it doesn't.
1343160	1349300	So I can basically once I have initial foothold I can pivot to Citrix routing the Citrix receiver client through my victim endpoint.
1349300	1363920	Connect to the internal Citrix infrastructure without MFA and then often I'm able to escalate privileges on that Citrix infrastructure and steal credentials and Chrome cookies from other users and then just use just that access to get objective to actually just pull the specific data that I need in those environments.
1365160	1367000	And so these are the three use cases.
1367020	1369940	Basically SOX proxying for things like browsing internal web apps.
1370600	1376980	Decentralized C2 and local remote port forwarding was really how we envisioned this utility.
1377520	1378780	And so I'm going to have two demos today.
1378780	1380680	One with Zoom and one with Microsoft Teams.
1380680	1386980	And so we're going to basically have a video demo where we demo obtaining credentials from Zoom basically as a stand alone basis on an attacker.
1386980	1388120	We're just going to run burp.
1388180	1389580	We're going to run Chrome.
1389580	1390880	We're going to join a meeting.
1391240	1393220	Wait for that web socket connection to be made .
1393220	1395880	We'll get credentials back through the turn infrastructure.
1396420	1400260	And we're going to put that in a configuration file and use it with our tooling.
1400260	1401980	And so we have two components that I'm going to demo.
1401980	1403860	In this video, it's the controller and the relay.
1404320	1408300	And the controller you run on the operator system and you run the relay on a victim system.
1408320	1413660	And just for demo purposes, it's easier for me to run this just like, you know, with a VM and GCP.
1413660	1415380	I'm just going to SSH into it and run the tool.
1415380	1420840	But really this is meant to be run through an existing implant you have in a system like night hawk or cobalt strike.
1420840	1430220	And as long as you have the ability to run an arbitrary binary in memory and read standard output, this tool can integrate with your existing implant without needing any other infrastructure in place.
1430220	1441240	And so we kind of designed it in a way that we wanted to be used with whatever existing C2 channel you use as long as that C2 implant provides some basic primitives that I believe any decent one should be able to provide.
1442460	1446500	And so now I've got a demo that I'm just going to play.
1446940	1450960	And so then basically here we're just in burp on the attacker system.
1450960	1453440	There's the victim doesn't need to be involved here or anything.
1453440	1461480	We're just joining a meeting and just waiting for it to actually finish initializing.
1461480	1464560	And then from here we can just close the browser.
1465040	1470200	And then we go into burp and we actually just look through the web socket channel and we get those credentials.
1470280	1476760	And so you can grab these from the web socket connection and basically throw them into a configuration file.
1476820	1486400	And I'm not going to show that putting in the config file on screen but this is all documented in our documentation and how this is actually done if you're curious.
1486400	1489500	And so here we've got a demo where one side is my operator system.
1489500	1491280	I'm running the controller component.
1491500	1492700	We're generating an offer.
1492700	1496520	The offer thing I mentioned before with the exchange, the handshake process.
1496520	1500540	Then you basically want to pass that offer to the relay component which you run on the victim system.
1500820	1504280	And then this generates an answer that you pass back to the controller.
1504480	1510960	And then this establishes the connection through Zoom's turn infrastructure and now we have communication between these two systems.
1510960	1512460	And then we're just downloading a file.
1512460	1514140	And you'll notice that this infrastructure is very fast.
1514140	1518880	Like we're getting 9 or 10 megabytes per second down on this download here.
1519200	1525640	And so this is a fairly good speed for any sort of internal short term C2 that we might want to do.
1527700	1537080	And then if we look at this at the network level, we basically see connection outbound on 443TCP and it's going to look at the client hello.
1537080	1540360	You see it's going to a Zoom.US subdomain.
1541560	1545880	And so they actually did push some recent mitigations on the Zoom side to block this.
1545880	1550200	It depends on, there's a lot of providers that you have turn infrastructure that you could use this tool with.
1550420	1553200	And whether it's possible to restrict it depends on how it's used.
1553200	1560440	And basically in their case, they're only using it for communication between the client and the media server and they're not using it to facilitate peer to peer connections as well.
1560440	1567520	And so they basically restricted what can actually connect to this, the turn server can actually connect to.
1567520	1569680	And so it can only connect to these media servers.
1569680	1571540	I haven't actually looked for any bypasses or anything.
1571540	1574520	So I can't vouch for if it works or not.
1574960	1578440	But the feasibility depends on the provider and how they use the turn infrastructure.
1578440	1587460	And there are quite a few providers from the web conferencing providers to CloudFlare or Twilio that have turn infrastructure that you can use with the same type of channel.
1588780	1591120	And so Microsoft Teams, this still works.
1591120	1592520	And so that's good.
1592520	1596920	And so there's two other utilities that we have here.
1596920	1600040	With Microsoft Teams, it was just an unauthenticated endpoint you could hit.
1600060	1602860	With Zoom, you had to actually go through a process of joining the meeting.
1602860	1604780	And so that was a little difficult to automate.
1604780	1607200	And I think even if we did automate it, it might be a little bit brittle.
1607200	1610940	So we decided kind of against that, just have some manual documentation.
1611500	1612960	And so we're going to show a couple things.
1612960	1615720	One of them is just downloading a hundred megabyte test file through the channel.
1615840	1617060	And then we have an admin utility.
1617060	1622440	You can basically use the admin utility to connect to the controller and use that to manage your local and remote port forwards.
1622820	1625480	And so I'm going to demonstrate a remote port forwarding capability.
1625620	1631840	And again, we're just using my local laptop and a GCP VM just because it makes it really easy to demo in video form for a presentation.
1633620	1637400	And so again, I just wanted to have like a demonstration diagram of what's happening.
1637400	1640320	Basically, I've got a web server running on my attacker system.
1640340	1642740	That web server just has a file hosted on it.
1642740	1651200	It's meant to simulate whatever tooling you might want to expose on, say, an internal network on like an endpoint or something that's on an internal client environment, for example.
1651300	1656640	We're just using a VM and GCP because it's easier to demo for a short presentation in video form.
1656640	1662740	And so basically we're going to show that we're not able to access that service on the VM and GCP, but it's accessible locally.
1662740	1667940	And we're going to go through the process of using the admin utility to establish a remote port forward.
1669100	1671520	And so I've got another demo here.
1674710	1675910	There we go.
1676630	1687950	So then in this demo, we're just first running the credentials utility for getting a configuration file that basically has our term credentials for Microsoft Teams infrastructure in them.
1687950	1690090	We're then going to kick off the controller.
1690090	1691850	It's going to generate an offer.
1692510	1697390	That offer gets sent to the relay component running on our GCP infrastructure.
1697710	1709350	And then we're using that to run the relay utility and then generate an answer that we then send back to the actual controller component.
1709350	1715870	So we do have documentation on how to do this, like running the tool in memory through other C2 channels like Nighthawk on GitHub documentation.
1715870	1723230	It's just for a demo, just using SSH for like simulating our long-term C2 channel is useful for a presentation like this.
1723530	1726430	And so here we're downloading a file and we're getting fairly decent speeds.
1726430	1729510	I think we get about three to five megabytes per second down here.
1729590	1734010	And I'll talk a little bit about later why download speeds can vary.
1734010	1740250	And so some other things later on, but you know, you can get fairly decent speeds through this infrastructure.
1740250	1741890	I've gotten 10 to 20 before.
1742090	1745010	Here we're routing traffic internationally.
1745010	1748170	And so it's going to be a little bit slower in this scenario.
1753230	1756190	And then I actually forgot.
1756190	1757550	We've got the other part here.
1757850	1767770	So then now we're running the admin utility and we're going to basically list remote port forwards to show that there's no currently active.
1770870	1780010	And then if we pivot back over, this is running commands on my operator system, just showing that this service is not accessible within our victim virtual machine within GCP.
1780010	1783910	Again, it would be more of like an end point or something compromise an internal network.
1783910	1786050	We're just using GCP as a quick demo.
1786370	1789230	You can see that that web server is running locally on the operator system.
1789310	1793230	And we're going to run a command here to create a remote port forward.
1793550	1803870	And that's going to basically any time someone connects to that port on GCP on 8080, it's going to route through Microsoft's turn infrastructure back to the operator laptop and originate a connection to the local web server.
1803870	1807590	And then now that web server is accessible through the victim system.
1809030	1811770	And then now you can see that that remote port forward is active.
1811770	1824090	And so yeah, those are really the three main use cases I had envisioned for this , which was basically local and remote port forwarding, SOX proxying, and then decentralized command and control.
1825290	1830790	And then if we go here, we can look at Wireshark and see what this looks like at the network level.
1830790	1837270	You can basically see that there's a connection outbound on 443TCP over TLS.
1837410	1840210	There's a client hello being sent here.
1840210	1844510	It's connecting to teams.Microsoft.com, subdomain for a channel.
1845070	1857750	And so now the third part I want to talk about is a lot of what we're focusing on today is this concept of we want to have a channel that's very fast that is going to be low latency and high throughput.
1857750	1865290	And so we're optimizing for things like if we're trying to do different types of tunneling traffic into a network or exfiltrating data, how do we maximize the speeds?
1865290	1876990	And so I just want to talk about some interesting observations I had on actually using this tool and like how different ways that traffic gets routed can actually impact tunneling speeds and how you can work around that.
1876990	1880950	Not just with this tool, but kind of in general when you're doing red team operations.
1881630	1884110	And so as a disclaimer , I'm not like an expert on internet routing or anything .
1884110	1886770	I just started researching this like three weeks ago.
1886770	1888550	So I'm not an expert.
1888550	1890910	But I wanted to share some interesting observations I've had.
1890910	1903650	And I kind of wanted to set the scene a little bit by just talking about an interesting scenario we ran into once where we basically, one of the things we really like to do is compromise help desk users because they're often very highly privileged users and relatively easy targets.
1903650	1909210	And part of this is they often usually have indirect DA privilege and nobody realizes that.
1909290	1918690	And also they're usually entry level employees and it's generally a lot easier to get them to actually run malware on their systems or reset other users' passwords or things of that nature.
1918950	1925130	And it's frequently outsourced overseas, especially with larger multinational companies.
1925130	1933250	And so we've run into issues before where we're trying to tunnel traffic through their systems and we're running it to kind of slower, unreliable channels, proxying traffic through their systems.
1933250	1935910	And so an example, maybe you have an operator in the U.S.
1935910	1941610	they're proxying traffic through a compromised help desk employee in India and they're running into speed issues.
1941970	1947850	And so one of the things that you might think about here is actually, oh, it must be the last mile connection.
1947870	1960530	Because if you think about the early days of the internet with things like dial up or even DSL until recently in many rural parts of the United States, generally the last mile was the thing that was running into issues from a speed perspective.
1961050	1976170	But really whether it's India or even a lot of more rural parts of the United States there's actually a massive global build out of fiber to the home infrastructure whether it's a variety of factors from things like just the cost of fiber actually going down quite a bit over time.
1976670	1981330	And so oftentimes it's not actually the last mile connection that is the bottleneck.
1981330	1985650	And often it can be things like how your traffic is routed internationally.
1986210	1989030	And so that can actually be where the bottleneck is.
1989030	2000790	Some of these countries have very good domestic fiber networks but then they have more congested internet exchange points that they use to route internationally or just kind of poor peering with other major internet routes.
2000790	2004970	And some of this is just the way internet routing works is a lot messier.
2004970	2010850	I think in general it's a lot more centralized than I think many people would realize.
2010850	2024250	And so a lot of providers kind of have pretty bad international routing, especially residential providers because a lot of major sites and CDNs have localized points of presence so they don't need to actually go through the international channels and stuff like that.
2024250	2033830	And so it's a bit hard to explain but I can kind of show this by, you know, I'm in, I was making these slides in a relatively rural part of the Midwest so I have about 40 megabits down.
2033830	2047770	It's not amazing speed but this is basically me running a connection on a 40 megabit per second connection and this is connecting directly from the last mile into the ISPs network so there's nothing else that's happening and seeing I'm getting about 40.
2048110	2056230	And then if I say try to download a file from Hetzner in Singapore I get about half that speed averaging about 2 megabytes per second.
2056750	2069030	But if I connect to basically Hetzner, connect to express VPN in Chicago, basically that changes how my traffic gets routed internationally and I double the actual download speed for that file.
2069030	2085910	So that shows like if you're doing anything like say compromising help desk user in India or somewhere and you're trying to route traffic through their system from the U.S., the way that your traffic is routed through different parts of the internet can sometimes matter more than what the last mile connection speed are on both sides and this can also impact things like data exfiltration.
2085910	2094790	Sometimes if you're exfiltrating data, you want to get that data off the initial first stage very fast in case, you know, something happens during that period.
2095270	2106370	And so like if you look at say trace route you can see how this gets impacted where from my residential connection I'm getting routed through hurricane electric as a transit provider where it's using NTT with express VPN.
2106370	2117270	And express VPN tends to use as providers like CDN 77 to optimize connectivity to their infrastructure and then they, you know, tend to pay more for premium transit that gives you better international routing.
2117270	2125730	And so this is just something I've noticed and been messing with but it just shows how the way that you position your infrastructure and what infrastructure you're using really matters a lot.
2125730	2130150	And actually I'll talk a little bit about why web conferencing is actually very useful in this regard later on.
2131450	2138350	But, you know, again, this just goes in the idea of like things like peering or routing relationships can sometimes matter more than your last mile connection speed.
2138350	2144030	So like imagine you're on like a budget VPS and you've compromised a web server and you're trying to exfiltrate 10 gigs of data.
2144150	2156130	If your budget VPS provider, you know, doesn't have good peering with whatever server you're trying to actually download to, you could get very, very low download speeds even if your last mile connection to the ISP is very good.
2156130	2166890	So thinking about how you position your infrastructure if you're trying to exfiltrate data like, you know, that they're running stuff in this data center and this provider and this AWS region has good peering with their ISP in this area with, you know,
2166890	2167770	running trace route and stuff.
2167770	2172290	You can find faster paths where you can increase exfil speeds or stuff like that.
2172290	2175250	And so, again, I think this could be an entire talk on its own.
2175250	2182370	I just kind of wanted to talk about because a big theme of this talk is how you optimize things like tunneling speed or exfiltration speed.
2182370	2189630	And I wanted to talk about how I was kind of observing this when I was testing like setting up different systems around the world and messing with stuff like this.
2190430	2210370	And there's another couple of design decisions we made that I wanted to mention which is one of my original ideas was to support full VPN tunneling where basically you could set up a like virtualized VPN interface, run the system on another system and it would do the turns over TLS over TCP and basically tunneling TCP over TCP traffic with raw VPN tunneling.
2210450	2217270	But the problem here is that when you are tunneling TCP over TCP traffic, you can run into some pretty major performance issues.
2217310	2222270	Basically any sort of like packet loss on the outer layer, for example, can trigger congestion control and stuff on the inner layer.
2222270	2224750	And that's referred to as like a TCP meltdown problem.
2225410	2230090	And there's a lot of videos on the internet that explain this that are 20 or 30 minutes so I don't have a lot of time.
2230330	2232830	But head of line blocking is a big issue with TCP.
2232910	2242530	So with this tunnel that we're using with TCP, any packets that get lost ahead of other ones, that needs to be retransmitted before the full chain of messages can be processed.
2242530	2246090	And so these are all things that can kind of impact tunneling speeds.
2246090	2253670	And so this is just an example of me on like a VPN server using TCP over UDP outer layer versus a TCP outer layer .
2253670	2256870	And you get very different speeds even going through the same server.
2256870	2266950	And so be careful with, you know, if you're trying to do full VPN tunneling, if you're using TCP as an outer layer for transport, any sort of packet loss can really kill your tunneling speed.
2266950	2270090	And so that's why I didn't implement that in the tool even though I originally planned to .
2270210	2273090	And so those are just some of the nuances.
2273350	2279370	And so for example, in this scenario, be careful cheaping out on your infrastructure, basically.
2279370	2287350	Because if you have a compromised user in India using a budget VPS or you're even doing peer-to-peer communication, this can slow down connection speeds.
2287350	2293730	So a common thing people might think is that peer-to-peer is always going to be faster than a centralized server.
2293730	2294990	But if you have a user in the U.S.
2294990	2302970	and a user in India and you're trying to make a direct peer-to-peer connection with NAT hole punching, and usually residential ISPs don't really pay for amazing transit.
2302970	2310430	And so that could actually be slower than doing something like this where you're actually connecting to like using Microsoft Teams infrastructure as a relay.
2310430	2312890	Because they have globalized points of prevalence around the world.
2312890	2315230	They have their own private backbone infrastructure.
2315230	2327630	And so this is one of the other advantages of using things like Microsoft Teams for tunneling is you can actually ride on Microsoft's backbone and run through better transit and get better tunneling speeds than you would through other types of channels.
2328010	2343030	And so generally if you're like at this scenario where you're tunneling traffic through like a help desk user like we often run into, definitely recommend Microsoft Teams as a good vector for tunneling traffic, getting high performance tunneling going.
2343650	2347250	And so now I have I think maybe seven minutes for questions.
2347250	2353250	I've got three QR codes, but I know this is DEF CON and people don't usually trust QR codes.
2353250	2361550	So if you just want to take a picture, you can just copy this URL using like OCR on your phone if you want to see this other information we have.
2361630	2364550	Basically this talk is about 40 minutes, 45 minutes.
2364770	2373530	And so we've got about like I think in Google Docs it was like a 35 page document split up over two blog posts that talks about other parts of this research I didn't talk about today.
2373530	2378090	We've got the open source tool on GitHub that you can actually download and use.
2378410	2380370	My LinkedIn profile for if you have any questions.
2380370	2386350	I used to use XL out for this, but I think now if you don't have like the premium subscription, you can't message people if they don't follow you.
2386350	2391070	So I think LinkedIn is a good one, even though it's not really my favorite platform personally.
2391070	2394670	But anyway, any questions would be appreciated.
2395350	2396850	Just a quick question.
2396850	2403350	So the turn relays from Microsoft and Zoom will relay traffic on your behalf.
2403350	2407910	Have you looked if there's any restriction in terms of what they will connect onward to?
2407910	2410310	So you said Zoom will now only connect to media servers.
2410310	2416410	Is there anything within the team's networks or the Zoom's networks that are reachable over these relays that shouldn't be?
2417090	2418670	I didn't really look into that.
2418670	2426190	You do need when you do the process of setting up the infrastructure, you do need to exchange certain information.
2426190	2429430	So I wasn't able to find a way to connect to like arbitrary systems internally.
2429430	2430230	It might be possible.
2430230	2435750	My focus on this research was more just how do you tunnel traffic for command and control.
2435750	2437470	But that would be an interesting thing to look into.
2437470	2442230	It would definitely be something I would look into more if I wanted to expand on this research.
2444830	2450150	This turn infrastructure is supposed to be used for very specific kinds of traffic.
2450150	2453290	That is video traffic between two end points.
2453290	2464350	Any guesses why would Microsoft and Zoom allow any arbitrary communication that look nothing like bidirectional video conferencing traffic through?
2464430	2474690	So the interesting thing is it actually looks exactly the same at the network level because in both cases on the web client with Zoom they're using WebRTC with data channels sending their custom protocol.
2474930	2478330	And on the Microsoft team's side they're using WebRTC as well.
2478330	2485610	So basically what you see with the WebRTC connection is you see basically a DTLS encrypted tunnel that traffic is being sent over.
2485610	2493310	So it's going to look very similar in many cases to what the client would normally be sending through the infrastructure.
2494130	2500930	So I guess the only difference may be packet sizes, packet rates, bidirectionality, but not actual contents.
2500930	2512830	Yeah, it's using the same basic building blocks from a protocol perspective, but it would likely look slightly different if you looked into it more in depth.
2512830	2513630	Thank you.
2518520	2519760	Awesome.
2519800	2521400	Thank you for coming everyone.
