1 00:00:00,000 --> 00:00:02,780 Chuck Norris came to me the other day. He said, 2 00:00:02,860 --> 00:00:05,440 John, I need some tools to help me hack VMware. 3 00:00:07,060 --> 00:00:08,120 So I got to work. 4 00:00:08,960 --> 00:00:09,360 Mike. 5 00:00:14,560 --> 00:00:16,300 Well, that's not entirely what happened. 6 00:00:16,640 --> 00:00:18,440 In fact, it's not at all what happened. 7 00:00:19,100 --> 00:00:23,100 But just in case Chuck comes around, I've got some stuff ready for him. 8 00:00:24,260 --> 00:00:26,780 So this evening we're going to take a look at VMware. 9 00:00:26,960 --> 00:00:29,300 We're going to look at some ways of attacking VMware networks. 10 00:00:30,000 --> 00:00:32,660 And I'll also show you the tools that I've developed to help us do this. 11 00:00:33,660 --> 00:00:36,960 So afterwards, hopefully, you'll all be leaked VMware hackers 12 00:00:36,960 --> 00:00:40,040 able to own an entire network just by popping the one box. 13 00:00:41,540 --> 00:00:42,980 My name's John Fitzpatrick. 14 00:00:43,120 --> 00:00:46,760 I work as a pen tester for MWR Info Security in the UK. 15 00:00:49,540 --> 00:00:52,980 For the last six months or so, I've spent all of my spare hours 16 00:00:52,980 --> 00:00:55,300 battling against VMware's APIs. 17 00:00:56,700 --> 00:00:59,400 And in the process, I've found some pretty interesting stuff. 18 00:01:00,120 --> 00:01:02,540 And it's my intention today to share this with you. 19 00:01:02,680 --> 00:01:05,220 I will demonstrate some of the potential attack vectors. 20 00:01:05,980 --> 00:01:07,520 Hopefully, you'll learn something interesting. 21 00:01:09,140 --> 00:01:12,760 The slides have changed slightly from what's on the DVD, but not massively. 22 00:01:13,160 --> 00:01:17,080 But the latest slides will be available to pull down from our website. 23 00:01:17,240 --> 00:01:18,640 And I'll give you the URLs at the end. 24 00:01:19,040 --> 00:01:22,480 And as was mentioned, I'll be in the QA room afterwards if anyone's got any questions. 25 00:01:26,420 --> 00:01:27,700 So why VMware? 26 00:01:28,920 --> 00:01:29,880 Well, virtualization. 27 00:01:30,000 --> 00:01:30,660 Virtualization's taken off. 28 00:01:35,120 --> 00:01:36,020 Virtualization's taken off. 29 00:01:36,140 --> 00:01:40,080 And it's rare that I go on a pen test now and not see some form of virtualization. 30 00:01:40,920 --> 00:01:41,820 Normally, it's VMware. 31 00:01:43,380 --> 00:01:47,140 In fact, this research was all kicked off when I was on a pen test. 32 00:01:47,360 --> 00:01:49,680 And I gained access to VMware server console. 33 00:01:50,980 --> 00:01:52,380 But the desktop was locked. 34 00:01:53,020 --> 00:01:55,220 And it meant if I wanted to get anywhere with that, 35 00:01:55,320 --> 00:01:57,320 I'd have had to boot the guy off that was on the box. 36 00:01:58,960 --> 00:01:59,360 Which... 37 00:01:59,360 --> 00:02:00,620 Which probably wasn't a good idea. 38 00:02:01,620 --> 00:02:03,400 In this case, it wasn't such a problem. 39 00:02:03,520 --> 00:02:05,340 We could gain access to the box in other ways. 40 00:02:06,160 --> 00:02:08,520 But I thought, well, if that comes up again in the future, 41 00:02:08,600 --> 00:02:09,940 I want to be able to get on this box. 42 00:02:10,440 --> 00:02:11,480 And I want to have a play. 43 00:02:13,000 --> 00:02:15,680 So I guess probably a lot of you have played about with VMware before. 44 00:02:16,940 --> 00:02:21,800 Some of you maybe have got virtualized networks back in your office or wherever you work. 45 00:02:25,600 --> 00:02:26,940 Well, the structure of the presentation. 46 00:02:27,260 --> 00:02:28,720 We're going to start by looking at VMware. 47 00:02:28,820 --> 00:02:29,340 The difficulties. 48 00:02:29,340 --> 00:02:29,600 The different flavors. 49 00:02:30,020 --> 00:02:31,000 And some of the key concepts. 50 00:02:32,000 --> 00:02:33,840 We'll move on to VMware server. 51 00:02:34,080 --> 00:02:35,640 We'll look at some ways of attacking that. 52 00:02:35,920 --> 00:02:39,060 And I've got about six demos in total to show you. 53 00:02:39,120 --> 00:02:41,000 So hopefully they'll all run fine. 54 00:02:43,820 --> 00:02:46,000 Some of these demos are for ESX. 55 00:02:46,220 --> 00:02:47,360 And we'll look at ESX. 56 00:02:47,380 --> 00:02:49,040 Some of the different attack vectors for that. 57 00:02:50,320 --> 00:02:55,200 And we'll move on to a tool which was developed by a colleague of mine called Dradis. 58 00:02:55,800 --> 00:02:57,980 Which is a good tool for information sharing. 59 00:02:58,160 --> 00:02:59,320 Sort of structuring your information. 60 00:02:59,340 --> 00:03:00,660 While you're on a pen test. 61 00:03:01,540 --> 00:03:04,720 And then of course we'll shift on to some recommendations afterwards. 62 00:03:04,940 --> 00:03:07,880 And see how you can sort of help protect yourself if you're running VMware. 63 00:03:11,480 --> 00:03:11,960 Right. 64 00:03:12,300 --> 00:03:14,560 Well, we'll kick off with an introduction to VMware. 65 00:03:20,440 --> 00:03:22,620 There's loads of different flavors of VMware. 66 00:03:22,800 --> 00:03:24,300 But here's a few listed here. 67 00:03:24,580 --> 00:03:26,500 You start off with the basic player. 68 00:03:26,620 --> 00:03:28,760 Which is there simply to play virtual machines. 69 00:03:30,440 --> 00:03:30,840 Workstations. 70 00:03:30,840 --> 00:03:32,060 Perhaps a step up from that. 71 00:03:33,080 --> 00:03:34,960 You've got far more functionality there. 72 00:03:35,020 --> 00:03:36,220 You can create snapshots. 73 00:03:36,220 --> 00:03:36,960 That kind of thing. 74 00:03:39,220 --> 00:03:40,000 VMware server. 75 00:03:40,280 --> 00:03:43,720 Or kind of what used to be called GSX. 76 00:03:46,220 --> 00:03:48,180 And ESX I guess are the two main ones. 77 00:03:48,640 --> 00:03:50,440 They're the ones I'm interested in anyway. 78 00:03:50,540 --> 00:03:52,820 Because they're the ones that expose the service on the network. 79 00:03:53,140 --> 00:03:57,180 And so purely because of that they provide something that we can attack. 80 00:03:59,340 --> 00:04:01,600 So we're going to look at server and ESX today. 81 00:04:04,900 --> 00:04:06,920 So the key concept with virtualization. 82 00:04:06,920 --> 00:04:08,080 You have one server. 83 00:04:08,100 --> 00:04:10,160 Which can run multiple guest operating systems. 84 00:04:11,460 --> 00:04:14,940 So essentially one piece of hardware can be many, many boxes on your network. 85 00:04:16,400 --> 00:04:19,100 In fact with VMware's virtual infrastructure. 86 00:04:19,200 --> 00:04:23,040 This kind of comes out more in a many, many relationship. 87 00:04:23,200 --> 00:04:25,540 Perhaps you'll run multiple ESX boxes. 88 00:04:25,680 --> 00:04:27,760 Again with multiple operating systems on it. 89 00:04:30,780 --> 00:04:33,140 Or VMware server looks something like this. 90 00:04:33,320 --> 00:04:34,300 You've got your hardware. 91 00:04:34,520 --> 00:04:36,820 On top of that you'll install your operating system. 92 00:04:37,140 --> 00:04:39,300 Whether this be Windows, Linux, whatever. 93 00:04:40,380 --> 00:04:43,020 The operating system is the light blue layer at the bottom. 94 00:04:44,220 --> 00:04:46,440 On top of that you'll install VMware server. 95 00:04:47,140 --> 00:04:49,640 And then on top of that you can create your virtual machines. 96 00:04:49,760 --> 00:04:51,680 Which all have their own operating system. 97 00:04:52,480 --> 00:04:54,880 And whatever applications you're running on them. 98 00:04:57,940 --> 00:04:59,320 Now ESX is slightly different. 99 00:05:00,760 --> 00:05:03,940 ESX, well, essentially is the operating system. 100 00:05:04,280 --> 00:05:08,700 So by running ESX you strip out one layer of the complexity there. 101 00:05:09,600 --> 00:05:12,200 Your virtual machines therefore can talk to ESX. 102 00:05:12,260 --> 00:05:13,800 Which can talk directly to the hardware. 103 00:05:14,060 --> 00:05:16,600 So if you want to give 2GB of RAM to a virtual machine. 104 00:05:16,900 --> 00:05:20,920 It's got no operating system to contend with for that RAM. 105 00:05:21,080 --> 00:05:22,560 It can talk directly to ESX. 106 00:05:22,620 --> 00:05:24,560 Which will give it the RAM it wants. 107 00:05:32,440 --> 00:05:36,240 now virtual machines because they're virtual they're made up of several different files 108 00:05:37,140 --> 00:05:43,980 here's a few of them the vmx files the main configuration file this is what's actually 109 00:05:43,980 --> 00:05:48,940 executed by vmware and it contains things like the virtual machine name settings mac address 110 00:05:49,520 --> 00:05:57,100 hard drive settings that kind of thing vmdk is the disk file it's essentially the virtual 111 00:05:57,100 --> 00:06:00,780 machines hard drive and it stores all your data that's stored on your virtual machine 112 00:06:04,780 --> 00:06:09,300 vmsn because of the way virtual machines work you can create snapshots of them quite easily 113 00:06:09,300 --> 00:06:14,420 so if you want to go screwing about with something you just create a snapshot of your machine if it 114 00:06:14,420 --> 00:06:20,260 ends up messing up your machine you can just revert back with no problems at all and that 115 00:06:20,260 --> 00:06:26,140 information stored in the vmsn file and then you've got the vmem file which is your virtual 116 00:06:26,140 --> 00:06:26,920 machines memory 117 00:06:26,920 --> 00:06:30,900 now you're not going to see this unless your virtual machine is running or maybe it's crashed 118 00:06:30,900 --> 00:06:33,300 you'll probably see it for some of your snapshots though 119 00:06:39,320 --> 00:06:46,700 now because virtual machines have a disk file we can look into reading data from that and 120 00:06:46,700 --> 00:06:50,980 the first time i'll show you we'll read some data from a disk file and show you how important 121 00:06:50,980 --> 00:06:55,080 it is that you ensure that this is secured and protected on your network 122 00:07:12,740 --> 00:07:16,660 right the tool we're going to use for this is a tool provided by vmware 123 00:07:18,400 --> 00:07:20,640 it's uh what we call vmware mount 124 00:07:22,540 --> 00:07:25,560 can you read the text on that at the back is that okay 125 00:07:26,460 --> 00:07:26,900 yeah i can read the text on that at the back 126 00:07:26,920 --> 00:07:33,120 yep yep cool um here first of all we're going to take a look at the partition table on the 127 00:07:33,120 --> 00:07:39,340 virtual machine it's it's a windows xp machine you can see that specifiable pretty much from 128 00:07:39,340 --> 00:07:41,580 the name of the disk file we're specifying 129 00:07:46,060 --> 00:07:48,880 if we run that we can see that there's just one partition 130 00:07:48,880 --> 00:07:52,840 it's ntfs which is kind of what we'd expect if it's a windows machine 131 00:07:57,440 --> 00:08:08,120 next steps just to mount that and we do that again with the same command we specify the partition we want to mount and where we want to mount it to in this case we're mounting it to slash mount slash vmware 132 00:08:11,140 --> 00:08:12,580 just say yes to them 133 00:08:15,200 --> 00:08:16,820 there you go we've mounted the drive 134 00:08:18,700 --> 00:08:21,180 if we just change to a new window there 135 00:08:28,360 --> 00:08:31,700 there you go we can see the contents of our our windows hard drive 136 00:08:33,260 --> 00:08:35,400 uh... so from that we can have a quick play 137 00:08:38,600 --> 00:08:40,780 in this case we'll jump into the 138 00:08:42,340 --> 00:08:44,420 system32 config file our directory 139 00:08:49,680 --> 00:08:50,800 grab the sys key 140 00:08:54,540 --> 00:08:56,340 and then pull out the password hashes 141 00:09:01,780 --> 00:09:05,360 and then from there it's nice and easy just to run a tool like John the Ripper 142 00:09:07,020 --> 00:09:09,520 and we can use that just to crack all the passwords 143 00:09:10,760 --> 00:09:11,520 which is done 144 00:09:11,520 --> 00:09:12,800 quite nicely there 145 00:09:21,460 --> 00:09:23,960 now in this case we went for the password file 146 00:09:23,960 --> 00:09:26,900 um... well for the passwords for the box we could have gone for the password file 147 00:09:26,920 --> 00:09:28,160 for anything any sensitive files 148 00:09:28,160 --> 00:09:32,680 and one thing that's worth noting is because you've got the ability to create snapshots 149 00:09:33,260 --> 00:09:36,360 as soon as you build your virtual machine all of your files on that are there 150 00:09:37,440 --> 00:09:40,540 and any changes you make are then made on top of that 151 00:09:41,540 --> 00:09:46,000 so so that you can revert to your original virtual machine your original files are still there 152 00:09:46,000 --> 00:09:47,780 so anything you delete on your disk file 153 00:09:48,500 --> 00:09:48,940 um... 154 00:09:49,820 --> 00:09:53,020 it's still there even if it's not present on the virtual machine 155 00:10:09,680 --> 00:10:12,660 right so we've had a look at some of the key concepts of vmware 156 00:10:12,660 --> 00:10:15,500 next we'll shift on and have a look at vmware server 157 00:10:17,680 --> 00:10:20,420 now vmware server looks something like this 158 00:10:20,420 --> 00:10:23,260 in fact it looks exactly like that that's a screenshot 159 00:10:25,100 --> 00:10:25,580 um... 160 00:10:26,320 --> 00:10:26,900 now vmware server looks something like this 161 00:10:26,920 --> 00:10:30,360 now vmware server is managed through the console which is what you can see there 162 00:10:31,240 --> 00:10:35,840 on the left we've got the inventory which contains a list of all the virtual machines 163 00:10:35,840 --> 00:10:37,660 and on the right we've got the 164 00:10:39,060 --> 00:10:42,240 well the window there with the desktop on there 165 00:10:42,650 --> 00:10:43,920 now that's all vnc 166 00:10:44,380 --> 00:10:45,800 so if you're administering 167 00:10:46,840 --> 00:10:47,300 uh... 168 00:10:47,300 --> 00:10:51,480 your vm from the console be aware that anyone else that's logged onto that server can also 169 00:10:51,480 --> 00:10:52,220 watch what you're doing 170 00:10:52,630 --> 00:10:55,880 which is probably part of the reason that vmware recommend that you don't manage 171 00:10:55,880 --> 00:10:56,640 uh... your 172 00:10:56,920 --> 00:10:58,400 virtual machines from the console 173 00:10:59,480 --> 00:11:02,400 uh... but also i guess there's some performance 174 00:11:03,420 --> 00:11:04,800 uh... issues there if you do 175 00:11:05,720 --> 00:11:09,060 now vmware server will authenticate against the local accounts in the box 176 00:11:09,530 --> 00:11:13,260 so you know be careful if you've got guest account enabled because someone could just 177 00:11:13,260 --> 00:11:14,460 jump on your box and browse 178 00:11:15,020 --> 00:11:15,980 browse through it 179 00:11:16,610 --> 00:11:20,360 and whether you can run a virtual machine is kinda down to your file system permissions 180 00:11:20,730 --> 00:11:22,240 so make sure you lock that down as well 181 00:11:25,880 --> 00:11:30,100 now if we want to attack vmware server the first thing we need to do is spot it on the 182 00:11:30,100 --> 00:11:30,380 network 183 00:11:31,640 --> 00:11:37,040 now this can be spotted on port 902 that's where vmware authd runs which is the authentication 184 00:11:37,040 --> 00:11:37,660 daemon 185 00:11:39,380 --> 00:11:44,060 uh... if you netcat onto that you can you can see in the banner that it's vmware 186 00:11:45,300 --> 00:11:49,700 the rest of the ports i mean they could be anything it depends what else is running on 187 00:11:49,700 --> 00:11:50,020 the box 188 00:11:53,840 --> 00:11:54,280 uh... 189 00:11:54,280 --> 00:11:56,140 now communication with uh... 190 00:11:57,240 --> 00:11:58,800 vmware server looks something like that 191 00:11:59,380 --> 00:12:01,380 uh... this is just us logging into the box 192 00:12:01,380 --> 00:12:07,000 by default it does use ssl uh... but if like me you don't quite have bruce and i as foo 193 00:12:07,000 --> 00:12:11,320 and can't decrypt ssl in real time then it's quite useful just to flick that off and you 194 00:12:11,320 --> 00:12:12,400 can do that from the console 195 00:12:17,280 --> 00:12:22,220 now vmware provide uh... several tools for uh... managing network access so you can 196 00:12:22,220 --> 00:12:22,580 do that in their systems 197 00:12:22,580 --> 00:12:27,700 uh... for vmware server they provide a tool called vmware command which comes with vmware 198 00:12:27,700 --> 00:12:28,060 server 199 00:12:28,760 --> 00:12:31,580 uh... it's a nice tool it's got some useful functionality 200 00:12:32,840 --> 00:12:33,320 uh... 201 00:12:35,180 --> 00:12:39,200 it's kind of a pain to use against a large number of systems or if you want to perform 202 00:12:39,200 --> 00:12:39,940 lots of tasks 203 00:12:39,940 --> 00:12:43,560 because you've got to pass the configuration file to it every time 204 00:12:44,120 --> 00:12:48,500 uh... to get around this problem what i've created is a ruby module which essentially 205 00:12:48,500 --> 00:12:50,140 allows you to access this functionality 206 00:12:50,740 --> 00:12:51,560 it works as a 207 00:12:51,560 --> 00:12:52,960 or basically a wrap around 208 00:12:52,960 --> 00:12:54,180 a vmware command 209 00:12:55,300 --> 00:12:58,620 so if you are on a antork and need to perform lots of actions 210 00:12:58,620 --> 00:13:00,400 or if you're just administering your servers 211 00:13:00,400 --> 00:13:03,400 and need to perform lots of actions that's a useful tool to have 212 00:13:08,000 --> 00:13:11,240 something else provided for a vmware server is uh... 213 00:13:11,240 --> 00:13:12,020 the vixap PI 214 00:13:12,020 --> 00:13:14,100 i don't if any of you have used it 215 00:13:14,100 --> 00:13:15,980 its quite powerful API 216 00:13:15,980 --> 00:13:19,500 you can do stuff like transfer files back and forth from the 217 00:13:19,500 --> 00:13:21,120 the host operating system 218 00:13:21,120 --> 00:13:21,540 to the goods二 219 00:13:21,540 --> 00:13:25,320 guest operating systems. You can even run programs in the 220 00:13:25,320 --> 00:13:29,120 guest operating system if you like. Now it's got 221 00:13:29,120 --> 00:13:33,400 Perl and C bindings. In order to use it, you've got a fair 222 00:13:33,400 --> 00:13:37,560 amount of code you need to write. But a lot 223 00:13:37,560 --> 00:13:41,000 of the operations that are there, they're not available from the console directly 224 00:13:41,000 --> 00:13:45,280 which is probably the reason that a lot of people I've spoken to don't even realise that that 225 00:13:45,280 --> 00:13:49,280 functionality exists. One thing that's interesting to note 226 00:13:49,280 --> 00:13:53,180 is if you're copying files back and forth using the VIX API, it doesn't use 227 00:13:53,180 --> 00:13:57,160 the network so there's no traffic for someone to detect. It talks 228 00:13:57,160 --> 00:13:58,440 directly with the virtual machine. 229 00:14:00,780 --> 00:14:04,960 Now I've written some Ruby bindings for this because when I'm testing I don't want to sit and write 230 00:14:04,960 --> 00:14:06,360 130 lines of C code. 231 00:14:08,660 --> 00:14:13,220 So here you can see how easy it is to script out with my Ruby code. The first line 232 00:14:13,220 --> 00:14:16,660 simply includes the library I've written. The second line there will 233 00:14:16,660 --> 00:14:18,720 execute a command within the 234 00:14:18,720 --> 00:14:23,020 guest operating system. In this case it just adds a user, a VM 235 00:14:23,020 --> 00:14:23,360 user. 236 00:14:27,500 --> 00:14:31,000 I don't know if many of you have played with Ruby and C, but 237 00:14:31,000 --> 00:14:35,020 they talk quite nicely and essentially you can write all your Ruby code in C if you 238 00:14:35,020 --> 00:14:39,100 want, which is kind of useful. Especially if you want to play 239 00:14:39,100 --> 00:14:42,160 with something low level like memory or something like that. 240 00:14:48,720 --> 00:14:53,280 Right, we'll move on to a few demos. These use some of the tools that I've developed, some of the 241 00:14:53,280 --> 00:14:59,500 techniques that I've played about with, in order to gain access to a VMware server and virtual 242 00:14:59,500 --> 00:15:00,000 machines. 243 00:15:03,900 --> 00:15:10,980 I should probably explain the setup I've got. I've got a network with my laptop connected, and it's 244 00:15:10,980 --> 00:15:16,020 from there that we're going to perform the attacks. I've got VMware server running, and on that is a 245 00:15:16,020 --> 00:15:17,480 Windows 2003 box. 246 00:15:17,860 --> 00:15:18,560 Now we can 247 00:15:18,560 --> 00:15:22,460 can assume that that 2003 box is completely fire-walled off from the rest of the network. 248 00:15:22,800 --> 00:15:27,700 In fact, maybe it's even sitting on a different network, so gaining access, we could use that 249 00:15:27,700 --> 00:15:29,220 as a proxy onto this new network. 250 00:15:45,820 --> 00:15:50,420 Well, the first thing we want to do if we want to get onto the box is to obtain some 251 00:15:50,420 --> 00:15:50,900 credentials. 252 00:15:52,240 --> 00:15:57,440 Now, the VMware command tool I mentioned earlier, because that allows you to remotely administer 253 00:15:57,440 --> 00:15:59,200 and perform actions against servers. 254 00:15:59,200 --> 00:16:01,880 One thing you've got to do is log in. 255 00:16:02,280 --> 00:16:08,040 So by simply wrapping around that script, we can perform a brute force, because that's 256 00:16:08,040 --> 00:16:10,000 got to tell us if our credentials were good or bad. 257 00:16:10,360 --> 00:16:17,540 So here we've just brute forced the user account JJ on the box 172.16.93.1 with our dictionary, 258 00:16:17,700 --> 00:16:24,320 and you can see at the bottom we've succeeded with the password DEFCON16. 259 00:16:25,620 --> 00:16:27,100 So now we've got some credentials. 260 00:16:27,180 --> 00:16:29,180 We can take a bit more of a look at the box. 261 00:16:32,840 --> 00:16:34,860 And see what else is there. 262 00:16:41,740 --> 00:16:46,160 Now VMware commands can pull out a fair amount of info about a box. 263 00:16:53,860 --> 00:16:59,180 And using the Ruby module I've written, which essentially wraps around VMware commands, we're 264 00:17:01,180 --> 00:17:03,420 able to pull out a whole load of information. 265 00:17:05,240 --> 00:17:08,520 At the top there you can see we've got a whole list of the virtual machines on the 266 00:17:08,520 --> 00:17:08,760 box. 267 00:17:11,420 --> 00:17:15,840 We can grab things like the power state and what users are logged on, which is kinda useful 268 00:17:15,840 --> 00:17:17,520 if we can see who's logged on the box. 269 00:17:17,620 --> 00:17:19,480 We can see more accounts that we can attack. 270 00:17:20,820 --> 00:17:24,700 And at the bottom there, we're reading the config file of this particular virtual machine. 271 00:17:24,960 --> 00:17:28,280 It would be nice and easy to loop around and read the config file of every machine. 272 00:17:28,760 --> 00:17:29,160 Well, I think it's a big thing too. 273 00:17:29,620 --> 00:17:33,800 Now this works by pulling one parameter at a time from the config file and we've 274 00:17:33,800 --> 00:17:37,920 pulled out some useful stuff like in the MAC address. Now why is that useful? 275 00:17:38,240 --> 00:17:43,360 That's useful because if you're attacking a guest operating system it 276 00:17:43,360 --> 00:17:46,560 might well be on the network you're on and if you can find the MAC address you 277 00:17:46,560 --> 00:17:50,640 can tie that up to an IP address and then you can attack it from its IP 278 00:17:50,640 --> 00:17:50,940 address. 279 00:18:00,100 --> 00:18:07,680 Now I also mentioned that I've written some modules for the VIX API, some Ruby 280 00:18:07,680 --> 00:18:12,980 modules which we can run nice and easily and I'll show you some of the potential 281 00:18:12,980 --> 00:18:13,740 of that now. 282 00:18:22,140 --> 00:18:27,540 Now what I've done is I've created a Metasploit payload which is a .exe file 283 00:18:27,540 --> 00:18:28,900 which will place 284 00:18:28,900 --> 00:18:34,160 onto the virtual machine and because we have the ability to copy files back and 285 00:18:34,160 --> 00:18:40,720 forth that's nice and easy to do. After that we'll execute it and we've got Metasploit 286 00:18:40,720 --> 00:18:47,340 sitting there listening waiting for this connection to come back. So we'll kick 287 00:18:47,340 --> 00:18:47,780 that off now. 288 00:18:58,900 --> 00:19:03,160 So first of all it's gotta transfer the file across. In this case it's called 289 00:19:03,160 --> 00:19:09,340 defconl.exe and you can see that succeeded and it's executed the program. 290 00:19:11,180 --> 00:19:23,320 So now back in our Metasploit window we've got a session back. Now if we 291 00:19:23,320 --> 00:19:28,600 interact with that session we can do all sorts of things with the box. First of 292 00:19:28,600 --> 00:19:30,480 So let's take a look just to make sure everything's worked. 293 00:19:40,900 --> 00:19:44,980 And now using Metasploit, we've pretty much got full access to that box. 294 00:19:45,060 --> 00:19:49,680 We've grabbed all the password hashes from the box as well. 295 00:19:49,780 --> 00:19:51,640 We could have done pretty much anything we liked. 296 00:19:51,700 --> 00:19:53,520 We can transfer files back and forth from it. 297 00:19:53,580 --> 00:19:55,080 We can run whatever programs we want. 298 00:19:55,840 --> 00:19:59,920 So there's a fair amount of power if you're able to use the VIX API when you're testing. 299 00:20:18,160 --> 00:20:19,520 Well, that was VMware Server. 300 00:20:20,480 --> 00:20:22,080 We'll take a look at ESX. 301 00:20:23,840 --> 00:20:25,060 The ESX architecture. 302 00:20:25,080 --> 00:20:28,460 The ESX architecture is slightly different, and there's some different attack paths. 303 00:20:33,240 --> 00:20:35,760 Now, ESX can be administered in many ways. 304 00:20:36,000 --> 00:20:39,680 One of them is through a web interface, which is what you can see there. 305 00:20:39,920 --> 00:20:42,240 And again, on the left, we've got the inventory. 306 00:20:42,500 --> 00:20:45,960 On the right, we've got all the settings for the virtual machines, 307 00:20:46,120 --> 00:20:47,960 and we can open up a console from there as well. 308 00:20:51,340 --> 00:20:54,420 Alternatively, we can manage it using the virtual infrastructure client. 309 00:20:55,080 --> 00:20:57,860 Now, this is a .NET application written by VMware. 310 00:20:59,580 --> 00:21:02,920 And it talks SOAP to a web service which is running on the virtual machine. 311 00:21:04,440 --> 00:21:09,620 And if you can, I don't know if you can see, but on the right there, there's also a virtual network. 312 00:21:11,660 --> 00:21:15,060 ESX has the ability to create virtual networks as well as virtual machines. 313 00:21:15,840 --> 00:21:20,280 So that's another thing that we can play about with and attack on an ESX box. 314 00:21:24,400 --> 00:21:24,800 Again, 315 00:21:25,080 --> 00:21:27,440 if we want to attack ESX, we're going to need to find it first. 316 00:21:28,920 --> 00:21:32,140 Because ESX doesn't sit on top of another operating system, 317 00:21:32,300 --> 00:21:36,620 all of the ports we can see in the port scanner are relevant because they're ports on the ESX box. 318 00:21:37,700 --> 00:21:41,360 The most relevant ports kind of depend on what you use it for, 319 00:21:41,460 --> 00:21:46,160 but I'd say 443 is pretty important because most of the useful services run on that. 320 00:21:51,180 --> 00:21:53,780 One thing interesting about ESX is 321 00:21:55,120 --> 00:21:58,180 your ESX boxes are always assigned VMware MAC addresses. 322 00:21:58,580 --> 00:22:02,280 No matter what manufacturer your network interfaces are, 323 00:22:02,400 --> 00:22:04,560 it's always going to have a VMware MAC address. 324 00:22:07,480 --> 00:22:09,940 One thing I haven't mentioned is ESXI, 325 00:22:10,020 --> 00:22:12,040 which is kind of similar to ESX. 326 00:22:12,360 --> 00:22:14,420 It's a free version. 327 00:22:14,560 --> 00:22:17,740 It was made free maybe a week or so ago. 328 00:22:19,600 --> 00:22:23,760 It's pretty much, well, I wouldn't say the same as, but it's very similar to ESX. 329 00:22:23,940 --> 00:22:24,820 It has, 330 00:22:24,820 --> 00:22:29,020 fewer services running, but again you'll be able to detect it on the network 331 00:22:29,020 --> 00:22:32,320 through looking at its MAC address and what services are running 332 00:22:32,320 --> 00:22:34,360 and M-MAP will fingerprint them quite nicely. 333 00:22:40,300 --> 00:22:42,060 So the services we have running 334 00:22:43,180 --> 00:22:44,960 slash SDK on the web server 335 00:22:46,840 --> 00:22:50,640 that's the SOAP interface which the VMware virtual infrastructure client 336 00:22:50,640 --> 00:22:53,720 talks to and some of the tools I'll show you in a bit talk to that as well. 337 00:22:56,680 --> 00:22:58,880 Slash UI is where the web interface is 338 00:22:58,880 --> 00:23:03,200 so you can go and have a play with that. Slash mob is really useful if you're doing any development 339 00:23:03,200 --> 00:23:07,400 with the virtual infrastructure API. It shows all of the 340 00:23:07,400 --> 00:23:11,460 objects on the ESX server and you can 341 00:23:11,460 --> 00:23:15,260 connect to and talk to them, query them, pull out information, perform tasks 342 00:23:16,140 --> 00:23:19,300 so if you're doing any development I'm pretty sure you'll play about 343 00:23:19,300 --> 00:23:23,620 with that. VMware AuthD still runs on port 902 344 00:23:23,620 --> 00:23:24,800 so if you're doing any development I'm pretty sure you'll play about with that. 345 00:23:24,820 --> 00:23:27,980 But there's no VMware server D so you can't 346 00:23:27,980 --> 00:23:30,400 play about with it as much as you can on VMware server. 347 00:23:31,640 --> 00:23:34,900 And there's also a console operating system 348 00:23:35,260 --> 00:23:37,060 which is running Red Hat. 349 00:23:39,780 --> 00:23:43,180 And that's what you'll connect to if you connect through SSH. 350 00:23:44,920 --> 00:23:48,440 Interestingly root access is disabled by default for SSH 351 00:23:48,440 --> 00:23:53,900 but if you want to perform a lot of the admin on ESX chances are you're going to want to log in. 352 00:23:54,240 --> 00:23:54,800 But if you want to perform a lot of the admin on ESX chances are you're going to want to log in. 353 00:23:54,820 --> 00:23:59,380 So I imagine most people would end up enabling root login for SSH. 354 00:24:10,780 --> 00:24:12,560 Right, the virtual infrastructure API 355 00:24:12,560 --> 00:24:16,180 I mean, it's got all the functionality you're ever going to need 356 00:24:16,180 --> 00:24:17,400 to play about with ESX. 357 00:24:20,160 --> 00:24:24,800 Now written some tools that talk to this API, which I think are pretty useful. 358 00:24:24,820 --> 00:24:31,320 useful when you're pen testing. If you're going to use the tools VMware provide, the 359 00:24:31,320 --> 00:24:36,960 majority of it, you're using a GUI, which is a real pain if you want to perform repetitive 360 00:24:36,960 --> 00:24:41,240 tasks, particularly if they're against a number of different servers. So it's nice to be able 361 00:24:41,240 --> 00:24:47,540 to talk to that directly from a script or whatever. Things like checking security settings 362 00:24:47,540 --> 00:24:53,120 across all of your ESX boxes is something you probably want to script up at some point. 363 00:24:54,440 --> 00:24:58,880 I've written some Ruby code which will talk to this web service. I think it would be fair 364 00:24:58,880 --> 00:25:03,140 to say it's not the nicest web service I've ever played with, but it's pretty powerful. 365 00:25:06,420 --> 00:25:14,360 I'll show you a quick demo of what I've done. It wasn't very practical to ship my ESX server 366 00:25:14,360 --> 00:25:22,320 over here, so I've had to record it. Hopefully it will be clear. I'll show you the output 367 00:25:22,320 --> 00:25:22,980 and talk through it. 368 00:25:40,340 --> 00:25:45,280 The first thing we're going to do is connect to the box. We can grab things like the version 369 00:25:46,460 --> 00:25:52,900 without authenticating. But once we've authenticated, we'll get back a session, and we can perform 370 00:25:52,980 --> 00:25:58,520 loads of tasks, list the virtual machines, find out a list of all the users, even identify 371 00:25:58,520 --> 00:26:04,440 non-standard users or users with shell access. We can then grab all the network settings. 372 00:26:05,300 --> 00:26:12,860 We could play about with the network if we want. Firewall rulesets. One thing that you 373 00:26:12,860 --> 00:26:17,940 can do with this that I don't think you can do with the tool provided by VMware is grab 374 00:26:17,940 --> 00:26:21,640 a list of all the patches that you might want to apply to that host. So if you want to scan 375 00:26:22,980 --> 00:26:25,600 and find out which ones need patches, this is quite useful. 376 00:26:29,600 --> 00:26:33,460 I'll show you the output from that, and we'll talk through that a little bit more, because 377 00:26:33,460 --> 00:26:35,980 I didn't imagine it was massively clear there. 378 00:26:51,280 --> 00:26:52,960 I won't go through everything, because I don't think it's going to work. 379 00:26:56,800 --> 00:27:01,200 We've got a list of the virtual machines. We can list all the sessions on the box. In 380 00:27:01,200 --> 00:27:07,020 this case there's only one, so it looks like we're the only person connecting. Because 381 00:27:07,020 --> 00:27:14,420 the users are users of the Red Hat costs, they're pretty much your standard Linux users, 382 00:27:14,660 --> 00:27:19,060 but we can find the non-standard ones. In this case, MWiTest, but these are the users 383 00:27:19,060 --> 00:27:22,300 that are perhaps most interesting because they have shell access. 384 00:27:24,320 --> 00:27:27,100 We can then grab all the network settings, stuff like 385 00:27:27,100 --> 00:27:30,460 DNS servers, and we can see here that 386 00:27:30,460 --> 00:27:37,780 the box has two physical network interfaces. Now here we can see that 387 00:27:37,780 --> 00:27:39,640 there's a couple of virtual switches set up. 388 00:27:41,040 --> 00:27:43,640 We can see several different networks so 389 00:27:43,640 --> 00:27:46,700 it kind of indicates that they've got some quite good network segregation 390 00:27:46,700 --> 00:27:47,480 going on here. 391 00:27:47,720 --> 00:27:51,760 We've even got separate VLANs on some of the switches. 392 00:27:54,120 --> 00:27:57,660 Now because your networks are completely virtual and your machines are 393 00:27:57,660 --> 00:27:58,380 completely virtual, 394 00:27:59,420 --> 00:28:01,900 your ESX server knows which box is where. 395 00:28:02,040 --> 00:28:04,500 So we can make use of this 396 00:28:05,680 --> 00:28:10,380 to ensure security. The MAC addresses of your virtual machines aren't going to be 397 00:28:10,380 --> 00:28:11,080 changing regularly. 398 00:28:12,340 --> 00:28:15,640 Your IP addresses again aren't going to be changing regularly and your virtual 399 00:28:15,640 --> 00:28:17,320 switches know exactly where your 400 00:28:17,320 --> 00:28:19,940 virtual machines are and what they should be doing. 401 00:28:20,920 --> 00:28:27,100 So you can disable forged transmissions, MAC address changes, and if you enable 402 00:28:27,100 --> 00:28:35,060 these properties, then any traffic that's forged will be dropped by the switch, 403 00:28:35,280 --> 00:28:38,580 which adds another layer of security to your network. 404 00:28:40,280 --> 00:28:44,840 Additionally, you probably don't want promiscuous mode enabled on your switches. 405 00:28:45,020 --> 00:28:48,520 There's no need for your virtual machines to see traffic destined for the other virtual 406 00:28:48,520 --> 00:28:49,820 machines. So we can 407 00:28:49,820 --> 00:28:52,680 flick that off. Now you can see in this instance 408 00:28:53,140 --> 00:28:56,400 that these settings aren't particularly secure for most of the interfaces. 409 00:28:57,780 --> 00:29:01,520 That's just the default with the ESX. 410 00:29:01,920 --> 00:29:06,240 We can grab the rule set for the firewall and take a look and see what rules are allowed in and out. 411 00:29:06,820 --> 00:29:10,100 By default, there's a default deny inbound and outbound, which is 412 00:29:10,560 --> 00:29:16,480 quite nice. Now if any of you use VMware Server, 413 00:29:16,640 --> 00:29:18,600 quite possibly you use it, um, 414 00:29:20,000 --> 00:29:24,720 as a secondary operating system. Maybe you run Linux as your main operating system and 415 00:29:24,720 --> 00:29:28,680 want access to Windows, in which case it's quite nice and useful to be able to copy and 416 00:29:28,680 --> 00:29:31,540 paste back and forth between your VM and your main desktop. 417 00:29:33,140 --> 00:29:37,720 When you run in a server, probably you don't want the ability for people to copy and paste 418 00:29:37,720 --> 00:29:40,540 between the host and the guest operating systems. 419 00:29:42,180 --> 00:29:46,700 You can disable this functionality. The last thing you want is to go copy in your root 420 00:29:46,700 --> 00:29:48,580 password and someone on one of your guest machines and you're good to go and save. 421 00:29:48,600 --> 00:29:49,960 to paste it onto their desktop. 422 00:29:51,060 --> 00:29:53,460 So you can set some settings that allow you to do that. 423 00:29:53,620 --> 00:29:55,920 By default, these aren't set in ESX, 424 00:29:56,020 --> 00:29:57,840 so it's something you need to go out and do yourself. 425 00:30:02,560 --> 00:30:04,920 And I mentioned the ability to check the patch levels. 426 00:30:05,140 --> 00:30:07,300 Here we can see a fair amount of info on the patches, 427 00:30:07,820 --> 00:30:10,460 whether it requires your box to be rebooted afterwards, 428 00:30:11,960 --> 00:30:13,600 what patches supersede it, 429 00:30:14,660 --> 00:30:17,100 whether it needs you to turn your VMs off afterwards, 430 00:30:17,380 --> 00:30:18,200 that kind of thing. 431 00:30:18,200 --> 00:30:20,660 So there's a lot of information you can extract here, 432 00:30:20,740 --> 00:30:23,240 and this kind of script is probably quite useful 433 00:30:23,240 --> 00:30:25,320 if you want to just check the overall security level 434 00:30:25,320 --> 00:30:26,480 of all your ESX boxes 435 00:30:26,480 --> 00:30:29,580 and whether you've got potential vulnerabilities there. 436 00:30:40,360 --> 00:30:43,120 Right, now we're going to move on to a tool called DRADIS. 437 00:30:47,780 --> 00:30:48,180 DRADIS 438 00:30:48,180 --> 00:30:49,800 Quite possibly a lot of you are sitting there thinking, 439 00:30:49,920 --> 00:30:51,800 well, there's quite a lot of scripts there. 440 00:30:51,960 --> 00:30:54,960 That's a lot to play with. 441 00:30:55,100 --> 00:30:57,380 It would be nice if they were put in a more tidy form. 442 00:30:58,140 --> 00:30:59,800 Now, DRADIS allows us to do that. 443 00:30:59,880 --> 00:31:01,540 We can pull them all together in DRADIS 444 00:31:01,540 --> 00:31:04,220 and make them nice and useful to us. 445 00:31:05,340 --> 00:31:07,500 Now, DRADIS is a tool written by a colleague of mine. 446 00:31:07,820 --> 00:31:08,960 It's free to download. 447 00:31:09,040 --> 00:31:09,940 It's on SourceForge. 448 00:31:11,420 --> 00:31:13,160 It's intended for information sharing 449 00:31:13,160 --> 00:31:15,380 and structuring of information during a pen test, 450 00:31:16,360 --> 00:31:18,160 but it allows various different models, 451 00:31:18,180 --> 00:31:19,440 modules to be plugged into it. 452 00:31:19,560 --> 00:31:21,680 And in this case, I've plugged in my VMware modules 453 00:31:22,320 --> 00:31:24,060 so we can use all of their functionality. 454 00:31:29,060 --> 00:31:31,300 Now, it works on a client-server architecture. 455 00:31:31,720 --> 00:31:33,920 You run the server and anyone can connect to it, 456 00:31:35,440 --> 00:31:37,120 add information, read the information. 457 00:31:37,440 --> 00:31:40,260 So multiple pen testers can use it if they're on a pen test. 458 00:31:42,040 --> 00:31:46,260 It's Ruby-based, and it's pretty extensible. 459 00:31:46,340 --> 00:31:48,080 Like I said, I can add all my VMware, 460 00:31:48,180 --> 00:31:49,440 modules to it nice and easily. 461 00:31:49,760 --> 00:31:51,760 We can use it to put together a methodology 462 00:31:51,760 --> 00:31:54,220 for testing VMware networks, if we like. 463 00:31:58,800 --> 00:32:00,520 Now, it looks something like this. 464 00:32:01,500 --> 00:32:05,340 On the left, we've got a list of different objects or concepts. 465 00:32:06,520 --> 00:32:08,800 On the right, we can see the properties of each 466 00:32:08,800 --> 00:32:10,140 of these concepts. 467 00:32:11,840 --> 00:32:13,800 So on there, I know it's probably a little bit small, 468 00:32:14,260 --> 00:32:16,380 but we can see the settings for the firewall. 469 00:32:17,160 --> 00:32:18,160 And for those of you who don't know, 470 00:32:18,160 --> 00:32:19,680 for those of you that like the command line at the bottom, 471 00:32:19,760 --> 00:32:22,500 there's a command line so we can run programs 472 00:32:22,500 --> 00:32:24,540 and operations from that as well. 473 00:32:25,500 --> 00:32:26,740 There's also a notes tab, 474 00:32:26,840 --> 00:32:29,500 so we can add notes specific to a host or to a test 475 00:32:29,500 --> 00:32:31,300 that we want to share with other testers as well. 476 00:32:39,660 --> 00:32:40,860 Now, how does DRADIS work? 477 00:32:41,420 --> 00:32:42,880 Like I said, we've got concepts. 478 00:32:43,280 --> 00:32:46,280 In this case, we have the concepts of a VMware server, 479 00:32:46,940 --> 00:32:48,140 of an ESX server, 480 00:32:48,160 --> 00:32:51,600 even of a virtual switch or a network interface. 481 00:32:52,360 --> 00:32:54,920 And we have various actions that we might want to perform, 482 00:32:55,140 --> 00:32:58,000 such as creating a user, rebooting a box, 483 00:32:58,200 --> 00:32:59,760 checking the patch level, that kind of thing. 484 00:32:59,920 --> 00:33:03,540 And we build all of them into what's described as a universe. 485 00:33:04,040 --> 00:33:07,240 So our universe describes all these different concepts and actions. 486 00:33:07,480 --> 00:33:09,480 In this case, we've got a VMware universe, 487 00:33:09,620 --> 00:33:10,540 but it could be anything. 488 00:33:10,780 --> 00:33:12,720 You could have a universe to describe your network, 489 00:33:12,980 --> 00:33:16,980 in which case you might have web servers, mail servers, 490 00:33:17,160 --> 00:33:18,140 and you might have different concepts. 491 00:33:18,140 --> 00:33:18,620 You might have different actions, 492 00:33:18,920 --> 00:33:23,420 such as checking the version or anything like that. 493 00:33:24,140 --> 00:33:25,780 And you just plug it in as a module. 494 00:33:30,740 --> 00:33:32,540 So let's take a quick look at a demo. 495 00:33:35,780 --> 00:33:39,060 Again, because it wasn't possible to ship my ESX box over here, 496 00:33:39,240 --> 00:33:42,060 we've had to video it for you. 497 00:33:46,440 --> 00:33:47,940 Now, the first thing we want to do is, 498 00:33:47,940 --> 00:33:48,720 is boot the server up. 499 00:33:49,680 --> 00:33:50,860 It's running WebRick. 500 00:33:50,960 --> 00:33:51,720 It's a Ruby server. 501 00:33:54,300 --> 00:33:56,080 And then fire up DRADIS. 502 00:33:56,320 --> 00:33:58,680 Like I said, because it's client-server architecture, 503 00:33:59,000 --> 00:34:00,500 there could be multiple clients running 504 00:34:00,500 --> 00:34:02,380 and talking to the same server. 505 00:34:04,820 --> 00:34:05,940 It looks like this. 506 00:34:06,700 --> 00:34:08,780 We don't really need the command line at the bottom, 507 00:34:08,860 --> 00:34:11,800 so we'll just move that down for now to give more space. 508 00:34:13,420 --> 00:34:15,340 Right, our concepts are on the left. 509 00:34:16,980 --> 00:34:17,440 Let's see what we've got. 510 00:34:17,440 --> 00:34:17,920 So in this case, we've got a server. 511 00:34:17,920 --> 00:34:19,940 In this case, we'll create the concept of an ESX server. 512 00:34:27,020 --> 00:34:29,000 Now, the properties of an ESX server, 513 00:34:29,140 --> 00:34:31,460 in this case, is just the version and IP address. 514 00:34:32,680 --> 00:34:35,300 So we'll give it the IP address of our ESX server. 515 00:34:35,540 --> 00:34:37,760 There's no reason you couldn't extend one of the modules 516 00:34:37,760 --> 00:34:40,520 to detect ESX servers on your network as well. 517 00:34:45,780 --> 00:34:47,900 Now, we have properties for these ESX servers. 518 00:34:47,900 --> 00:34:48,760 We have these concepts as well. 519 00:34:49,380 --> 00:34:51,520 In this case, we've got a version property. 520 00:34:51,940 --> 00:34:53,040 So performing that action, 521 00:34:53,120 --> 00:34:54,880 we can grab the version of the ESX server. 522 00:34:57,760 --> 00:34:59,820 In order to log on to an ESX box, 523 00:34:59,980 --> 00:35:00,840 we need some credentials. 524 00:35:01,240 --> 00:35:03,800 And surprisingly, there's a username and password. 525 00:35:04,860 --> 00:35:06,080 So we'll enter them in. 526 00:35:10,800 --> 00:35:12,020 So we've got a question. 527 00:35:12,100 --> 00:35:13,080 If we didn't have credentials, 528 00:35:14,000 --> 00:35:15,240 what if we didn't have them? 529 00:35:15,440 --> 00:35:15,880 Well, 530 00:35:17,900 --> 00:35:19,620 let me just pause the demo for a sec. 531 00:35:20,880 --> 00:35:22,260 If we don't have credentials, 532 00:35:22,440 --> 00:35:24,780 then we're more limited in the actions we can perform. 533 00:35:24,960 --> 00:35:26,980 There's a small amount of information 534 00:35:26,980 --> 00:35:28,800 we can grab from an ESX box. 535 00:35:30,500 --> 00:35:31,560 Most of the information, 536 00:35:31,720 --> 00:35:32,660 you're going to need credentials, 537 00:35:32,780 --> 00:35:34,240 assuming there's no vulnerability 538 00:35:34,240 --> 00:35:37,400 that lets you grab information from it first. 539 00:35:39,040 --> 00:35:40,600 So for the purpose of this, 540 00:35:40,660 --> 00:35:41,660 we're working with credentials. 541 00:35:41,920 --> 00:35:44,860 But credentials can come at several different user levels. 542 00:35:45,080 --> 00:35:46,880 So it might be worth running checks 543 00:35:46,880 --> 00:35:47,880 with different user levels. 544 00:35:47,880 --> 00:35:50,460 To see whether your permissions are set up properly, 545 00:35:50,600 --> 00:35:51,140 that kind of thing. 546 00:35:51,500 --> 00:35:51,940 Okay. 547 00:35:55,700 --> 00:35:57,280 In this case, yes, it would, 548 00:35:57,360 --> 00:35:59,540 because port 902 is open and running. 549 00:35:59,920 --> 00:36:00,860 So the question was, 550 00:36:00,980 --> 00:36:03,220 would the tool I showed you 551 00:36:03,220 --> 00:36:04,860 for brute forcing authentication work? 552 00:36:05,280 --> 00:36:07,300 And the answer is, yes, it would, 553 00:36:07,320 --> 00:36:08,280 against this box, 554 00:36:08,380 --> 00:36:09,780 because it's got port 902 open. 555 00:36:11,080 --> 00:36:12,680 Alternatively, we could have brute forced 556 00:36:12,680 --> 00:36:14,080 the web service as well, 557 00:36:14,160 --> 00:36:16,160 because that has a login function, 558 00:36:16,440 --> 00:36:17,040 and we could, 559 00:36:17,880 --> 00:36:18,520 attack it through that. 560 00:36:18,720 --> 00:36:20,460 Also, we could brute force SSH. 561 00:36:20,580 --> 00:36:22,680 So there's a variety of different options 562 00:36:22,680 --> 00:36:24,540 for trying to obtain credentials. 563 00:36:24,960 --> 00:36:26,400 And then there's also the possibility 564 00:36:26,400 --> 00:36:28,700 that they share credentials across boxes. 565 00:36:30,180 --> 00:36:31,680 So if we look at the case 566 00:36:31,680 --> 00:36:32,980 where we mounted the hard drive, 567 00:36:33,180 --> 00:36:35,000 maybe some of the credentials we found 568 00:36:35,400 --> 00:36:37,120 then would be valid here as well. 569 00:36:43,720 --> 00:36:45,200 Okay, so just jumping back here, 570 00:36:45,240 --> 00:36:47,060 we've logged in and we've got back a session ID. 571 00:36:53,120 --> 00:36:55,100 Next, we're going to take a quick look at the firewall, 572 00:36:55,220 --> 00:36:56,740 see if there's any dodgy rules in there 573 00:36:56,740 --> 00:37:00,640 that might let us jump onto the box through other means. 574 00:37:04,140 --> 00:37:06,740 So we'll populate the firewall rule set settings. 575 00:37:11,560 --> 00:37:14,960 And I mean, we've seen these before from the script, 576 00:37:15,100 --> 00:37:17,260 but it's a pretty default firewall rule set. 577 00:37:29,200 --> 00:37:32,080 And we can take a look at some of the authentication settings. 578 00:37:41,200 --> 00:37:42,800 Here, we'll grab a list of sessions 579 00:37:42,800 --> 00:37:43,960 that are active on the server, 580 00:37:44,140 --> 00:37:46,760 and we'll grab some of the non-default users as well, 581 00:37:46,800 --> 00:37:47,640 because their accounts, 582 00:37:47,640 --> 00:37:49,180 they're normally quite interesting to attack. 583 00:37:51,380 --> 00:37:54,340 And here we can see there's several sessions to the box, 584 00:37:54,420 --> 00:37:56,880 so probably we're not the only person using it at this time. 585 00:38:04,480 --> 00:38:06,960 And the next thing we're going to take a look at is the patching. 586 00:38:06,960 --> 00:38:09,140 We'll find out what patches need applying on this box. 587 00:38:09,480 --> 00:38:11,140 Now, in order to check the patch level, 588 00:38:11,380 --> 00:38:13,740 you need a repository which contains the patches. 589 00:38:14,320 --> 00:38:16,780 In this case, our repository is on a web server. 590 00:38:18,160 --> 00:38:19,860 And the web server structure, 591 00:38:20,020 --> 00:38:23,560 it contains all the patches and the downloads. 592 00:38:24,740 --> 00:38:26,480 It takes a moment or two to run, 593 00:38:26,580 --> 00:38:29,060 because it's got to scan the web server for that information. 594 00:38:35,540 --> 00:38:37,120 It will return at some point. 595 00:38:38,520 --> 00:38:39,540 Okay, it's come back, 596 00:38:39,540 --> 00:38:43,240 and we've got some details of the patches which need applying. 597 00:38:44,160 --> 00:38:44,600 Okay. 598 00:38:46,420 --> 00:38:47,600 Which we can see there, 599 00:38:47,600 --> 00:38:52,220 and again, we've got information such as whether we need to reboot the box and that kind of thing. 600 00:39:05,200 --> 00:39:06,980 Right, so let's move on to some recommendations. 601 00:39:07,500 --> 00:39:09,280 You've seen some potential attack vectors. 602 00:39:10,120 --> 00:39:11,780 If you're running VMware on your network, 603 00:39:12,080 --> 00:39:13,320 you know, what should you do? 604 00:39:13,900 --> 00:39:17,580 Well, the first thing to note is nothing I've shown you today gives you access to the box. 605 00:39:17,600 --> 00:39:19,480 You can run the box without some weakness being exploited. 606 00:39:21,540 --> 00:39:27,300 But perhaps there's vulnerabilities in VMware that we could exploit as well to get on there. 607 00:39:27,520 --> 00:39:33,160 So it's important that we ensure the box is secure in the first place. 608 00:39:34,500 --> 00:39:35,520 So how do we do that? 609 00:39:36,020 --> 00:39:40,140 Well, VMware's written some really good documentation on securing, 610 00:39:40,640 --> 00:39:42,200 well, in particular, ESX. 611 00:39:42,340 --> 00:39:43,420 It's not a bad read, 612 00:39:43,460 --> 00:39:47,360 so it's definitely worth having a look through if you've got ESX or server deployed. 613 00:39:47,360 --> 00:39:47,580 It's not a bad read, so it's definitely worth having a look through if you've got ESX or server deployed. 614 00:39:50,420 --> 00:39:50,860 It's not a bad read, so it's definitely worth having a look through if you've got ESX or server deployed. 615 00:39:50,860 --> 00:39:52,740 You need to ensure that your updates are there. 616 00:39:52,860 --> 00:39:56,080 I know it's one of those things that's always said. 617 00:39:56,240 --> 00:39:58,960 But there's been a few advisories released. 618 00:39:59,260 --> 00:40:01,420 IDefense and core have put out some stuff recently. 619 00:40:03,540 --> 00:40:06,040 And also because the cos is running Red Hat, 620 00:40:06,120 --> 00:40:08,720 all of the Red Hat vulnerabilities also need patching as well. 621 00:40:08,880 --> 00:40:11,980 So it's important to ensure that you keep on top of this. 622 00:40:13,100 --> 00:40:17,120 And also, defense and depth steps you've taken to protect yourself. 623 00:40:17,180 --> 00:40:17,580 And also, defense and depth steps you've taken to protect yourself. 624 00:40:18,120 --> 00:40:21,080 VMware is always going to be a nice target for attackers 625 00:40:21,800 --> 00:40:24,700 and because it's probably run in several of your servers 626 00:40:24,700 --> 00:40:28,900 it's important that this, if there's one place on your network that you 627 00:40:28,900 --> 00:40:32,680 you go out of your way to protect then it really should be 628 00:40:32,680 --> 00:40:39,640 your VMware boxes. And also don't forget things like VMware tools which are 629 00:40:39,640 --> 00:40:40,240 running on your 630 00:40:40,240 --> 00:40:45,000 on your guest machines. They do leave the potential for attack. 631 00:40:48,780 --> 00:40:50,880 Like I said, VMware is always going to be 632 00:40:51,480 --> 00:40:53,160 a juicy target for an attacker. 633 00:40:54,520 --> 00:40:58,940 One of the key things that VMware bang on about and quite rightly so is to keep 634 00:40:58,940 --> 00:41:00,760 your management network separate from your 635 00:41:00,760 --> 00:41:06,680 your corporate LAN. The attacks we've seen today are all focused against the 636 00:41:06,680 --> 00:41:07,380 management networks. 637 00:41:07,660 --> 00:41:10,960 If they're not there then the attacks quite simply they just can't be 638 00:41:10,960 --> 00:41:11,440 performed. 639 00:41:14,760 --> 00:41:20,280 And as I mentioned, earlier, it's disabled MAC addresses changes, disable promiscuous mode to ensure your 640 00:41:20,280 --> 00:41:23,980 boxes as secure as they possibly can be and your networks as secure as they can be. 641 00:41:24,940 --> 00:41:28,420 It's unlikely that you gonna want to change MAC addresses regularly on your 642 00:41:28,420 --> 00:41:36,460 on your guest's machines and also as 643 00:41:36,460 --> 00:41:37,100 I mention disable copy and paste between your virtual machines. 644 00:41:37,100 --> 00:41:39,120 It alsoarsa mentioned to say will copy and paste between your virtual machines. 645 00:41:39,440 --> 00:41:39,960 Mmm. 646 00:41:40,820 --> 00:41:41,420 And it's unlikely that you're going to want to change something recovered at your 647 00:41:41,420 --> 00:41:43,220 If they're servers, it's probably something you don't need. 648 00:41:43,420 --> 00:41:47,960 And if you've got a CD drive on your ASX server or your VMware server, 649 00:41:49,200 --> 00:41:51,500 disable the guest machines from reading that. 650 00:41:51,600 --> 00:41:54,720 The last thing you want to do is put something sensitive in your CD drive, 651 00:41:54,900 --> 00:41:57,960 which everyone connected to one of the guest machines can also see. 652 00:42:00,640 --> 00:42:04,800 VMware's documentation states that only port 443 and port 80 are needed 653 00:42:04,800 --> 00:42:08,740 for general operation of your server. 654 00:42:08,740 --> 00:42:12,060 So if your deployment doesn't need access to any of the other ports, 655 00:42:12,180 --> 00:42:13,300 then close them off in the firewall. 656 00:42:17,160 --> 00:42:20,300 One thing worth noting is that guest operating systems 657 00:42:20,300 --> 00:42:23,040 do write their logs to the ASX server. 658 00:42:24,800 --> 00:42:27,320 So it's important that you make sure that they're rotated 659 00:42:27,320 --> 00:42:29,640 and tidied up pretty regularly. 660 00:42:29,760 --> 00:42:33,940 The last thing you want is for your file system to fill up 661 00:42:33,940 --> 00:42:36,280 through a malicious user filling up your log files. 662 00:42:39,300 --> 00:42:40,020 Future work. 663 00:42:40,180 --> 00:42:41,660 Well, I've still got plenty to play with. 664 00:42:43,440 --> 00:42:45,440 I've found some pretty interesting stuff, 665 00:42:46,040 --> 00:42:49,000 which I'll chat to VMware about sometime soon. 666 00:42:49,580 --> 00:42:51,480 I'll publish it all when it's done. 667 00:42:52,360 --> 00:42:55,040 But there's still a lot of technologies that VMware have produced 668 00:42:55,040 --> 00:42:56,120 that I've not played with. 669 00:42:56,220 --> 00:42:58,160 I've not played with vMotion, for example. 670 00:43:00,240 --> 00:43:02,600 It's something I'm definitely going to look at in the future. 671 00:43:11,340 --> 00:43:14,380 Well, to conclude, I mean, the tools I've shown you, 672 00:43:14,420 --> 00:43:16,120 they're all going to be made available. 673 00:43:16,340 --> 00:43:18,060 They didn't quite make it onto the DEF CON CD 674 00:43:18,060 --> 00:43:19,360 because they weren't ready in time. 675 00:43:20,120 --> 00:43:23,000 But they're available to download, or will be very shortly, 676 00:43:23,020 --> 00:43:25,940 from my website or mwrinfoesecurity.com. 677 00:43:26,900 --> 00:43:29,460 DRADIS, the tool I showed you, you can download from SourceForge. 678 00:43:29,500 --> 00:43:31,300 That's dradis.sourceforge.net. 679 00:43:33,040 --> 00:43:36,580 So, yeah, go away, have a play, see what's useful to you. 680 00:43:36,660 --> 00:43:37,340 If there's... 681 00:43:38,740 --> 00:43:40,160 something that you think could be implemented, 682 00:43:40,320 --> 00:43:41,420 drop me a mail. 683 00:43:41,460 --> 00:43:42,680 I'll have a look into it. 684 00:43:47,140 --> 00:43:49,800 Right, I'm moving into QA room to take questions, 685 00:43:49,860 --> 00:43:50,960 but we've got a few moments 686 00:43:50,960 --> 00:43:52,820 if people want to fire anything at me. 687 00:43:54,260 --> 00:43:55,380 We have a question. 688 00:43:56,820 --> 00:44:00,200 By default, isn't there a bad login lockout 689 00:44:00,200 --> 00:44:03,000 on server and ESX? 690 00:44:03,700 --> 00:44:05,240 The question was, by default, 691 00:44:05,260 --> 00:44:08,600 is there an account lockout on server and ESX? 692 00:44:09,240 --> 00:44:10,560 Not that I've come across. 693 00:44:10,740 --> 00:44:13,140 I guess it depends on the settings you've got on your box. 694 00:44:13,380 --> 00:44:15,140 One thing that I should have pointed out, 695 00:44:15,200 --> 00:44:15,900 which I haven't, 696 00:44:15,900 --> 00:44:20,020 is the auth daemon that runs on VMware server, 697 00:44:20,580 --> 00:44:21,840 by default, it... 698 00:44:23,120 --> 00:44:26,300 Well, under Linux, it will run through INETD or XINETD. 699 00:44:26,520 --> 00:44:28,160 If it runs through INETD, 700 00:44:29,280 --> 00:44:34,160 then after about 250-odd requests to log in, 701 00:44:34,600 --> 00:44:36,360 INETD will stop the service listening, 702 00:44:36,500 --> 00:44:38,320 so you can cause a denial of service 703 00:44:38,320 --> 00:44:39,020 through doing that. 704 00:44:39,180 --> 00:44:41,640 So make sure you run VMware auth daemon 705 00:44:41,640 --> 00:44:42,640 through INETD, 706 00:44:43,440 --> 00:44:44,760 or if you're going to attack it, 707 00:44:44,800 --> 00:44:49,280 that you will ensure it's running on XINETD before you do. 708 00:44:49,800 --> 00:44:51,740 But back to the original question, sorry. 709 00:44:52,940 --> 00:44:55,520 Account lockout is down to whether you've said it. 710 00:44:55,560 --> 00:44:58,520 I've not seen account lockout on either ESX or VMware server. 711 00:44:59,180 --> 00:45:00,340 You haven't seen it at all, 712 00:45:00,380 --> 00:45:02,440 or you haven't seen it enabled by default? 713 00:45:02,880 --> 00:45:04,540 Definitely not enabled by default, no. 714 00:45:04,860 --> 00:45:05,300 Okay. 715 00:45:06,340 --> 00:45:06,780 Sorry? 716 00:45:08,340 --> 00:45:09,900 Doesn't it have tally by default? 717 00:45:11,380 --> 00:45:13,400 By default, server doesn't, no. 718 00:45:18,340 --> 00:45:19,080 Which slide? 719 00:45:24,140 --> 00:45:28,500 That info is on the CD, yeah. 720 00:45:29,960 --> 00:45:31,600 Right, I'll move through to QA room 721 00:45:31,600 --> 00:45:32,920 if anyone else has got any more questions. 722 00:45:33,300 --> 00:45:33,940 Thank you.