1 00:00:00,000 --> 00:00:04,540 Okay, good afternoon everyone. Welcome to the Packet. Welcome back to the Packet Hacking Village. 2 00:00:05,020 --> 00:00:09,520 It is now the top of the hour, 1 p.m., and we have an old friend. 3 00:00:09,940 --> 00:00:13,940 He has spoken at Black Hat, Vendepcon, a number of occasions. 4 00:00:14,480 --> 00:00:19,400 Our old friend, who we'll be talking about, an old friend who we'll be talking about PowerShell today, Nick Patel. 5 00:00:32,060 --> 00:00:34,180 Am I audible? Yes, I am. 6 00:00:36,980 --> 00:00:42,900 Thank you everyone for coming to this session. Thank you very much for having me, guys. 7 00:00:47,460 --> 00:00:52,460 So, I'm going to talk about PowerShell for penetration testers. 8 00:00:54,240 --> 00:00:56,420 First of all, a couple of things about me. 9 00:00:56,600 --> 00:00:59,980 You know, even if they have introduced me, I always like... 10 00:01:00,000 --> 00:01:02,740 I like to increase my Twitter followers. 11 00:01:03,640 --> 00:01:08,360 So, I am a hacker, I'm a trainer, speaker, penetration tester, etc. 12 00:01:09,020 --> 00:01:13,720 I maintain two open source toolkits, Cotilia and Nishan. 13 00:01:14,140 --> 00:01:19,880 Cotilia is useful for using human interface devices for penetration testing. 14 00:01:20,060 --> 00:01:21,040 I spoke about it yesterday. 15 00:01:22,040 --> 00:01:26,040 And the second one is Nishan, which we will be using today. 16 00:01:27,220 --> 00:01:29,820 It helps you in using PowerShell. 17 00:01:30,000 --> 00:01:36,340 So, this is my Twitter ID, please do follow me, and that's my blog. 18 00:01:37,180 --> 00:01:43,560 I'm generally interested in new ways of breaking into machines, obviously, when I'm authorized to do so. 19 00:01:44,160 --> 00:01:46,720 And I've spoken at a couple of conferences previously. 20 00:01:48,740 --> 00:01:55,620 So, if you don't know, then we'll be talking about PowerShell, and why do we as hackers... 21 00:01:55,620 --> 00:01:59,860 Why will we use Windows and PowerShell as an attack platform? 22 00:01:59,860 --> 00:01:59,980 So, if you don't know, then we'll be talking about PowerShell, and why do we as hackers... Why will we use Windows and PowerShell as an attack platform? 23 00:02:02,620 --> 00:02:09,540 Then we'll see how do we quickly not really, it will not leave take a long time for that. 24 00:02:09,660 --> 00:02:15,280 We'll see how we can execute codes, commands and PowerShell scripts that is necessary 25 00:02:15,280 --> 00:02:17,800 so, that you can follow on the live demonstrations. 26 00:02:18,180 --> 00:02:21,620 So, they would be only live demonstrations, even if I fail at them. 27 00:02:21,720 --> 00:02:22,860 There are no recorded demonstrations. 28 00:02:23,820 --> 00:02:29,960 And then, we'll pick a penetration testing scenario, and pri our work or try to work with them. 29 00:02:29,960 --> 00:02:35,920 work out that only using PowerShell. And then a couple of obligatory slides for defenses 30 00:02:35,920 --> 00:02:45,220 as well. So, for Microsoft, PowerShell is something which was designed to automate things 31 00:02:45,220 --> 00:02:51,100 for system administrators and whatever is useful for a system administrator is always 32 00:02:51,100 --> 00:02:59,860 useful for an attacker. So we use PowerShell because it is present on all modern Windows 33 00:02:59,960 --> 00:03:06,660 OS, post Windows Vista. It is installed by default on all Windows machines. It is really 34 00:03:06,660 --> 00:03:14,540 tightly integrated with .NET. In fact, it is based on the .NET framework. So .NET, WMI, 35 00:03:14,900 --> 00:03:22,520 Windows registry, file system, Windows API, certificate stores, and in fact other machines 36 00:03:22,520 --> 00:03:29,240 on the network. It is always expandable with the use of the .NET framework. It is easy 37 00:03:29,240 --> 00:03:29,740 to learn. 38 00:03:29,960 --> 00:03:35,600 Although we are not going to learn it today. It also allows you to have less dependency 39 00:03:35,600 --> 00:03:43,220 to some extent on MSF to a really small extent. And also on tools which create your Python 40 00:03:43,220 --> 00:03:49,560 or Ruby scripts to executables. No more executables are required on for your penetration test 41 00:03:49,560 --> 00:03:50,360 gigs anymore. 42 00:03:50,960 --> 00:03:58,980 So PowerShell contains two parts. If you notice, the title of the slides are in a format typical 43 00:03:58,980 --> 00:04:05,080 to PowerShell so that you can grab something more out of this. PowerShell.exe is the console 44 00:04:05,080 --> 00:04:11,880 part of PowerShell. It is where all the action happens. You run commands, scripts, command 45 00:04:11,880 --> 00:04:18,040 lets, everything here. It supports tab completion, context sensitive help, et cetera. And also 46 00:04:18,040 --> 00:04:24,340 the last thing, it provides various options and execution parameters which are really 47 00:04:24,340 --> 00:04:25,180 helpful to us. 48 00:04:26,840 --> 00:04:28,320 Okay. So there are two slides. Sorry. 49 00:04:28,420 --> 00:04:28,960 Thank you. 50 00:04:30,280 --> 00:04:34,820 Next, one command that's a PowerShell has command list. One 51 00:04:34,820 --> 00:04:38,360 command list which I would like to emphasize upon is get help. 52 00:04:38,560 --> 00:04:43,980 Consider it like man pages for PowerShell. Everything, every 53 00:04:43,980 --> 00:04:47,060 built-in command list, all of the offensive PowerShell tools, 54 00:04:47,280 --> 00:04:50,300 defensive PowerShell tools, everyone tries to be compatible 55 00:04:50,300 --> 00:04:55,220 with this thing. You just type get help or its alias help and 56 00:04:55,220 --> 00:04:59,300 the script name and you'll get a nice list of help topics 57 00:04:59,300 --> 00:05:03,240 available. This is the first place to go if you're trying to 58 00:05:03,240 --> 00:05:07,640 learn PowerShell. And if you're version 3 or more, you may have 59 00:05:07,640 --> 00:05:17,680 to run update help before that. So, for example, let's run help 60 00:05:17,680 --> 00:05:22,960 about get help. Is it visible to the back? Is it visible? Yeah. 61 00:05:23,060 --> 00:05:23,660 Thank you. 62 00:05:23,660 --> 00:05:29,640 So, let's try get help. Get help. That is the list help about 63 00:05:29,640 --> 00:05:38,380 the help system. Okay. So this is how you run PowerShell just. 64 00:05:38,760 --> 00:05:42,800 Okay. You can just go to start menu and type PowerShell or you 65 00:05:42,800 --> 00:05:49,460 can just run it from the command prompt. This is the help about 66 00:05:49,460 --> 00:05:53,640 get help. It comes with a couple of users. You just download a 67 00:05:53,640 --> 00:05:58,080 useful features or parameters, sorry, like this. If you say 68 00:05:58,080 --> 00:06:01,660 hyphen examples, it will list only the examples for that 69 00:06:01,660 --> 00:06:08,600 particular topic. Commandlets. Commandlets are heart and core 70 00:06:08,600 --> 00:06:13,640 of PowerShell. They are written CMD let but spoken commandlet. 71 00:06:14,700 --> 00:06:17,780 They are certainly the best features of PowerShell, task 72 00:06:17,780 --> 00:06:21,800 based, ready to use commands, built in. So that's just 73 00:06:21,800 --> 00:06:27,060 something which you will always dream of on Windows. They follow 74 00:06:27,060 --> 00:06:32,620 a verb noun naming convention. That is a verb dash a noun. For 75 00:06:32,620 --> 00:06:39,340 example, get dash help. Get dash process. Invoke dash something. 76 00:06:39,460 --> 00:06:43,800 Things like this. And you have aliases for commandlets. For 77 00:06:43,800 --> 00:06:50,160 example, have you ever seen LS working on Windows but it works 78 00:06:50,160 --> 00:06:51,720 because it is an alias? 79 00:06:51,720 --> 00:06:55,240 Yes. For the get child item commandlet. You can define your 80 00:06:55,240 --> 00:07:03,300 own aliases as well. Commandlets always return objects so you can 81 00:07:03,300 --> 00:07:07,540 do inert objects but if you want to edit them, that's not possible 82 00:07:07,540 --> 00:07:13,660 but a lot of things could be done. Another commandlet which 83 00:07:13,660 --> 00:07:16,120 could be considered part of the help system and it is really 84 00:07:16,120 --> 00:07:21,560 useful to explore PowerShell is the get command commandlet. If you run it, if you have your window 85 00:07:21,720 --> 00:07:31,540 machine right now with you connected to your DefCon open network, just type this. So, there are a lot 86 00:07:31,540 --> 00:07:36,240 of commandlets on this machine and it depends on the version of PowerShell, I am running 87 00:07:36,240 --> 00:07:47,640 PowerShell version 3. So I have 298 built in commandlets. For version 5, it's like I think in 88 00:07:47,640 --> 00:07:51,700 thousands. It also depends on the number of Microsoft things you have. But you can take a lot of 89 00:07:51,720 --> 00:08:01,320 on your machine. Okay so PowerShell.exe is the shell part and the ISU is the 90 00:08:03,000 --> 00:08:07,960 development part of the PowerShell or the scripting part. It is also a built-in 91 00:08:07,960 --> 00:08:16,960 thing which looks like this. It comes with the Windows Management Framework so 92 00:08:16,960 --> 00:08:23,060 if you have PowerShell you will have this as well. PowerShell scripts are saved 93 00:08:23,060 --> 00:08:31,460 within extension of .ps1 like many other development environments. ISE also 94 00:08:31,460 --> 00:08:35,340 supports context-sensitive help, type completion, selective running, etc. 95 00:08:37,780 --> 00:08:44,020 Execution policies. If you work with Windows machines and you hack 96 00:08:44,020 --> 00:08:46,660 things you will often 97 00:08:46,660 --> 00:08:52,500 listen to this from our sysadmin friends or even from our hacker friends that if 98 00:08:52,500 --> 00:08:57,620 there is an execution policy enabled you may not be able to execute things. For 99 00:08:57,620 --> 00:09:08,840 example, so that the default execution policy on machines is either this or 100 00:09:08,840 --> 00:09:16,480 all sign. So now if I try to run a command or sorry a script 101 00:09:16,660 --> 00:09:26,560 let's say it says that because the execution of scripts has been disabled 102 00:09:26,560 --> 00:09:35,900 on this machine you cannot execute this script. But if you run this EP is a shot 103 00:09:35,900 --> 00:09:43,980 for the execution policy and now if I run this the script has been loaded in 104 00:09:43,980 --> 00:09:46,260 my current PowerShell session and I can run it. 105 00:09:47,360 --> 00:09:53,280 So this is not something which I did, it is by design by Microsoft. 106 00:09:53,440 --> 00:09:59,900 Because execution policy is not supposed to be a security control. In fact I forgot to 107 00:09:59,900 --> 00:10:06,760 add a tweet by Jeffrey Snover who is the designer of PowerShell. They, they add this 108 00:10:07,360 --> 00:10:12,060 deliberately to make it obvious that this is not a security control. You can always 109 00:10:12,780 --> 00:10:16,340 bypass this. It is meant to be by bypassed. It is just there to 110 00:10:16,660 --> 00:10:23,400 users from accidentally executing scripts. Just like this thing. So if you double click a PowerShell 111 00:10:23,400 --> 00:10:33,360 script, it opens up in a notepad. Just to stop you from executing it by mistake. In fact, there are so 112 00:10:33,360 --> 00:10:42,800 many ways that the nice guys at NetSPI have listed 15 ways of bypassing it. So go for it. The last 113 00:10:42,800 --> 00:10:53,840 thing for the theoretical part is basics of modules. So modules are, as in other languages, a collection 114 00:10:53,840 --> 00:11:03,240 of functions or things which you can do. And you may like to do in a single file or in a single script. 115 00:11:04,000 --> 00:11:10,360 So you can always run these commands. You can run get module to list all the available modules on 116 00:11:10,360 --> 00:11:12,780 your machine. The one of integration. 117 00:11:12,800 --> 00:11:21,160 The one of interest for us right now is the import module commandlet. We'll use this. We'll see how we 118 00:11:21,160 --> 00:11:29,860 can use this to import modules. And after you have inserted a module, you can use this to list the 119 00:11:29,860 --> 00:11:36,620 modules imported. The commands exported by a module. So our penetration testing scenario is going 120 00:11:36,620 --> 00:11:42,780 to be this. We need to grab domain admin token or credentials or access some of these. So we're 121 00:11:42,800 --> 00:11:49,200 going to do that somehow. Note that that domain admin is not a good target. If you do penetration 122 00:11:49,200 --> 00:11:56,000 testing professionally, you may like to discuss a goal with your client prior to the engagement. So 123 00:11:56,000 --> 00:12:02,500 DA is really not a good goal. But for this demonstration, let's go for it. So back to our scenario. 124 00:12:02,960 --> 00:12:08,800 In our scenario, the goal is to get DA. But server-side attacks have been largely unsuccessful, which is 125 00:12:08,800 --> 00:12:11,600 generally the case nowadays if you are going from the outside. 126 00:12:12,800 --> 00:12:17,300 And metasploit payloads are being detected by antivirus. Let's assume this. I know you guys are smart. 127 00:12:17,420 --> 00:12:24,560 There are so many ways of bypassing antivirus. But let's just assume this thing. So this is how we are 128 00:12:24,560 --> 00:12:34,140 going to do that. We will run a client-side attack. And one of the ways is to get access to a token 129 00:12:34,140 --> 00:12:39,840 with DA privs. So that was the initial thing I planned, that red-dotted arrow. But that's really very 130 00:12:39,840 --> 00:12:42,780 simple. So what we'll have from client-side attack, we're going to run a client-side attack. We're 131 00:12:42,800 --> 00:12:48,160 going to have access to a SQL server. That SQL server may be running as a local admin or system. 132 00:12:48,980 --> 00:12:55,520 Or as a domain admin. That depends on the time we have at hand and how patient you guys are with me. 133 00:12:56,000 --> 00:13:01,500 So at the end, we will have shell access to the domain as a domain admin. That's the target. 134 00:13:03,420 --> 00:13:11,960 So client-side attacks. PowerShell is the really ideal tool for client-side attacks. It is built-in onto the machines. 135 00:13:11,960 --> 00:13:18,180 antivirus and countermeasures generally don't care about it and not not only it 136 00:13:18,180 --> 00:13:25,100 could be used to weaponize of a word file or something it could also be used 137 00:13:25,100 --> 00:13:29,280 to generate them as we'll see in a second so we'll use client-side experts 138 00:13:29,280 --> 00:13:37,980 from my tool and use it for nasty so this is how we'll use them let's try 139 00:13:37,980 --> 00:13:49,400 outward which we executed just now so outward as the name suggests it will 140 00:13:49,400 --> 00:14:00,500 create a let me go to the classroom first of all let's import nishan to the 141 00:14:00,500 --> 00:14:05,960 current session so that we need not run each script independently 142 00:14:08,940 --> 00:14:13,280 please ignore this warning this has nothing to do with the maliciousness I 143 00:14:13,280 --> 00:14:17,760 just didn't follow the naming convention verb noun naming convention for some of 144 00:14:17,760 --> 00:14:25,960 the scripts so let's use let me clear that let's use outward and then it asks 145 00:14:25,960 --> 00:14:32,100 for a payload we will provide it a PowerShell payload for now let's just say 146 00:14:35,140 --> 00:14:35,940 this thing 147 00:14:35,940 --> 00:14:44,940 you won't be able to see any output right now and that is it so now if you 148 00:14:44,940 --> 00:14:55,140 see here on the desktop of my machine there is a word file called salaried 149 00:14:55,140 --> 00:14:59,960 details talk about you can always use whatever name you want so this is how 150 00:14:59,960 --> 00:15:03,360 we do it i'll show you to how to use payloads with this in a couple of 151 00:15:03,360 --> 00:15:03,800 minutes 152 00:15:03,800 --> 00:15:08,340 So, this is basically how outward works. 153 00:15:08,500 --> 00:15:11,140 You just need to provide a payload to it. 154 00:15:11,300 --> 00:15:15,540 It will generate an auto, so the basic thing is 155 00:15:15,820 --> 00:15:18,380 there is an auto-executable macro inside it. 156 00:15:19,060 --> 00:15:22,760 Please note that that macro is not password protected. 157 00:15:22,980 --> 00:15:25,780 As far as I know, there is no way of programmatically 158 00:15:27,020 --> 00:15:29,500 password protect a macro, at least if you're using 159 00:15:29,500 --> 00:15:32,340 com object of what it doesn't expose that API 160 00:15:32,340 --> 00:15:33,420 or function at all. 161 00:15:33,420 --> 00:15:34,780 That's at least what I know. 162 00:15:35,960 --> 00:15:37,240 So, that was the one way. 163 00:15:37,840 --> 00:15:41,680 Also, you can provide a payload URL to a PowerShell script. 164 00:15:42,100 --> 00:15:45,740 So, the target need to have access to this web server. 165 00:15:45,900 --> 00:15:48,180 It will pull the script and execute it in memory. 166 00:15:50,360 --> 00:15:53,680 So, we're just going through the different methods 167 00:15:53,680 --> 00:15:57,380 or attacks available with client-side attack category 168 00:15:57,380 --> 00:15:58,040 in Nishang. 169 00:15:59,640 --> 00:16:01,820 So, outward, out-excel. 170 00:16:02,540 --> 00:16:03,280 We can also, 171 00:16:03,420 --> 00:16:06,060 we can also use out-HTA, which generates a HTA, 172 00:16:06,180 --> 00:16:09,560 which is a Microsoft, which gets executed by a Microsoft 173 00:16:09,940 --> 00:16:15,860 signed executable MSHTA, and out-CHM, out-shortcut, 174 00:16:15,980 --> 00:16:20,080 which creates a compiled HTML file and LNK file, respectively. 175 00:16:21,020 --> 00:16:24,480 So, we are going to use out-CHM, 176 00:16:25,540 --> 00:16:29,840 because this is going to be our target, and this one. 177 00:16:30,760 --> 00:16:33,400 And I have, so there's a small, small, small, small, small, 178 00:16:33,400 --> 00:16:34,560 small script running over there, 179 00:16:35,200 --> 00:16:37,320 and there is a mail server running over there. 180 00:16:37,420 --> 00:16:41,180 So, if a CHM attachment is signed to it, 181 00:16:41,200 --> 00:16:42,280 it executes it automatically. 182 00:16:42,680 --> 00:16:44,940 So, that is why we are going to use CHM. 183 00:16:46,040 --> 00:16:48,180 And note that our target, this machine, 184 00:16:48,240 --> 00:16:49,060 it's really restrictive. 185 00:16:49,380 --> 00:16:50,240 It is a Windows 8. 186 00:16:51,060 --> 00:16:53,780 It has incoming traffic only on port 25, 187 00:16:54,380 --> 00:16:57,100 outgoing only on 80, 443, and a couple of them. 188 00:16:58,260 --> 00:17:02,100 Only on port 53 for UDP, and I think ICMPV4. 189 00:17:02,240 --> 00:17:02,780 That's it. 190 00:17:03,400 --> 00:17:04,300 So, it's quite a restrictive machine. 191 00:17:06,740 --> 00:17:10,780 Let's generate, okay, prior to that, 192 00:17:10,900 --> 00:17:12,480 we need a reverse shell access. 193 00:17:12,920 --> 00:17:15,540 So, let's go through the shell slides, as well. 194 00:17:17,860 --> 00:17:19,360 Okay, we assume that we can run 195 00:17:19,360 --> 00:17:22,720 successful client-side attacks on our target. 196 00:17:23,580 --> 00:17:27,920 So, now let's use a couple of shells, again, from Nishang, 197 00:17:29,460 --> 00:17:31,960 to be able to get an interactive shell access 198 00:17:31,960 --> 00:17:32,840 on the target machine. 199 00:17:33,400 --> 00:17:36,240 So, we'll use this TCP reverse shell from Nishang. 200 00:17:36,920 --> 00:17:41,300 So, it needs to have only these options, 201 00:17:41,900 --> 00:17:44,300 that is, the IP address to which it will connect, 202 00:17:44,440 --> 00:17:47,160 and on the port on which our listener would be listening. 203 00:17:48,500 --> 00:17:50,240 So, what we are going to do is, 204 00:17:51,160 --> 00:17:53,960 one thing which I forgot to show you is this, 205 00:17:54,740 --> 00:17:59,820 PowerShell supports encoded command parameters, 206 00:17:59,960 --> 00:18:01,000 that is, hyphen e. 207 00:18:01,380 --> 00:18:03,360 So, you can run scripts, like, 208 00:18:03,360 --> 00:18:05,200 PowerShell.exe hyphen e, 209 00:18:05,700 --> 00:18:07,460 and the base64 encoded command. 210 00:18:07,780 --> 00:18:10,600 So, that thing is useful, because, first of all, 211 00:18:10,680 --> 00:18:13,420 if your script contains so many double quotes 212 00:18:13,420 --> 00:18:15,520 and single quotes, that problem is resolved. 213 00:18:15,680 --> 00:18:18,680 Also, it gets executed in memory, as far as I know. 214 00:18:18,880 --> 00:18:20,480 So, that thing never touches disk. 215 00:18:22,380 --> 00:18:22,860 So, 216 00:18:26,200 --> 00:18:26,680 okay. 217 00:18:32,660 --> 00:18:34,060 So, let's get started. 218 00:18:34,180 --> 00:18:40,340 I'm going to use this shell from Nishang. 219 00:18:40,460 --> 00:18:45,020 This is invoke PowerShell TCP one line. 220 00:18:45,160 --> 00:18:47,080 Let me open it in the ISE. 221 00:18:48,660 --> 00:18:50,840 So, this is just a one line shell. 222 00:18:52,540 --> 00:18:54,780 So, the second one is even smaller, 223 00:18:54,860 --> 00:18:56,660 but that doesn't show the output back. 224 00:18:57,560 --> 00:19:00,920 So, I'm going to encode this and use this. 225 00:19:05,900 --> 00:19:08,640 In fact, I think I've already prepared one here. 226 00:19:10,000 --> 00:19:11,980 So, okay, we're going to use this one, 227 00:19:12,040 --> 00:19:13,100 which is the same thing. 228 00:19:19,140 --> 00:19:21,500 So, let's just quickly run invoke encode. 229 00:19:23,720 --> 00:19:26,220 And the TCP, 230 00:19:26,680 --> 00:19:27,420 we're going to use the reverse shell. 231 00:19:29,980 --> 00:19:33,780 And we want it to be executable 232 00:19:33,780 --> 00:19:36,600 with the hyphen E parameter of PowerShell. 233 00:19:37,680 --> 00:19:41,620 So, it is returned to this file. 234 00:19:41,760 --> 00:19:44,240 So, this is our base 64 encoded shell. 235 00:19:47,620 --> 00:19:51,100 Let me start a listener, but not using Linux, 236 00:19:51,240 --> 00:19:53,180 because we are going to use only PowerShell. 237 00:19:53,880 --> 00:19:56,500 Let's use PowerCut, which is an awesome port, 238 00:20:02,020 --> 00:20:02,460 another single port in the network. 239 00:20:02,460 --> 00:20:07,420 And we think we could go on and we really need a lot of 240 00:20:11,580 --> 00:20:11,600 So, this is the output. 241 00:20:11,600 --> 00:20:13,740 This is the output. 242 00:20:13,740 --> 00:20:13,960 And it's very easy to add here, 243 00:20:13,960 --> 00:20:14,060 We are going to run the Bird Map. 244 00:20:14,060 --> 00:20:14,100 We will do this, 245 00:20:16,000 --> 00:20:18,480 So, right now, we're going to see. 246 00:20:23,720 --> 00:20:26,480 We're going to test our�� napht. 247 00:20:30,000 --> 00:20:39,500 our reverse shell if it works or not let's do it on local machine so this is how we use it 248 00:20:40,720 --> 00:20:50,420 so this is what we are going to run on our target and yes because it works let's use it on the target 249 00:20:55,060 --> 00:20:56,160 so here 250 00:21:04,740 --> 00:21:12,080 we're going to use okay we are going to use out CHM because MS office is not there on that machine 251 00:21:13,280 --> 00:21:13,860 you 252 00:21:39,300 --> 00:21:45,520 now to use this one you must have html help workshop installed on on your machine that is 253 00:21:45,520 --> 00:21:50,120 the attackers machine so so we have 254 00:21:50,420 --> 00:22:01,460 all compiled html help file on at this directory now now let's send an email to 255 00:22:01,460 --> 00:22:08,080 to a target if you see if this is proper no it's not 256 00:22:19,800 --> 00:22:23,000 i forgot to start a listener i think oh it's there 257 00:22:26,480 --> 00:22:36,220 so let's see okay so now we have a reverse shell from the target machine which is 112 of windows 258 00:22:36,220 --> 00:22:38,060 8 machine and we have a reverse shell from the target machine which is 112 of windows 8 machine 259 00:22:38,080 --> 00:22:46,200 and we are running as a domain user which may or may not be a domain admin so 260 00:22:47,540 --> 00:22:51,980 this mimics obviously it is not really this easy in an external gig but if you do 261 00:22:52,560 --> 00:22:59,140 for like 100 users you'll get at least 30 or 40 connectbacks that's at least my my dear clients 262 00:22:59,140 --> 00:23:05,500 give give to me so we can assume that now we have a photo machine in fact we have there's no need to 263 00:23:05,500 --> 00:23:15,480 assume it so this starts our post exploitation phase obviously i skipped a couple of starting 264 00:23:15,480 --> 00:23:23,840 phases so now again powershell is one of the best tools for post exploitation for the same 265 00:23:23,840 --> 00:23:29,600 reasons which we discussed it's built in it's powerful and microsoft is going really big on 266 00:23:29,600 --> 00:23:35,300 powershell so this is going to be one of the best things you will ever learn 267 00:23:35,800 --> 00:23:41,220 not this session powershell so now we have an interactive partial session on one of the machines 268 00:23:42,020 --> 00:23:47,660 we can use various powershell tools for it so let's use power view these are from the guys 269 00:23:47,660 --> 00:23:56,080 from veal awesome tool so it has a lot of commandlets or functions or scripts whatever you 270 00:23:56,080 --> 00:24:03,000 want to call them to enumerate a domain but instead of going through everything we'll just use 271 00:24:03,000 --> 00:24:05,260 this one so invoke user 272 00:24:05,500 --> 00:24:13,900 hunter could be used to enumerate a domain to find all the machines where a domain admin is logged 273 00:24:13,900 --> 00:24:19,140 in and if you use the parameter check access with it it will check that if you have a local admin 274 00:24:19,140 --> 00:24:30,480 access to that machine as well which is really sweet so to now there are two ways either i can 275 00:24:30,480 --> 00:24:35,260 use this reverse shell or okay i'll use this 276 00:24:35,500 --> 00:24:36,500 one as well never mind 277 00:24:46,160 --> 00:24:52,340 okay what we are going to do now is we will pull power view or we load power view into the memory 278 00:24:52,340 --> 00:24:59,120 of of this powershell session using this one liner 279 00:25:03,580 --> 00:25:05,480 so as you can see right now on theQueue 280 00:25:05,500 --> 00:25:09,120 Right now we are using .NET to extend the capabilities of PowerShell. 281 00:25:09,480 --> 00:25:16,440 So this, those of you who work with .NET or C Sharp, nat.webclient is a .NET class. 282 00:25:18,100 --> 00:25:29,260 And this is invoke expression, we are just going to, I mean it is up to you, if you want 283 00:25:29,260 --> 00:25:34,640 you can just upload this file there and work that way or we can use this in memory. 284 00:25:34,640 --> 00:25:39,200 So right now this thing will not touch disk at all, it would be in the memory. 285 00:25:45,940 --> 00:25:52,200 As you can see it has been downloaded, so now we must, we should have invoke user hunted 286 00:25:52,200 --> 00:25:52,520 there. 287 00:26:03,220 --> 00:26:04,380 Let's see if. 288 00:26:04,380 --> 00:26:10,220 This is get help compatible, oh yes it is. 289 00:26:10,420 --> 00:26:17,680 So every PowerShell tool you are going to use is the one named there, the one which 290 00:26:17,680 --> 00:26:22,180 are really popular or at least are out there of beta things, they'll support this thing. 291 00:26:22,480 --> 00:26:26,260 So let's just copy this so that I do not have to type this out. 292 00:26:31,840 --> 00:26:34,260 I think I should run this with verbose. 293 00:26:34,380 --> 00:26:36,920 Because we will not see anything, okay. 294 00:26:37,780 --> 00:26:40,880 Let me see if there is any verbose option with this. 295 00:26:41,760 --> 00:26:42,960 No effect of verbosity. 296 00:26:43,160 --> 00:26:50,140 Okay so it, you have to believe this, that it looked for, for machines where a domain 297 00:26:50,140 --> 00:26:54,260 admin is logged in and it has local admin but it was unable to find that thing. 298 00:26:54,600 --> 00:26:58,640 Because there is, there is no such machine, there are only these three machines running 299 00:26:58,640 --> 00:26:59,740 on my lab right now. 300 00:27:00,060 --> 00:27:03,140 So I demonstrated it just because. 301 00:27:03,140 --> 00:27:08,740 Because I have been able to get into, to get the domain admin access by using just 302 00:27:08,740 --> 00:27:09,200 this thing. 303 00:27:10,360 --> 00:27:12,280 So let's move on with this thing. 304 00:27:13,700 --> 00:27:20,200 So after having to fail the, having to get a domain admin with single command, let's 305 00:27:20,200 --> 00:27:21,220 try a couple of more things. 306 00:27:21,660 --> 00:27:29,080 So this is from the nice guys from NetSPI, this script, we will check if the current 307 00:27:30,240 --> 00:27:31,900 user, that is the lab user. 308 00:27:32,500 --> 00:27:33,020 Okay. 309 00:27:33,140 --> 00:27:37,440 With whose privileges we have the access to that machine, we'll see that if it has access 310 00:27:37,440 --> 00:27:38,420 to a database server. 311 00:27:56,080 --> 00:27:58,040 So again, we will do the same thing. 312 00:27:58,260 --> 00:28:01,120 We'll pull our script in the memory. 313 00:28:02,460 --> 00:28:03,120 Of course. 314 00:28:03,120 --> 00:28:04,060 Let's run this PowerShell session. 315 00:28:14,020 --> 00:28:15,800 And let's run this. 316 00:28:23,900 --> 00:28:24,600 Reset. 317 00:28:27,460 --> 00:28:30,040 So what's the name? 318 00:28:32,080 --> 00:28:32,780 Okay. 319 00:28:32,800 --> 00:28:33,080 Let's see. 320 00:28:33,120 --> 00:28:34,560 Let's check access, so. 321 00:28:46,000 --> 00:28:53,780 So as conspired by me, we got access to a couple of SQL servers. 322 00:28:56,600 --> 00:28:57,360 Okay. 323 00:28:57,500 --> 00:29:01,880 No access to only one server on this machine. 324 00:29:01,880 --> 00:29:05,220 Which is, which appears to be a file server. 325 00:29:06,060 --> 00:29:10,940 And there is, okay, there is an SQL server running on the local machine as well. 326 00:29:11,020 --> 00:29:12,240 But we are not interested in that. 327 00:29:12,580 --> 00:29:14,920 And in fact, we have no access to that as well. 328 00:29:18,380 --> 00:29:20,760 So we got access to a database. 329 00:29:22,260 --> 00:29:27,340 You can obviously use this script to execute SQL queries and a lot of things there. 330 00:29:28,760 --> 00:29:34,960 But to execute commands or PowerShell scripts, I'm going to use this thing, which is from 331 00:29:34,960 --> 00:29:37,000 my tool, because I need to promote my tool as well. 332 00:29:37,040 --> 00:29:39,100 I don't want you guys to use others' tools always. 333 00:29:40,500 --> 00:29:42,360 So I'm going to use this thing. 334 00:29:44,900 --> 00:29:48,440 Note this parameter, Windows authentication. 335 00:29:48,700 --> 00:29:55,860 That means we will use the trust relationship we had with the database server, which we 336 00:29:55,860 --> 00:29:56,560 enumerated. 337 00:29:56,560 --> 00:29:57,520 Just now. 338 00:29:59,580 --> 00:30:05,140 So as a lab user, as this, this domain user, which is called lab user, we have access to 339 00:30:05,140 --> 00:30:05,620 the database. 340 00:30:06,020 --> 00:30:09,680 And we have sysadmin, which may or may not be the case. 341 00:30:09,740 --> 00:30:13,260 I mean, it depends on the, on the role of that user in that organization. 342 00:30:18,040 --> 00:30:26,540 So now I will load execute command mssql into sysadmin. 343 00:30:37,200 --> 00:30:38,240 So here is a SQL release. 344 00:30:39,140 --> 00:30:39,680 So now I've loaded the code. 345 00:30:39,680 --> 00:30:39,740 I'm going to see the status. 346 00:30:39,740 --> 00:30:52,640 I'm going to say css. 347 00:30:55,320 --> 00:30:56,080 I'm going to have this. 348 00:30:56,340 --> 00:30:56,540 I'm going to have this. 349 00:30:56,540 --> 00:30:58,620 Our tab completion enabled. 350 00:30:58,820 --> 00:31:00,620 I mean, you need not type everything. 351 00:31:00,800 --> 00:31:03,460 But since we are in a remote shell, 352 00:31:03,600 --> 00:31:05,380 this doesn't support tab completion. 353 00:31:05,560 --> 00:31:06,980 So I need to type out everything. 354 00:31:07,820 --> 00:31:12,080 So the server name was pfptlab file. 355 00:31:16,380 --> 00:31:18,060 And Windows authentication. 356 00:31:19,160 --> 00:31:22,940 I don't think we need to provide anything else. 357 00:31:22,940 --> 00:31:25,800 And payload. 358 00:31:25,980 --> 00:31:27,500 Because we won't be able to... 359 00:31:27,500 --> 00:31:29,340 So generally when you execute it, 360 00:31:29,440 --> 00:31:32,040 it asks you if you want a PowerShell session 361 00:31:32,040 --> 00:31:34,920 or a plain old command prompt or an SQL session. 362 00:31:35,240 --> 00:31:37,060 But that won't be visible here 363 00:31:37,060 --> 00:31:39,440 because we are already on a reverse shell. 364 00:31:39,680 --> 00:31:42,700 So let's just try this first. 365 00:31:44,780 --> 00:31:45,340 Okay. 366 00:31:46,080 --> 00:31:47,540 So as you can see that, 367 00:31:48,940 --> 00:31:52,580 we have access as a service user. 368 00:31:52,940 --> 00:31:55,520 And this is on the remote machine. 369 00:31:56,100 --> 00:31:57,940 If you don't believe me... 370 00:32:06,620 --> 00:32:07,260 Sorry. 371 00:32:08,560 --> 00:32:10,160 Let me just IP config. 372 00:32:10,340 --> 00:32:11,860 I think that dollar... 373 00:32:12,680 --> 00:32:13,000 Okay. 374 00:32:14,440 --> 00:32:18,420 We are on this machine, 230.200. 375 00:32:21,060 --> 00:32:22,140 So right now, 376 00:32:22,160 --> 00:32:22,820 if you... 377 00:32:22,940 --> 00:32:28,240 If you see this thing which we discussed earlier, 378 00:32:29,800 --> 00:32:30,880 we are here. 379 00:32:31,600 --> 00:32:34,020 We had access to SQL server or we are here. 380 00:32:34,100 --> 00:32:35,220 We can say that we are here. 381 00:32:36,500 --> 00:32:37,800 So in fact, 382 00:32:39,740 --> 00:32:42,400 the truth is that we are already... 383 00:32:42,940 --> 00:32:44,440 We already have domain admin. 384 00:32:44,880 --> 00:32:46,140 Because I was... 385 00:32:47,140 --> 00:32:48,400 I don't know about the time. 386 00:32:48,480 --> 00:32:51,020 If you want, I can just restart that as a local system 387 00:32:51,020 --> 00:32:52,060 and do all that thing. 388 00:32:52,940 --> 00:32:55,640 So if you notice, 389 00:32:55,720 --> 00:33:00,320 we were running as Grave service, 390 00:33:00,480 --> 00:33:02,720 which is actually a domain admin in my lab. 391 00:33:03,900 --> 00:33:07,280 To check that, I'll just try... 392 00:33:10,460 --> 00:33:10,760 Okay. 393 00:33:14,560 --> 00:33:18,020 Let's try to run the command on the domain controller. 394 00:33:27,560 --> 00:33:30,500 So invoke command is a built-in PowerShell command. 395 00:33:30,700 --> 00:33:33,340 So invoke command is a built-in PowerShell command. 396 00:33:33,340 --> 00:33:34,980 This is the domain controller. 397 00:33:43,620 --> 00:33:45,580 Let's run IP config there 398 00:33:45,580 --> 00:33:47,140 and see if it works. 399 00:33:50,800 --> 00:33:51,440 Okay. 400 00:33:52,280 --> 00:33:52,920 Let's run IP config there. 401 00:33:58,900 --> 00:34:06,100 We are able to execute commands on the domain controller. So 402 00:34:06,100 --> 00:34:10,600 that was one of the simpler cases. But this is from one of 403 00:34:10,600 --> 00:34:15,140 my actual penetration tests. I used it. I did that exactly the 404 00:34:15,140 --> 00:34:19,760 same way. Created client side attacks, sent it to the clients. 405 00:34:19,760 --> 00:34:24,280 Of course, that involved a lot of enumeration where I need to 406 00:34:24,280 --> 00:34:29,380 figure out the email addresses and the potential targets for 407 00:34:29,380 --> 00:34:34,020 phishing and their roles in the organization of my client. So 408 00:34:34,540 --> 00:34:40,220 that was one of the cases. Now, I don't know if I'm going to try 409 00:34:40,220 --> 00:34:44,220 this because this is something really scary and takes a long 410 00:34:44,220 --> 00:34:47,800 time. But I don't do video demonstrations, so I don't have 411 00:34:47,800 --> 00:34:48,520 a video as well. 412 00:34:49,760 --> 00:34:53,800 If we did not have access as a domain controller or our SQL 413 00:34:54,460 --> 00:34:59,300 server was not running as a domain controller or as a system 414 00:34:59,960 --> 00:35:04,840 or a local service, or not as a local service, if it was running 415 00:35:04,840 --> 00:35:10,800 at least as a system, we can use this script from PowerSploit, 416 00:35:10,920 --> 00:35:14,580 another really, really awesome collection of scripts for 417 00:35:15,920 --> 00:35:19,520 PowerShell. In fact, the guy who wrote this just gave a talk in 418 00:35:19,760 --> 00:35:24,120 the lab this year, over WMI. So you can use invoked token 419 00:35:24,120 --> 00:35:29,560 manipulation. Okay, invoked token manipulation is written by 420 00:35:29,560 --> 00:35:36,240 Joe, who is here as well. So you can use it to manipulate or 421 00:35:36,240 --> 00:35:43,180 reuse or replay tokens of different users on a machine. So 422 00:35:43,180 --> 00:35:48,140 imagine this. Because we have system access on that machine, 423 00:35:48,240 --> 00:35:49,740 we would be able to use it to manipulate or reuse or replay 424 00:35:51,700 --> 00:35:56,400 tokens on that machine. And on that database server, there is a 425 00:35:56,400 --> 00:36:02,880 service running as the domain admin. So if you want, I can give 426 00:36:02,880 --> 00:36:07,220 it a try. But it takes time. I can show you the process. So 427 00:36:07,220 --> 00:36:10,580 there's something which is there to show at least. So it takes 428 00:36:10,580 --> 00:36:14,240 actually this long. I plan to do it. But when I tested it in my 429 00:36:14,240 --> 00:36:17,480 lab, it took really long, like half an hour to do that. There 430 00:36:17,480 --> 00:36:18,360 were so many fields. 431 00:36:20,420 --> 00:36:26,800 So do you want me to try that? Hands up. Oh, you guys are in 432 00:36:26,800 --> 00:36:32,700 minority, so no. I'll definitely show you. So if you're really 433 00:36:32,700 --> 00:36:38,120 interested, I'll definitely show you maybe after this. Or I don't 434 00:36:38,120 --> 00:36:41,740 want to ruin everyone else's mood that, okay, this was a 435 00:36:42,320 --> 00:36:46,120 Windows attack platform and didn't work. So let's just move 436 00:36:46,120 --> 00:36:49,740 on. But I do have time. Let me try this. So let me try this. 437 00:36:53,320 --> 00:36:59,840 Okay. So please be aware that there could be fails. There would 438 00:36:59,840 --> 00:37:06,540 be things which I can figure out. So what I'm going to do, I'm 439 00:37:06,540 --> 00:37:10,520 going to restart the SQL Server service which is currently running 440 00:37:10,520 --> 00:37:14,360 as a domain admin to a local system. 441 00:37:28,420 --> 00:37:29,060 I'm going to show you one of the things that can be done to 442 00:37:29,060 --> 00:37:37,320 this at the end. Okay. So I think I shall just close this thing. 443 00:37:40,820 --> 00:37:49,640 Now if I run Swatch Closely. If this works, because I don't know 444 00:37:49,640 --> 00:37:49,740 whether this will work or not, but I'm just going to run it in a 445 00:37:49,740 --> 00:37:51,900 Windows authentication may work or may not work 446 00:37:51,900 --> 00:37:54,220 because of that change. 447 00:37:54,500 --> 00:37:58,960 If it works, okay, it says the target principal name 448 00:37:58,960 --> 00:38:03,520 is incorrect and cannot generate SSPI context. 449 00:38:04,860 --> 00:38:05,580 That's bad. 450 00:38:15,160 --> 00:38:17,680 Okay, but this is the first time I'm having a look 451 00:38:17,680 --> 00:38:18,660 at this thing, actually. 452 00:38:21,180 --> 00:38:23,060 So we have to make a couple of assumptions. 453 00:38:23,500 --> 00:38:25,400 I will log into that Windows 8 machine 454 00:38:25,400 --> 00:38:27,240 and assume that I have RDP access to that. 455 00:38:27,360 --> 00:38:28,340 There's no other way around. 456 00:38:30,360 --> 00:38:31,420 Is that acceptable? 457 00:38:34,140 --> 00:38:34,580 Thanks. 458 00:38:39,660 --> 00:38:43,520 Okay, this is how our CHM after execution looks like. 459 00:38:43,680 --> 00:38:45,580 So this is something which is not really good. 460 00:38:45,880 --> 00:38:47,440 It shows the CHM file. 461 00:38:47,660 --> 00:38:48,960 But if you use outward 462 00:38:48,960 --> 00:38:53,000 or out-excel, they're really clear, really clean. 463 00:38:53,280 --> 00:38:54,760 User doesn't see anything. 464 00:38:55,040 --> 00:38:58,140 So okay, it has been executed for so many times. 465 00:39:02,020 --> 00:39:03,780 I think I'll just clean this. 466 00:39:03,900 --> 00:39:07,840 So the script on the target, it just saves the attachments 467 00:39:07,840 --> 00:39:10,140 to this directory and it gets executed, 468 00:39:10,300 --> 00:39:11,660 just to mimic a normal user. 469 00:39:11,920 --> 00:39:13,420 They always open every attachment. 470 00:39:14,380 --> 00:39:16,280 So let me just close this. 471 00:39:22,120 --> 00:39:25,540 And I think I do have everything here on this target. 472 00:39:35,800 --> 00:39:38,640 I don't know, I think I should not have this error. 473 00:39:38,960 --> 00:39:41,280 Wow, wow, it's not there. 474 00:39:41,420 --> 00:39:42,260 So it took some time. 475 00:39:42,860 --> 00:39:43,920 Wow, nice, yes. 476 00:39:44,580 --> 00:39:48,140 So as you can see that, we are system now. 477 00:39:48,140 --> 00:39:49,460 Now demo gods are happy with me. 478 00:39:51,120 --> 00:39:53,000 So we are now running a system. 479 00:39:53,200 --> 00:39:56,040 Now we'll go through a painful process 480 00:39:56,040 --> 00:40:00,000 of trying to get domain admin access 481 00:40:00,000 --> 00:40:01,840 on that machine using this thing. 482 00:40:04,440 --> 00:40:09,020 So we must run PowerCat on attacker's machine, okay? 483 00:40:10,720 --> 00:40:12,160 On port 443. 484 00:40:15,560 --> 00:40:16,840 So here it goes. 485 00:40:16,840 --> 00:40:18,460 Okay, it's already there. 486 00:40:18,640 --> 00:40:20,420 So it's the complete thing. 487 00:40:20,640 --> 00:40:22,920 Yeah, we did code exec using client-side attacks. 488 00:40:24,220 --> 00:40:30,680 Now here, we have the execute command MSSQL running as well. 489 00:40:30,960 --> 00:40:33,120 Now, if you see this command, 490 00:40:35,920 --> 00:40:37,840 what we are trying to do here is, 491 00:40:38,440 --> 00:40:41,440 we will pull PowerCat in our existing reverse shell, 492 00:40:42,240 --> 00:40:46,820 add a relay, because we do not have direct connection, 493 00:40:46,840 --> 00:40:48,160 to the PFPT lab file. 494 00:40:48,380 --> 00:40:49,360 So we are sitting here. 495 00:40:49,440 --> 00:40:50,380 I do not have a network diagram. 496 00:40:50,700 --> 00:40:52,600 So if this is our attacker's machine, 497 00:40:53,100 --> 00:40:54,940 and this is the client-side, 498 00:40:54,940 --> 00:40:56,740 so the third portal is PFPT lab. 499 00:40:56,900 --> 00:40:58,520 So I do not have direct access. 500 00:40:58,600 --> 00:40:59,080 I'll go there. 501 00:40:59,340 --> 00:41:01,160 And from this machine, I have to go there. 502 00:41:01,720 --> 00:41:03,840 So for that, we need relays. 503 00:41:04,660 --> 00:41:06,220 PowerCat, because it's awesome, 504 00:41:06,380 --> 00:41:09,360 it has the capability of adding temporary relays as well. 505 00:41:09,500 --> 00:41:10,440 So let's use that. 506 00:41:13,100 --> 00:41:14,740 And this relay is, 507 00:41:18,140 --> 00:41:19,840 it, as you can see, 508 00:41:19,920 --> 00:41:23,640 it forwards port 8000 of our Windows 8 machine 509 00:41:24,160 --> 00:41:26,540 to port 80 of our attacker's machine. 510 00:41:27,800 --> 00:41:29,260 Let's just quickly run this. 511 00:41:29,540 --> 00:41:31,220 I'm running it as a PowerShell job. 512 00:41:31,760 --> 00:41:33,820 That's what the start job command let do. 513 00:41:37,040 --> 00:41:39,720 Okay, looks good. 514 00:41:42,060 --> 00:41:42,780 Let's try. 515 00:41:46,080 --> 00:41:47,920 Okay, so the job has been started. 516 00:41:48,080 --> 00:41:50,260 That means it may be working. 517 00:41:52,500 --> 00:41:55,040 Now we need to start another listener. 518 00:41:58,560 --> 00:41:59,080 Okay. 519 00:42:02,520 --> 00:42:05,080 I need to run it on this machine. 520 00:42:07,420 --> 00:42:08,780 This port, and try it again. 521 00:42:26,880 --> 00:42:28,280 Okay. 522 00:42:29,300 --> 00:42:30,700 Okay. 523 00:42:30,700 --> 00:42:42,760 And we get the Atlas. 524 00:42:57,380 --> 00:43:02,840 okay so the idea is to pull power cut here on the windows 8 machine that's our target 525 00:43:02,840 --> 00:43:11,480 and add a relay okay but that's not working right now so so let me check the check the 526 00:43:11,480 --> 00:43:19,740 power rule see if I have the portal out or not it should not be sorry no no no windows is too long 527 00:43:29,720 --> 00:43:35,620 because we have these four ports allowed on on the outside so they should be absolutely fine 528 00:43:38,660 --> 00:43:40,720 let me just try running this once more 529 00:43:52,940 --> 00:43:59,980 I have to move move from this thing I'm sorry so maybe catch me after this I mean this works 530 00:43:59,980 --> 00:44:08,740 trust me but sorry no video demonstrations still so so the basic thing is this if you have even 531 00:44:08,740 --> 00:44:11,460 if you can use tokens you can use tokens you can use tokens you can use tokens you can use tokens 532 00:44:11,480 --> 00:44:19,060 you can do it remotely now I can show it really ugly way if you want really ugly I mean really 533 00:44:19,060 --> 00:44:27,320 really ugly do not try this at home it's that ugly I can just turn off the firewall on this 534 00:44:27,320 --> 00:44:34,320 machine so that I have a direct access oh it's off Wow because of some testing well that's that's 535 00:44:34,320 --> 00:44:40,060 great so now we'll have a direct shell access to that machine assuming that thing so this is our 536 00:44:44,760 --> 00:44:52,540 let's quickly run a listener on some oh okay 537 00:45:02,100 --> 00:45:11,020 it's already in use so I'll use this thing so I have a listener running here so I'll just change 538 00:45:11,480 --> 00:45:14,040 the network so that we can quickly have a look at that thing 539 00:45:26,200 --> 00:45:36,380 I always wish I can do this in real penetration tests so now we have access to that machine and 540 00:45:36,380 --> 00:45:39,200 now if we just put 541 00:45:41,920 --> 00:45:47,200 into with inside the traffic control on that at the time at the logic side we want to work with 542 00:45:47,200 --> 00:45:53,140 this so basically we want this to run along the rural network so let's try a little bit 543 00:45:53,140 --> 00:45:53,260 quit the linear here I want to realize that it's running like this backwards so to start with 544 00:45:53,260 --> 00:45:53,420 right so right we're going to log into orbits system so first we're going to have to activate 545 00:45:53,420 --> 00:45:53,480 that one right where it can it can run it can just and we go back to the project manager so 546 00:45:53,480 --> 00:46:06,060 let's add in there we need to do PTX input on that behavioral meaning user cmd operation 547 00:46:06,060 --> 00:46:06,480 which involved two different options one is empty key which is greater than one I should say 548 00:46:06,480 --> 00:46:11,460 I would have to I might have to use double just now so just easier except for the contract 549 00:46:14,200 --> 00:46:38,020 Okay, and now if we run it quickly, wait, okay, let me try it again. 550 00:46:58,440 --> 00:47:01,220 Let me check if it is there now. 551 00:47:04,520 --> 00:47:07,640 Okay, it's there, so let's run it. 552 00:47:07,640 --> 00:47:08,740 Let me just copy this. 553 00:47:27,680 --> 00:47:29,180 Okay, let me try the lucky port. 554 00:47:32,880 --> 00:47:33,300 Okay. 555 00:47:54,640 --> 00:47:57,060 Okay, let me try the lucky port. 556 00:47:57,100 --> 00:47:57,260 Okay. 557 00:47:57,420 --> 00:47:57,880 Okay. 558 00:48:16,360 --> 00:48:17,280 Okay. 559 00:48:18,200 --> 00:48:19,120 Okay. 560 00:48:19,580 --> 00:48:20,420 Okay. 561 00:48:20,820 --> 00:48:21,740 Okay. 562 00:48:21,740 --> 00:48:23,380 So this is my last attempt. 563 00:48:24,340 --> 00:48:25,260 Okay. 564 00:48:25,680 --> 00:48:26,600 Okay. 565 00:48:26,600 --> 00:48:27,760 Let me just move this thing. 566 00:48:30,040 --> 00:48:30,520 Okay. 567 00:48:33,380 --> 00:48:40,700 So in any case, you can use this to enumerate them, enumerate the tokens, and then reuse them. 568 00:48:40,940 --> 00:48:48,940 So the basic idea was that we'll create a reverse shell with the token of the domain admin, and then we'll have domain admin access. 569 00:48:49,260 --> 00:48:52,580 But never mind, we had the access already in some other scenario. 570 00:48:53,280 --> 00:48:55,340 So how do we do it? 571 00:49:04,140 --> 00:49:07,180 Admit to use it? 572 00:49:07,180 --> 00:49:10,940 Let's eaten it and expect tourists to experience the true nature of anھیb 1940 s. 573 00:49:11,020 --> 00:49:12,260 Here is some training. 574 00:49:12,640 --> 00:49:12,840 Here's the basic idea we did to explicar 575 00:49:12,840 --> 00:49:13,000 Havingehienna is wild. 576 00:49:13,000 --> 00:49:13,120 Acitz? 577 00:49:22,840 --> 00:49:23,200 And this is a place where you don't come straight up to look. 578 00:49:23,200 --> 00:49:23,540 I'm going to use it right now . 579 00:49:23,540 --> 00:49:23,560 Okay. 580 00:49:23,660 --> 00:49:25,320 We have done it in one of the experiments. 581 00:49:25,320 --> 00:49:35,520 useful part. Also, make your users aware. Work on user awareness that if someone is 582 00:49:35,520 --> 00:49:40,920 sending you, if you get an unsolicited email, do not open attachments. I mean, that fails 583 00:49:41,820 --> 00:49:49,100 a lot, but keep trying. Keep trying to make them aware. And this is because in my talk, 584 00:49:49,100 --> 00:49:54,820 system admins generally feel like that I'm targeting them. No. If a determined hacker 585 00:49:54,820 --> 00:49:59,920 or an attacker can get inside your machine, a determined system admin would be able to 586 00:49:59,920 --> 00:50:04,040 catch them. It's your environment. It's your backyard. You will be able to catch him. And 587 00:50:04,540 --> 00:50:09,820 shouts to these guys. They're all PowerShell hackers. Many of them are here. So ask them 588 00:50:09,820 --> 00:50:14,200 on Twitter. Meet them. If you're really into PowerShell hacking, you must meet these guys. 589 00:50:15,200 --> 00:50:18,880 And closing remarks. Bad guys are already 590 00:50:18,880 --> 00:50:19,080 dead. 591 00:50:19,100 --> 00:50:26,080 Using it, you will see so many malwares or bad guys using PowerShell. Use this. And 592 00:50:26,080 --> 00:50:31,680 of course, this is my original code. PowerShell is not the feature of Windows penetration 593 00:50:31,680 --> 00:50:37,240 testing. It is the present. And at last, some shameless self-promotion. I do PowerShell 594 00:50:37,240 --> 00:50:45,280 training. So just check out the schedule. If you like it, attend it. And all the information 595 00:50:45,280 --> 00:50:48,740 you may like. Just catch me for some stickers if you want. Off to the top. 596 00:50:49,100 --> 00:50:49,800 So that's it.