1 00:00:00,000 --> 00:00:07,560 The fact that we leverage as OT pen testers, assuming that we compromise the enterprise environment, we get domain admin. 2 00:00:07,560 --> 00:00:13,140 Domain admin is not always the key or dependent on success. 3 00:00:13,140 --> 00:00:14,480 It just makes things easier. 4 00:00:14,480 --> 00:00:16,420 So first thing, get domain admin. 5 00:00:16,560 --> 00:00:17,520 And oh... 6 00:00:18,740 --> 00:00:20,200 Let me go back. 7 00:00:20,200 --> 00:00:20,700 Okay. 8 00:00:21,040 --> 00:00:22,500 Thank you. 9 00:00:23,520 --> 00:00:24,440 Cool. 10 00:00:24,440 --> 00:00:25,420 Yes. 11 00:00:25,800 --> 00:00:27,240 Much better. 12 00:00:28,900 --> 00:00:30,700 Well, I'm actually a little bit ahead. 13 00:00:30,700 --> 00:00:32,540 So here's the remote access architecture. 14 00:00:32,540 --> 00:00:36,340 So just going back a slide, you have RDP jump servers. 15 00:00:36,340 --> 00:00:39,660 You have remote access proxy or VPN gateway. 16 00:00:39,660 --> 00:00:42,920 So these are the most three common types of remote access. 17 00:00:42,920 --> 00:00:45,740 Like I said, there could be a jump server in the OT DMC. 18 00:00:45,740 --> 00:00:47,360 Sometimes it's double hopped. 19 00:00:47,580 --> 00:00:54,260 But this is kind of key as an OT pen tester to know what type of remote access people are using to get in. 20 00:00:54,260 --> 00:00:56,200 Because that will change our tactic. 21 00:00:56,880 --> 00:00:57,660 Okay. 22 00:00:57,720 --> 00:01:01,100 So this is like a basic standard IT type of attack. 23 00:01:01,100 --> 00:01:02,540 But it's actually pretty... 24 00:01:02,540 --> 00:01:05,720 I kind of want to highlight it, because it's actually pretty interesting. 25 00:01:06,400 --> 00:01:16,260 So assuming we get domain admin in the enterprise network, the first thing we do is we pivot to NZ user's workstation that remotes into the OT DMC. 26 00:01:16,300 --> 00:01:22,100 And of course, we also look for the RDP save credentials. 27 00:01:22,100 --> 00:01:31,360 If you think about these operators, if they're logging into the OT DMC five days a week, and they don't want to type in their creds every single time they RDP in. 28 00:01:31,580 --> 00:01:33,640 So of course, you look at the desktop. 29 00:01:33,640 --> 00:01:35,660 You might find a .rdp file. 30 00:01:35,900 --> 00:01:42,960 And using something like Sharp DP API or Mimikatz, you can harvest these clear text credentials. 31 00:01:43,660 --> 00:01:51,320 But if they're leveraging multi-factor authentication, that would prevent us from masquerading as these users. 32 00:01:51,320 --> 00:01:59,140 But we also like to keep this in our back pocket, because the chances that once they're in the OT network, there's a good chance that these creds will work again. 33 00:01:59,140 --> 00:02:02,420 So like cred reuse is definitely a thing between IT and OT. 34 00:02:04,420 --> 00:02:08,740 Okay, another kind of low-level attack is group membership. 35 00:02:08,740 --> 00:02:19,700 So again, once we get domain admin, we look at the groups that these OT users are associated with, and we just add ourselves to those groups. 36 00:02:19,700 --> 00:02:24,540 And sometimes, just by doing that, we can access the same resources that they do. 37 00:02:25,000 --> 00:02:29,020 But again, if multi-factor authentication, that would prevent us. 38 00:02:29,020 --> 00:02:33,320 But we'll just use that later. 39 00:02:33,960 --> 00:02:38,220 Okay, so two kind of low-level, just general type of IT attacks. 40 00:02:38,500 --> 00:02:41,100 And now we're getting into something a little bit more interesting. 41 00:02:41,600 --> 00:02:53,320 So I'm not sure if any of you heard of set RDP, but this attack is a fun attack to do, it's very limited as far as the type of environments we can leverage this. 42 00:02:53,700 --> 00:03:02,200 So what's interesting about this attack is that it intercepts remote desktop credentials as an end-user attempts to authenticate to a jump server. 43 00:03:02,440 --> 00:03:09,120 But it only works in usually small environments, like wastewater treatment plants, or just very small organizations. 44 00:03:09,420 --> 00:03:16,840 Because to pull off this attack, you have to be in the same subnet, and the workstation and the jump server also has to be in the same subnet. 45 00:03:16,840 --> 00:03:19,720 So you're talking about a very small organization. 46 00:03:19,720 --> 00:03:22,820 But this is a pretty fun attack because you can just run this man-in-the-middle attack 47 00:03:26,020 --> 00:03:28,240 and gather clear-text credentials. 48 00:03:28,400 --> 00:03:33,180 Again, if there's multi-factor authentication, that would stop us from pivoting. 49 00:03:33,180 --> 00:03:38,440 But we can keep this in our back pocket and maybe reuse the creds later on. 50 00:03:40,220 --> 00:03:43,400 Okay, so this is where the fun stuff happens. 51 00:03:43,400 --> 00:03:49,760 This is probably the most common technique that we use to pivot between IoT and OT. 52 00:03:50,600 --> 00:03:52,800 And there's a few reasons why. 53 00:03:52,800 --> 00:03:54,580 It's actually very easy to pull off. 54 00:03:54,580 --> 00:03:56,360 There's not a whole lot of requirements. 55 00:03:56,760 --> 00:03:59,620 And it bypasses multi-factor authentication. 56 00:03:59,940 --> 00:04:08,300 So again, assuming we have domain admin, we find the users, like operators, that remote into the OT DMZ. 57 00:04:08,340 --> 00:04:10,240 We pivot to their workstation. 58 00:04:10,240 --> 00:04:16,140 And so one of the requirements is we have to have an anti-authority system level shell. 59 00:04:16,140 --> 00:04:17,320 And that's pretty easy to do. 60 00:04:17,840 --> 00:04:19,380 There's multiple ways to do it. 61 00:04:19,380 --> 00:04:20,540 You can use Task Manager. 62 00:04:20,540 --> 00:04:22,000 You can use PsXec. 63 00:04:22,200 --> 00:04:28,460 We just upload PsXec, spawn another shell as anti-authority system. 64 00:04:28,660 --> 00:04:30,720 And then the first thing we run is query user. 65 00:04:30,720 --> 00:04:33,360 So what users are logged on to that host? 66 00:04:33,360 --> 00:04:36,580 If it's a jump server on the enterprise, it's not... 67 00:04:40,440 --> 00:04:43,580 at any given time, you can see at least 12 different connections. 68 00:04:43,660 --> 00:04:46,840 So jump servers, there's a lot of connections we can see. 69 00:04:46,900 --> 00:04:50,140 If it's an end-user workstation, it's probably just one session. 70 00:04:50,140 --> 00:04:55,520 But with this attack, what we do is then we find the user that we want to hijack. 71 00:04:55,540 --> 00:04:59,260 And we run, like, tscon.exe and the session ID. 72 00:04:59,260 --> 00:05:01,280 And then, boom, we have their session. 73 00:05:01,280 --> 00:05:02,860 We just, like, bump them off. 74 00:05:02,860 --> 00:05:04,820 And now we have their connection. 75 00:05:05,180 --> 00:05:08,280 So we're just piggybacking off of their remote access process. 76 00:05:08,280 --> 00:05:12,320 So they're going through the whole remote access two-factor authentication. 77 00:05:12,320 --> 00:05:15,360 They're going to jump server or remote access proxy. 78 00:05:15,560 --> 00:05:19,640 And then in some situations, they're even pivoting to, like, some engineer workstation. 79 00:05:19,740 --> 00:05:23,800 So we don't need to know what their password is or know the two-factor authentication. 80 00:05:23,800 --> 00:05:26,140 We just bump them off and we have their session. 81 00:05:26,280 --> 00:05:29,120 The thing about this attack is it's not very OPSEC. 82 00:05:29,120 --> 00:05:30,940 It's actually, like, non-SEC. 83 00:05:31,620 --> 00:05:33,120 You know, we're bumping them off. 84 00:05:33,120 --> 00:05:35,660 Usually, they think it's, like, a network connectivity issue. 85 00:05:35,900 --> 00:05:41,780 But, you know, this type of attack, we usually collaborate with the end user. 86 00:05:41,780 --> 00:05:45,880 Because if they're, like, an operator doing something very important, we don't want to just bump them off. 87 00:05:45,880 --> 00:05:50,020 So we let them know beforehand, hey, we're going to run this attack. 88 00:05:50,020 --> 00:05:51,260 Are you okay with that? 89 00:05:51,340 --> 00:05:53,760 And then we bump them off and take over. 90 00:05:53,920 --> 00:05:55,700 But again, it's not very OPSEC. 91 00:05:55,700 --> 00:05:56,940 Like , you know, it is something... 92 00:05:56,940 --> 00:06:01,300 If you try to do this as a red team, someone would know. 93 00:06:01,900 --> 00:06:05,320 So this leads me into the next attack. 94 00:06:05,920 --> 00:06:07,580 Remote desktop shadowing. 95 00:06:07,580 --> 00:06:09,740 So this is also, like, another favorite of mine. 96 00:06:10,480 --> 00:06:14,360 It's very similar to remote desktop session hijacking. 97 00:06:14,440 --> 00:06:18,520 But you don't need to have an NT authority system shell. 98 00:06:18,520 --> 00:06:22,660 All you need is admin and you have to make an edit to the registry. 99 00:06:23,240 --> 00:06:25,300 And then same thing, you can run a query user. 100 00:06:25,300 --> 00:06:29,020 If you're on a jump server, you'll probably see over a dozen connections. 101 00:06:29,020 --> 00:06:32,560 If you're on top of workstations, this is usually the end user's connection. 102 00:06:33,400 --> 00:06:37,560 And then we run mstsc.exe, which is RDP. 103 00:06:37,560 --> 00:06:41,200 Or you can run shadow.exe. 104 00:06:41,200 --> 00:06:48,860 And with the no consent prompt, this means that the end user wouldn't know that you're shadowing their session. 105 00:06:49,060 --> 00:06:51,300 So that kind of makes it OPSEC. 106 00:06:51,300 --> 00:06:56,240 So once we run this command, we would have, like, a view of their desktop. 107 00:06:56,680 --> 00:06:59,540 And, like, again, they wouldn't know that we're viewing their desktop. 108 00:06:59,820 --> 00:07:05,280 But on the flip side, if we run commands or move the mouse, they can see that. 109 00:07:05,540 --> 00:07:08,340 So not very OPSEC, right? 110 00:07:08,800 --> 00:07:13,460 Again, we would work with the end user to let them know we're going to run this attack. 111 00:07:13,660 --> 00:07:19,340 But we can't do a whole lot if we want to, like, hide our activity. 112 00:07:19,340 --> 00:07:22,320 So this kind of leads into, like, the next attack. 113 00:07:22,540 --> 00:07:23,760 This is OPSEC. 114 00:07:23,760 --> 00:07:25,740 This is actually very, very OPSEC. 115 00:07:25,740 --> 00:07:29,100 So hidden desktop or HVNC. 116 00:07:29,560 --> 00:07:33,560 So, again, we have a domain admin on the enterprise network. 117 00:07:33,680 --> 00:07:36,440 We pivot to an end user workstation. 118 00:07:36,440 --> 00:07:44,800 And if we're using Cobol Strike, we can run hidden desktop, which is an open source tool by White Knight Labs. 119 00:07:44,800 --> 00:07:48,780 There's also, like, commercial tools from OST and Fortra. 120 00:07:48,780 --> 00:07:58,160 But the main concept here is that, again, the end user is logging into the OTDMC or they're logging into, like, their engineering workstation. 121 00:07:58,320 --> 00:08:04,440 And once they have gone through the connection process, we would launch HVNC's hidden desktop. 122 00:08:05,060 --> 00:08:06,940 And then we would be presented with a... 123 00:08:06,940 --> 00:08:07,540 Sorry. 124 00:08:07,940 --> 00:08:09,180 Is that better? 125 00:08:09,180 --> 00:08:09,620 Yeah. 126 00:08:09,620 --> 00:08:20,200 We would be presented with another UI of their desktop, but we can run commands, open up prompts without them seeing our activity. 127 00:08:20,540 --> 00:08:22,160 So this is actually really hard. 128 00:08:22,160 --> 00:08:23,300 This is a nice trick. 129 00:08:23,300 --> 00:08:29,240 So we're pretty much piggybacking off of their connection into the OTDMC or even lower. 130 00:08:29,480 --> 00:08:32,520 And, yeah, it bypasses two-factor authentication. 131 00:08:34,920 --> 00:08:35,800 Okay. 132 00:08:36,140 --> 00:08:37,000 Next. 133 00:08:37,000 --> 00:08:42,900 So this is unfortunately something that I've encountered on many engagements. 134 00:08:42,900 --> 00:08:45,160 Larger organizations. 135 00:08:45,680 --> 00:09:04,380 So in situations where, like, an organization is relying on top IT to manage network infrastructure or even worse, like, a third party to manage their network infrastructure, unfortunately, sometimes they leave it open to, like, from the enterprise to the OT. 136 00:09:04,380 --> 00:09:07,600 So, like, it's a very implicit... 137 00:09:07,600 --> 00:09:08,600 Bless you. 138 00:09:08,720 --> 00:09:09,920 Implicit rules. 139 00:09:09,920 --> 00:09:21,700 For example, if they have implicit firewall rules, they allow access to network switches, routers, management portals to the whole enterprise. 140 00:09:21,700 --> 00:09:29,520 This is something that we can leverage to access these, like, these interfaces, like, over SSH or telnet or web. 141 00:09:29,520 --> 00:09:35,560 And it's really sad because, like, you know, it kind of bypasses their whole remote access design. 142 00:09:35,560 --> 00:09:40,760 And, yeah, so it's not just the router switches or firewalls. 143 00:09:40,760 --> 00:09:43,220 It's also other, like, miscellaneous devices. 144 00:09:43,220 --> 00:09:45,960 Like, one common one is BMC devices. 145 00:09:46,140 --> 00:09:52,140 So, like, think iDRAC or ILO or UPS devices. 146 00:09:52,140 --> 00:09:55,840 So what I have here is, like, a UPS interface over telnet. 147 00:09:55,840 --> 00:09:58,020 And then I can enable SSH. 148 00:09:58,020 --> 00:10:01,300 And with SSH tunneling, I can pivot into OTDMC. 149 00:10:01,300 --> 00:10:07,160 So this is kind of like one of those things where, yeah, they just leave open to the whole enterprise network. 150 00:10:07,160 --> 00:10:12,360 And , yeah, if you have SSH, and if you combine this with default creds, it's even worse. 151 00:10:13,720 --> 00:10:15,220 So miscellaneous stuff. 152 00:10:16,160 --> 00:10:16,440 Okay. 153 00:10:16,440 --> 00:10:20,120 This is my last slide on attacks. 154 00:10:20,160 --> 00:10:24,680 And I was, like, kind of wondering if I should leave this in, put this in here, because I almost feel like it's common knowledge. 155 00:10:24,680 --> 00:10:28,960 But the thing is, I see this so often, and it's kind of sad. 156 00:10:29,580 --> 00:10:30,120 Okay. 157 00:10:30,120 --> 00:10:41,100 So in situations where there's, like, a jump server in the enterprise network, and then they incorporate, like, two-factor authentication, they use RSA or whatever, two-factor authentication, they forget that. 158 00:10:41,100 --> 00:10:46,440 So even if I have domain admin access, I can't remote desktop into the jump server because I don't have two-factor, right? 159 00:10:46,440 --> 00:10:49,720 So the client usually thinks, oh, this is great, you know, you can get in. 160 00:10:49,720 --> 00:10:55,240 But they tend to forget that, like, on Windows servers, like, WinRM is on by default. 161 00:10:55,320 --> 00:10:57,200 Or SMB might be open. 162 00:10:57,200 --> 00:11:00,720 We don't need two-factor authentication to access these services. 163 00:11:00,720 --> 00:11:14,780 We can just use, like, Evo, WinRM, or PS remoting to access the jump server through a different port, and then we can just redo the whole attack chain, use RDP shadow, RDP session hijacking, or HPNC. 164 00:11:15,300 --> 00:11:20,720 So, yeah, always put the jump server below the firewall and close off any ports. 165 00:11:20,720 --> 00:11:25,600 If it's meant to be just remote desktop, make sure only remote desktop is exposed. 166 00:11:27,300 --> 00:11:28,400 Okay. 167 00:11:28,400 --> 00:11:32,620 So defense detection opportunities. 168 00:11:32,620 --> 00:11:44,380 So , yeah, easy to detect remote desktop session hijacking, just look for TS con, RDP shadowing, look for shadow.exe, especially with the no consent prompt. 169 00:11:44,380 --> 00:11:48,900 That should be a very, like, high fidelity indicator. 170 00:11:48,900 --> 00:12:00,340 Because if you think about an IT support that's working with someone to troubleshoot something, they're usually going to ask for permission to take over their screen, their desktop. 171 00:12:00,340 --> 00:12:04,000 So if someone's not using that, that might be a red flag. 172 00:12:04,680 --> 00:12:13,080 HPNC is going to be much more difficult to detect because you're going to have to look at, like, API calls to, like, switch desktop or create desktop. 173 00:12:13,080 --> 00:12:15,260 That's going to be a bit of a challenge. 174 00:12:17,240 --> 00:12:17,740 Okay. 175 00:12:17,740 --> 00:12:20,100 So hard in the DMC defensive takeaways. 176 00:12:20,800 --> 00:12:28,540 Like, a lot of the attacks that I mentioned, yeah, like, we bypassed two-factor authentication and all that. 177 00:12:28,540 --> 00:12:30,560 But there's still a lot of things that you can do. 178 00:12:30,560 --> 00:12:36,280 So first, secure remote access paths, you know, the basics, multi-factor authentication for everything. 179 00:12:37,400 --> 00:12:39,540 So strengthen segmentation points. 180 00:12:39,540 --> 00:12:53,540 So one thing I want to see more often, I've only seen this top one engagement, unfortunately, but they had two jump servers, but they split the protocol from remote desktop to remote desktop over web. 181 00:12:53,660 --> 00:13:00,860 And funny enough, that actually kind of was pretty effective because we could hijack the session that had, like, a standard remote desktop access. 182 00:13:00,860 --> 00:13:04,580 But once they switched to remote desktop over web, they're not using port 339 anymore. 183 00:13:04,580 --> 00:13:06,800 It's using 80 and 443. 184 00:13:06,980 --> 00:13:11,060 And so we couldn't hijack that same session on the second server. 185 00:13:11,060 --> 00:13:14,560 So you want to separate, you want to change the protocols. 186 00:13:14,560 --> 00:13:17,380 So not just go with RDP over RDP. 187 00:13:19,040 --> 00:13:26,140 Hardened jump servers, like I said, you want to make sure that if you expect people to RDPN, only RDP is accessible. 188 00:13:26,140 --> 00:13:27,720 You want to put it behind the firewall. 189 00:13:28,380 --> 00:13:29,440 You want to NAT it. 190 00:13:30,600 --> 00:13:35,440 And of course, you want to enhance detection and visibility if you can, wherever you can. 191 00:13:36,140 --> 00:13:41,100 So look for, like, even IDs 4624, 4634, 4778. 192 00:13:42,380 --> 00:13:44,540 And so I'm a bit early. 193 00:13:44,760 --> 00:13:49,100 I actually have time for some questions. 194 00:13:49,600 --> 00:13:49,880 Oh. 195 00:13:50,800 --> 00:13:51,900 Thank you. 196 00:13:56,610 --> 00:13:57,270 Yes. 197 00:13:57,270 --> 00:13:57,990 Go ahead. 198 00:14:04,370 --> 00:14:04,890 Do next... 199 00:14:04,890 --> 00:14:07,130 Oh, the question is, why are... 200 00:14:07,130 --> 00:14:09,590 Is do next on the jump box bad? 201 00:14:10,230 --> 00:14:10,570 Okay. 202 00:14:10,970 --> 00:14:21,510 So do next on the jump box means, like, when an end user remotes into the jump box, they have an interface in the OT DMC already, right? 203 00:14:21,510 --> 00:14:26,670 So it makes it very easy for us to start scanning the network. 204 00:14:27,230 --> 00:14:28,430 You know, you can just do an ARP. 205 00:14:28,430 --> 00:14:31,610 You can enumerate the OT DMC much easier. 206 00:14:31,890 --> 00:14:33,550 You don't want to be doing that. 207 00:14:33,550 --> 00:14:36,610 You want to have an RDP into something else. 208 00:14:37,190 --> 00:14:40,330 Yeah, that would be, yeah, very easy to enumerate. 209 00:14:40,610 --> 00:14:41,950 Any other questions? 210 00:14:55,480 --> 00:14:56,740 What was the beginning again? 211 00:14:56,740 --> 00:14:57,220 Sorry. 212 00:14:59,910 --> 00:15:00,790 Oh. 213 00:15:01,610 --> 00:15:02,730 Yeah, yeah. 214 00:15:02,730 --> 00:15:06,130 Actually, I don't commonly see that, but that's a good idea. 215 00:15:06,130 --> 00:15:11,370 He said, do I recommend having separate identity stores between IT DMC and OT? 216 00:15:11,370 --> 00:15:12,570 Yes, definitely. 217 00:15:12,650 --> 00:15:13,770 Especially, like, Active Directory. 218 00:15:13,770 --> 00:15:17,430 You don't want to have Active Directory between enterprise and OT. 219 00:15:18,170 --> 00:15:19,590 In some situations, I've seen... 220 00:15:20,190 --> 00:15:20,970 Oh, thank you. 221 00:15:20,970 --> 00:15:21,750 Five minutes. 222 00:15:23,230 --> 00:15:24,970 Some situations I've seen... 223 00:15:24,970 --> 00:15:28,790 Actually, OT DMC is work group devices, which makes it, you know, very interesting. 224 00:15:28,790 --> 00:15:33,530 Definitely separate identity stores between IT and enterprise. 225 00:15:33,530 --> 00:15:34,470 I mean, OT. 226 00:15:35,350 --> 00:15:36,490 Any other questions? 227 00:15:36,490 --> 00:15:37,650 Got a few more minutes. 228 00:15:41,770 --> 00:15:42,810 Go ahead. 229 00:15:49,640 --> 00:15:53,020 Yeah, that's why I like it so much. 230 00:15:53,020 --> 00:15:54,840 Because it's hard to detect. 231 00:15:54,840 --> 00:15:56,160 It really is. 232 00:15:58,020 --> 00:16:01,780 So, actually, I created a fork of this tool. 233 00:16:01,780 --> 00:16:05,600 Because most of the times on the OT Pentest, we're not even using C2. 234 00:16:05,600 --> 00:16:06,700 We're living off the LAN. 235 00:16:07,780 --> 00:16:11,560 So, this is where, like, something like URL rules would come in. 236 00:16:11,840 --> 00:16:14,760 And I know, like, you know, I work at SE. 237 00:16:14,760 --> 00:16:21,360 I know how, you know, for bigger organizations, URL rules is not always the most practical thing to find API calls. 238 00:16:21,360 --> 00:16:22,480 Because it's a lot of resource... 239 00:16:22,480 --> 00:16:24,200 It's very resource intensive, right? 240 00:16:24,700 --> 00:16:25,160 So... 241 00:16:25,160 --> 00:16:27,170 But, yeah, you want... 242 00:16:27,920 --> 00:16:33,240 I mean, for this attack, you're going to have to detect the C2 beacon first. 243 00:16:33,240 --> 00:16:35,640 So, that's your best bet. 244 00:16:36,800 --> 00:16:38,380 Aaron, go ahead. 245 00:16:54,060 --> 00:16:54,820 Okay. 246 00:16:55,480 --> 00:16:56,500 So, yeah. 247 00:16:56,500 --> 00:16:57,700 Suspicious SMB pipes. 248 00:16:57,700 --> 00:16:58,660 That's a good one. 249 00:16:59,100 --> 00:17:00,760 But, again, again, a huge organization. 250 00:17:00,760 --> 00:17:01,700 That may be hard to... 251 00:17:01,700 --> 00:17:03,020 It's like a needle in a haystack, right? 252 00:17:03,260 --> 00:17:03,640 So... 253 00:17:03,640 --> 00:17:04,040 But, yeah. 254 00:17:04,060 --> 00:17:05,980 Thank you for that input, Aaron. 255 00:17:07,760 --> 00:17:08,900 Anything else? 256 00:17:12,780 --> 00:17:13,320 Okay. 257 00:17:13,320 --> 00:17:14,440 Well, that's it. 258 00:17:14,620 --> 00:17:15,400 Thanks, guys.