1 00:00:00,000 --> 00:00:05,840 Hello everyone. Before we start, if you have empty seat near you, 2 00:00:05,960 --> 00:00:19,340 raise your hand. It's okay. Okay, let's start. Hello everyone. My name is Alexander Nershenko. 3 00:00:19,540 --> 00:00:27,220 This talk is how to hack VMware with Android server. In this talk I will discuss some ways 4 00:00:28,240 --> 00:00:37,510 to gain control over vCenter, which means to the whole network. I will describe few non-dangerous 5 00:00:37,800 --> 00:00:45,980 bugs. There were zero days when we found them. But if you can use all of them together, we can 6 00:00:45,980 --> 00:00:56,920 hack vCenter. So, just about me. I work as penetration testing at RPSCAN company. 7 00:00:56,920 --> 00:01:04,580 We do some business security, research, and testing. Also, I'm one of the organizers of 8 00:01:04,580 --> 00:01:11,420 DEF CON group in Russia and Zero Nights Conference. Also, I'd like to play sometimes CTF. 9 00:01:13,600 --> 00:01:20,780 And this talk was prepared with Alexey Sinsov. So, thanks to him for ideas and support. 10 00:01:20,980 --> 00:01:26,900 Unfortunately, he couldn't attend DEF CON. But we will do it. 11 00:01:26,920 --> 00:01:31,500 Before we start talking about VMware, I would like to talk about pentest in general. 12 00:01:32,900 --> 00:01:39,980 So, the main goal of pentest is to show weak elements in infrastructure, how to hack system, 13 00:01:40,320 --> 00:01:50,920 why we can hack it, and show how we can hack it. We have usually large number of targets, 14 00:01:51,140 --> 00:01:56,900 different types. And unfortunately, we didn't have usually not much information. 15 00:01:59,040 --> 00:02:08,540 So, we couldn't use all bug-hunting methods like source code review because it's usually a lot of time 16 00:02:08,540 --> 00:02:15,680 and we need source reverse engineering. The same reason we could use a little bit of phasing 17 00:02:16,620 --> 00:02:25,540 if we have web or binary. Anyway, usually we can use logic, looking for logic flow. 18 00:02:25,540 --> 00:02:30,180 And searching bugs and public research. 19 00:02:35,420 --> 00:02:41,960 I would like to show that using public research like old bugs, old research, old information, 20 00:02:42,300 --> 00:02:46,580 and little bit analysis, we can find new bugs. 21 00:02:48,800 --> 00:02:52,880 So, one day we have network, big network. 22 00:02:52,880 --> 00:02:59,560 And all infrastructure was built on VMware ESXi host and vSphere. 23 00:03:00,700 --> 00:03:05,960 So, all seems pretty secure. All patched up with latest updates. 24 00:03:08,160 --> 00:03:11,440 There was no default password or anything stupid. 25 00:03:11,680 --> 00:03:15,620 So, we decided to try to attack vCenter server. 26 00:03:16,580 --> 00:03:20,900 Because vCenter is a solution to manage vSphere. 27 00:03:20,900 --> 00:03:29,880 So, if you can hack vCenter, we can hack all VM, machine, and all infrastructure. 28 00:03:32,680 --> 00:03:36,500 So, we have vCenter version 4.1 update 1. 29 00:03:38,100 --> 00:03:42,660 There are a lot of services on vCenter like update manager, 30 00:03:42,900 --> 00:03:46,960 orchestrator, chargeback. And each service has a web server. 31 00:03:47,160 --> 00:03:49,320 And usually use Java technology. 32 00:03:51,160 --> 00:03:54,900 So, first thing we found in a public source. 33 00:03:56,020 --> 00:03:59,320 It's old Directed Arousal discovered by Claudio Crestoni. 34 00:04:02,120 --> 00:04:04,660 It's classic Directed Arousal, I think. 35 00:04:04,740 --> 00:04:07,000 But it was fixed in our version. 36 00:04:07,840 --> 00:04:09,440 So, it's bad. 37 00:04:11,820 --> 00:04:15,860 But Alexey Sensov didn't trust any fix of patch. 38 00:04:16,040 --> 00:04:20,540 And after few minutes, he found another Directed Arousal. 39 00:04:20,540 --> 00:04:20,880 So, it's bad. 40 00:04:20,900 --> 00:04:22,120 But it's almost in the same place. 41 00:04:23,860 --> 00:04:27,980 Now, there are Metasploit module for this Directed Arousal. 42 00:04:29,000 --> 00:04:31,580 So, we can read any file. 43 00:04:31,680 --> 00:04:33,040 But what file to read? 44 00:04:34,360 --> 00:04:37,400 Claudio proposed to read a file with a GSD profile. 45 00:04:37,760 --> 00:04:38,480 It's a log file. 46 00:04:39,100 --> 00:04:41,200 And vCenter uses SOAP protocol. 47 00:04:42,040 --> 00:04:45,700 And this log file contains SOAP request with session ID. 48 00:04:45,940 --> 00:04:50,880 So, if we replace our session ID with session ID file, 49 00:04:50,880 --> 00:04:53,700 we can get admin access. 50 00:04:54,620 --> 00:04:58,960 He also developed a tool called Vasta. 51 00:04:59,140 --> 00:05:01,700 It has collection of Metasploit modules. 52 00:05:02,080 --> 00:05:06,560 And also has a local proxy for this task. 53 00:05:08,020 --> 00:05:11,800 But unfortunately, it also was fixed in our version. 54 00:05:12,800 --> 00:05:16,980 But it contains IP addresses of administrators. 55 00:05:17,580 --> 00:05:20,500 It contains IP addresses of admins. 56 00:05:20,500 --> 00:05:23,660 We can try use classic attack. 57 00:05:23,780 --> 00:05:25,520 Like make IP poisoning. 58 00:05:26,380 --> 00:05:27,960 Spoof SSL certificate. 59 00:05:28,580 --> 00:05:30,120 And sniff traffic. 60 00:05:31,960 --> 00:05:35,040 But administrators of this network was really clever. 61 00:05:35,240 --> 00:05:39,300 And they add certificate to trust it. 62 00:05:39,360 --> 00:05:40,800 And didn't clear knock button. 63 00:05:40,900 --> 00:05:41,820 So, it doesn't work. 64 00:05:44,100 --> 00:05:46,360 So, we find another way. 65 00:05:46,460 --> 00:05:48,500 We just steal key with Directed Arousal. 66 00:05:49,640 --> 00:05:50,480 And make IP address. 67 00:05:50,500 --> 00:05:51,420 Make IP Poisoning. 68 00:05:51,440 --> 00:05:52,280 Decrypt traffic. 69 00:05:54,120 --> 00:05:57,640 But what if IP spoofing doesn't work? 70 00:06:00,180 --> 00:06:03,700 So, we do little bit analysis. 71 00:06:04,100 --> 00:06:06,820 And found vCenter Orchestrator. 72 00:06:06,920 --> 00:06:11,320 It's a software for automatic configuration and management vCenter. 73 00:06:11,520 --> 00:06:14,280 It's instant by default with vCenter. 74 00:06:14,500 --> 00:06:16,600 It has interesting files. 75 00:06:16,800 --> 00:06:18,140 Like gate etc. 76 00:06:18,440 --> 00:06:19,420 Password properties. 77 00:06:20,500 --> 00:06:23,040 It contains md5 hash without assault. 78 00:06:25,740 --> 00:06:29,420 So, nowadays like I know it's not very secure. 79 00:06:31,080 --> 00:06:35,440 So, we've caused brute forces and gain control. 80 00:06:36,820 --> 00:06:38,100 So, we get in. 81 00:06:38,280 --> 00:06:41,380 And this is interface of Orchestrator configurations. 82 00:06:43,000 --> 00:06:46,820 Like you can see there are a lot of plugins and pages. 83 00:06:46,920 --> 00:06:50,400 Interesting like database, LDAP, mail, SSL. 84 00:06:50,400 --> 00:06:52,100 All that pages. 85 00:06:52,240 --> 00:06:55,240 Almost all have password field in them. 86 00:06:55,420 --> 00:07:01,060 So, we think that it will be cool if we can read without password fields. 87 00:07:01,260 --> 00:07:03,400 And actually there wasn't just plain text. 88 00:07:07,460 --> 00:07:08,740 Yeah, just like that. 89 00:07:08,860 --> 00:07:10,680 Pretty easy for hackers. 90 00:07:11,200 --> 00:07:12,120 It's a job. 91 00:07:13,400 --> 00:07:16,300 So, we also find interesting files. 92 00:07:16,520 --> 00:07:19,300 Like vs. xml. 93 00:07:19,300 --> 00:07:20,600 And vml properties. 94 00:07:21,920 --> 00:07:24,280 This file looks like this. 95 00:07:24,620 --> 00:07:26,660 It has something like. 96 00:07:26,980 --> 00:07:29,000 It looks like a hash. 97 00:07:29,180 --> 00:07:30,840 But actually it didn't hash. 98 00:07:30,980 --> 00:07:33,320 Because it has odd length. 99 00:07:33,700 --> 00:07:36,780 So, definitely not hash. 100 00:07:39,740 --> 00:07:42,340 So, I encoded few passwords. 101 00:07:44,040 --> 00:07:46,080 And as you can see. 102 00:07:46,180 --> 00:07:49,240 The first read by password. 103 00:07:49,240 --> 00:07:49,280 So, I encoded few passwords. 104 00:07:49,280 --> 00:07:50,280 And it looks like a length. 105 00:07:51,020 --> 00:07:54,360 Green bytes was always constant. 106 00:07:54,640 --> 00:07:56,440 And they was in ASCII range. 107 00:07:57,720 --> 00:07:59,220 And black bytes. 108 00:07:59,340 --> 00:08:01,700 When you encode other passwords. 109 00:08:01,920 --> 00:08:02,840 Or the same password. 110 00:08:03,040 --> 00:08:04,820 They was every time different. 111 00:08:06,280 --> 00:08:08,280 And also I would like to say. 112 00:08:08,380 --> 00:08:10,420 That now there are knowledge base. 113 00:08:10,660 --> 00:08:11,880 Article from VMware. 114 00:08:12,160 --> 00:08:13,100 About this issue. 115 00:08:16,040 --> 00:08:18,160 So, I decompile application. 116 00:08:18,520 --> 00:08:19,220 And found that. 117 00:08:19,280 --> 00:08:20,720 It has pretty simple algorithm. 118 00:08:21,360 --> 00:08:24,120 It just generates 60 random string. 119 00:08:25,020 --> 00:08:27,220 Then take password. 120 00:08:27,380 --> 00:08:28,120 Password symbol. 121 00:08:28,340 --> 00:08:29,980 Add position of this password. 122 00:08:30,160 --> 00:08:31,000 And that's all. 123 00:08:31,940 --> 00:08:34,900 I think not very clever decision. 124 00:08:35,060 --> 00:08:36,780 To store password in this format. 125 00:08:38,860 --> 00:08:41,600 So, I write simple decoder. 126 00:08:42,300 --> 00:08:43,000 And ruby. 127 00:08:45,980 --> 00:08:48,860 So, it's another way. 128 00:08:48,860 --> 00:08:50,080 To hack a system. 129 00:08:50,540 --> 00:08:51,700 But there was. 130 00:08:53,460 --> 00:08:54,780 Another way. 131 00:08:55,040 --> 00:08:56,600 We didn't find that bug. 132 00:08:56,700 --> 00:08:58,040 During our penetration testing. 133 00:08:58,400 --> 00:09:00,800 But I think it's very interesting bug. 134 00:09:01,560 --> 00:09:02,740 It was discovered. 135 00:09:02,860 --> 00:09:05,200 By guys from digital defense. 136 00:09:05,540 --> 00:09:06,540 And they found out. 137 00:09:06,760 --> 00:09:08,600 That vCentral orchestrator. 138 00:09:08,680 --> 00:09:10,800 Has old strats library. 139 00:09:11,180 --> 00:09:12,580 And that library. 140 00:09:12,700 --> 00:09:15,920 Has remote code execution bug. 141 00:09:16,140 --> 00:09:17,140 Discovered by Mideq. 142 00:09:17,220 --> 00:09:17,580 Do you believe? 143 00:09:18,860 --> 00:09:20,220 It was bug. 144 00:09:20,360 --> 00:09:21,900 In handling. 145 00:09:22,100 --> 00:09:23,260 OJNL expression. 146 00:09:24,740 --> 00:09:26,720 OJNL expression is language. 147 00:09:26,820 --> 00:09:28,280 For setting and getting. 148 00:09:28,420 --> 00:09:29,140 Java properties. 149 00:09:30,020 --> 00:09:32,320 And each CCP parameter. 150 00:09:32,380 --> 00:09:33,520 Is as. 151 00:09:35,080 --> 00:09:36,120 OJNL expression. 152 00:09:36,520 --> 00:09:37,800 So, you could just. 153 00:09:41,160 --> 00:09:41,880 Bypass. 154 00:09:43,620 --> 00:09:45,060 This unicode. 155 00:09:45,140 --> 00:09:45,660 Hash sign. 156 00:09:45,900 --> 00:09:47,840 And execute any java code. 157 00:09:48,860 --> 00:09:50,960 So, it's this example of exploit. 158 00:09:51,200 --> 00:09:51,980 You just. 159 00:09:52,220 --> 00:09:53,680 Insert this code. 160 00:09:53,820 --> 00:09:54,860 And get request. 161 00:09:55,460 --> 00:09:57,900 And get remote code execution. 162 00:09:59,720 --> 00:10:01,580 So, I think that's. 163 00:10:02,020 --> 00:10:02,620 Often. 164 00:10:02,780 --> 00:10:04,140 During penetration testing. 165 00:10:04,240 --> 00:10:07,220 We have like a big system. 166 00:10:07,420 --> 00:10:08,100 Big applications. 167 00:10:08,560 --> 00:10:10,040 Which has a lot of library. 168 00:10:10,240 --> 00:10:10,720 And dependency. 169 00:10:11,480 --> 00:10:13,520 So, I think that's maybe cool. 170 00:10:13,620 --> 00:10:15,320 To have some tool. 171 00:10:15,400 --> 00:10:17,240 To find fast. 172 00:10:19,260 --> 00:10:20,560 So, I write this. 173 00:10:20,560 --> 00:10:21,120 This tool. 174 00:10:21,280 --> 00:10:23,080 It just get library name. 175 00:10:23,180 --> 00:10:23,940 Gets its version. 176 00:10:26,300 --> 00:10:27,260 And search. 177 00:10:27,460 --> 00:10:28,420 And so we have the base. 178 00:10:28,720 --> 00:10:29,620 Now it use. 179 00:10:31,100 --> 00:10:31,580 Standard. 180 00:10:31,820 --> 00:10:33,140 But in future. 181 00:10:33,240 --> 00:10:35,980 I would like to make my own. 182 00:10:36,620 --> 00:10:37,640 Database of mobility. 183 00:10:38,800 --> 00:10:41,180 So, there are four vectors. 184 00:10:41,360 --> 00:10:42,120 To attack the center. 185 00:10:42,380 --> 00:10:43,220 We find out. 186 00:10:43,220 --> 00:10:45,080 Dict traversal. 187 00:10:45,360 --> 00:10:46,180 And IRP poisoning. 188 00:10:46,360 --> 00:10:47,140 Dict traversal. 189 00:10:47,160 --> 00:10:48,440 And password decoding. 190 00:10:48,780 --> 00:10:50,680 And remote execution. 191 00:10:51,100 --> 00:10:52,580 Using strats bug. 192 00:10:54,280 --> 00:10:55,020 Also. 193 00:10:55,100 --> 00:10:57,580 V center infrastructure products. 194 00:10:57,860 --> 00:10:59,100 There are a lot of products. 195 00:10:59,240 --> 00:11:00,180 With V center. 196 00:11:00,400 --> 00:11:01,700 Like operation management suite. 197 00:11:02,020 --> 00:11:03,020 Capacity configuration. 198 00:11:03,940 --> 00:11:04,680 Management. 199 00:11:05,280 --> 00:11:08,240 They all have some sort of credentials. 200 00:11:08,400 --> 00:11:08,900 For. 201 00:11:13,220 --> 00:11:14,280 There are maybe another. 202 00:11:15,480 --> 00:11:16,900 Vulnerabilities in the system. 203 00:11:17,040 --> 00:11:18,400 So, if you have one. 204 00:11:18,580 --> 00:11:19,660 You may think about. 205 00:11:19,720 --> 00:11:21,000 How make it more like. 206 00:11:21,160 --> 00:11:21,640 Secure. 207 00:11:23,800 --> 00:11:24,860 So, for hardening. 208 00:11:24,980 --> 00:11:25,840 I recommend to update. 209 00:11:25,980 --> 00:11:26,340 Of course. 210 00:11:26,360 --> 00:11:26,720 Virtual. 211 00:11:28,500 --> 00:11:30,160 Filter administration services. 212 00:11:30,400 --> 00:11:31,060 And configurations. 213 00:11:32,240 --> 00:11:32,980 Such like. 214 00:11:33,640 --> 00:11:34,360 Usual user. 215 00:11:34,960 --> 00:11:36,380 Didn't have access to this. 216 00:11:43,540 --> 00:11:44,320 Documents. 217 00:11:44,440 --> 00:11:47,300 It has a lot of tips. 218 00:11:47,540 --> 00:11:49,520 Which may prevent. 219 00:11:49,660 --> 00:11:50,940 From zero days vulnerability. 220 00:11:51,740 --> 00:11:52,320 Like. 221 00:11:52,640 --> 00:11:54,260 To make permission. 222 00:11:54,480 --> 00:11:56,060 On SSL certificate. 223 00:11:57,040 --> 00:11:58,300 And passwords. 224 00:11:58,740 --> 00:11:59,720 Something like that. 225 00:12:02,020 --> 00:12:03,260 So, conclusion. 226 00:12:03,660 --> 00:12:05,440 That patch. 227 00:12:05,600 --> 00:12:08,320 Not always fix bug properly. 228 00:12:08,820 --> 00:12:09,500 And. 229 00:12:09,500 --> 00:12:10,820 If pin tester. 230 00:12:11,580 --> 00:12:13,140 Can get more profit. 231 00:12:13,320 --> 00:12:14,960 If he tries to research. 232 00:12:14,980 --> 00:12:15,500 Something. 233 00:12:17,320 --> 00:12:19,140 And few simple bugs. 234 00:12:19,660 --> 00:12:20,460 And we can own. 235 00:12:20,580 --> 00:12:21,620 All infrastructure. 236 00:12:24,760 --> 00:12:26,160 So, I think that's all. 237 00:12:27,080 --> 00:12:28,020 I think. 238 00:12:34,040 --> 00:12:35,140 We have time. 239 00:12:35,140 --> 00:12:36,340 Any questions?