1 00:00:00,000 --> 00:00:05,020 Thank you for coming to this session, titled Owning Bad Guys and Mafia Using JavaScript 2 00:00:05,620 --> 00:00:11,920 Botnets. I hope you enjoy the topic. But before starting, I would like to introduce myself 3 00:00:12,420 --> 00:00:21,300 and my country. I work in a small company called I64 in Spain. I'm also Microsoft MVP 4 00:00:21,300 --> 00:00:27,800 in enterprise security. And I live in Spain. Do you know Spain? Have you been to Spain 5 00:00:27,800 --> 00:00:34,100 any time in your life? If not, you have to go and visit our country. This is Madrid, 6 00:00:34,260 --> 00:00:38,880 the city in which I live. As you can see, it's the city that never sleeps, but it's 7 00:00:38,880 --> 00:00:44,080 smaller than New York. And there are a lot of big places in Spain that you have to visit. 8 00:00:44,340 --> 00:00:50,440 This is the Sacred Family in Barcelona, one of the most beautiful churches in the world, 9 00:00:50,500 --> 00:00:56,560 as you can see. And, of course, there are other places that you might like to visit. 10 00:00:56,920 --> 00:00:57,500 This is 11 00:00:57,500 --> 00:01:03,840 Ibiza, a small island in which I'm going to stay tomorrow. So if you want to rest and 12 00:01:03,840 --> 00:01:08,960 discover a different Spain, it's very close to you. It's in Europe, just crossing the 13 00:01:08,960 --> 00:01:17,060 ocean. And, of course, you are a brave man. You can visit other cities with other parties. 14 00:01:17,320 --> 00:01:22,560 This is Pamplona. How many of you have been running bottles any time in your life? There 15 00:01:22,560 --> 00:01:26,820 is only one rule. If you drink, don't run. That's the only rule. 16 00:01:27,520 --> 00:01:32,600 The rest is easy. You only need to run faster than the bull. It's very easy to do it. 17 00:01:33,940 --> 00:01:39,980 And, of course, if you like another party, we've got something special. This is the Tomatina. 18 00:01:40,240 --> 00:01:47,060 It's a battlefield with tomatoes, one day long, one day length. I'm not sure the history 19 00:01:47,060 --> 00:01:54,300 about this party, but you only need to throw tomatoes. That's all. It's quite interesting. 20 00:01:57,500 --> 00:01:59,140 Well, we are Spaniards, you know. 21 00:02:01,460 --> 00:02:07,880 Well, let's start with today's topic. Today's topic is quite simple. It's let's create a 22 00:02:07,880 --> 00:02:13,880 botnet. That's all. But from the beginning, we got a lot of problems with it. I guess 23 00:02:13,880 --> 00:02:18,400 that many of you have been thinking about creating a botnet any time in your life. How 24 00:02:18,400 --> 00:02:25,680 many of you have been thinking about it, about creating a botnet? How many of you did it? 25 00:02:28,600 --> 00:02:36,440 I did it. Well, the idea of creating a botnet is quite interesting. But, of course, as you, 26 00:02:36,600 --> 00:02:44,100 I'm lazy. I'm from Spain, so it's normal. So we are lazy. This is a nice picture. I 27 00:02:44,100 --> 00:02:51,500 would like to show you this picture. Let me use Zoom. I would like to show you this 28 00:02:51,500 --> 00:02:56,800 picture because for sure it's for Spanish people. They need a power supplier. They need 29 00:02:56,820 --> 00:03:02,060 a power supplier. And they are using flip flops to connect it through the swimming pool. 30 00:03:02,180 --> 00:03:09,740 It's incredible. This is more or less like we used to do the things in Spain. So that's the 31 00:03:09,740 --> 00:03:15,060 idea of creating the botnet. We wanted to create the botnet, but we were lazy. We haven't 32 00:03:15,060 --> 00:03:22,800 money. You know it. We haven't zero days. We aren't the FBI of the NSA, so we cannot intercept 33 00:03:22,800 --> 00:03:26,800 for free the communications. And, of course, we are not the FBI of the NSA. So we cannot 34 00:03:26,820 --> 00:03:30,720 do it. We are the FBI of Google, Apple, or Microsoft that are running all the devices around 35 00:03:30,720 --> 00:03:35,660 the world. And, you know, we are Spaniards, so we need to do something different from the 36 00:03:35,660 --> 00:03:41,640 beginning. So the idea of creating the botnet, it was quite simple. We thought, okay, let 37 00:03:41,640 --> 00:03:50,980 them be infect. Let's do something that allows bot to be infect for themselves. So the only 38 00:03:50,980 --> 00:03:56,520 thing that we wanted is that they wanted to be infect. Quite simple. In the end, if you think 39 00:03:56,520 --> 00:04:01,680 about this topic, it's very useful. And the malware industry has been using it around the 40 00:04:01,680 --> 00:04:11,520 last five or ten years with rogue antivirus and with social engineering tricks. So why not to do a 41 00:04:11,520 --> 00:04:18,000 botnet doing the same trick? So the idea of creating the botnet is just to create a man in the 42 00:04:18,000 --> 00:04:23,540 middle attack. There are so many man in the middle attacks that can be used in different scenarios. 43 00:04:23,980 --> 00:04:26,500 Of course, if we are in a network, there are different types of attacks. But the idea is to use a 44 00:04:26,500 --> 00:04:34,660 we can use something like ARP spoofing or we can use row DHCP in IPv4 or IPv6 network. 45 00:04:35,080 --> 00:04:40,500 Man in the middle attacks in IPv6 networks. We are going to publish a new tool, a new 46 00:04:40,500 --> 00:04:47,200 FOCA which is the evil FOCA to perform man in the middle attacks in IPv6 network just 47 00:04:47,860 --> 00:04:54,700 pointing and click. Quite simple. And of course if you are able to manage the DNS you can do 48 00:04:54,700 --> 00:05:00,680 the man in the middle attack. But it's quite complicated if you are thinking about internet 49 00:05:00,680 --> 00:05:06,780 because you have to deal with a lot of providers, internet providers and networks so it's 50 00:05:06,780 --> 00:05:13,020 difficult to use an internet. One of the most used in the internet several years ago is the man 51 00:05:13,020 --> 00:05:19,840 in the browser in which an add-on is installed in the browser, an add-on like a browser helper 52 00:05:19,840 --> 00:05:24,680 object in internet explorer and a lot of examples of the man in the middle attacks. We 53 00:05:24,680 --> 00:05:30,640 got a lot of malware having used this trick. We got a lot of malware from Russian, especially 54 00:05:30,640 --> 00:05:38,280 from Russian, using this trick. This is very useful and it works so well that they need 55 00:05:38,280 --> 00:05:43,240 special files to configure the Trojan to attack all different banks. This is a very 56 00:05:43,240 --> 00:05:49,960 ancient Trojan, banking Trojan using an XML file to configure the man in the browser to 57 00:05:49,960 --> 00:05:54,560 control all different web pages from different banks. Quite simple and it 58 00:05:54,680 --> 00:06:02,600 works very well. But we needed to call in something and deal with antivirus system, 59 00:06:02,960 --> 00:06:11,460 managing detection programs so we decided that it was very complicated for us and we needed 60 00:06:11,460 --> 00:06:17,760 something easier. So we talk about the man in the top or JavaScript in the middle. The idea is 61 00:06:17,760 --> 00:06:24,000 quite simple. If you are able to run a JavaScript in one tab you can do a lot of things. You can 62 00:06:24,000 --> 00:06:30,780 access to the code, you can modify the HTML, you can access to the form fields, you can manage 63 00:06:30,780 --> 00:06:38,880 even the not supposed to be managed cookies like HTTP only cooking using different tricks and so 64 00:06:38,880 --> 00:06:47,260 on. In fact, there are very well known project which is the browser exploitation framework 65 00:06:47,260 --> 00:06:53,980 project that allows you to do a lot of things just installing on a small piece of JavaScript code in a 66 00:06:53,980 --> 00:07:02,320 in a browser. So the idea is just to do a cache poisoning. The problem is that we need to 67 00:07:03,040 --> 00:07:08,720 configure this on the Internet and it's quite complicated if you want to infect a lot of bots 68 00:07:08,720 --> 00:07:17,460 on the network. So we were thinking about how to do it easy and we did this. So the idea is how to 69 00:07:17,460 --> 00:07:23,000 create a JavaScript from scratch and it's quite simple. First of all, we thought about the 70 00:07:23,000 --> 00:07:31,420 turn out but the idea with turn out is quite simple. If you are the last one on the line, you 71 00:07:31,420 --> 00:07:37,180 will be able to access to all content. You will be able to intercept all communications. The 72 00:07:37,180 --> 00:07:44,720 problem when we try to create the rogue turn out is that they are using some security test to 73 00:07:44,720 --> 00:07:51,400 discover who is modifying the answer of the DNS or who is hiding some special files and so on. 74 00:07:53,000 --> 00:08:00,920 as you can see. So we thought, well, it's too complicated. We need to detect when they are 75 00:08:00,920 --> 00:08:06,400 sending the test and creating a section for the test. No. Too difficult. We are Spanish. 76 00:08:10,480 --> 00:08:17,420 The next thing that we did is just to create a proxy. To create a proxy is quite simple 77 00:08:17,420 --> 00:08:23,740 because a proxy is not a big infrastructure like the Tor network in which all are connected. 78 00:08:23,980 --> 00:08:32,000 A proxy server is just a standalone server that people decide to connect to. So the idea is 79 00:08:32,000 --> 00:08:38,340 that if you read all the manuals on the Internet about how to be anonymous, the first thing is 80 00:08:38,340 --> 00:08:45,380 connect to any proxy server on the Internet. So we thought, hey, it is very interesting 81 00:08:45,380 --> 00:08:47,020 because it's a man in the middle schema. 82 00:08:47,620 --> 00:08:52,960 So if we are a proxy server on the Internet and people decide to connect to the Internet 83 00:08:52,960 --> 00:09:00,840 through our proxy server, we will be able to collect all data and infect all browsers. 84 00:09:01,200 --> 00:09:11,140 So we did it. The first thing that we need to do is just to rent a server on the Internet. 85 00:09:11,480 --> 00:09:16,300 Of course, you have to take care about what kind of server are you going to use. Don't 86 00:09:16,300 --> 00:09:17,300 use any 87 00:09:17,300 --> 00:09:24,140 Pirate Bay server, not even in Amazon. Remember what happened with the WikiLeaks. Not in Mega 88 00:09:24,140 --> 00:09:31,180 Blob. It's better if you select any country in which there are no laws. 89 00:09:35,430 --> 00:09:42,640 So we were renting servers on Iraq, Afghanistan, and Kazakhstan, Spain. 90 00:09:49,220 --> 00:09:49,540 . 91 00:09:53,220 --> 00:09:53,860 Then... 92 00:09:53,860 --> 00:10:01,300 Sorry. Once you install... you rent the server, you only need to configure something which is 93 00:10:01,300 --> 00:10:08,540 very simple. Apache Web Server and SquidProxy. And the idea is that with this server, we were 94 00:10:08,540 --> 00:10:16,900 going to infect all JavaScript files with one small piece of code. Two lines only. So when the user 95 00:10:16,900 --> 00:10:23,060 user connect to our proxy server, we go to the website, we go to the response page, okay, 96 00:10:23,260 --> 00:10:28,920 and the response page has a JavaScript file, then we retrieve the original JavaScript and 97 00:10:28,920 --> 00:10:36,220 then we added only two lines to load the payload. A new payload. We didn't want to use any payload 98 00:10:37,000 --> 00:10:44,100 very well known on the Internet like beef, so we just code in two lines and install that 99 00:10:44,100 --> 00:10:54,140 two lines in all JavaScript files that were across our proxy server. So in the end, only need 100 00:10:54,140 --> 00:11:04,520 to do this. First of all, we created a rewrite program to add that lines of code, so we need to 101 00:11:04,520 --> 00:11:13,220 configure this option in a squid proxy and then we added the non-expiration policy in Apache 102 00:11:13,220 --> 00:11:19,460 because once we infect a JavaScript file in the web browser, we want it to be there forever. 103 00:11:22,120 --> 00:11:29,360 Then the code that we needed to create is just this. It's a Perl script, as you can see, and the 104 00:11:29,360 --> 00:11:37,040 only thing that we are doing is we retrieve the file with using W get, we copy it into our file 105 00:11:37,040 --> 00:11:43,200 system and then we add it or pass a JavaScript file and then we add it to the web browser. So we 106 00:11:43,980 --> 00:11:48,200 send the JavaScript to the JavaScript. And then of course we send the JavaScript, the new 107 00:11:48,200 --> 00:11:54,620 JavaScript to the client using a print. It's a very small piece of code. It's full of common 108 00:11:54,620 --> 00:12:04,200 injection vulnerabilities, but it works. The JavaScript is just this. It's a small piece of code 109 00:12:04,200 --> 00:12:13,200 and we are just connecting to the control panel and the only check that we do is just that we are 110 00:12:13,220 --> 00:12:23,220 running only one instance of the payload in every tab. So simple. And of Wen want wanted to do 111 00:12:23,220 --> 00:12:30,800 anything but to good people. So we created a special advert in advice on the web page of our 112 00:12:30,800 --> 00:12:35,760 servers and saying following. Following proxy server is being used for a security risk all 113 00:12:35,760 --> 00:12:40,200 JavaScript files will be in fact and all your data will be collected. If you want to be safe 114 00:12:40,200 --> 00:12:43,180 don't use this proxy server. You know that. Don't send sensitive infrared its 115 00:12:43,180 --> 00:12:43,200 inform you. So what we want to do here we just go toinho are here, but we're going to work 116 00:12:43,220 --> 00:12:53,060 after all, you continue to die on your own wrist. So we published this. So if you don't 117 00:12:53,060 --> 00:12:58,740 want it to lose your passwords, if you don't want it to be fed, don't use our proxy. That's 118 00:12:58,740 --> 00:13:09,940 quite simple. It's a good security policy. No, no. Actually, in the Army, you got the 119 00:13:09,940 --> 00:13:18,000 same security policies. The following site is for temporary loading and unloading. On your 120 00:13:18,000 --> 00:13:25,680 own wrist. This is a web page from the Army. So it's the same security policy. So it's legal. 121 00:13:29,940 --> 00:13:39,340 So the next thing that we need to do is just to make our proxy server public. So we copy our IP 122 00:13:39,340 --> 00:13:49,560 address and publish the IP address on a proxy server list, as you can see. And then just let the 123 00:13:49,560 --> 00:14:02,440 internet do its magic. And as you can see, in a few days, we got 1,110 different results about 124 00:14:02,440 --> 00:14:09,320 our IP address because all proxy server leads are copying themselves. So if you're 125 00:14:09,340 --> 00:14:13,760 to publish your IP address on one proxy server list, they're copying the same IP address towards 126 00:14:13,760 --> 00:14:19,820 proxy server list. Which is funny because in one hour, in one day, you can have a lot of bots. 127 00:14:20,120 --> 00:14:29,580 So the next thing that we do is just to create a small piece of payload. So the first one is just 128 00:14:29,580 --> 00:14:35,660 cookie-stealing. We're running our JavaScript inside. We didn't want it to deal with HTTPS 129 00:14:36,520 --> 00:14:39,320 connection. We didn't want it to be technical, but we don't want it to be in our own code. We 130 00:14:39,340 --> 00:14:45,720 deal with secure cookies. We didn't want it to deal with HTTP only cookies. So we just 131 00:14:45,720 --> 00:14:51,220 copied the normal cookies, the unsecured cookies and sent the cookies to our control panel 132 00:14:51,220 --> 00:14:59,200 just using a get. Then we created a small payload to grab all form fields. The idea is 133 00:14:59,200 --> 00:15:05,400 that we hook the submit function copying all the information in the fields and send the 134 00:15:05,400 --> 00:15:15,300 fields value to our control panel and that's all. Just enjoy. Doing this in one day we were 135 00:15:15,300 --> 00:15:26,160 able to get 5,000 bots, which is not bad. Not creating any special polymorphic malware, not 136 00:15:26,160 --> 00:15:31,960 doing just publishing one IP address on the Internet. We are from Spain, you know? 137 00:15:41,540 --> 00:15:48,380 So the question is, who the hell is using this kind of services on the Internet? How many of 138 00:15:48,380 --> 00:15:58,400 you are using this kind of services on the Internet? If you read all manuals, if you want to be 139 00:15:58,400 --> 00:16:04,380 anonymous, use anonymous proxy server. If you want to be more anonymous, use more than one anonymous 140 00:16:04,380 --> 00:16:08,540 proxy server, which is cool because you can be fed for more than one proxy server. 141 00:16:08,820 --> 00:16:16,780 So, and the idea is that the kind of people who is using that services is, of course, bad 142 00:16:16,780 --> 00:16:24,940 people. All the things that we were able to collect were bad people doing bad things. So, of 143 00:16:24,940 --> 00:16:33,100 course, the first thing that we discovered is the Nigerian scammers. We collect all information, of 144 00:16:33,100 --> 00:16:41,800 course we collect also user name and password. But we advertise them so it's all legal. So we 145 00:16:41,800 --> 00:16:50,200 want, once we got the password we get into the mail boxes of those people. And this is one of 146 00:16:50,200 --> 00:16:55,120 my favorites. There were a lot of people doing this. This is one of my favorites. As you can 147 00:16:55,120 --> 00:17:03,080 see the email name is, the alias is Royal Hotel England and hotmail.co.uk. So this is the 148 00:17:03,100 --> 00:17:12,900 email. And that guy was creating a spam campaign trying to scam people with VISA. The idea is 149 00:17:12,900 --> 00:17:21,740 they were, he was offering to the victims a special VISA to get a job in the UK. Of course this is 150 00:17:21,740 --> 00:17:29,740 the email. He was asking for money. 275 pounds. And he was asking for money and a lot of 151 00:17:29,740 --> 00:17:33,080 people were suspicious. Saying this is a scam. This is a scam. This is a scam. This is a scam. 152 00:17:33,100 --> 00:17:38,860 And they were saying, okay, I respect you kind information but show me the money. Show me the 153 00:17:38,860 --> 00:17:45,580 job before. Show me the job and then I send the money. Of course, if the guy was suspicious, the 154 00:17:45,580 --> 00:17:53,660 scammer wasn't continuing with the scam. But others weren't so suspicious. So in the end they 155 00:17:53,660 --> 00:17:59,560 were sending all the information needed to create the VISA. As you can see, passport, application 156 00:17:59,560 --> 00:18:08,060 form, my resume. Passport, passport, passport. High quality picture for the passport in the UK. 157 00:18:08,860 --> 00:18:18,520 Fingertips as you can see. And so on. A lot of people sending. This is the easiest way of 158 00:18:18,520 --> 00:18:29,040 identity theft that I've seen in my life. For sure if you got all this information you probably can't create your own mule for 159 00:18:30,880 --> 00:18:57,300 to use in malware, in banking malware. So quite simple. Another one which is one of my favorites is this guy. Well have you seen this girl? This is a profile in a social network for having a flint and that kind of things. How do you look to that girl? How many of you really think that that girl needs to search for a boy on the internet? 160 00:19:03,160 --> 00:19:29,400 Well, it was very suspicious for us at the beginning. So we decided to collect the user name and password of this profile. And analyze what she was doing. And in the end as you can see, this ancient queen here is searching for a relationship and dating. She's from Texas. 161 00:19:29,560 --> 00:19:40,100 and it's 30. But she has another profile in another network. In this case she is from New 162 00:19:40,100 --> 00:19:51,620 Zealand. It's 31 and it's Aries and so on. And in another profile she lives in Virginia. 163 00:19:52,500 --> 00:20:02,820 Any person from Virginia who has seen this girl? And of course the most wonderful is that in 164 00:20:02,820 --> 00:20:13,380 other profiles she looks completely different. She is from Germany. So in the end we decide to 165 00:20:13,380 --> 00:20:21,600 get into the, into that guy's e-mail box and we were reading the information that was in the 166 00:20:21,620 --> 00:20:27,940 e-mail box and she was starting there. Well, that guy of course is not a girl. It's a boy. He 167 00:20:28,620 --> 00:20:35,100 was collecting chats of people who were in contact with that profile. So that profiles are 168 00:20:35,100 --> 00:20:42,860 for phishing victims. And this is one of my favorite chats in which KK Bill is the girl, is 169 00:20:42,860 --> 00:20:51,560 supposed to be the girl. And Fiat 176 is the victim. Hello, sweetie. Hello, my sweet mouse. I 170 00:20:51,620 --> 00:21:02,820 think we need a name. . The second one is nice. How are you doing? 171 00:21:08,080 --> 00:21:15,120 . Well, in the chat, in the chat you can see, I'm sorry. In the chat they are 172 00:21:15,120 --> 00:21:21,600 discussing the details of their love. And the details is are 70, 100 Europe that needs to be 173 00:21:21,620 --> 00:21:32,480 sent in a chain for the naked picture. I don't know what kind of picture are these. And the point 174 00:21:32,480 --> 00:21:40,860 is that this boy, this predator is a multitasking scammer. So he's chatting with different people at 175 00:21:40,860 --> 00:21:47,860 the same time. And he also fails. And in the middle of the chat he has started to chat in German. 176 00:21:53,240 --> 00:22:02,720 So we were inside the e-mail box. And it's quite nice because he has all the victims very well 177 00:22:02,720 --> 00:22:10,520 classified in his e-mail box. And there is a folder with all the chats in which he is working 178 00:22:10,520 --> 00:22:17,260 right now. And we were searching for mails asking for money through Western Union. And as you can 179 00:22:17,260 --> 00:22:43,540 see, there was 158 messages asking for money from Western Union. So quite simple. And the e-mail 180 00:22:43,540 --> 00:22:49,260 manager asked me that the other city and country is not possible. Now what can we do? Of course, 181 00:22:49,300 --> 00:22:55,480 she is asking for money that needs to be transferred to a different country in which it's supposed to 182 00:22:55,480 --> 00:23:03,200 be leaving that fake profile. And she gets angry. Fucking stop playing games on me. I gave you 183 00:23:03,200 --> 00:23:13,340 right address. Well, you can imagine the rest of the e-mails. Another of the scammers in that 184 00:23:15,220 --> 00:23:21,400 test that we did was someone very weird because he was doing something strange with dogs. 185 00:23:22,880 --> 00:23:32,180 We weren't sure about what he was doing with dogs and why he needed to be using a proxy server on 186 00:23:32,180 --> 00:23:37,660 the Internet, an anonymous proxy server on the Internet. So we decided to use the user name and 187 00:23:37,660 --> 00:23:43,520 password to get into the e-mail box. And we found that the e-mail was not working. And we 188 00:23:43,540 --> 00:23:51,260 discovered something very hard. We discovered a picture. Please, this is a warning. If you are 189 00:23:51,260 --> 00:24:05,320 not, if you love animals, please don't see this picture because this is the picture. He was 190 00:24:05,320 --> 00:24:11,940 selling this fake jersey because in the end he was selling the same jersey around the world. So 191 00:24:11,940 --> 00:24:13,520 it's the most. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 00:24:14,760 --> 00:24:43,520 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 00:24:43,520 --> 00:24:54,860 we were about to send this IP address to column police because this guy is not normal. Also 194 00:24:54,860 --> 00:24:59,120 people trying to be anonymous, a lot of people trying to be anonymous and the first thing 195 00:24:59,120 --> 00:25:07,480 that they were doing was just to test if they were anonymous. The problem is that if you are 196 00:25:07,480 --> 00:25:15,760 using a proxy server you are anonymous to the end page but not to the proxy server so the proxy 197 00:25:15,760 --> 00:25:21,660 server can track you any time. It's quite simple. So okay you are anonymous. We don't know 198 00:25:21,660 --> 00:25:29,900 that you are from the states. Okay your IP address is this and we know the real IP address. So it's 199 00:25:29,900 --> 00:25:36,760 quite simple. A lot of cases of people doing the same trying to be anonymous. This is the 200 00:25:37,880 --> 00:25:48,540 work case we discovered. It's a guy trying to make out money of reading blog posts. It's 201 00:25:48,540 --> 00:25:53,960 supposed to be a business. You read the blog post of anyone around the world and you will be 202 00:25:53,960 --> 00:26:02,920 paid for it. And after one month he was able to earn 24 bucks. So I'm not sure that it is so 203 00:26:02,920 --> 00:26:07,440 good business right now. Of course we discovered a lot of 204 00:26:07,440 --> 00:26:07,460 problems. We discovered a lot of problems. We discovered a lot of problems. We discovered a 205 00:26:07,480 --> 00:26:14,520 A lot of people hacking doing defacing and so on. And this is one of our favorites. You can see 206 00:26:14,520 --> 00:26:23,040 in the control panel we got the local files in the website that have been hacked. This is a 207 00:26:23,040 --> 00:26:29,740 WebCell and they are of this WebCell, of course we connected to the site to the website and it 208 00:26:29,740 --> 00:26:37,360 was it was it has the deface you can see you can see the hacker. It was anonymous but you had the 209 00:26:37,360 --> 00:26:42,820 email address. I don't understand this very well. But the problem is that this hacker was using a 210 00:26:42,820 --> 00:26:49,500 web cell and the web cell was hacked with a JavaScript. Do you know? Probably you know that 211 00:26:49,500 --> 00:26:54,100 there are a lot of web cells on the Internet with a small piece of JavaScript that are copying your 212 00:26:54,100 --> 00:27:01,560 web cell and you are trojanized by this web cell. This web cell was trojanized and of course it 213 00:27:01,560 --> 00:27:07,640 was trojanized by a JavaScript file so when the JavaScript file crossed through our proxy 214 00:27:07,640 --> 00:27:12,920 server, we fed that JavaScript and then we owned the web cell of the hacker. So in the end, 215 00:27:12,940 --> 00:27:16,400 the hacker who was hacking was hacked. So I don't understand. 216 00:27:24,320 --> 00:27:31,540 Also one of our favorite things is that once you are using a proxy server, you are using a 217 00:27:31,560 --> 00:27:37,900 web cell. If you disconnect from the proxy server but you don't erase your cache, you will be 218 00:27:37,900 --> 00:27:47,640 in fact for the rest of the time. Because the JavaScript is on your cache. So the idea is that we 219 00:27:47,640 --> 00:27:53,000 discovered that some Intranet applications were using JavaScript from the Internet. So we were 220 00:27:53,000 --> 00:27:59,680 able to discover to infect that JavaScript and then we infect the Intranet application. In this 221 00:27:59,680 --> 00:28:01,340 case, this is a guy from Mexico. 222 00:28:01,560 --> 00:28:08,500 He wanted to browse for some form on the Internet and then disconnect from the proxy server. But he 223 00:28:08,500 --> 00:28:14,680 was in fact, as you can see, this is an internal server. We were unable to connect to it. But there 224 00:28:14,680 --> 00:28:23,240 is an ERP application with data and of course a lot of information of the user and the password and 225 00:28:23,240 --> 00:28:31,540 so on. But we couldn't connect to that Intranet because it's not public on the Internet. And of course, form. A lot of 226 00:28:31,560 --> 00:28:37,020 form. People searching for form. Form is the business. Believe me. Not hacking. Form, form, form. 227 00:28:38,860 --> 00:28:46,560 Even we were, we were discovering this. This is a very nice story in which in a church, in a church, in a 228 00:28:46,560 --> 00:28:55,020 Catholic church was discovered this painting from monks since seven centuries before. They were 229 00:28:55,020 --> 00:29:01,540 painting peanuts. It's true. It's true. It's true. It's true. It's true. It's true. It's true. It's true. It's 230 00:29:01,560 --> 00:29:09,840 true. It's true. It's true. So we were collecting URLs and we discovered a lot of URLs on forms. Of 231 00:29:09,840 --> 00:29:16,880 course a lot of user names and passwords that we've been selling on the Internet of course. And but 232 00:29:16,880 --> 00:29:26,840 the most, the most, the most weird page is Chat to Rate. Believe me, you never watch that website. 233 00:29:27,720 --> 00:29:31,540 Chat to Rate is completely different. So we were collecting URLs and we discovered a lot of URLs on 234 00:29:31,560 --> 00:29:38,700 So in the end, once we got the JavaScript bundles, once we got the bots in fact with 235 00:29:38,700 --> 00:29:44,260 JavaScript, you can create a special payload. And of course, if you are connecting through 236 00:29:44,260 --> 00:29:49,240 a proxy server, probably you won't connect to your banking system or you are not going 237 00:29:49,240 --> 00:29:53,700 to connect to your social profile or you are not going to connect to your intranet or your 238 00:29:53,700 --> 00:30:00,500 personal website or whatever. But if you don't claim your cache, you are in fact, if someone 239 00:30:00,500 --> 00:30:09,980 forced you to load a JavaScript file which is in the webpage that you are going to visit after 240 00:30:10,440 --> 00:30:19,560 being used in the proxy server, then you will be hacked. So in this example, we got LinkedIn.com 241 00:30:19,560 --> 00:30:27,520 and as you can see, there are some scripts that are load in LinkedIn website. So if you are 242 00:30:27,520 --> 00:30:30,480 using the proxy server, then we can do this. So if you are using the proxy server, then we can 243 00:30:30,480 --> 00:30:36,680 create a special payload forcing you to load these JavaScript files. Then these JavaScript 244 00:30:36,680 --> 00:30:44,500 files will be in fact, once you disconnect and connect to LinkedIn, our payload will be 245 00:30:44,500 --> 00:30:50,840 executed. It's so simple. So we can create a special target attacks to several websites 246 00:30:51,480 --> 00:30:56,280 collecting passwords of people who were using a proxy server before on the Internet. It's 247 00:30:56,280 --> 00:31:00,080 quite simple. So you only need to select the target. 248 00:31:00,680 --> 00:31:09,100 Whatever, bank, social network, intranet, analyze the files that are going to be loaded by this 249 00:31:09,100 --> 00:31:16,880 website and forced to load this file when the guy, when the victim is connected to the proxy 250 00:31:16,880 --> 00:31:22,440 server. It's quite simple. So I wanted to do a demo in real, but I would like to show you the 251 00:31:22,440 --> 00:31:30,460 control panel, how it looks like. Because we, of course, we, we, we, we, we, we, we, we, we, we, we, 252 00:31:30,480 --> 00:31:37,380 we turn off proxy server in the Internet time ago, but for BlackHat and DefCon, I think I create 253 00:31:37,380 --> 00:31:43,840 a new control panel, but I didn't publish this proxy server on the Internet, but after 254 00:31:43,840 --> 00:31:49,140 delivering the talk in BlackHat, I don't know why, someone published on the Internet. 255 00:31:51,540 --> 00:31:57,280 So we configured this proxy only for ten parallel connections, only for ten 256 00:31:57,280 --> 00:32:00,400 parallel connections, and now, right now, this morning I'm going to 257 00:32:00,480 --> 00:32:11,520 show you the overview, the bots. We view zombies, old zombies, and as you can see, if we search 258 00:32:11,520 --> 00:32:21,880 for the date, 28, which is today, we started to receive a lot of bots from today, from 259 00:32:21,880 --> 00:32:31,700 different countries, a lot from the States, Brazil, whatever. And we got a lot of information 260 00:32:31,700 --> 00:32:37,780 right now, collect from them. We didn't want to do it. We didn't publish the IP address, 261 00:32:37,920 --> 00:32:47,580 believe me. But the demo that I would like to show you is more or less this. I wanted to do the 262 00:32:47,580 --> 00:32:51,480 demo with the IP address, the IP address, the IP address, the IP address, the IP address, the 263 00:32:51,480 --> 00:32:51,860 IP address, the IP address, the IP address, the IP address, the IP address, the IP address, the IP 264 00:32:51,880 --> 00:32:59,300 interested in this. Let me show the Web site, which is members. This is California 265 00:33:00,040 --> 00:33:05,740 creating a union link. As you can see, this Web site is perfect for a target attack because 266 00:33:05,740 --> 00:33:13,320 this one HTTP has an HTTP website in which there is an dachtein code to said mixture 267 00:33:13,320 --> 00:33:20,420 Thompson wh 보� to check his website. But we can inject a JavaScript file very easily 268 00:33:20,420 --> 00:33:27,580 in the HTTP website, hook the form and collect the username and password from this website. 269 00:33:27,880 --> 00:33:35,980 So the only thing that we need to do in our control panel is analyze the target and select 270 00:33:35,980 --> 00:33:49,560 one file. In this example, I select members, CCUL.org, scripts, JTAG.JavaScript, as you 271 00:33:49,560 --> 00:33:57,540 can see. And then in our control panel, create some special payload. So we go to the control 272 00:33:57,540 --> 00:34:05,700 panel. And you can see we got preset attacks in which you can configure what is interesting 273 00:34:06,360 --> 00:34:12,180 for you. And in the California credit union league, the only thing that we need to do 274 00:34:12,180 --> 00:34:18,680 is to force to download this file. So the guy who is using our proxy server that is 275 00:34:18,680 --> 00:34:19,540 watching POD. 276 00:34:19,540 --> 00:34:28,540 And he's in fact will be downloading this file to the cache. He will be watching POD, 277 00:34:28,780 --> 00:34:34,380 hacking website, whatever. But at the same time, he will be downloading this JavaScript 278 00:34:34,380 --> 00:34:42,820 file for the target attacks. So then when he was disconnect, when he was ‑‑ when 279 00:34:42,820 --> 00:34:48,500 he will be disconnect, in this case, select not to be connect anymore. 280 00:34:48,840 --> 00:34:49,520 Okay. 281 00:34:49,540 --> 00:34:57,820 So the JavaScript file which is in the cache will be in fact with our payload because we 282 00:34:57,820 --> 00:35:05,260 downloaded before and this file is not out of date. So the browser will be using. So 283 00:35:05,950 --> 00:35:15,340 in the end, after the guy connect to the website sending the information, that form will be 284 00:35:15,340 --> 00:35:19,520 hooked and we are going to be able to retrieve all the data. 285 00:35:19,520 --> 00:35:24,280 So we can run our control panel and send this data in our control panel. It's so simple, 286 00:35:24,420 --> 00:35:27,640 so easy to do, and very profitable. 287 00:35:29,040 --> 00:35:37,240 So some thoughts about our JavaScript botnets. In this example, we didn't worry at all about 288 00:35:37,240 --> 00:35:45,140 doing something special with the江 connection. We didn't worry about per cache object using 289 00:35:45,140 --> 00:35:49,500 the E tag or using special tricks. Hopefully, we don't need to go through that or use the 290 00:35:49,500 --> 00:35:56,740 force the inspiration of the object that are previously in the cache. And we didn't want 291 00:35:56,740 --> 00:36:03,020 it to use, to do something with the HTTPS connection because we didn't want it to rise 292 00:36:03,020 --> 00:36:09,580 any alerts. So we, and of course we didn't have any flame digital certificate and Moxie 293 00:36:09,580 --> 00:36:16,760 was very busy tweeting so we cannot contact within to create the special digital certificate. 294 00:36:16,760 --> 00:36:23,400 And the idea, the good point of it is that we did it only in one day. So in one day we 295 00:36:23,400 --> 00:36:29,340 were able to configure the proxy server, configure the Apache, publish the IP address, create 296 00:36:29,340 --> 00:36:36,060 the JavaScript and collect all this information. So if we were able to do this in only one 297 00:36:36,060 --> 00:36:45,100 day, the problem is how many of you think that governments, intelligence services, bad guys 298 00:36:45,680 --> 00:36:46,740 aren't able to do this? 299 00:36:46,760 --> 00:36:55,340 Aren't doing the same on the internet? The question is, how many of you think that only 300 00:36:55,340 --> 00:37:00,620 one of those proxy servers on the internet is secure? Only one. How many of you think 301 00:37:00,620 --> 00:37:10,180 that only one of those proxy servers is secure? No one? Secure. I don't think so. Secure. 302 00:37:10,300 --> 00:37:16,740 No. That is not going to infect you. Or collect your data. The one you run. It's not going 303 00:37:16,740 --> 00:37:21,100 to infect you. It's not an anonymous proxy server. It's yours. It's completely different. 304 00:37:21,640 --> 00:37:29,820 So in the end, using a proxy server on the internet is a very bad idea. But we got thousands 305 00:37:29,820 --> 00:37:34,920 and thousands and thousands of webpages on the internet saying people, if you want to 306 00:37:34,920 --> 00:37:40,420 be anonymous, use a proxy server on the internet. So we are going to have this problem a long 307 00:37:40,420 --> 00:37:44,440 time and a long time and a long time. So don't use it. 308 00:37:45,800 --> 00:37:50,740 So sound protection. Of course, this is a man in the middle schema. And it's a man in the middle 309 00:37:50,740 --> 00:37:58,000 schema in which you decide to be hacked because you configured your web browser to use that man 310 00:37:58,000 --> 00:38:04,240 in the middle. That proxy server. So you have to think twice if it's worth it to be using that 311 00:38:04,240 --> 00:38:10,600 proxy server. And of course, the problem is with Tor networks. But right now, we got more news 312 00:38:10,600 --> 00:38:14,420 about fake Tor networks. Tor nodes or rogue Tor networks. And so it's not a good idea to use 313 00:38:14,420 --> 00:38:19,780 or notes on the internet than fake or rogue proxy server on the internet. And I don't 314 00:38:19,780 --> 00:38:25,800 know why. And of course, after using this kind of services, if you need to do this for 315 00:38:25,800 --> 00:38:31,960 whatever reason you have, take care and clean all the information that you don't love from 316 00:38:31,960 --> 00:38:38,120 the internet. Take special care with that machine. If it's possible, use a new virtual 317 00:38:38,120 --> 00:38:43,980 machine and burn it out after using. Throw it to the trash, whatever you want. And of 318 00:38:43,980 --> 00:38:50,240 course, VPNs are not a silver bullet because in this case we were able to discover a lot of 319 00:38:50,240 --> 00:38:58,340 people connecting to a personal VPN to be outside of the network in which they were connecting. 320 00:38:58,580 --> 00:39:04,560 And then from the VPN connect to a proxy server and in the end it's possible to infect the 321 00:39:04,560 --> 00:39:11,540 client in any case. So take care of it. And that's all. Tomorrow I'm going to be delivering a 322 00:39:11,540 --> 00:39:13,520 new talk in Skype talks. 323 00:39:24,080 --> 00:39:25,080 Thank you very much.