And I guess with no further ado, Adam Crosser is going to talk about covert channels and web conferencing. So let's hear it for Adam. All right. Happy to be here today, everyone. Thank you for coming to my presentation. This is Ghost Calls Abusing Web Conferencing for Covert Command and Control. To start off with just a brief introduction, I'm Adam Crosser. I'm a staff security engineer at Praetorian. 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. 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. And so the first type is basically what I would refer to as like a short term command and control channel. So this would be maybe you're doing SOX proxying, tunneling different tools through the end point. Maybe remote port forwarding for like NTM relaying on the internal network or stuff like that. Data exfiltration. Shorter duration, maybe a couple of hours that you're using for things like, for those types of things. Generally I would describe it as low latency, high throughput communication. The second type is what I consider like a long term C2. So that would be whatever is going to kick off again whenever your system reboots and you log back in. That's going to be your long term C2. A lot of people actually use the same short term and long term C2. There are some what I consider to be disadvantages of that that I'm going to talk about later on. And then the other type is backup C2. So you can get really creative here. Basically backup access vectors that you've put in place. So if there is some sort of incident response event, you have multiple TTPs that you're using, different backup systems. You can get really creative here. Like I found like credentials for like forklifts that weren't domain joined. It didn't have EDR on them that I set up backup C2 on. They take like a Windows tablet running on them. And you can get really creative there. And the final type is peer to peer communication. 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. But it doesn't have any sort of egress out to the internet. You can set up a channel with another system on the network. Maybe it's like an end point laptop that has more direct internet access. 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. 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. We didn't really have a good channel that we really liked for this mechanism. And so I'm going to, we kind of made this model of what would the ideal attributes of this channel actually look like. And so we came up with four things. One of them is latency. So latency being, you know, if you send a message and when that message is received, how long does that take? But there's another thing here which is throughput. 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. You can't send much data through them. And there are a lot of other channels where they have very high throughput but they also have relatively high latency. The third one is reach of course. 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. And the fourth one would be trust. 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. So maybe allow listed, excluded from inspection. And so that would be what I would consider to be an ideal short term command and control channel. 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. So on these types of engagements, we don't always actually run code on end points. We might do things with CICD infrastructure in the cloud or with identity based attacks. 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. We wanted to focus on services that would be widely used across most enterprise users. So not services that would only be used by developers. And we wanted to think through common workflows and services that might be used. And so using the selecting criteria, we came up with a few ideas. 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. So one option is DNS over HTTP. I think the latency there would be quite low. But we had two concerns on the throughput side. One of them is we weren't sure that we would be able to send a large amount of data through it. 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. From a reach perspective, a lot of large enterprises, they have their own internal DNS resolution infrastructure. So it's not uncommon for them to not be using DNS over HTTP. More common on consumer devices for sure. And from a trust perspective, we thought that would be good. Another option was kind of cloud file storage. This would solve the throughput issue. But generally you're going to be chunking large amounts of data. So it would introduce some more latency that wouldn't be acceptable for kind of realtime communication, RDP, web browsing, stuff like that. 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. Another classic one is just you register a domain, maybe age it for three years, get it classified as like finance. You could use like a WebSockets connection. That would be good from a low latency, high throughput perspective. You could get decent speeds there. But anything communicating with that would be compromised assets. And it wouldn't necessarily be trusted within most environments. So another idea was kind of e‑mail and messaging applications. And so depending on what you're using like e‑mail or Slack, there would be some more latency there. The throughput would be not ideal. But they would be widely used and trusted. 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. We're looking for something that is used for realtime communication. 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. And from a latency perspective, even a small amount of latency on a video call could make it unusable . And so every part of this infrastructure is kind of designed for realtime low latency communication which is what we needed in a channel. 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. And especially after things like, you know, the pandemic, these solutions are widely used. 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. And they're generally going to be trusted in a lot of environments. And so you can actually see this in a lot of the vendor recommendations. 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. They also recommend excluding their infrastructure from things like TLS inspection. 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. And so just a quick disclaimer, you know, this isn't like a mistake that these providers are making or anything. It's just when you have these types of systems, they need to be designed in a way to facilitate realtime communication. Any system that does additional inspection or rerouting of traffic is going to introduce latency. But from an attacker perspective, it's also useful. And so it's more of a, this is just how these solutions work and how they need to work to function. 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. It's just how these systems need to work. 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. 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. 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. And when you join a meeting, there's different information that gets looked up or you create a meeting. Each meeting has a media server allocated to it usually. 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. There's another operating mode that many of these solutions support, which is peer to peer communication . So you can either have a direct centralized server or you can use peer to peer communication between endpoints . And in some cases it can be faster to use peer to peer communication . In some cases it won't be. And I'll talk about that a little bit later on. And there's a third piece of infrastructure that's often used, which is turn infrastructure. And it's basically, it acts as a relay. 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. You can use the turn infrastructure as a way to communicate between two devices that want to make a peer to peer communication connection. 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. 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. And as I mentioned before, there's a lot of very common protocols that are used with web conferencing. And one of this is WebRTC. And I've got some stuff in the resources section. There's some like 60‑minute talks that just talk about WebRTC. So I don't have a whole lot of time to talk about it today. 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. 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. Alice, for example, will generate something called an offer that gets sent to Bob. It can be done through, say, a third party signaling server. Bob would then take that offer value, generate an answer from that and send it back to Alice. And again, I don't have time today to really deep dive into all of that functions. But just understanding that that handshake process exists is an important part of understanding what we're doing today. And so we started this by doing some reverse engineering of different products like Zoom. And I'll talk about why we picked the products that we focused on a little bit later. 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. And so we see that it's egressing to Zoom infrastructure on 80 to 1 UDP. And basically it's using a custom header with some different values in it. And it's kind of a wrapper around the RTP protocol. 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. So if you're interested more in their research , I definitely recommend checking out these two resources . 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. 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. 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. 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. 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. 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, it's still able to adapt and function properly and actually get you on the call. 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. And that would fail. 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. 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. 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. 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. And then on the web client side, it does something similar. 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. And it makes a web RTC connection outbound over 801UDP to the media server. But that's going to fail due to the egress controls within our environment. So then it's going to try to then use the turn infrastructure I mentioned before. 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. And it will use the turn server as basically a proxy to communicate with the media server infrastructure. But then again, this would fail because of the egress controls. 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. So then it's going to then fall back and make a web socket connection to the realtime web gateway. Actually makes multiple to then talk to the media server kind of using the realtime web gateway as a proxy . 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. And this is also highly adaptable . 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. It would get a little bit backlogged. It would just send audio only. It can do stuff like adapting, different products can do things like adapting the actual video quality or they can prioritize certain video streams. Like if someone's screen sharing, they might prioritize that over, you know, other video streams on the call that they could subscribe to. 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. So now the next step, of course, is we have a bit of an understanding of how they function. Let's work on designing a capability and defining what we wanted to actually do. And so we started just by looking at, you know, vendor market share. And we actually did this earlier in the research project. And so you probably noticed that I'm talking about two companies in particular, Zoom and Microsoft Teams. And this is just because they, if you look at, the data is different depending on the source that you look at. But it's basically, these two are basically always atop no matter what the percentages are. 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. So we started by reverse engineering Zoom. We looked at both the desktop and the web client. We like looking at the web client a bit more because it's easier than reverse engineering like C++ code. 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. 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. 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. 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. 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. And so when we looked at Microsoft Teams, we found something similar. Instead of sending that over a web socket connection, they actually just have an authenticated endpoint you can hit to get turn credentials. And so again, it's not a vulnerability. It's just how these solutions actually function. And so we had made a few observations around how these credentials actually function . One of them is that they're usually valid for a couple of days. And so the idea was we wanted to build something that would complement an existing long-term channel. So maybe you're using like Nighthawk or Cobalt Strike. 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. Some channels are very, very good covert channels. 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. And so these observations applied to both Zoom and Microsoft Teams. And once we obtain these credentials, there's no requirement on the victim side. They don't need to have, say, Zoom installed. If we just run our tooling on their systems, we can use that infrastructure without any dependencies on the actual victim side as well. And so now the next step comes actually building the tool. And the first question is, of course, you know, what is it that we actually want to build? 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. 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. And so it's meant to run in parallel with a long-term C2. 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. And I can use an example. This is from a couple of years ago back when you could domain front through Fastly. And I was on a project and I was domain fronting through a banking website. I'm just using somebank.com. 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. 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. 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. And once you dug into it, it was like a handful of systems actually in the network that were actually making that communication. 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. And that's why I recommend splitting your channel between short-term and long-term and having a tool like this is actually useful. And so we developed a tool. I'm going to show this QR code and URL later in the presentation, but it's called Turrent or Turntunneler. It's a tool for short-term command and control. And so it has a couple of use cases. 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. 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. We know that you can do that. We're going to give you a laptop or a VDI infrastructure that you can actually start from . 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. You can do C2 in an entirely decentralized manner. 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. You can basically connect those with the tool without needing to spin up any backend infrastructure. So that would save you time on your project. 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. 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. And so there's a couple other capabilities. And just because not everyone is going to understand what these terms mean, I just wanted to define them really quickly. And so one of them is this concept of remote port forwarding. So imagine you have a tool like NTL relay X and it's a Python based tool . It has a decent number of dependencies. It would be very difficult to run it on a victim system. So what you can do is take your attacker system. You can run that tool. Have a listen on a local port. And then on your victim system you can figure something called a remote port forward. 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. 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. So that can be really useful on a variety of different engagement types. Another thing I like to do is something called local port forwarding. So I mentioned that use case before with SAP where it's a thick client. It doesn't support SOX proxying. 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 . 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. So I can basically once I have initial foothold I can pivot to Citrix routing the Citrix receiver client through my victim endpoint. 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. And so these are the three use cases. Basically SOX proxying for things like browsing internal web apps. Decentralized C2 and local remote port forwarding was really how we envisioned this utility. And so I'm going to have two demos today. One with Zoom and one with Microsoft Teams. 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. We're just going to run burp. We're going to run Chrome. We're going to join a meeting. Wait for that web socket connection to be made . We'll get credentials back through the turn infrastructure. And we're going to put that in a configuration file and use it with our tooling. And so we have two components that I'm going to demo. In this video, it's the controller and the relay. And the controller you run on the operator system and you run the relay on a victim system. And just for demo purposes, it's easier for me to run this just like, you know, with a VM and GCP. I'm just going to SSH into it and run the tool. But really this is meant to be run through an existing implant you have in a system like night hawk or cobalt strike. 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. 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. And so now I've got a demo that I'm just going to play. And so then basically here we're just in burp on the attacker system. There's the victim doesn't need to be involved here or anything. We're just joining a meeting and just waiting for it to actually finish initializing. And then from here we can just close the browser. And then we go into burp and we actually just look through the web socket channel and we get those credentials. And so you can grab these from the web socket connection and basically throw them into a configuration file. 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. And so here we've got a demo where one side is my operator system. I'm running the controller component. We're generating an offer. The offer thing I mentioned before with the exchange, the handshake process. Then you basically want to pass that offer to the relay component which you run on the victim system. And then this generates an answer that you pass back to the controller. And then this establishes the connection through Zoom's turn infrastructure and now we have communication between these two systems. And then we're just downloading a file. And you'll notice that this infrastructure is very fast. Like we're getting 9 or 10 megabytes per second down on this download here. And so this is a fairly good speed for any sort of internal short term C2 that we might want to do. 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. You see it's going to a Zoom.US subdomain. And so they actually did push some recent mitigations on the Zoom side to block this. It depends on, there's a lot of providers that you have turn infrastructure that you could use this tool with. And whether it's possible to restrict it depends on how it's used. 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. And so they basically restricted what can actually connect to this, the turn server can actually connect to. And so it can only connect to these media servers. I haven't actually looked for any bypasses or anything. So I can't vouch for if it works or not. But the feasibility depends on the provider and how they use the turn infrastructure. 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. And so Microsoft Teams, this still works. And so that's good. And so there's two other utilities that we have here. With Microsoft Teams, it was just an unauthenticated endpoint you could hit. With Zoom, you had to actually go through a process of joining the meeting. And so that was a little difficult to automate. And I think even if we did automate it, it might be a little bit brittle. So we decided kind of against that, just have some manual documentation. And so we're going to show a couple things. One of them is just downloading a hundred megabyte test file through the channel. And then we have an admin utility. You can basically use the admin utility to connect to the controller and use that to manage your local and remote port forwards. And so I'm going to demonstrate a remote port forwarding capability. 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. And so again, I just wanted to have like a demonstration diagram of what's happening. Basically, I've got a web server running on my attacker system. That web server just has a file hosted on it. 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. We're just using a VM and GCP because it's easier to demo for a short presentation in video form. 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. And we're going to go through the process of using the admin utility to establish a remote port forward. And so I've got another demo here. There we go. 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. We're then going to kick off the controller. It's going to generate an offer. That offer gets sent to the relay component running on our GCP infrastructure. 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. 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. It's just for a demo, just using SSH for like simulating our long-term C2 channel is useful for a presentation like this. And so here we're downloading a file and we're getting fairly decent speeds. I think we get about three to five megabytes per second down here. And I'll talk a little bit about later why download speeds can vary. And so some other things later on, but you know, you can get fairly decent speeds through this infrastructure. I've gotten 10 to 20 before. Here we're routing traffic internationally. And so it's going to be a little bit slower in this scenario. And then I actually forgot. We've got the other part here. 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. 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. Again, it would be more of like an end point or something compromise an internal network. We're just using GCP as a quick demo. You can see that that web server is running locally on the operator system. And we're going to run a command here to create a remote port forward. 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. And then now that web server is accessible through the victim system. And then now you can see that that remote port forward is active. 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. And then if we go here, we can look at Wireshark and see what this looks like at the network level. You can basically see that there's a connection outbound on 443TCP over TLS. There's a client hello being sent here. It's connecting to teams.Microsoft.com, subdomain for a channel. 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. 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? 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. Not just with this tool, but kind of in general when you're doing red team operations. And so as a disclaimer , I'm not like an expert on internet routing or anything . I just started researching this like three weeks ago. So I'm not an expert. But I wanted to share some interesting observations I've had. 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. And part of this is they often usually have indirect DA privilege and nobody realizes that. 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. And it's frequently outsourced overseas, especially with larger multinational companies. 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. And so an example, maybe you have an operator in the U.S. they're proxying traffic through a compromised help desk employee in India and they're running into speed issues. And so one of the things that you might think about here is actually, oh, it must be the last mile connection. 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. 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. And so oftentimes it's not actually the last mile connection that is the bottleneck. And often it can be things like how your traffic is routed internationally. And so that can actually be where the bottleneck is. 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. And some of this is just the way internet routing works is a lot messier. I think in general it's a lot more centralized than I think many people would realize. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. And actually I'll talk a little bit about why web conferencing is actually very useful in this regard later on. 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. 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. 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. 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, running trace route and stuff. You can find faster paths where you can increase exfil speeds or stuff like that. And so, again, I think this could be an entire talk on its own. 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. 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. 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. But the problem here is that when you are tunneling TCP over TCP traffic, you can run into some pretty major performance issues. Basically any sort of like packet loss on the outer layer, for example, can trigger congestion control and stuff on the inner layer. And that's referred to as like a TCP meltdown problem. 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. But head of line blocking is a big issue with TCP. 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. And so these are all things that can kind of impact tunneling speeds. 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 . And you get very different speeds even going through the same server. 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. And so that's why I didn't implement that in the tool even though I originally planned to . And so those are just some of the nuances. And so for example, in this scenario, be careful cheaping out on your infrastructure, basically. 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. So a common thing people might think is that peer-to-peer is always going to be faster than a centralized server. But if you have a user in the U.S. 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. 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. Because they have globalized points of prevalence around the world. They have their own private backbone infrastructure. 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. 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. And so now I have I think maybe seven minutes for questions. I've got three QR codes, but I know this is DEF CON and people don't usually trust QR codes. 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. Basically this talk is about 40 minutes, 45 minutes. 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. We've got the open source tool on GitHub that you can actually download and use. My LinkedIn profile for if you have any questions. 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. So I think LinkedIn is a good one, even though it's not really my favorite platform personally. But anyway, any questions would be appreciated. Just a quick question. So the turn relays from Microsoft and Zoom will relay traffic on your behalf. Have you looked if there's any restriction in terms of what they will connect onward to? So you said Zoom will now only connect to media servers. Is there anything within the team's networks or the Zoom's networks that are reachable over these relays that shouldn't be? I didn't really look into that. You do need when you do the process of setting up the infrastructure, you do need to exchange certain information. So I wasn't able to find a way to connect to like arbitrary systems internally. It might be possible. My focus on this research was more just how do you tunnel traffic for command and control. But that would be an interesting thing to look into. It would definitely be something I would look into more if I wanted to expand on this research. This turn infrastructure is supposed to be used for very specific kinds of traffic. That is video traffic between two end points. Any guesses why would Microsoft and Zoom allow any arbitrary communication that look nothing like bidirectional video conferencing traffic through? 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. And on the Microsoft team's side they're using WebRTC as well. So basically what you see with the WebRTC connection is you see basically a DTLS encrypted tunnel that traffic is being sent over. So it's going to look very similar in many cases to what the client would normally be sending through the infrastructure. So I guess the only difference may be packet sizes, packet rates, bidirectionality, but not actual contents. 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. Thank you. Awesome. Thank you for coming everyone.