[00:08.030 --> 00:11.110] All right, so my name is Ken Pyle. [00:11.130 --> 00:15.190] I am a partner and exploit developer at a firm named Cyber. [00:15.330 --> 00:20.510] I do exploit development, offensive work. [00:20.710 --> 00:24.630] I'm a really prolific zero-day hunter. [00:25.270 --> 00:26.770] So this is, we do managed services, [00:26.770 --> 00:30.690] we do managed services, data security, breach response, digital forensics. [00:30.810 --> 00:34.990] I'm primarily, as I tell people, I live on the very red side of purple. [00:35.190 --> 00:36.750] Like, very red side of purple. [00:36.750 --> 00:38.630] I get called in and it's like, has anybody ever seen this? [00:38.630 --> 00:41.130] Have you ever given your view on it? [00:41.610 --> 00:45.150] I'm also a graduate professor of cyber security at Chestnut Hill College. [00:45.150 --> 00:49.430] I teach applied cryptography, advanced exploit development, cyber warfare stuff, [00:49.430 --> 00:51.730] refinement of exploits, what have you. [00:51.910 --> 00:53.750] I have to give you the plug because I'm here, whatever. [00:53.910 --> 00:55.730] But I'm going to be very clear about this. [00:56.010 --> 00:58.350] None of the opinions I'm expressing in this presentation [00:58.350 --> 01:00.890] are representative of either of those institutions. [01:01.330 --> 01:03.110] So you know where this is going. [01:03.150 --> 01:05.850] All right, this is actually my academic research [01:05.850 --> 01:08.130] I've been working on for a really, really long time. [01:08.570 --> 01:11.890] And I'm going to, as I put this presentation together, [01:11.890 --> 01:16.450] it looks very small, but I'm building up from the bottom to something really big. [01:16.450 --> 01:18.750] And it all starts with some very basic concepts. [01:18.750 --> 01:21.190] One of the things I try to tell people is, [01:22.410 --> 01:27.110] I am a really, really prolific exploiter of critical infrastructure. [01:27.430 --> 01:28.470] If you don't know who I am, I'm the person, [01:28.470 --> 01:31.310] if anybody heard about the emergency alert system getting hacked last year, [01:31.310 --> 01:32.250] that was me. [01:33.370 --> 01:36.390] The ruckus Andoriu botnet that got started earlier this year [01:36.390 --> 01:39.210] caused a big problem on the KEV, that's me. [01:40.150 --> 01:41.490] Some other stuff. [01:41.490 --> 01:44.870] And I always tell people this, I love my job, I am super passionate, [01:44.870 --> 01:47.650] I love this, I've been doing this since I was six years old. [01:47.650 --> 01:49.970] I was on a 2400 baud modem doing this. [01:50.350 --> 01:53.750] I do some really serious work, we all do some really serious work, [01:53.750 --> 01:56.890] but it is really important to not take yourself too seriously. [01:57.430 --> 01:59.990] So when I popped the emergency alert system, [01:59.990 --> 02:02.230] and my picture was getting broadcast all over the world, [02:02.230 --> 02:05.470] I made sure to troll goth fans with my favorite New Order CD. [02:05.590 --> 02:08.870] The keys to set off emergency system alerts across the United States [02:08.870 --> 02:10.790] are actually hidden behind that CD. [02:11.670 --> 02:14.870] But the whole point of it is, we do really serious work, [02:14.870 --> 02:16.930] and we get really tied up into it, [02:16.930 --> 02:19.430] and there's this problem we have in the industry [02:19.430 --> 02:21.530] of everybody aiming guns at each other. [02:21.550 --> 02:23.670] I'm an exploiter, I'm a hacker, [02:23.670 --> 02:26.590] and I have to talk to appsec people constantly. [02:26.590 --> 02:28.510] And it's always adversarial. [02:28.510 --> 02:30.330] And it doesn't need to be. [02:30.850 --> 02:32.690] It's also not very difficult. [02:32.690 --> 02:33.770] All the things I'm going to show you here [02:33.770 --> 02:36.330] are literally basic concept things [02:36.330 --> 02:38.630] that I'm sure you read in the first five pages [02:38.630 --> 02:40.230] of anything you ever read. [02:41.170 --> 02:42.890] So if you ask yourself a couple questions [02:42.890 --> 02:45.010] of how do I know some of these things, [02:45.010 --> 02:47.450] or how did I figure some of this out, [02:47.450 --> 02:49.090] my full confession is this, [02:49.090 --> 02:50.730] I used to be an MSP engineer, [02:50.730 --> 02:53.070] I used to be a security and network engineer, [02:53.070 --> 02:55.450] and I know because I'm sitting in a room of appsec people, [02:55.450 --> 02:58.590] I will tell you flat out, it's not always the network. [02:59.270 --> 03:01.490] But this time it kind of is. [03:02.450 --> 03:05.070] But it's your fundamental lack of understanding [03:05.070 --> 03:06.330] of how the network works [03:06.330 --> 03:09.230] that makes what I'm going to show you happen. [03:09.610 --> 03:12.810] And I want the light bulbs to start going off. [03:12.990 --> 03:15.670] So people ask me this, how do you find zero days? [03:16.970 --> 03:18.690] Break out the crayons. [03:19.170 --> 03:21.890] On the engineering side, we hate doing this. [03:22.090 --> 03:24.790] I hate having to explain myself to people. [03:25.190 --> 03:26.410] You have to. [03:27.090 --> 03:30.010] You guys got to be a little bit more cool with us on our side, [03:30.010 --> 03:31.670] and we'll be a little bit better on your side, [03:31.670 --> 03:33.150] but that's causing these problems. [03:33.250 --> 03:34.710] How do you find zero days? [03:34.710 --> 03:36.850] It's as simple as reading the effing manual. [03:37.050 --> 03:39.450] I tell people this all the time. [03:40.250 --> 03:42.610] Understand what you are actually working at. [03:42.610 --> 03:44.750] If you're an appsec person, [03:44.750 --> 03:46.330] your application is transmitted [03:46.330 --> 03:48.370] in some way over a network, correct? [03:48.730 --> 03:51.530] You should probably learn how that road works, [03:51.970 --> 03:54.490] and all the off-ramps and ways to hijack it [03:54.490 --> 03:56.870] through application security. [03:57.430 --> 04:00.570] I always tell people to be eternally cynical, skeptical. [04:02.350 --> 04:04.510] If somebody tells you they did something, [04:05.070 --> 04:06.350] double-check anyway. [04:06.670 --> 04:09.330] The big problem we have with supply chain management software, [04:09.330 --> 04:10.730] stuff like this, is we're all depending [04:10.730 --> 04:12.430] on the person behind us or next to us [04:12.430 --> 04:15.310] to have done their job and actually read the manual. [04:15.850 --> 04:17.990] Turns out, it's the complete opposite. [04:18.510 --> 04:19.490] Don't give up. [04:19.490 --> 04:20.530] If you find something new, [04:20.530 --> 04:22.350] and I'm going to show you something that's brand new, [04:22.470 --> 04:24.970] a new type of HTTP exploit I came up with, [04:24.970 --> 04:27.090] and I knew what I had, [04:27.090 --> 04:29.170] but I had to protect it because people were trying [04:29.170 --> 04:31.430] to actively not let me talk about it. [04:31.850 --> 04:34.490] Not just this situation, it's a bunch of... [04:34.490 --> 04:37.250] And sometimes you just have to, as an engineer, [04:37.250 --> 04:39.590] lower yourself to the pity of explaining [04:39.590 --> 04:42.110] the network to plebs who don't know anything. [04:42.110 --> 04:43.570] That's BS, man. [04:44.270 --> 04:46.710] As a very good friend of mine, an amazing hacker, [04:46.710 --> 04:48.350] John Vandiver, said, [04:48.350 --> 04:51.370] great hacking is just great system administration. [04:51.890 --> 04:53.790] That's living off the land, right? [04:53.990 --> 04:56.350] Living off the land is taking what the defense gives you [04:56.870 --> 04:59.190] to accomplish something you want to do. [04:59.710 --> 05:00.990] So I did it. [05:01.410 --> 05:03.110] So I'm going to break out the crayons a little bit. [05:03.110 --> 05:04.770] Like I said, I'm going to explain through this, [05:04.770 --> 05:06.070] and it's going to look weirdly weird. [05:06.070 --> 05:07.350] I'm going to snap something else on, [05:07.350 --> 05:08.690] and it's all going to click together. [05:09.510 --> 05:12.510] Breaking out the crayons, living off the land, [05:12.510 --> 05:16.090] finding new exploits, is all about one thing. [05:16.450 --> 05:19.450] What is the difference between the way you intended [05:19.450 --> 05:24.070] this application to be working and how it's actually designed? [05:24.750 --> 05:25.610] Right? [05:25.610 --> 05:30.170] I intended for this application to provide a login. [05:30.390 --> 05:32.810] As designed, it allows you to inject things [05:32.810 --> 05:35.210] into the login page and obtain access, right? [05:35.210 --> 05:36.790] That's how it works. [05:37.770 --> 05:39.990] Going back to that, sanitization of input, [05:39.990 --> 05:43.190] if I can tell one other thing to application developers, [05:43.190 --> 05:47.850] is that sanitization of input needs to happen on both sides, [05:47.850 --> 05:51.530] and any time information comes in and leaves. [05:51.850 --> 05:53.610] And there is more implication from that [05:53.610 --> 05:57.230] other than an API call or an HTTP request. [05:58.090 --> 05:59.510] And now this is what I'm saying, [05:59.510 --> 06:00.850] it's kind of about the network, [06:00.850 --> 06:02.910] but it's a fundamental lack of understanding. [06:03.030 --> 06:05.870] The lack of understanding of the OSI model. [06:06.770 --> 06:09.810] And trust me, there is no greater abuse in technology [06:09.810 --> 06:11.930] than the first hundred pages of every book you've ever read [06:11.930 --> 06:14.670] that explains the OSI model for the 900th time. [06:14.850 --> 06:15.530] Right? [06:15.630 --> 06:17.130] But it's actually important, [06:17.130 --> 06:18.490] and you should actually learn it, [06:18.490 --> 06:20.450] because I'm old. [06:20.450 --> 06:22.250] I feel like I'm coming back from the future [06:22.250 --> 06:24.590] to warn everybody about something that happened. [06:24.950 --> 06:27.430] I'm old, and some of the tricks I'm using [06:27.430 --> 06:30.410] are things that I've been using for 30 years. [06:31.450 --> 06:32.730] Because what happened? [06:32.730 --> 06:35.510] They were known about, nobody fixed them, [06:35.510 --> 06:37.750] it's like the last person standing in the room [06:37.750 --> 06:39.430] and everybody forgot that old knowledge, [06:39.430 --> 06:40.330] and when I wonder why that, [06:40.330 --> 06:42.790] it's just forgotten, it goes into the ether. [06:43.310 --> 06:44.510] And the last thing I tell people is [06:44.510 --> 06:46.570] sometimes you actually need to write the manual [06:46.570 --> 06:48.270] to explain it to people. [06:49.230 --> 06:51.410] So, here's the story. [06:51.410 --> 06:52.430] I'll give you the background story, [06:52.430 --> 06:54.390] how it got to this, and how it snaps together. [06:54.790 --> 06:57.190] So, ConnectWise Control and their applications [06:57.190 --> 06:59.630] are set for MSPs and large organizations [06:59.630 --> 07:01.130] to do endpoint management. [07:01.790 --> 07:02.190] Right? [07:02.330 --> 07:05.070] You've had some version, Kaseya, ConnectWise, [07:05.070 --> 07:06.070] there's all these different things [07:06.070 --> 07:07.670] that allow MSPs or large corporations [07:07.670 --> 07:10.190] to manage all their endpoints, jump in, yada, yada, yada. [07:10.670 --> 07:14.610] I began disclosing my work in October 22 to them. [07:15.850 --> 07:18.150] After disclosing it and being responsible, [07:18.150 --> 07:20.430] they started saying it was minimally impactful, [07:20.430 --> 07:22.350] but they still patched it. [07:23.850 --> 07:25.410] In addition to that, several IR firms, [07:25.410 --> 07:27.110] because a lot of people in that side of the world [07:27.110 --> 07:28.270] know me and came out to me and said, [07:28.270 --> 07:30.510] I heard you're on some hot stuff, can you tell me? [07:30.890 --> 07:32.350] I shared it and I always said, like, [07:32.350 --> 07:33.990] as I always say, I'll share what I know, [07:33.990 --> 07:35.610] just do me a favor, don't share it with anybody, [07:36.230 --> 07:38.750] keep it quiet until I talk about it. [07:38.770 --> 07:40.630] Because it's not a fame thing, [07:40.630 --> 07:42.430] this is actually a pretty big deal. [07:43.530 --> 07:47.570] After attempting this and being called overblown, [07:47.570 --> 07:49.390] ridiculous, whatever else, it's not a big deal, [07:49.390 --> 07:51.810] and after all the patching, I finally just said, [07:51.810 --> 07:52.930] I'm done with this. [07:53.150 --> 07:56.310] I'm going to MITRE and I'm just gonna ask for the CVEs. [07:56.490 --> 07:59.770] So after being called overblown, this wasn't a big deal, [07:59.770 --> 08:02.430] my CVEs were classified as a 9.8. [08:04.250 --> 08:07.930] Not only that, on December 1st, [08:07.930 --> 08:09.750] Krebs posted an article about it, [08:09.750 --> 08:11.930] how I publish a blog post around my findings, [08:11.930 --> 08:15.010] and coincidentally, ConnectWise released an advisory [08:15.010 --> 08:18.990] warning about phishing campaigns, client-side exploitation, [08:18.990 --> 08:21.690] and all these other things that bear a lot of similarities [08:21.690 --> 08:22.750] to what I did. [08:25.450 --> 08:27.490] I'm not here to talk about that, but I'll say this, [08:27.490 --> 08:29.150] all you really needed to do all of this [08:29.150 --> 08:30.490] is sitting there on the right-hand corner, [08:30.490 --> 08:32.070] I just never explained it to anybody. [08:32.550 --> 08:34.670] Because it was like, if this is the game [08:34.670 --> 08:36.650] that's gonna get played, I'm just gonna go talk about it [08:36.650 --> 08:37.730] and that's the end of it. [08:38.310 --> 08:40.170] Going a little further, a third-party company [08:40.170 --> 08:42.410] who did some analysis of this, [08:42.410 --> 08:45.550] posted a public analysis and comment on my work [08:45.550 --> 08:47.110] stating it wasn't a big deal. [08:47.150 --> 08:48.650] And I'm not here to talk about them, [08:48.650 --> 08:50.930] it's not the story about them, but I will say, [08:50.930 --> 08:52.930] there are a number of potential emissions and issues [08:52.930 --> 08:54.110] in this analysis. [08:54.770 --> 08:57.050] So instead of going in a fight with them, [08:57.050 --> 08:58.450] I checked their homework. [08:59.710 --> 09:02.190] So, there's your CVEs. [09:02.190 --> 09:03.610] One of the things I'll tell you is that analysis [09:03.610 --> 09:05.390] does not ever mention that those things are actually [09:06.430 --> 09:07.330] a little ridiculous. [09:07.330 --> 09:09.630] But, let's talk with it. [09:09.630 --> 09:11.730] How does living off the land start? [09:11.810 --> 09:14.070] It starts with understanding how things work. [09:14.590 --> 09:17.130] In the top left corner is basically your average, [09:17.130 --> 09:20.190] hey, this is a switching network with a router and firewall, [09:20.190 --> 09:21.990] bottom's the OSI model, the top right, [09:21.990 --> 09:23.450] I'm gonna explain it to you in a minute. [09:24.650 --> 09:28.150] But, living off the land is basically this. [09:28.470 --> 09:29.390] And you can read it. [09:29.390 --> 09:31.490] Taking advantage of things like, [09:31.490 --> 09:33.990] abusing PowerShell, Visual Basic, WMI, [09:33.990 --> 09:36.570] PS Exec, Mimikatz, [09:36.570 --> 09:38.230] all of these things that are allowed, [09:38.230 --> 09:40.610] exploits the functionality of a system [09:40.610 --> 09:43.930] to hijack it for nefarious purposes. [09:44.310 --> 09:46.130] That's living off the land. [09:46.610 --> 09:48.910] Abusing something you're given to do it. [09:49.570 --> 09:51.790] It may include tactics like DLL hijacking, [09:51.790 --> 09:54.550] hiding payloads, process dumping, downloading files, [09:54.550 --> 09:55.830] all these other things. [09:55.830 --> 09:58.470] Code execution, persistence, log evasion. [09:59.530 --> 10:04.410] These are all hallmarks of mega super APT groups, right? [10:04.750 --> 10:06.250] Like, oh, they do live off the land, [10:06.250 --> 10:07.350] they're gonna be detected. [10:07.350 --> 10:08.950] No, it's just knowing how a computer works. [10:08.950 --> 10:10.670] Nobody on my side of the house wants to tell you [10:10.670 --> 10:13.590] it's really as simple as knowing how to launch a command shell. [10:14.550 --> 10:17.290] So, after all of this and everything else, [10:17.290 --> 10:18.870] my work was repeatedly acknowledged [10:18.870 --> 10:21.490] as defeating controls, internally reproducible, [10:21.870 --> 10:24.130] sharing traits with APT groups, [10:24.130 --> 10:28.450] I directly disclosed it prior to any public notification by them, [10:28.450 --> 10:30.390] and it's being actively exploited. [10:31.890 --> 10:33.270] Keep that in mind. [10:33.750 --> 10:35.090] So why don't you ask yourself this, [10:35.090 --> 10:36.910] if I'm gonna build a botnet, [10:36.910 --> 10:39.670] what are the things that I really want? [10:40.270 --> 10:42.310] So, on the left-hand side, I want a port scanner, [10:42.310 --> 10:45.410] C2 beaconing, tunneling, arbitrary request handler, [10:45.410 --> 10:47.950] amazing hosting that doesn't go down, [10:47.950 --> 10:49.650] code signing, trusted execution, [10:49.650 --> 10:52.450] exfiltration, implantation, client-side exploitation. [10:52.610 --> 10:54.750] For me, that's a fully functioning botnet [10:54.750 --> 10:56.230] with all the tooling I need. [10:56.710 --> 10:58.750] On the right-hand side, what would I love to have? [10:58.750 --> 11:01.210] I'd love to be able to bypass everybody's firewall rules, [11:01.210 --> 11:03.870] something has no monitoring, poor user habits. [11:03.870 --> 11:05.910] I would love to get access to somebody else's [11:05.910 --> 11:07.990] trusted SSL and code signing certificates [11:07.990 --> 11:09.770] to sign my malware with. [11:10.390 --> 11:12.470] I want to drop catch domains, [11:12.470 --> 11:15.050] so I can catch people when their instances expire [11:15.050 --> 11:16.310] and I can phish them. [11:16.550 --> 11:18.570] I want to be able to send my phishing emails [11:18.570 --> 11:21.190] to a trusted SMTP source, [11:21.190 --> 11:22.670] like their hosted cloud instance [11:22.670 --> 11:25.850] that enables you to do all of that through a hosted solution. [11:26.950 --> 11:28.410] And this is the thing to think about, [11:29.070 --> 11:31.290] HTTP API protocol fuzzing. [11:31.470 --> 11:33.330] I'll show you how that works, [11:33.330 --> 11:36.670] but think about this in the context of your applications. [11:37.450 --> 11:39.270] With abusing a little trick [11:39.270 --> 11:41.770] with server-side request forgery, [11:41.770 --> 11:44.890] I have a really amazing little thing to show you. [11:44.890 --> 11:46.690] I want to bypass eight controls. [11:46.690 --> 11:49.470] This bypasses AV and EDR controls. [11:49.470 --> 11:50.670] I know it does. [11:51.390 --> 11:53.930] Even better, if all of this can be free to you, [11:53.930 --> 11:56.330] instead of spending thousands of dollars on hosting, [11:57.610 --> 12:01.390] and I really am after is getting code past everything. [12:01.390 --> 12:04.290] There's all those controls in place that make things stop happening. [12:04.510 --> 12:06.810] Now, what's perfect for that? [12:06.950 --> 12:08.250] RMM software. [12:08.670 --> 12:10.630] And I'm not picking on ConnectWise, [12:10.630 --> 12:12.890] because you can go look at my critical CVEs [12:12.890 --> 12:15.010] on all kinds of MSP software. [12:15.190 --> 12:17.170] Because say it happened in 2020, right? [12:17.590 --> 12:20.190] 2019, I alerted them to a very similar kind of issue [12:20.190 --> 12:21.970] and said, you've got to fix this. [12:22.150 --> 12:24.710] Why? Why do I go after this piece of software? [12:24.710 --> 12:26.050] It's poorly managed. [12:26.330 --> 12:29.270] People disable controls to make this work. [12:29.270 --> 12:30.930] And I'm going to show you a specific example [12:30.930 --> 12:32.430] for every one of these points. [12:32.570 --> 12:35.110] It provides system access in Windows. [12:35.550 --> 12:36.810] So I'm the colonel, right? [12:36.890 --> 12:37.790] Normal looking. [12:37.790 --> 12:39.110] So if I want to phish people, [12:39.110 --> 12:41.930] and I figure out who your MSP is, [12:41.930 --> 12:43.290] or your company is, [12:43.290 --> 12:46.050] I can just make it look like it came from them. [12:46.430 --> 12:47.510] Gives me access to everything. [12:47.510 --> 12:48.850] And here's the important part. [12:49.010 --> 12:51.890] I can either maintain persistence, [12:51.890 --> 12:53.310] or I can make it temporary [12:53.310 --> 12:56.250] and leave very few, if any, forensic IOCs. [12:56.490 --> 12:57.730] That's what I go after. [12:57.730 --> 12:59.250] I want to be not detected. [12:59.250 --> 13:02.730] And again, all of this is free. [13:03.330 --> 13:05.990] You don't need a dollar to your name [13:05.990 --> 13:08.070] to set all of this up. [13:09.750 --> 13:12.470] Now, let's talk about this. [13:13.550 --> 13:14.510] Many people... [13:14.510 --> 13:15.770] and this is... [13:15.770 --> 13:16.550] I'm talking about specific... [13:16.550 --> 13:17.150] but you've got to think about this [13:17.150 --> 13:18.450] in the context of your application, [13:18.450 --> 13:19.670] how you're designing things. [13:19.810 --> 13:21.470] People disable security controls [13:21.470 --> 13:25.150] because software is either over-designed, [13:25.150 --> 13:27.650] or there's deployment complexities. [13:27.650 --> 13:28.890] And what people try to do, [13:28.890 --> 13:29.670] which we all do, [13:29.670 --> 13:32.050] is design so it works absolutely everywhere, [13:32.050 --> 13:33.490] no matter the infrastructure. [13:33.970 --> 13:34.990] What you're looking at here [13:34.990 --> 13:36.630] is on the left-hand side, [13:36.630 --> 13:37.930] and I'll read it so you can't see it. [13:37.930 --> 13:40.890] It's a posting from a Zscaler forum, [13:40.890 --> 13:42.090] the support forum. [13:42.830 --> 13:44.510] I'm having problem with connectwise [13:44.510 --> 13:46.250] connecting to a direct IP. [13:46.250 --> 13:48.230] At the bottom there it says, [13:48.230 --> 13:49.510] oh, the way we fixed this [13:49.510 --> 13:51.690] was on our SSL inspection. [13:51.970 --> 13:53.690] We accepted and allowed [13:53.690 --> 13:56.150] asterisk.screenconnect.com [13:56.150 --> 13:57.550] but we should have used [13:57.550 --> 13:59.530] screenconnect.com. [14:00.070 --> 14:01.650] So, [14:01.650 --> 14:02.890] think about it this way. [14:02.890 --> 14:05.430] If you asterisk the domain name [14:05.430 --> 14:08.770] for disabling security controls, [14:08.770 --> 14:10.330] as long as I have [14:10.570 --> 14:12.010] a subdomain existing [14:12.010 --> 14:13.190] in there and resolving [14:13.190 --> 14:15.850] what has just happened, [14:15.850 --> 14:17.090] you have disabled [14:17.250 --> 14:19.590] all inspection of SSL [14:19.590 --> 14:22.130] for anything coming from there. [14:22.590 --> 14:24.190] That's really important. [14:24.330 --> 14:26.570] On the right-hand side, you have another one where it says, [14:26.570 --> 14:28.150] I'm having an oddball issue with screenconnect [14:28.150 --> 14:30.110] where the agent can't connect back to screenconnect [14:30.110 --> 14:31.650] so it just keeps retrying. [14:31.870 --> 14:33.830] If I disable, decrypt, and scan, [14:33.830 --> 14:35.550] it'll just work fine. [14:35.670 --> 14:37.670] I've whitelisted screenconnect.com [14:37.670 --> 14:39.390] including all domain names. [14:39.570 --> 14:41.410] And the bottom one is a moderator saying, [14:41.410 --> 14:43.830] please show a picture of the edit of this configuration. [14:46.720 --> 14:48.180] Starting to get it now? [14:49.060 --> 14:49.840] So, [14:49.840 --> 14:51.860] even further, [14:51.860 --> 14:53.500] there is really poor management [14:53.500 --> 14:55.760] of their cloud instances of [14:55.760 --> 14:57.940] registering FQDNs. [14:57.940 --> 14:59.520] What you're looking at is [14:59.520 --> 15:01.880] some company that I dug out of security trails [15:01.880 --> 15:03.880] that has a screenconnect.com [15:03.880 --> 15:05.560] subdomain for their old instance [15:05.560 --> 15:07.680] except it was retired [15:07.680 --> 15:09.160] for a year. [15:10.020 --> 15:12.060] I did some OSINT, I went out, [15:12.060 --> 15:13.440] I registered their domain [15:13.440 --> 15:16.020] to me, started a connectwise [15:16.020 --> 15:18.320] instance, and I now own their FQDN [15:18.320 --> 15:19.340] for it. [15:19.340 --> 15:21.120] So if you didn't go back [15:21.120 --> 15:23.200] and disable all of those changes [15:23.200 --> 15:25.180] that you made to your security [15:25.180 --> 15:27.660] controls for any of this, [15:27.660 --> 15:29.340] what have I just done? [15:30.440 --> 15:31.600] Right through. [15:32.140 --> 15:33.600] And I prove it. [15:33.900 --> 15:35.260] Further complicating [15:35.260 --> 15:37.720] this fact is that every single cloud instance, [15:37.720 --> 15:39.400] even trials, that you [15:39.400 --> 15:41.340] get, issues the [15:41.340 --> 15:43.260] same wildcard SSL [15:43.260 --> 15:45.280] certificate to absolutely every [15:45.280 --> 15:46.380] instance. [15:47.500 --> 15:48.540] Anybody do [15:48.540 --> 15:49.800] cryptography like me? [15:50.300 --> 15:52.240] What is the first rule of public-key [15:52.240 --> 15:54.220] cryptography? Control [15:54.220 --> 15:56.320] of the key and registration [15:56.320 --> 15:58.520] and knowing it. So this is a [15:58.520 --> 16:01.140] really good cert. It's a high-grade cert. [16:01.140 --> 16:02.820] So anybody, whether you're [16:02.820 --> 16:04.740] a corporate customer paying millions of dollars [16:04.740 --> 16:07.140] or whatever, or some idiot like me [16:07.140 --> 16:09.300] with some free time in a basement, [16:09.300 --> 16:10.840] I can go get the same SSL [16:10.840 --> 16:12.600] certificate for you. And remember, [16:12.600 --> 16:13.900] everybody's keying on the wildcard. [16:15.880 --> 16:16.640] And they [16:16.640 --> 16:18.540] don't inspect SSL either, do they? [16:19.060 --> 16:20.340] Awesome. [16:20.740 --> 16:22.220] So, there's another [16:22.220 --> 16:24.500] certificate that exists in all of this. [16:24.500 --> 16:26.220] A code-signing certificate. When you [16:26.220 --> 16:28.280] download their agent for installing [16:28.280 --> 16:30.420] these things, it's [16:30.420 --> 16:32.440] signed. But it's a [16:32.440 --> 16:34.640] click-once installer. [16:34.640 --> 16:36.520] And there is a small little space [16:36.520 --> 16:38.900] in here in which [16:38.900 --> 16:40.580] the code-signing certificate [16:40.580 --> 16:41.900] doesn't apply. It's [16:41.900 --> 16:43.680] an unregulated space [16:43.680 --> 16:46.700] in a signed executable. [16:46.700 --> 16:48.040] You're all AppSec people. [16:48.040 --> 16:50.180] Is that something you're supposed to do? [16:50.900 --> 16:52.000] How much is [16:52.000 --> 16:53.820] that cert now worth? [16:53.960 --> 16:55.520] Zero dollars. [16:56.300 --> 16:58.660] It's worth it. It doesn't do anything. [16:58.720 --> 17:00.020] I can go in there and edit [17:00.020 --> 17:02.040] that space and [17:02.040 --> 17:03.660] it won't break the certificate. [17:03.660 --> 17:06.740] So how are the two ways that EDR and AV work? [17:07.560 --> 17:08.420] Hash-banning [17:08.420 --> 17:10.680] and code-signing. [17:10.680 --> 17:12.640] By changing this space and [17:12.640 --> 17:14.640] injecting whatever I want in here, it changes the [17:14.640 --> 17:16.620] hash of the file. And that changes every [17:16.620 --> 17:18.180] time you start a session. [17:18.180 --> 17:20.080] So you can't hash-ban it. [17:20.080 --> 17:22.640] The only other trust control you can anchor this on, [17:22.640 --> 17:24.860] other than watching behavior, is a [17:24.860 --> 17:26.840] code-signing certificate that [17:26.840 --> 17:30.420] doesn't actually do anything. [17:30.420 --> 17:30.880] See how this [17:30.880 --> 17:34.620] is all starting to snowball a little bit? [17:34.620 --> 17:36.240] To make matters [17:36.240 --> 17:37.160] worse, the [17:37.160 --> 17:38.300] download of that signed executable [17:38.300 --> 17:40.480] that gives you system [17:40.480 --> 17:42.800] access, all these other things, or whatever, [17:42.800 --> 17:45.340] is transmitted via HTTP, [17:45.340 --> 17:46.440] which [17:46.440 --> 17:49.100] is plain text. [17:49.480 --> 17:50.400] So, by [17:50.400 --> 17:52.620] transmitting a [17:52.620 --> 17:55.380] weakly-signed, can't-hash-ban [17:56.080 --> 17:57.240] it executable [17:57.240 --> 17:59.580] over a network via plain text, [17:59.580 --> 18:01.220] I can essentially, without any [18:01.220 --> 18:03.020] social engineering or interaction, back [18:03.020 --> 18:09.250] door that thing when people are downloading. [18:09.250 --> 18:09.590] Not only that, you can [18:09.590 --> 18:11.290] man-in-the-middle-it, proxy it, or just [18:11.290 --> 18:13.550] directly edit the file and download [18:13.550 --> 18:15.810] it from anybody's public instance. [18:16.110 --> 18:17.610] Top right, left corner. [18:17.610 --> 18:19.510] This thing executed that malformed [18:19.510 --> 18:21.650] HTTP request to that IP address [18:21.650 --> 18:23.490] via that signed client that [18:23.490 --> 18:25.610] I manually edited and man-in-the-middle-ed [18:25.610 --> 18:28.310] and it worked. [18:28.450 --> 18:29.630] It executed [18:29.630 --> 18:31.610] an arbitrary HTTP [18:31.610 --> 18:33.510] request to a host [18:33.510 --> 18:35.330] of my designation inside [18:35.330 --> 18:37.290] of a signed executable. [18:37.910 --> 18:38.970] Checkmate, right? [18:40.070 --> 18:41.350] That's the first 10 [18:41.350 --> 18:43.370] seconds of this. Because [18:43.370 --> 18:45.690] all of these things violate the CIA triad. [18:46.290 --> 18:47.530] There's no integrity. [18:47.870 --> 18:49.190] You can use this to do some availability [18:49.190 --> 18:51.270] problems. It's in the CV, and it's [18:51.270 --> 18:53.130] definitely not maintaining cryptographic controls. [18:53.130 --> 18:55.290] So, I'm going to rewind a little [18:55.290 --> 18:57.610] bit and go back to third-party analysis. [18:58.090 --> 18:59.490] And I want to read this to you. [18:59.870 --> 19:01.350] Third-party companies are giving out some [19:01.350 --> 19:03.210] pretty flawed advice, and I don't think maybe they [19:03.210 --> 19:05.770] understand exactly how the AppSec or product works. [19:05.770 --> 19:07.630] I'm going to read you an analysis they had on [19:07.630 --> 19:09.810] another case to you, [19:09.810 --> 19:11.730] and I want you to put this together in your head. [19:12.050 --> 19:13.870] This simply means that hackers could register [19:13.870 --> 19:15.790] for trials of control and potentially [19:15.790 --> 19:17.570] serve malicious JavaScript from an [19:17.570 --> 19:20.210] asterisk.screenconnect.com domain. [19:20.550 --> 19:21.970] Theoretically, this could be a [19:21.970 --> 19:24.010] building block for other attack chains, [19:24.010 --> 19:27.930] but it's not worth losing sleep over. [19:27.930 --> 19:28.390] Because [19:28.390 --> 19:29.990] this happens, [19:29.990 --> 19:31.910] and they're wild-carding, [19:32.370 --> 19:33.690] control of any server in their [19:33.690 --> 19:35.450] cloud domain FQDN [19:35.450 --> 19:37.390] DNS zone, whether [19:37.390 --> 19:39.450] inflected or injected, [19:39.450 --> 19:41.410] will allow you to perform client-side [19:41.410 --> 19:43.270] exploitation and bypass [19:43.270 --> 19:45.810] browser controls. Why? [19:45.810 --> 19:47.410] We are allowing [19:47.410 --> 19:49.250] script access from [19:49.250 --> 19:52.090] asterisk.screenconnect.com. [19:52.090 --> 19:53.430] Right? [19:53.610 --> 19:55.650] It's not a theory. In fact, [19:55.650 --> 19:57.770] I'm giving you only one weaponized [19:57.770 --> 19:59.650] example of this. As long [19:59.650 --> 20:01.650] as you can figure out how to get something on [20:01.650 --> 20:03.850] that, it goes nuclear. [20:04.110 --> 20:05.670] Now, think about this in an AppSec [20:05.670 --> 20:08.650] perspective. I'm downloading an executable file, [20:08.650 --> 20:09.390] an agent, [20:09.390 --> 20:11.510] that doesn't have any effective [20:11.510 --> 20:13.230] framing mitigations. [20:13.450 --> 20:15.350] Does anybody know what that does? [20:15.470 --> 20:17.590] Download a file via a frame, and it's [20:18.170 --> 20:20.070] a no-click downloader. [20:20.070 --> 20:21.650] It will just download it [20:21.650 --> 20:23.710] because it's injected in a frame. [20:23.730 --> 20:25.430] So, if I can come up with a malicious [20:25.430 --> 20:27.630] agent, put it [20:27.630 --> 20:29.530] in another instance, and find [20:29.670 --> 20:31.470] a web page that I can inject content [20:31.470 --> 20:33.570] into, I can now [20:33.570 --> 20:35.670] install without a click [20:36.430 --> 20:37.590] an agent on [20:37.590 --> 20:39.050] anybody's computer. [20:39.930 --> 20:41.650] Which gives you access [20:41.650 --> 20:42.690] to everything. [20:44.070 --> 20:45.510] Now that you have this, [20:45.510 --> 20:47.610] you're probably asking yourself, how do I weaponize this? [20:47.610 --> 20:48.950] How do you live off the land? [20:49.370 --> 20:51.630] Well, living off the land is understanding how things work, [20:51.630 --> 20:53.550] right? So, why not [20:53.550 --> 20:55.350] just make it an unauthenticated, signed [20:55.350 --> 20:57.950] exploit factory and delivery method? [20:57.950 --> 20:59.790] It's a signed Windows executable [20:59.790 --> 21:02.030] that you can't hashband, [21:02.030 --> 21:04.010] that's always excluded, but not [21:04.010 --> 21:05.890] only that, it works across [21:05.890 --> 21:07.950] multiple operating systems, signed [21:07.950 --> 21:10.250] or unsigned. It executes [21:10.250 --> 21:12.010] arbitrary requests and other things [21:12.010 --> 21:14.230] that I'm not talking about to targeted endpoints. [21:14.890 --> 21:16.150] Because it's a network [21:16.150 --> 21:18.030] thing that goes back to a DNS [21:18.030 --> 21:19.990] name or an IP address, it [21:19.990 --> 21:21.970] resolves it and creates requests [21:21.970 --> 21:23.890] from it. It's an [21:23.890 --> 21:25.630] arbitrary HTTP [21:25.630 --> 21:27.530] or command [21:27.530 --> 21:29.610] executing application that's [21:29.610 --> 21:31.270] signed with somebody's legitimate [21:31.270 --> 21:33.550] sign, sir. Now, here's where it gets [21:33.550 --> 21:35.630] crazy. You already know about [21:35.630 --> 21:37.970] this, but look at the top right corner. [21:37.970 --> 21:39.910] As long as I have a [21:39.910 --> 21:41.810] cloud instance, an [21:41.810 --> 21:43.810] on-premise instance, I can [21:43.810 --> 21:45.710] sign executables with their [21:45.710 --> 21:48.110] code signing certificate. [21:48.110 --> 21:49.730] Even an unlicensed [21:49.730 --> 21:51.610] on-premise version of it that [21:52.170 --> 21:53.930] has a trial that was never licensed. [21:53.930 --> 21:55.490] Hint, hint. [21:56.950 --> 21:58.210] It works. [21:58.610 --> 22:00.530] So here's a signed exploit factory. [22:00.530 --> 22:01.430] I'm the guy who came up with the [22:01.430 --> 22:03.890] Endorubot one. I'm the one who came up with the Cisco Dell [22:03.890 --> 22:05.990] one that became a big problem. Why do [22:05.990 --> 22:07.950] I make every one of my exploits [22:07.950 --> 22:09.830] that are web-based, I try to get them to get [22:09.830 --> 22:11.910] requests. Because they're client [22:11.910 --> 22:14.450] deliverable. They're not posts. [22:14.450 --> 22:15.690] I just have to craft [22:16.030 --> 22:17.090] a good URL. [22:17.910 --> 22:19.930] So what you can do is [22:19.930 --> 22:21.790] embed my exploits, which give you [22:21.790 --> 22:23.990] remote code execution, complete control [22:23.990 --> 22:25.750] of network infrastructure, [22:25.750 --> 22:27.010] by bouncing it out of an [22:27.610 --> 22:28.510] executable, [22:30.330 --> 22:31.910] somebody downloads it, and because [22:31.910 --> 22:33.850] they're inside somebody's firewall, it [22:33.850 --> 22:36.050] will execute that to wherever I want. [22:36.050 --> 22:38.130] That's how you bypass a firewall. [22:38.790 --> 22:39.910] If you don't believe [22:39.910 --> 22:41.970] me and you want to test this out for yourselves, [22:42.350 --> 22:44.030] and that you can actually inject this, [22:44.310 --> 22:45.590] here's the exploit. [22:45.650 --> 22:48.090] This will compromise [22:48.090 --> 22:50.310] Cisco, Dell, Netgear, [22:50.310 --> 22:52.510] D-Link, Linksys, there's a whole slew [22:52.510 --> 22:54.690] of switches that have this. [22:54.930 --> 22:56.290] And it really is as simple as [22:56.290 --> 22:58.370] pointing to the right IP address, feeding it [22:58.370 --> 23:00.690] about 1,200 characters, [23:00.690 --> 23:02.610] and then putting a [23:02.610 --> 23:04.490] certain character in there, and it reboots [23:04.490 --> 23:06.590] the switch. Which [23:06.590 --> 23:09.030] stops all of your applications from working. [23:09.030 --> 23:11.690] But why would I give you that exploit [23:11.690 --> 23:13.390] as part of that? [23:13.390 --> 23:14.530] Because remember how I said you can [23:14.530 --> 23:16.690] man in the middle of the download? [23:16.690 --> 23:17.990] What do you need to do that? [23:17.990 --> 23:19.910] To roomful AppSec people, [23:19.910 --> 23:21.650] and they don't know this, this is important. [23:21.650 --> 23:24.490] What happens in the first 15 seconds you reboot a switch? [23:25.910 --> 23:27.710] ARP table flushes. [23:28.350 --> 23:30.530] What do you need to do man in the middle? [23:30.590 --> 23:32.430] Control of ARP and Mac. [23:32.750 --> 23:33.970] So if you want to test [23:33.970 --> 23:36.350] out man in the middle in the download, [23:36.350 --> 23:38.210] get a switch, send it that exploit, [23:38.210 --> 23:39.750] and do this, and you can completely [23:39.750 --> 23:41.790] recreate my work in about [23:41.790 --> 23:44.010] 10 seconds. Don't believe me? [23:44.010 --> 23:46.490] That's the default IP address for those switches. [23:46.490 --> 23:48.570] So what I do is I control external [23:48.570 --> 23:50.470] domains with internally resolvable IP [23:50.470 --> 23:52.770] addresses, like the default IP addresses for everybody's [23:52.770 --> 23:54.410] switch, or most of them. [23:54.730 --> 23:56.770] Spray them out, and eventually [23:56.770 --> 23:57.970] you're going to get a hit. [23:59.510 --> 24:00.630] Even more to the point, [24:00.630 --> 24:02.630] I'm not just talking about Windows executables, [24:02.630 --> 24:04.550] and this is important. I did a lot of work on this, nobody [24:04.550 --> 24:06.530] read it. I'm one of the leading exploiters [24:06.530 --> 24:08.550] of a format called JNLP, Java Network Launch [24:08.550 --> 24:10.710] Protocol. It actually launches Java [24:10.710 --> 24:12.610] and works across any operating system [24:12.610 --> 24:14.830] that has Java in it. So this injection [24:14.830 --> 24:16.910] problem doesn't just exist in the Windows [24:16.910 --> 24:19.090] executable. Every kind [24:19.090 --> 24:21.250] of agent, EXE, [24:21.250 --> 24:22.990] DBN, Windows, [24:23.670 --> 24:25.030] Linux, they all [24:25.030 --> 24:27.170] suffer from this problem where you can inject [24:27.170 --> 24:28.590] into space like this [24:28.590 --> 24:31.030] to get it to do these things. [24:31.030 --> 24:33.930] All this is, is a downloader. [24:34.010 --> 24:35.130] Like a click once [24:35.130 --> 24:37.150] installer. It just goes out and retrieves [24:37.150 --> 24:39.070] something, but I have control [24:39.070 --> 24:41.090] of what it retrieves. [24:41.450 --> 24:42.950] So, now that you have [24:42.950 --> 24:45.030] all that, how do you [24:45.030 --> 24:47.030] actually exploit this in a meaningful way? [24:48.370 --> 24:49.030] What if I [24:49.030 --> 24:50.850] did have a way to theoretically inject [24:50.850 --> 24:52.890] things into ScreenConnect.com's domain without [24:52.890 --> 24:53.990] them ever knowing? [24:56.150 --> 24:56.890] So put that [24:56.890 --> 24:58.750] aside for a second and look at this. [24:59.270 --> 25:01.370] You have this malicious code factory, [25:01.370 --> 25:03.050] how do I start delivering it? And remember [25:03.050 --> 25:04.870] all those tools I told you I built out? How [25:04.870 --> 25:07.330] do I do it? So here's my moment. [25:08.070 --> 25:08.890] For the past [25:08.890 --> 25:11.150] year, I have been routing, [25:11.150 --> 25:13.510] abusing, using the ConnectWise [25:13.510 --> 25:14.430] cloud service [25:15.150 --> 25:16.490] under their noses. [25:16.910 --> 25:19.390] After informing them of this, [25:19.390 --> 25:20.990] and I've been collecting POC for [25:20.990 --> 25:23.130] C2 beaconing, bypassing firewall [25:23.130 --> 25:25.370] rules, tunneling malicious files, [25:25.370 --> 25:27.510] creating a giant DDOS cannon, [25:27.510 --> 25:28.890] botnet creation, client-side [25:28.890 --> 25:31.050] exploitation, port scanning and API access [25:31.050 --> 25:33.250] to external and internal [25:33.250 --> 25:35.270] hosts at ConnectWise. [25:36.070 --> 25:36.690] Arbitrary [25:36.690 --> 25:39.310] HTTP requests on arbitrary ports [25:39.310 --> 25:41.490] and exfiltration and implantation of malicious [25:41.490 --> 25:43.790] code. How did I do it? [25:44.030 --> 25:45.730] Because of one web page [25:46.450 --> 25:47.630] and how that software [25:47.630 --> 25:49.370] works. Why? [25:49.570 --> 25:51.570] Because software developers don't know [25:51.570 --> 25:53.010] how a network works. [25:53.310 --> 25:55.450] I'm going to explain it, it's going to look all complex [25:55.450 --> 25:58.070] but I did it a really simple way here. [25:58.130 --> 25:59.350] All you really need [25:59.350 --> 26:01.470] are three GET requests. [26:01.930 --> 26:03.490] If you look at this, the top [26:03.490 --> 26:05.250] one is how I made it into a port scanner [26:05.250 --> 26:07.210] and an arbitrary HTTP [26:07.210 --> 26:08.870] and API fuzzer. [26:08.870 --> 26:10.890] The second one is a content brooder [26:10.890 --> 26:12.790] you can use like Durabuster [26:12.790 --> 26:14.850] to scan people's things. [26:14.970 --> 26:17.090] And the last one is a client-side exploitation [26:17.090 --> 26:18.990] method of something I'm going to show you that I've never [26:18.990 --> 26:20.370] showed anybody before. [26:20.890 --> 26:22.930] Or you can just go to my [26:23.670 --> 26:25.090] GitHub and I'll give you the Python [26:25.090 --> 26:27.130] scripts. As you'll see, none of this [26:27.130 --> 26:29.130] requires anything other than a knowledge of the things on the [26:29.130 --> 26:31.170] left-hand side. Doesn't require a credit [26:31.170 --> 26:33.170] card. Actually, I host all [26:33.170 --> 26:35.510] of my stuff in ScreenConnect's own cloud. [26:35.510 --> 26:37.970] I registered for a trial instance anonymously [26:38.670 --> 26:39.570] and I've been hosting [26:39.570 --> 26:41.970] it for a long time. [26:43.090 --> 26:43.710] I'm hosting [26:43.710 --> 26:45.290] everything out of Amazon EC2 [26:45.290 --> 26:46.750] for free. [26:47.550 --> 26:49.270] And I'm going to give you the free Python scripts. [26:49.270 --> 26:51.330] In fact, if you take pictures, I have them all up here for you. [26:51.690 --> 26:53.430] So it starts with this web page. [26:55.430 --> 26:56.090] Oh. [26:58.470 --> 26:59.870] My battery's getting cut out. [26:59.870 --> 27:00.570] Hold on. [27:07.560 --> 27:09.200] Ah, there we go. Okay, sorry. [27:09.200 --> 27:10.760] My battery was going out. [27:10.960 --> 27:12.420] This page. [27:12.680 --> 27:14.960] How do you live off the land with ScreenConnect? [27:15.060 --> 27:17.360] If you go to that web page right now, [27:17.360 --> 27:19.760] I'm pretty sure it's still up. [27:20.980 --> 27:23.020] What is this page? Remember the difference between [27:23.020 --> 27:25.840] intended and as designed? [27:26.420 --> 27:27.480] So this is the intended design. [27:27.480 --> 27:29.320] Use our port test tool to determine the external [27:29.320 --> 27:31.500] accessibility of your ScreenConnect instance. [27:31.500 --> 27:33.020] If you have changed ports or are hosting [27:33.020 --> 27:35.080] at a different IP or host name, you'll need [27:35.080 --> 27:36.720] to change those values accordingly. [27:36.720 --> 27:39.080] So ask yourself this. [27:39.280 --> 27:40.740] What happens when I submit this [27:40.740 --> 27:41.860] post request? [27:42.320 --> 27:45.360] I control the DNS record, I control the port. [27:45.880 --> 27:47.700] The answer is this. [27:47.800 --> 27:49.100] I can control the port [27:49.100 --> 27:50.800] the request goes to, [27:50.800 --> 27:52.740] the host it goes to, [27:52.740 --> 27:54.800] and it's not coming [27:54.800 --> 27:56.560] from my IP address. [27:57.040 --> 27:59.460] It's a server-side request forgery. [27:59.460 --> 28:00.880] If you look it up, it's coming [28:00.880 --> 28:02.820] from their IP address. [28:03.680 --> 28:04.740] And I'm doing this over [28:04.740 --> 28:07.440] an anonymous VPN. [28:07.600 --> 28:08.840] So think about what's [28:08.840 --> 28:09.520] happening. [28:09.900 --> 28:12.620] When I submit this request, [28:12.620 --> 28:14.720] the server receives this request from me, [28:14.720 --> 28:15.760] get or post. [28:15.760 --> 28:18.700] The server at 52.202.11.141 [28:18.700 --> 28:19.820] processes that record [28:19.820 --> 28:23.540] and performs three to five DNS requests. [28:24.400 --> 28:26.460] It then creates a new HTTP [28:26.460 --> 28:27.220] request [28:28.000 --> 28:29.920] to the user control port [28:29.920 --> 28:33.460] and it's coming from the targeted IP address. [28:33.460 --> 28:35.280] So if you have a firewall [28:35.280 --> 28:39.080] that says asterisk.screenconnect.com [28:39.080 --> 28:41.500] you have whitelisted everything [28:41.500 --> 28:42.840] coming out of this. [28:43.780 --> 28:45.720] Make sense? Follow me so far? [28:45.720 --> 28:46.420] Alright. [28:46.800 --> 28:49.080] The page then returns a status of this. [28:49.080 --> 28:51.200] So the web server one, it just says succeeded. [28:51.640 --> 28:53.560] So if it connected, it got a 200 code [28:53.560 --> 28:54.800] it says succeeded. [28:55.100 --> 28:57.180] It's a blind SSRF, right? [28:58.620 --> 28:59.420] Okay. [29:00.000 --> 29:01.140] As intended, [29:01.140 --> 29:03.120] this is designed to let users of the software [29:03.120 --> 29:04.860] test ports and HTTP access [29:04.860 --> 29:07.420] no matter where they are. It's a diagnostic tool. [29:07.600 --> 29:09.320] Because people change ports [29:09.320 --> 29:11.140] in DNS or they use dynamic DNS [29:11.140 --> 29:12.560] for this, they change it. [29:12.560 --> 29:15.340] So the diagnostic tool has to be able to do that. [29:15.700 --> 29:16.940] It's unauthenticated [29:16.940 --> 29:19.220] and totally public because an MSP [29:19.220 --> 29:21.740] or a large corporate customer might need to test this. [29:22.080 --> 29:23.860] Now put this together in your head. [29:23.860 --> 29:25.060] What do you think the egress [29:25.060 --> 29:27.220] firewall rules on that host are? [29:27.980 --> 29:29.260] If you can scan on [29:29.260 --> 29:31.300] any port going [29:31.300 --> 29:33.320] out, what are [29:33.320 --> 29:35.160] the firewall rules going out? [29:36.120 --> 29:37.180] Okay. [29:37.660 --> 29:39.480] All ports are open. [29:39.720 --> 29:40.420] Got it? [29:40.420 --> 29:43.240] So what's happening is it's creating [29:43.380 --> 29:45.280] a DNS request. Going deep [29:45.280 --> 29:47.420] into this, I don't want to go too deep into it, [29:47.420 --> 29:49.320] but just understand it's three to five [29:49.320 --> 29:51.860] DNS requests and then the HTTP request. [29:52.280 --> 29:53.140] It's also [29:53.140 --> 29:55.340] effectively operating as a proxy [29:55.340 --> 29:57.180] for me. Every server side [29:57.180 --> 29:59.100] request forgery is a proxy. [29:59.120 --> 30:01.060] It's a limited proxy, [30:01.060 --> 30:03.820] but it is indeed proxying traffic. [30:05.000 --> 30:06.940] So working as designed, [30:06.940 --> 30:09.300] this is a port scanner, [30:09.580 --> 30:12.120] a proxy, a firewall bypass, [30:12.120 --> 30:13.160] backdoor access to [30:13.160 --> 30:15.280] people's HTTP and API. [30:15.760 --> 30:17.140] Remember how it's generating five [30:17.140 --> 30:19.040] to seven requests every time and it doesn't [30:19.040 --> 30:21.040] do any sort of rate limiting? [30:21.220 --> 30:23.060] That's a DDoS attack. Just [30:23.060 --> 30:25.260] flood it. Trust me. [30:25.260 --> 30:27.160] You can do C2 beaconing. [30:27.160 --> 30:28.700] You can enumerate content. [30:28.840 --> 30:31.240] You can fish from it. It bypasses AV [30:31.240 --> 30:33.160] because everybody's disabling this stuff. [30:33.440 --> 30:35.160] I have the malicious code signing thing [30:35.160 --> 30:36.700] and I now have access [30:37.260 --> 30:39.360] to ConnectWise's internal network. [30:40.660 --> 30:41.280] Who wants [30:41.280 --> 30:42.580] to call me on that one? [30:43.620 --> 30:45.200] I will explain why in a minute, [30:45.200 --> 30:47.060] but look on the bottom right hand corner. [30:47.100 --> 30:48.860] That's a port scan script I wrote, [30:48.860 --> 30:50.260] abusing that function. [30:50.780 --> 30:53.220] Do you see that lb.corp.xyz? [30:53.220 --> 30:55.760] Here's one of my nefarious things that I never tell developers. [30:55.880 --> 30:57.200] None of you actually likes to go [30:57.200 --> 30:59.080] look at DNS requests, especially externally [30:59.080 --> 31:01.120] injected ones, so I maintain [31:01.260 --> 31:02.660] a bunch of really funny zones. [31:02.900 --> 31:05.260] Corp.xyz is one that a lot of corporations [31:05.260 --> 31:07.160] used to use, but if you query [31:07.600 --> 31:09.260] lb.corp.xyz [31:09.260 --> 31:13.260] it resolves to 127.0.0.1. [31:15.460 --> 31:16.920] Making sense now? [31:17.480 --> 31:18.860] But I'm not going to get there yet. [31:18.860 --> 31:20.300] What I want to get there is this. [31:20.300 --> 31:22.740] Two one-way communication channels [31:22.740 --> 31:24.360] equal one two-way [31:24.360 --> 31:25.860] communication channel. [31:26.500 --> 31:28.540] I got this way, this way, [31:28.540 --> 31:30.520] all I'm really doing is three lights [31:30.520 --> 31:31.840] make a left turn. [31:32.420 --> 31:34.460] I turned this into [31:34.460 --> 31:36.240] an effective C2 exfiltration [31:36.240 --> 31:38.300] DNS and HTTP beacon, similar [31:38.300 --> 31:40.320] to HTTP exfiltration [31:40.320 --> 31:42.180] like staging, or Iodine [31:42.180 --> 31:44.100] C2, which is DNS based. [31:44.620 --> 31:46.400] How did I do it? [31:46.400 --> 31:47.920] I just encoded [31:47.920 --> 31:49.840] in that HTTP [31:49.840 --> 31:52.100] request that gets generated, I added [31:52.300 --> 31:54.660] a base64 payload to the end of it. [31:54.940 --> 31:55.820] Sent it [31:55.820 --> 31:57.580] to an external host [31:59.140 --> 32:00.040] and if you [32:00.040 --> 32:02.600] decrypt it, it says cyber POC. [32:02.660 --> 32:04.120] That's a message encoded [32:04.120 --> 32:06.120] over base64, exfiltrated [32:06.120 --> 32:07.500] through a trusted host [32:07.500 --> 32:10.080] and signaling something to me [32:10.080 --> 32:11.760] in a way they've never found. [32:12.380 --> 32:13.940] Instant win. [32:14.020 --> 32:16.580] What happens when you're requesting that? [32:16.580 --> 32:18.560] It sends that request via user [32:18.560 --> 32:20.740] control port as their IP address. [32:20.740 --> 32:22.340] This is going to get very important. [32:22.400 --> 32:24.420] Not my IP address. [32:24.580 --> 32:26.940] Good luck doing forensics on that. [32:26.940 --> 32:29.240] Good luck doing IR on that. [32:29.480 --> 32:30.480] How I'm creating [32:30.480 --> 32:32.820] an arbitrary HTTP generator [32:32.820 --> 32:34.620] is, at the end [32:34.620 --> 32:36.540] of that web server box, you [32:36.540 --> 32:38.680] can actually put slashes and restful [32:38.680 --> 32:40.520] stuff, but as long as you [32:40.520 --> 32:42.740] put the anchor tag at the end of it, [32:42.740 --> 32:44.580] it snips off all the other [32:44.580 --> 32:46.700] stuff at the end that they add on, [32:46.700 --> 32:48.700] making it a completely arbitrary [32:48.700 --> 32:50.860] HTTP request generator. [32:51.540 --> 32:52.980] Why the anchor tag? [32:53.360 --> 32:54.860] What does it do in a browser? [32:54.860 --> 32:56.660] You guys disregard it because it's an anchor tag [32:56.660 --> 32:58.200] for the browser. Not for that. [32:58.200 --> 32:59.640] They're snipping it off. [32:59.680 --> 33:02.380] So all you need to do is put in that web server host, [33:02.380 --> 33:04.820] the FQDN, whatever the URL is, [33:04.820 --> 33:05.320] and put an [33:06.260 --> 33:08.280] anchor tag at the end, and it's going to forward out [33:08.280 --> 33:09.540] that exact thing. [33:10.040 --> 33:12.900] I told them about this in December of 2022, [33:12.900 --> 33:14.820] and as of July [33:14.820 --> 33:16.960] 15th, the day I got the acceptance from [33:16.960 --> 33:19.000] the CFP, I immediately generated [33:19.000 --> 33:20.880] this to prove it was still possible. [33:22.100 --> 33:22.720] AppSecVillage, [33:23.040 --> 33:25.120] a-v-s-v-d-c-31, [33:25.120 --> 33:26.940] and if you decrypt the base64 value [33:26.940 --> 33:28.920] in there, it has a funny little message for you. [33:29.280 --> 33:31.000] Proof of concept. I get the F [33:31.000 --> 33:32.980] out. There it is. I'm [33:32.980 --> 33:34.520] not even done. This is the beginning. [33:34.780 --> 33:36.820] If you see this right here, it says succeeded, right? [33:36.820 --> 33:39.200] It's giving me a message. It definitely connected, right? [33:39.780 --> 33:40.900] So what happens if [33:40.900 --> 33:43.200] I start feeding that form malicious input? [33:44.980 --> 33:47.260] Like the loopback interface. [33:48.280 --> 33:49.040] This is [33:49.040 --> 33:50.780] an external and internal port scanner [33:50.780 --> 33:52.960] because it's [33:52.960 --> 33:54.920] coming from that host. [33:54.960 --> 33:56.860] All you need to do, and there's the Python script [33:56.860 --> 33:59.000] for doing it, is to basically [33:59.000 --> 34:01.040] iterate through every port [34:01.040 --> 34:03.780] for your target host, [34:03.780 --> 34:05.040] parse the return message [34:05.040 --> 34:06.740] it gives you in that page, [34:06.740 --> 34:08.460] and that's a port scanner. [34:09.200 --> 34:10.540] If you have gone [34:10.540 --> 34:11.600] out to your firewall [34:12.360 --> 34:14.500] and disabled controls [34:14.500 --> 34:16.400] or allowed firewall [34:16.400 --> 34:19.520] rules from asterisk.screenconnect.com, [34:19.520 --> 34:20.700] what have you done? [34:20.700 --> 34:22.500] You've given me backdoor [34:22.500 --> 34:24.560] access because it's [34:24.560 --> 34:26.540] coming from somebody else's IP. [34:26.760 --> 34:28.520] Don't believe I'm scanning the inside [34:28.520 --> 34:30.600] of their network? Here you go. [34:30.600 --> 34:31.980] Here's the URL. [34:31.980 --> 34:34.760] If you use lb.corp.xyz [34:34.760 --> 34:36.480] on the relay one, put in [34:36.480 --> 34:38.280] the port box 3389 [34:38.280 --> 34:40.600] and click test. [34:40.640 --> 34:42.800] Whatever you put in that teleprompter, [34:42.800 --> 34:44.580] Ron Burgundy is going to read. [34:44.660 --> 34:46.080] It resolves to [34:46.080 --> 34:48.340] 127.0.0.1 [34:48.340 --> 34:50.260] and it performs a TCP [34:50.260 --> 34:52.540] connection to 3389. [34:53.880 --> 34:54.760] Is that [34:54.760 --> 34:56.560] externally accessible? No, it is [34:56.560 --> 34:57.520] not. [34:57.780 --> 34:59.320] I win. [35:00.500 --> 35:02.260] And it all comes because [35:02.260 --> 35:04.580] nobody understands the OSI [35:04.580 --> 35:06.360] model. This is an [35:06.360 --> 35:08.460] application using the network, but nobody [35:08.460 --> 35:10.400] really thinks of what the network's doing. [35:10.520 --> 35:13.180] Web applications are layer 7. [35:13.580 --> 35:14.820] Network security [35:14.820 --> 35:16.400] and that kind of stuff is [35:16.400 --> 35:17.860] layer 2 and 3. [35:18.540 --> 35:20.420] All of the things that I'm bypassing are [35:20.420 --> 35:22.500] not anything web application developers tend to [35:22.500 --> 35:24.480] think about. So, how [35:24.480 --> 35:26.540] did I do this? How am I scanning behind [35:26.540 --> 35:29.280] people's firewalls, beyond VLANs? [35:29.480 --> 35:30.520] The only connectivity [35:30.520 --> 35:32.880] between those two, [35:32.880 --> 35:34.940] their internal network, me, [35:34.940 --> 35:37.100] other ones, is a layer 7 [35:37.100 --> 35:38.060] traffic crafter [35:38.760 --> 35:40.940] that is available on multiple [35:40.940 --> 35:42.280] subnets. [35:43.300 --> 35:44.040] Right? [35:44.620 --> 35:46.880] It's weakly controlled and because I [35:46.880 --> 35:48.940] can inject external IP [35:48.940 --> 35:50.800] addresses in, or internal IP [35:50.800 --> 35:52.800] addresses to external DNS, [35:52.800 --> 35:54.720] if I feed it one of their internal [35:54.720 --> 35:57.120] IP addresses for their cloud instance, [35:57.120 --> 35:58.900] I am now tunneling HTTP [35:58.900 --> 36:00.640] traffic or regular traffic [36:00.640 --> 36:03.360] to stuff inside their firewall. [36:04.220 --> 36:04.900] Does that make [36:04.900 --> 36:07.100] sense? Not difficult, right? [36:07.200 --> 36:08.440] Am I overblown? [36:08.440 --> 36:10.200] I don't think so, right? [36:10.380 --> 36:12.520] I should not be able to do this under [36:12.520 --> 36:15.320] any circumstances. Ever. [36:15.380 --> 36:16.180] Period. [36:17.800 --> 36:18.840] So, there's your Python [36:18.840 --> 36:20.660] script for doing it and that's how I scanned [36:20.660 --> 36:22.220] their internal network with it. [36:22.960 --> 36:24.760] So, you're probably at this point, great, you got a couple tools, [36:24.760 --> 36:25.720] what's the big deal? [36:26.180 --> 36:28.820] This is a blind server side request forgery, right? [36:28.820 --> 36:30.340] Incorrect. [36:30.340 --> 36:33.280] Everything is a proxy if you try hard enough. [36:33.440 --> 36:34.580] Exactly. [36:34.680 --> 36:35.740] Okay. [36:35.980 --> 36:38.540] Well, when the content on the other side isn't [36:38.540 --> 36:40.620] available, it actually [36:40.620 --> 36:42.220] returns the HTTP [36:42.700 --> 36:44.660] status code to you of [36:44.660 --> 36:46.320] what just happened. [36:46.500 --> 36:48.260] So, my arbitrary HTTP [36:48.660 --> 36:50.380] request is now [36:50.380 --> 36:52.380] getting back HTTP [36:52.380 --> 36:54.620] status codes telling me what [36:54.620 --> 36:56.460] happened. Isn't that [36:56.460 --> 36:58.540] Durabuster? Isn't that [36:58.640 --> 37:00.300] a brute force content enumerator? [37:01.060 --> 37:02.460] So, if you want to enumerate [37:02.460 --> 37:04.460] the content of anything, [37:05.040 --> 37:06.480] there's my Python script. If you look [37:06.480 --> 37:08.520] at the bottom, you just need a file with all your [37:08.520 --> 37:10.600] directory names called content.txt [37:11.480 --> 37:12.680] and it'll go through [37:12.680 --> 37:14.580] and you'll get reliable return [37:14.580 --> 37:16.680] codes out of all that. So, it's not so blind anymore, [37:16.680 --> 37:17.440] is it? [37:18.760 --> 37:20.440] Okay, here's the new thing that I [37:20.440 --> 37:22.380] invented. I'm pretty sure I invented it. [37:22.380 --> 37:24.740] Nobody knows. I've looked around about it. [37:24.740 --> 37:26.720] Here's the crazy part, and this is one [37:26.720 --> 37:28.460] of the things I know from 1980-something [37:28.460 --> 37:30.900] or 90-something, sorry, more accurate. [37:31.500 --> 37:32.780] Nobody actually [37:32.780 --> 37:34.640] cares about the content of [37:34.640 --> 37:36.820] HTTP status codes. [37:37.220 --> 37:38.660] Right? How many [37:38.660 --> 37:40.820] of you are actually saving anything [37:40.820 --> 37:43.200] other than the three-digit numerical? [37:44.100 --> 37:45.060] Right? [37:46.140 --> 37:46.820] That's [37:46.820 --> 37:49.100] IIS. That's Apache. [37:49.100 --> 37:50.500] All they ever keep [37:50.500 --> 37:52.580] are the three-digit status [37:52.580 --> 37:55.140] codes. Now, here's the secret. [37:56.240 --> 37:56.760] They [37:56.760 --> 37:57.660] are entirely [37:58.680 --> 38:00.240] attacker controllable. [38:01.560 --> 38:02.720] I saw you look. [38:02.720 --> 38:04.440] I'm going to prove it. Hold on. [38:04.980 --> 38:06.800] Those status codes, the text [38:06.800 --> 38:08.480] 200, okay, [38:08.480 --> 38:10.520] 400, all those, the text that [38:10.520 --> 38:11.420] appears after it [38:12.420 --> 38:14.500] is not saved. Nobody looks [38:14.500 --> 38:16.640] at it. Nobody wants to keep it. [38:16.680 --> 38:18.580] So, what you can actually do [38:19.260 --> 38:20.300] is inject [38:20.300 --> 38:22.180] payloads into that [38:22.180 --> 38:24.440] message, and if something [38:24.440 --> 38:26.460] returns the text of that message [38:26.460 --> 38:28.300] to you via server-side request [38:28.300 --> 38:30.240] forgery, what have I just [38:30.240 --> 38:32.040] done? I am now [38:32.040 --> 38:34.340] directly injecting into [38:34.340 --> 38:35.660] their web pages [38:36.300 --> 38:38.360] my content hosted somewhere [38:38.360 --> 38:40.420] else. Remember [38:40.420 --> 38:42.620] that agent download? Going to become important. [38:43.360 --> 38:44.260] It leaves [38:44.260 --> 38:46.400] very few IOCs because nobody actually has [38:46.400 --> 38:48.280] that, but think about it this way. [38:48.280 --> 38:50.220] The IOCs that could tell you where that [38:50.220 --> 38:52.240] is are on a third-party [38:52.240 --> 38:54.380] server, and it... [38:54.380 --> 38:55.920] I'm not going to speak... [38:55.920 --> 38:58.120] It doesn't appear that they're monitoring this [38:58.120 --> 39:00.300] because I've been doing it for a year, [39:00.300 --> 39:02.300] and I've never been stopped. [39:03.560 --> 39:04.460] That code, [39:04.460 --> 39:06.020] right? So, I invented my own [39:06.020 --> 39:07.580] HTTP status code called [39:08.280 --> 39:09.140] 666. [39:13.040 --> 39:14.160] HTTP status [39:14.160 --> 39:16.140] code 666 did not exist before [39:16.140 --> 39:17.680] this moment, but [39:17.680 --> 39:20.160] I am injecting into, as part [39:20.160 --> 39:21.960] of that code, my [39:21.960 --> 39:24.480] malicious page, or my malicious content. [39:24.600 --> 39:26.160] All the controls that are supposed [39:26.160 --> 39:28.040] to keep you from cross-site scripting and all those [39:28.040 --> 39:30.420] other things immediately disappear. What? [39:30.420 --> 39:32.200] Because this is directly integrated [39:32.200 --> 39:34.520] into that web page's content. [39:34.900 --> 39:35.600] It's not... [39:35.960 --> 39:38.120] It's proxying it, but it's not like sending it directly [39:38.120 --> 39:40.280] through. It's taking it, integrating it into that page [39:40.280 --> 39:42.320] as its own web page code [39:42.320 --> 39:44.000] and going. [39:45.200 --> 39:46.000] Right? [39:46.640 --> 39:48.000] Now, look at the thing at the bottom. [39:48.000 --> 39:50.300] We used asterisk.screenconnect.com, [39:50.300 --> 39:52.440] but we should have used screenconnect.com. [39:52.700 --> 39:54.200] So, all of this is hosted, [39:54.200 --> 39:55.220] or you can inject it through [39:55.220 --> 39:58.880] www.screenconnect.com. [39:59.680 --> 40:00.080] So, is [40:00.080 --> 40:02.200] it a theory that I have a way of injecting malicious [40:02.200 --> 40:04.080] code into anything on their pages? [40:04.680 --> 40:05.880] Absolutely not. [40:06.080 --> 40:08.100] So, all you really need to do is serve [40:08.560 --> 40:10.440] 666 as your error code, [40:10.440 --> 40:12.800] put in a cross-site scripting payload, [40:12.800 --> 40:15.260] and that is the world's simplest XSS. [40:15.500 --> 40:16.800] What you need is the [40:16.800 --> 40:18.820] Python listener to do this. [40:19.180 --> 40:21.440] And it's on the left-hand side. That's the code. [40:21.820 --> 40:23.020] So, all I did, [40:23.020 --> 40:24.800] because their post requests can also [40:24.800 --> 40:26.760] be submitted as GET requests, [40:26.760 --> 40:28.640] I now have a client-deliverable [40:29.200 --> 40:30.140] single URL [40:30.760 --> 40:33.020] that will trigger all of this reliably. [40:33.960 --> 40:34.720] Oh, wow, Ken, [40:34.720 --> 40:35.880] you popped a one. [40:36.400 --> 40:37.880] Get a lot more than that. [40:38.860 --> 40:40.480] You can do all of this [40:41.420 --> 40:42.420] just by doing that. [40:42.420 --> 40:43.720] And that's the web page code. [40:43.720 --> 40:46.400] I'm returning 666 via [40:46.400 --> 40:48.180] that code, but if you see here in the input [40:48.180 --> 40:50.220] field at the bottom where I highlighted it, [40:50.220 --> 40:52.300] it's directly integrated into [40:52.300 --> 40:53.720] the web page code. [40:54.840 --> 40:56.220] Your browser thinks [40:56.220 --> 40:58.320] this is legitimate content coming from [40:58.460 --> 40:59.640] a trusted source. [41:01.240 --> 41:02.520] So, how do you enumerate this? [41:02.520 --> 41:04.300] How do you find this cool new way [41:04.300 --> 41:05.180] of doing it? [41:06.220 --> 41:08.260] I'm a big proponent of none of our information [41:08.260 --> 41:10.300] or knowledge should be secret or esoteric [41:10.920 --> 41:12.440] and this isn't all that hard to do [41:12.440 --> 41:14.120] all this stuff, it's a matter of logic. [41:14.300 --> 41:16.100] So, I like using free tools instead of [41:16.100 --> 41:18.320] telling you to pay $15,000 for something. [41:18.320 --> 41:20.120] It's very simple. There is a diagnostic [41:20.120 --> 41:21.360] web page on the internet called [41:22.440 --> 41:23.640] httpstat.us. [41:23.780 --> 41:26.480] Whatever you put in the URL, it will return the error code [41:26.480 --> 41:28.160] for whatever you put in there. [41:28.160 --> 41:30.740] So, if you put 418 at the end of that, [41:30.740 --> 41:32.300] it'll return a 418 code. [41:32.300 --> 41:34.200] How many people know what a 418 code is? [41:34.200 --> 41:36.920] How many people have actually ever used that in the real world? [41:36.920 --> 41:39.380] Okay, you're like the three people I've ever met [41:39.380 --> 41:41.480] that have ever actually used this for anything. [41:41.820 --> 41:43.460] You're not a teapot. [41:43.460 --> 41:44.780] You're a proxy. [41:45.620 --> 41:46.880] Because if your [41:46.880 --> 41:48.780] blind server-side request forgery [41:48.780 --> 41:50.660] returns 418, [41:50.660 --> 41:52.580] that's not something anybody uses. [41:52.580 --> 41:55.660] That immediately tells you they're not sanitizing. [41:56.400 --> 41:57.100] So, if you've got [41:57.200 --> 41:59.180] a blind server-side request forgery like I do, [41:59.180 --> 42:01.000] that's how I do it in Burp. That's exactly how [42:01.000 --> 42:03.080] I do this. Run every status [42:03.080 --> 42:04.660] code from 1 to 699 [42:04.660 --> 42:06.780] and if you get any sort [42:06.780 --> 42:08.620] of code that means [42:08.620 --> 42:10.840] anything, it's any kind of HTTP status code, [42:10.840 --> 42:12.780] you're in. Now, here's [42:12.780 --> 42:14.240] where it gets silly. [42:15.140 --> 42:16.700] You have to understand what [42:16.700 --> 42:19.200] this is happening. I call it sanitization depth. [42:19.280 --> 42:20.560] On the right-hand side, you just have [42:20.560 --> 42:22.520] my custom error. But, [42:22.520 --> 42:24.600] the application completely [42:24.600 --> 42:26.940] fails to actually sanitize [42:26.940 --> 42:28.860] any of the data that I'm injecting [42:28.860 --> 42:30.500] via that status code. [42:31.000 --> 42:33.020] Character markup, anything. [42:33.020 --> 42:34.820] So, if you remember my talk from last year, [42:34.820 --> 42:36.720] I talked about how I figured out a way to do DNS [42:36.720 --> 42:38.900] and HTTP exfiltration via this. [42:39.660 --> 42:40.860] Malicious payloads that I want to [42:40.860 --> 42:43.020] transmit over this, because it's a proxy, [42:43.820 --> 42:45.140] I have all these characters [42:45.140 --> 42:47.040] available, so now I can use Base64 [42:47.620 --> 42:48.760] and you can encode [42:48.760 --> 42:51.260] anything as a Base64 payload. [42:52.280 --> 42:52.820] So, [42:53.640 --> 42:54.760] what do you do? [42:55.100 --> 42:57.060] Well, if you want to tunnel live HTTP [42:57.060 --> 42:59.420] traffic to bypass a content filter, [42:59.900 --> 43:01.140] or you just want to traffic [43:01.140 --> 43:03.540] files through connectwise port test, [43:03.540 --> 43:05.140] aka proxy chains, [43:05.680 --> 43:07.100] two one-way communication channels [43:07.100 --> 43:08.780] equal one communicate, right? [43:08.780 --> 43:11.320] So, all I'm doing, this Python script, [43:11.320 --> 43:14.140] I inject an arbitrary [43:14.140 --> 43:15.120] URL [43:15.120 --> 43:16.880] in the web server thing, [43:16.880 --> 43:19.040] and then what I'm actually putting at the end [43:19.040 --> 43:21.060] is a Base64 encoded [43:21.060 --> 43:22.400] URL. [43:22.720 --> 43:25.020] My proxy hosted in Amazon [43:25.020 --> 43:27.200] parses that, [43:27.200 --> 43:29.040] goes out and retrieves [43:29.040 --> 43:30.840] the web page I asked for, [43:30.840 --> 43:32.240] and then returns it [43:32.840 --> 43:34.840] inside that status code, [43:34.840 --> 43:37.000] and I wrote a shim on the other side [43:37.000 --> 43:39.420] that picks it up and parses it all. [43:40.460 --> 43:40.980] In [43:40.980 --> 43:43.120] 23 lines of Python code. [43:44.300 --> 43:45.200] It's really [43:45.200 --> 43:46.920] that easy. [43:46.940 --> 43:49.140] Now, think about this. I am inheriting [43:49.140 --> 43:50.780] all the firewall rules. [43:50.820 --> 43:52.900] How do I prove that at the only place on [43:52.900 --> 43:55.680] Earth this could have come from was their server? [43:56.640 --> 43:56.920] Well, [43:56.920 --> 43:58.740] you can add to your Amazon EC2 rules [43:58.740 --> 44:01.060] that the only IP address on the entire world [44:01.060 --> 44:02.980] that can connect to that server that I'm serving [44:02.980 --> 44:05.300] is their IP address. [44:05.520 --> 44:07.020] Why did I do that? [44:07.040 --> 44:09.060] Because if you've got third-party IR companies [44:09.060 --> 44:10.960] trying to sniff around your stuff and you don't want them [44:10.960 --> 44:12.880] finding it, putting up firewall [44:12.880 --> 44:14.940] rules that prevent them from ever looking at what your [44:14.940 --> 44:16.980] payloads look like is a pretty good idea. [44:19.360 --> 44:20.740] So, again, I've [44:20.740 --> 44:22.920] whitelisted ScreenConnect.com including domain [44:22.920 --> 44:24.920] names. So now [44:24.920 --> 44:27.080] it's basically an open network [44:27.080 --> 44:27.920] tunnel. [44:28.800 --> 44:31.020] So if you want to build a content filter bypass [44:31.020 --> 44:33.080] or just run a proxy, you can do [44:33.080 --> 44:35.020] the same exact thing. Now, here's [44:35.020 --> 44:37.020] why it's important to inherit [44:37.020 --> 44:39.200] all these firewall rules. If you're in a [44:39.200 --> 44:41.860] highly secure critical infrastructure environment, [44:41.860 --> 44:43.240] many times the only [44:43.240 --> 44:45.200] IP address or network traffic you are allowed to [44:45.200 --> 44:47.220] pass outside the house is to the [44:47.220 --> 44:49.820] remote management software. [44:49.820 --> 44:51.180] Anything else gets dropped. Anybody else run [44:51.180 --> 44:52.940] their stuff like that? A lot of people run that, especially in [44:52.940 --> 44:54.360] high availability environments. [44:54.840 --> 44:56.940] So now that I have this available, I [44:56.940 --> 44:59.020] can now tunnel out to the internet and hence [44:59.020 --> 45:00.960] the world via that status [45:00.960 --> 45:03.060] code. It's the only [45:03.060 --> 45:05.160] IP it can go, so I put something up in my Amazon [45:05.160 --> 45:06.940] instance that picks up the request and does [45:06.940 --> 45:08.600] all the HTTP stuff. [45:09.460 --> 45:11.020] Right? Not a bit [45:11.020 --> 45:12.520] of social engineering so far, [45:12.520 --> 45:15.000] which was their big concern. Oh, you need [45:15.000 --> 45:17.160] social engineering for all of this. No. [45:17.580 --> 45:18.980] So all you really need to do is start [45:19.080 --> 45:20.560] a free EC2 server. I [45:20.560 --> 45:22.300] prefer elastic ones because [45:22.300 --> 45:24.920] they are anywhere and you can sign up anonymously [45:24.920 --> 45:26.280] and don't cost you a dollar. [45:26.280 --> 45:28.100] You just host this scripting [45:28.100 --> 45:30.540] out there, make a firewall rule that says [45:30.540 --> 45:32.580] the only thing it can attach via HTTP [45:33.540 --> 45:34.500] on port 80 [45:34.500 --> 45:36.080] is this. Serve that code [45:36.080 --> 45:38.020] and you win. [45:39.280 --> 45:40.440] So I've been serving [45:40.440 --> 45:42.660] malicious POC and assigned executables [45:42.660 --> 45:44.300] to their cloud instance since January [45:44.300 --> 45:46.480] 2023. My warning [45:46.480 --> 45:48.600] to you is this. Whatever you do, [45:48.600 --> 45:50.500] and I seriously mean this because I'm not that guy. [45:50.500 --> 45:52.760] I'm an ethical go-by-the-books person. [45:52.920 --> 45:54.220] Do not click that URL [45:54.220 --> 45:56.500] or put it in while you put [45:56.500 --> 45:58.540] the Xs in because if you do, it will install [45:58.540 --> 46:00.540] without clicking a remote install agent [46:00.540 --> 46:02.460] on your computer. And [46:02.460 --> 46:04.480] it's a frame, right? I can inject that via frame [46:04.480 --> 46:06.040] without ever downloading, right? [46:06.600 --> 46:08.660] So let's talk about social engineering. What is social [46:08.660 --> 46:10.620] engineering? Tactic of manipulating, [46:10.620 --> 46:13.280] influencing, deceiving a victim in order to gain control, [46:13.280 --> 46:15.380] steal personal financial information, [46:15.380 --> 46:16.300] it uses psychological [46:16.300 --> 46:18.340] manipulation to trick users into making [46:18.340 --> 46:19.840] security mistakes, right? [46:20.340 --> 46:22.380] So if I can register your old [46:22.380 --> 46:23.380] domain, [46:24.620 --> 46:26.280] send somebody that cross-site [46:26.280 --> 46:28.320] scripting payload, and load it off [46:28.320 --> 46:31.480] of what used to be your FQDN, [46:31.480 --> 46:32.080] that's barely [46:32.080 --> 46:33.520] social engineering. [46:33.960 --> 46:36.320] The agent doesn't have any framing invitations, [46:36.320 --> 46:38.360] right? So why not [46:38.360 --> 46:40.520] start injecting a frame instead? [46:41.200 --> 46:42.200] So my [46:42.200 --> 46:43.640] payload is actually [46:44.240 --> 46:46.200] serving an iframe. [46:46.900 --> 46:47.720] But I use [46:47.720 --> 46:50.220] the hidden tag, right? [46:50.600 --> 46:51.760] You inject the frame, [46:51.760 --> 46:53.760] it automatically downloads, all [46:53.760 --> 46:55.740] of that gets bypassed. That's [46:55.740 --> 46:57.840] literally how you do it. It's barely social engineering [46:57.840 --> 46:59.060] at this point, right? [46:59.580 --> 47:01.680] So what if you have some company sniffing around your [47:01.680 --> 47:03.440] work and you don't want them finding it? [47:03.440 --> 47:05.620] Well, the simple elaboration for Tradecraft is [47:05.620 --> 47:07.640] just to use the hidden tag. So if anybody [47:07.640 --> 47:09.920] actually finds that page, they won't actually see it. [47:09.920 --> 47:11.740] And the psychological trick of all of this [47:11.740 --> 47:13.660] is what? I have total [47:13.660 --> 47:16.080] control of the HTML content in there. [47:16.080 --> 47:17.700] It doesn't check CSRF [47:17.700 --> 47:19.320] any of that to get requests. [47:19.320 --> 47:22.020] So I simply just started rewriting the web page. [47:23.140 --> 47:23.760] At the [47:23.760 --> 47:25.720] bottom of that it says, please wait [47:25.720 --> 47:27.480] while the PortConnect client is downloaded [47:27.480 --> 47:29.860] to your computer. So my trick is [47:29.860 --> 47:31.580] I send it to a port test page and say it's [47:31.580 --> 47:33.620] an installable port testing module. [47:33.920 --> 47:35.580] They download the agent and [47:35.580 --> 47:37.520] it loads on my machine, gives me full system [47:37.520 --> 47:38.840] access to the endpoint. [47:40.020 --> 47:41.280] Don't believe me? [47:43.700 --> 47:45.580] Give this video a watch. [47:46.800 --> 47:47.680] So this [47:47.680 --> 47:48.840] is me grabbing [47:49.540 --> 47:52.120] the URL as if I would send it to somebody, [47:52.120 --> 47:53.420] putting it in here [47:53.420 --> 47:55.880] and literally it's the same thing you're seeing. [47:56.120 --> 47:57.520] See how it says 666? I'm [47:57.520 --> 47:59.380] just showing you what the URL is. There's no tricks up [47:59.380 --> 48:01.460] my sleeve. I'm not playing any games. [48:02.120 --> 48:03.100] Hit enter. [48:06.000 --> 48:07.660] And I'm showing you this. [48:07.660 --> 48:09.300] All of the antivirus is turned [48:09.300 --> 48:11.360] on on this computer. All of the [48:11.360 --> 48:12.680] controls are there. [48:14.060 --> 48:15.660] It just downloaded. [48:17.180 --> 48:19.480] Open it up. I'll refresh [48:19.480 --> 48:21.220] it here just to show you that's how it [48:21.220 --> 48:23.660] downloads. Open it up. [48:23.900 --> 48:25.340] That's the HTTP request [48:25.340 --> 48:27.540] executing. I'm [48:27.540 --> 48:29.140] going to show you the details and you're going to see [48:29.140 --> 48:31.020] that's all the content I put in there. I [48:31.020 --> 48:32.560] injected from my server. [48:33.520 --> 48:35.280] Watch it one more time. Here's the [48:35.280 --> 48:37.400] important part. See this [48:37.400 --> 48:39.860] right here? You'll see it in a second. [48:42.590 --> 48:43.390] I need to [48:43.390 --> 48:45.330] hurry up about six months ago on this. [48:45.330 --> 48:47.250] That's signed by their [48:47.250 --> 48:49.410] controlled thing. Running that [48:49.410 --> 48:51.090] it looks fine. [48:51.270 --> 48:52.830] And now what am I doing? [48:53.450 --> 48:55.170] I'm waiting for my attacker [48:55.170 --> 48:56.950] to connect to the machine. [48:57.070 --> 48:59.050] Because it's calling back to my rogue connect [48:59.050 --> 49:01.210] wise instance in their cloud that I signed up [49:01.210 --> 49:03.230] for anonymously and it's loading [49:03.230 --> 49:05.070] up stuff on their computer. [49:05.470 --> 49:07.150] As system. [49:09.770 --> 49:10.950] That's how it's done. [49:11.250 --> 49:12.130] Like I said, [49:12.770 --> 49:13.850] thank you. [49:15.410 --> 49:16.450] There it is. [49:16.450 --> 49:18.590] And literally from this you now have access to everything. [49:18.590 --> 49:20.170] You load everything up and if you go back and read [49:20.170 --> 49:22.730] the Iranian APTs this is exactly their trampoline [49:22.730 --> 49:23.930] and everything else. [49:24.330 --> 49:26.410] It will either stay once or if on my end I just [49:26.410 --> 49:27.810] click persist. [49:27.910 --> 49:29.810] Maintain a shell. It will do it. [49:31.210 --> 49:32.610] Cool. Thank you for the applause. [49:32.610 --> 49:34.970] That was a moment for me because I worked [49:34.970 --> 49:37.130] really hard on this and it was a really rough time. [49:37.770 --> 49:39.830] I successfully exploited it. [49:39.830 --> 49:41.330] But there's more. [49:42.230 --> 49:43.190] I'm not telling [49:43.190 --> 49:45.970] everything. I'm just going to show you some stuff. [49:47.510 --> 49:47.930] Connect wise [49:47.930 --> 49:49.550] applications even beyond this use [49:49.810 --> 49:50.830] a client application [49:51.810 --> 49:53.510] that is really just a [49:53.510 --> 49:57.130] wrapped web browser. [49:57.130 --> 49:57.610] You can figure [49:57.610 --> 49:59.590] this out by looking at their web page and they [49:59.590 --> 50:03.830] parse what the user agent tags are. [50:03.830 --> 50:05.170] That client is absolutely [50:05.170 --> 50:07.310] exploitable because it's an old browser [50:07.790 --> 50:09.490] but nobody realizes [50:09.490 --> 50:11.310] it's a browser so [50:11.310 --> 50:13.230] there are tons of ways of going [50:13.230 --> 50:15.450] through connect wise, not this, the other parts [50:15.450 --> 50:17.390] of the system to deliver [50:18.050 --> 50:19.330] client side exploits [50:20.170 --> 50:21.970] without user interaction. [50:23.090 --> 50:23.990] That's one thing. [50:23.990 --> 50:25.430] I'm not sharing that yet because it's [50:25.430 --> 50:27.890] cool and it's another cool thing that nobody's ever done before. [50:28.090 --> 50:29.350] Now I want you to think, and this is the [50:29.350 --> 50:31.370] important part, I want you to think about this [50:31.370 --> 50:32.870] as application developers. [50:36.430 --> 50:37.470] Who leaves [50:37.470 --> 50:40.130] debugging symbols on when you compile code? [50:42.530 --> 50:43.490] So the [50:43.490 --> 50:45.030] click once installer that they provided [50:45.030 --> 50:46.890] if you carve through the metadata [50:47.750 --> 50:49.490] software bill of materials, software [50:49.490 --> 50:51.250] supply chain attacks, all that stuff I do [50:52.050 --> 50:53.570] what they've left in here [50:53.570 --> 50:55.290] was the absolute drive path [50:55.290 --> 50:56.990] including username for the profile [50:56.990 --> 50:59.590] source, stream connect work [50:59.590 --> 51:01.410] misc, bootstrapper, [51:01.410 --> 51:03.310] release, click once runner. [51:04.270 --> 51:05.370] The source is where [51:05.370 --> 51:07.050] the source code is stored. [51:07.050 --> 51:09.250] Right? I have [51:09.430 --> 51:11.170] a username of somebody who can [51:11.170 --> 51:13.270] actually get to that and compiles [51:13.270 --> 51:15.250] it. I know what [51:15.250 --> 51:17.270] they're doing and I'm going [51:17.270 --> 51:19.270] to mic drop after the next slide [51:19.270 --> 51:21.290] on this. There is [51:21.470 --> 51:23.130] a lot of metadata embedded [51:23.130 --> 51:24.830] in their software and applications [51:24.830 --> 51:27.430] that will allow you to map their internal [51:27.430 --> 51:28.370] network. [51:32.270 --> 51:33.690] This is the thing I'll come out is [51:33.690 --> 51:35.730] I love attacking developers and I love [51:35.730 --> 51:37.770] exploiting developer weaknesses because [51:37.770 --> 51:39.630] you all have something like this. [51:40.290 --> 51:41.970] So, wrapping up. [51:42.650 --> 51:43.750] Should companies, and this is where [51:43.750 --> 51:45.690] it comes down to, this is all cool, this is new stuff, whatever [51:45.690 --> 51:47.710] it's like, one, should [51:47.710 --> 51:49.670] companies be responsible, and that's the question I get, [51:49.670 --> 51:51.490] responsible for their own disclosure analysis of [51:51.490 --> 51:53.630] vulnerabilities? I don't know. [51:54.430 --> 51:55.670] I can tell you that I shouldn't [51:55.670 --> 51:57.750] have been the person that registered the CVEs and it certainly [51:57.750 --> 51:59.450] wasn't overblown in my eyes. [51:59.730 --> 52:01.730] So here's my trick I'm going to tell you. Learn how [52:01.730 --> 52:03.710] the CVE system reporting works. [52:04.210 --> 52:06.570] So if a company is a [52:06.990 --> 52:07.950] CNA and they won't [52:07.950 --> 52:10.030] give you your CVE, what you can do is [52:10.030 --> 52:12.490] go to MITRE, who's a CNA of last resort, [52:12.490 --> 52:14.890] and they'll issue it to you if you're correct. [52:14.890 --> 52:17.090] Which is why I went to MITRE. [52:17.230 --> 52:18.490] So if you're a bug hunter [52:18.490 --> 52:20.190] or somebody who's doing this and the program [52:20.190 --> 52:22.870] won't give it to you, you can just go to MITRE and say [52:22.870 --> 52:26.270] rectify this for me. [52:26.270 --> 52:26.810] Yes, [52:26.810 --> 52:28.890] you were just certified, yes. [52:27.730 --> 52:29.730] Follow that. [52:28.890 --> 52:30.930] A magic bullet [52:30.930 --> 52:33.110] of this isn't a big deal won't fix anything. [52:33.750 --> 52:34.910] All of you need to start [52:34.910 --> 52:37.350] thinking holistically how the system gets put together. [52:37.350 --> 52:38.930] Because like I said, it's an application [52:38.930 --> 52:40.890] problem, it's the network problem, [52:40.890 --> 52:42.690] but it's really a lack of understanding. [52:43.270 --> 52:44.890] Two last things, I'll get off, give me two [52:44.890 --> 52:46.830] seconds. Bug bounty programs [52:46.830 --> 52:48.970] and responsible disclosure are totally killing employment [52:48.970 --> 52:50.890] in the industry because why would anybody hire [52:50.890 --> 52:53.030] you full time when they can get the milk for free? [52:53.170 --> 52:55.330] Or for a t-shirt and 500 bucks? [52:55.590 --> 52:57.010] If you want more jobs in this [52:57.010 --> 52:59.430] industry, stop taking the quick payday. [52:59.430 --> 53:01.190] Put your CVEs that you register [53:01.190 --> 53:03.010] on your resume and that is money that will [53:03.010 --> 53:05.270] pay off on your salary for the rest of your life. [53:05.930 --> 53:06.970] Trust me, [53:06.970 --> 53:09.010] I've got hundreds. Last thing, I'll [53:09.010 --> 53:11.210] say this, ask yourself [53:11.210 --> 53:13.070] this, I'm not a bad person, I don't turn bad, [53:13.070 --> 53:15.310] but think about it this way as all of you. [53:15.470 --> 53:17.310] If I have to stare these people down, [53:17.310 --> 53:18.990] fly out to Las Vegas, do a press [53:18.990 --> 53:21.130] whatever, just for a few [53:21.130 --> 53:23.030] words of acknowledgement on a website, why [53:23.030 --> 53:24.350] would I ever help them again? [53:25.270 --> 53:27.470] Think about that as an application designer. [53:28.070 --> 53:29.030] Be more open. [53:29.210 --> 53:31.430] Thank you very much guys, that puts everybody else at risk. [53:31.430 --> 53:32.590] Thank you very much, I appreciate it.