1 00:00:08,410 --> 00:00:16,950 We would like to say, first of all, thanks to everybody that made it possible to be here. 2 00:00:16,950 --> 00:00:21,790 To the DEF CON staff, the Baidu, everybody. 3 00:00:21,790 --> 00:00:23,010 This is a dream. 4 00:00:23,010 --> 00:00:24,270 Thank you very much. 5 00:00:24,610 --> 00:00:34,370 Well, we both are a big bag of nerves, so we will try to do our best. 6 00:00:34,370 --> 00:00:37,070 Well, presentations. 7 00:00:37,970 --> 00:00:44,750 My partner, my colleague, he comes from Argentina. 8 00:00:45,330 --> 00:00:51,690 He's one of the members in the red team in ASEC Auditors. 9 00:00:51,690 --> 00:00:53,650 We work together. 10 00:00:53,650 --> 00:01:01,370 And he is a bug bounty hunter since a long time ago. 11 00:01:01,510 --> 00:01:04,550 Well, this is his Twitter account. 12 00:01:04,610 --> 00:01:06,830 And me. 13 00:01:07,890 --> 00:01:09,590 I am Gonzalo Sanchez. 14 00:01:09,590 --> 00:01:10,870 I come from Spain. 15 00:01:10,870 --> 00:01:14,030 I'm the red team leader in ASEC Auditors. 16 00:01:14,190 --> 00:01:21,770 And well, this is my LinkedIn account, in case anybody wants to contact. 17 00:01:22,770 --> 00:01:24,230 Yeah. 18 00:01:25,010 --> 00:01:26,990 Hello, DEF CON. 19 00:01:26,990 --> 00:01:37,510 Today we present how to use Google with different compression formats. 20 00:01:37,510 --> 00:01:42,910 Well, what we are going to talk. 21 00:01:42,910 --> 00:01:48,590 We bring to the account a vulnerability in Google Earth. 22 00:01:48,590 --> 00:01:50,270 Why Google Earth? 23 00:01:50,270 --> 00:01:54,070 Well, because Google is a challenge. 24 00:01:54,730 --> 00:02:08,190 A very huge company with fantastic products, with a very good reputation, with reliable levels of security in their products. 25 00:02:09,230 --> 00:02:12,270 Many people use Google products. 26 00:02:12,270 --> 00:02:29,690 And if you are able to have a vulnerability, find a vulnerability, and use it to spread malware, you are using a platform with a spreading potential. 27 00:02:29,690 --> 00:02:32,050 Very huge, very big. 28 00:02:32,050 --> 00:02:39,210 So in this case, for malware application, it's perfect. 29 00:02:39,210 --> 00:02:39,930 Nice Kilombo. 30 00:02:39,930 --> 00:02:44,470 This is the name of the account. 31 00:02:45,360 --> 00:02:46,770 Nice Kilombo. 32 00:02:46,770 --> 00:02:56,990 Kilombo is a very popular phrase in Argentina, which refers to have one or more problems. 33 00:02:57,590 --> 00:02:59,750 Confusion, problem, mess. 34 00:02:59,750 --> 00:03:01,250 This is Kilombo. 35 00:03:01,750 --> 00:03:05,610 Well, the attack vector, KML files. 36 00:03:07,550 --> 00:03:09,970 What is a KML file? 37 00:03:09,970 --> 00:03:19,830 It's a file with a very similar format to XML, with graphical information inside. 38 00:03:20,330 --> 00:03:25,390 This is the key import table in Google Earth. 39 00:03:25,390 --> 00:03:31,390 We are going to work with the description file of the KML file. 40 00:03:32,810 --> 00:03:37,150 We are going to show an example of a file. 41 00:03:39,370 --> 00:03:43,890 Please guys, can you connect the screen? 42 00:03:45,830 --> 00:03:57,410 We are going to show a file, an example of KML file with a location that is this hotel. 43 00:03:58,830 --> 00:03:59,890 Wow. 44 00:04:00,210 --> 00:04:00,950 Easy. 45 00:04:00,950 --> 00:04:06,670 It's a very similar format comparing to, sorry, with XML file. 46 00:04:06,670 --> 00:04:20,030 The key here is that we have field files with the location of the hotel, name, swap, and here the magic, the description file. 47 00:04:20,030 --> 00:04:24,470 This is the file that we are going to use in the next vulnerabilities. 48 00:04:24,830 --> 00:04:29,410 Another kind of file for attack vectors came in set. 49 00:04:29,410 --> 00:04:34,130 It's the same of KML file, but compressed with zip format. 50 00:04:34,850 --> 00:04:43,850 If you take the same file that we have seen, you compress it in zip file and you import it in Google Earth. 51 00:04:43,850 --> 00:04:48,810 Google Earth renders the file and shows the location. 52 00:04:48,810 --> 00:04:49,770 Easy. 53 00:04:50,550 --> 00:04:55,150 There is no need to waste time. 54 00:04:55,710 --> 00:05:12,090 There is an advantage when we talk with KML file, that is the obfuscation because the file is compressed and it complicates to identify the payload of the file. 55 00:05:12,090 --> 00:05:13,550 They are not suspicious files. 56 00:05:13,550 --> 00:05:26,590 We are familiar with executable files talking about malware, but probably if you see a KML file, you don't suspect about this file. 57 00:05:26,590 --> 00:05:28,690 This is an advantage for us. 58 00:05:28,690 --> 00:05:33,330 It's obfuscated because it's compressed and it's very common in Internet. 59 00:05:33,330 --> 00:05:35,890 We can find a lot of files in Internet. 60 00:05:37,210 --> 00:05:44,930 Where can we find this kind of files? 61 00:05:46,770 --> 00:06:02,050 Forums, for example, Pokemon Go, sites of bicycles routes, official sites with geographical information, airquakes, fires. 62 00:06:02,430 --> 00:06:04,770 This is an example of NASA. 63 00:06:06,630 --> 00:06:11,930 There's a lot of sites sharing information in this kind of formats. 64 00:06:11,930 --> 00:06:17,250 This is the victim and host with Google Earth. 65 00:06:17,250 --> 00:06:25,530 The victim imports a KML file and into this file comes the downloader. 66 00:06:25,530 --> 00:06:44,290 The downloader is executed and communicates with an intermediate server that is communicating with the real attacker, with the real payload that is downloaded by the intermediate server and it's delivered to the victim. 67 00:06:44,290 --> 00:06:48,670 And after that, the connection directly with the attacker. 68 00:06:48,810 --> 00:07:00,330 We have detected this problem with the current versions of Google Earth for Windows and Linux. 69 00:07:00,330 --> 00:07:05,790 In this presentation, we are focused on the Windows version. 70 00:07:08,870 --> 00:07:10,310 Summary. 71 00:07:10,410 --> 00:07:11,750 Location. 72 00:07:12,070 --> 00:07:17,570 The vulnerability is present into the JavaScript core of Google Earth. 73 00:07:17,570 --> 00:07:22,570 And we are talking about a null pointer and also an injection of JavaScript. 74 00:07:22,570 --> 00:07:26,570 We are going to see this in detail. 75 00:07:26,570 --> 00:07:30,710 Well, we bring three impacts to show. 76 00:07:30,730 --> 00:07:40,490 A remote cell and a Google cookie takeover using the null pointer vulnerability and a Monero mining using the JavaScript injection. 77 00:07:41,030 --> 00:07:44,330 This is a virtual machine that will be the attacker. 78 00:07:44,330 --> 00:07:48,630 And the victim is my computer. 79 00:07:48,970 --> 00:07:52,070 And my computer is Windows. 80 00:07:52,290 --> 00:07:53,310 Okay. 81 00:07:53,310 --> 00:08:01,350 And this is the virtual machine with the real attacker. 82 00:08:01,350 --> 00:08:19,430 Well, the victim has Google Earth and he has imported a site with an arbitrary name that is in this case is Google One. 83 00:08:19,430 --> 00:08:22,710 Well, we have to start the server. 84 00:08:23,370 --> 00:08:25,690 The server is the intermediate server. 85 00:08:25,690 --> 00:08:32,910 In order to make easy the presentation, the intermediate server and the attacker will be the same machine. 86 00:08:32,910 --> 00:08:33,590 This one. 87 00:08:33,590 --> 00:08:34,310 Okay? 88 00:08:34,730 --> 00:08:41,870 The intermediate server is the attacker. 89 00:08:41,870 --> 00:08:42,430 Okay. 90 00:08:42,430 --> 00:08:44,090 This is the intermediate server. 91 00:08:44,250 --> 00:08:54,430 The victim has imported and clicked on the site and the connection has received into the intermediate server. 92 00:08:54,430 --> 00:08:58,050 So, we have it. 93 00:08:59,390 --> 00:09:03,010 And we are going to show the remote cell. 94 00:09:03,010 --> 00:09:03,950 The impact one. 95 00:09:03,950 --> 00:09:04,870 Okay. 96 00:09:04,870 --> 00:09:09,090 First of all, basic execution. 97 00:09:09,090 --> 00:09:12,590 We will show and we will show the exploit. 98 00:09:13,250 --> 00:09:21,530 Um, well, Defcon has the exploit and probably will show when Google fix this, this problem. 99 00:09:21,530 --> 00:09:25,750 But, uh, this is a help to, to use it. 100 00:09:25,750 --> 00:09:29,730 Um, we are going to execute the command. 101 00:09:31,690 --> 00:09:33,730 Remote command. 102 00:09:35,810 --> 00:09:42,610 Basic operation like, uh, sample and it's received. 103 00:09:42,610 --> 00:09:46,990 And now we can access to files in the victim. 104 00:09:47,970 --> 00:09:52,330 The file is downloaded and we have it into the attacker machine. 105 00:09:52,330 --> 00:09:55,270 We have access to the victim's file. 106 00:09:55,510 --> 00:09:59,970 The file is downloaded and we can check it. 107 00:10:01,250 --> 00:10:02,010 Bingo. 108 00:10:02,010 --> 00:10:02,830 Okay. 109 00:10:03,670 --> 00:10:05,850 This is for the impact one. 110 00:10:05,850 --> 00:10:11,410 Remote cell and file access into the victim's file. 111 00:10:11,730 --> 00:10:12,930 Okay. 112 00:10:12,930 --> 00:10:14,890 Um, okay. 113 00:10:15,890 --> 00:10:20,130 Um, guys, please return to presentation. 114 00:10:20,430 --> 00:10:21,490 Impact two. 115 00:10:21,490 --> 00:10:27,030 We are going to use the victim's computer to mine Monero. 116 00:10:27,030 --> 00:10:49,530 Um, here we have a problem because, uh, we can not connect to this site with, uh, internet connection, but we can show at least the Kman file. 117 00:10:49,650 --> 00:10:53,750 Here we are not exploiting, uh, the null pointer vulnerability. 118 00:10:53,750 --> 00:11:02,510 Uh, here we are injecting JavaScript code into, um, description file. 119 00:11:02,770 --> 00:11:12,190 What we are doing here is connect with coin hive and downloading the JavaScript code for the Monero mining. 120 00:11:12,230 --> 00:11:21,330 Um, when you import this file in Google Earth, machine starts mining and resources collapse and what? 121 00:11:21,330 --> 00:11:23,950 You have a problem with your, with your computer. 122 00:11:23,950 --> 00:11:35,650 But as I said, uh, we can not solve this, this, this problem because there is a problem with the internet connection in, in, in this case. 123 00:11:35,650 --> 00:11:41,170 So we can continue with the presentation. 124 00:11:42,050 --> 00:11:48,350 And the last impact is the Google account hijacking. 125 00:11:48,530 --> 00:11:55,150 Um, what we are going to do is to take over the cookies of the victims. 126 00:11:55,150 --> 00:12:19,210 What we are doing now, because we have access to the files in the victim's computer, we are accessing for, um, for the cookies that SQLite file in the Firefox, uh, folder where the victim stores its own, um, Gmail cookies. 127 00:12:19,210 --> 00:12:22,550 What do we need in this case? 128 00:12:22,550 --> 00:12:35,010 This is a type of social engineering, uh, attack because we need that the victim has opened the Firefox browser with a open session in Gmail. 129 00:12:35,010 --> 00:12:40,070 With this, uh, file with the, the credentials inside. 130 00:12:40,070 --> 00:12:56,690 In this attack, the victim with the browser open, with the, uh, Gmail account opened, imports the KML file in Google Earth and we have access to its cookies file. 131 00:12:56,690 --> 00:12:59,330 Now we go to our browser. 132 00:12:59,330 --> 00:13:14,830 This is the, uh, folder of the attacker because we are going to, uh, open the Firefox browser in the attacker PC, opening the, the cookies of the victim. 133 00:13:17,230 --> 00:13:23,430 We delete any cookie in the attacker's browser. 134 00:13:35,790 --> 00:13:37,510 Import the file. 135 00:16:10,320 --> 00:16:13,820 Again, we have the cookies file. 136 00:16:14,780 --> 00:16:21,660 We are going to export information in CSV, CSV format. 137 00:16:37,580 --> 00:16:42,420 And once it's exported, we are going to import. 138 00:16:52,800 --> 00:17:02,540 We are using CSV format in order to make easy the transport between, between files. 139 00:17:05,640 --> 00:17:06,100 To 140 00:18:11,310 --> 00:18:15,930 repeat, in this case, sorry, we are a little bit nervous. 141 00:18:16,170 --> 00:18:16,370 Um 142 00:18:28,010 --> 00:18:30,550 , this is the server. 143 00:18:31,630 --> 00:18:32,170 Uh 144 00:18:36,520 --> 00:18:39,500 , start from the beginning. 145 00:18:47,540 --> 00:18:52,380 The victim clicks on the malicious, uh, site. 146 00:18:52,600 --> 00:18:54,240 Oops. 147 00:19:30,540 --> 00:19:32,220 Victim clicks. 148 00:19:32,440 --> 00:19:34,880 Something is wrong. 149 00:19:35,420 --> 00:19:36,900 Uh, what? 150 00:19:36,900 --> 00:19:38,660 Something is going wrong. 151 00:19:40,580 --> 00:19:54,740 Uh, 152 00:20:03,620 --> 00:20:04,920 better. 153 00:20:07,680 --> 00:20:13,280 If you can see this, this is a virtual machine. 154 00:20:13,280 --> 00:20:15,720 Windows of the victim. 155 00:20:15,720 --> 00:20:18,700 The victim has opened Firefox. 156 00:20:19,080 --> 00:20:21,740 Now we are starting the server. 157 00:20:21,900 --> 00:20:25,840 Same that we did some seconds ago. 158 00:20:25,840 --> 00:20:30,800 And the victim clicks on the malicious file. 159 00:20:30,800 --> 00:20:34,700 Here the connection is received. 160 00:20:35,240 --> 00:20:40,340 And now we execute with the get cookie option. 161 00:20:41,240 --> 00:20:44,780 Here we have exported the, the file. 162 00:20:45,680 --> 00:20:51,780 And here we are export in CSV format. 163 00:20:51,780 --> 00:20:57,200 Select all from the Mozilla cookies table. 164 00:20:59,440 --> 00:21:06,120 This is the cookies file of the Mozilla Firefox of the attacker. 165 00:21:06,500 --> 00:21:11,780 We are going to drop the table with the cookies of the attacker. 166 00:21:11,780 --> 00:21:16,420 And we are going to import here the victim's cookies. 167 00:21:16,420 --> 00:21:26,720 Drop the current table of Mozilla cookies and import with the file generated. 168 00:21:27,260 --> 00:21:30,320 And open Firefox. 169 00:21:30,560 --> 00:21:35,080 And we have the session of the victim. 170 00:21:35,460 --> 00:21:44,980 Please excuse that we didn't achieve this in live show, but it's so difficult to achieve it. 171 00:21:44,980 --> 00:21:51,380 So, these are the three paths that we wanted to, to show. 172 00:21:51,380 --> 00:21:58,460 It's a short description in order when they've conserved the, the, the exploit to everybody. 173 00:21:58,700 --> 00:22:04,000 The malicious game file we have seen so many times this morning. 174 00:22:04,760 --> 00:22:12,280 This is the server, the internet server that receives the communications from the victim. 175 00:22:12,280 --> 00:22:13,960 And this is the attacker. 176 00:22:13,960 --> 00:22:20,020 This is the, the Python that has mainly all the functionality. 177 00:22:20,020 --> 00:22:22,520 Everything is developed in Python. 178 00:22:22,700 --> 00:22:30,080 And well, this is uh, the structure of the exploit. 179 00:22:30,920 --> 00:22:35,340 And well, many thanks for everything. 180 00:22:38,890 --> 00:22:54,690 Incredible hard two days with a lot of problems with connections and what it was hard for us to, to bring, but at least we could show you this, this material. 181 00:22:54,790 --> 00:23:03,230 So thank you very much for everybody, especially for the guys that helped us in the last hour. 182 00:23:03,510 --> 00:23:07,650 Hector Paulino, uh, well, a lot of people. 183 00:23:07,690 --> 00:23:08,810 Raiko. 184 00:23:08,850 --> 00:23:16,150 And thank you everybody to be here and give us the opportunity to tell this and show this. 185 00:23:16,150 --> 00:23:20,330 I hope to, you enjoy with the material. 186 00:23:20,330 --> 00:23:20,850 Thanks.