00:00:00.000 --> 00:00:02.803 All right, guys, we'll get started. Welcome. Good 00:00:02.803 --> 00:00:05.772 afternoon, thanks for coming. Thanks to DEF CON for having me. 00:00:05.772 --> 00:00:11.912 My name is Jeremy Dorrough on two different variance of attack 00:00:11.912 --> 00:00:17.918 I made for the USB rubber ducky what we got here. Or is that 00:00:25.759 --> 00:00:32.099 just their screen? Are these screens screwed up, too, just 00:00:32.099 --> 00:00:40.073 that one? USB two different payloads for the USB rubber 00:00:40.073 --> 00:00:47.247 ducky that will decrypt theWi-Fi communications. Yeah, so, before 00:00:47.247 --> 00:00:52.085 we get started. Quick disclaimer. I'm here on my own 00:00:52.085 --> 00:00:58.091 behalf. It's my own opinions. Not my employer, no one else we 00:01:02.729 --> 00:01:08.735 get the legal jargon out of the way. Yeah. Okay. What are we 00:01:14.741 --> 00:01:20.747 doing here? Sorry. Alternates more than decade of experience 00:01:23.016 --> 00:01:29.022 in national security industry those ten years I've worked for 00:01:32.259 --> 00:01:38.265 a couple of different sectors. Started out with the Department 00:01:41.468 --> 00:01:49.109 of Defense, working for the Army at a datacenter hosting both 00:01:49.109 --> 00:01:53.046 class and unclass material. Left out of there to go to work in 00:01:53.046 --> 00:01:57.050 the energy sector, defending a nuclear power facility. Then 00:01:57.050 --> 00:02:00.587 currently I'm working in financial sector as network 00:02:00.587 --> 00:02:05.092 security engineer for Genworth financial. Just a side note, fun 00:02:05.092 --> 00:02:09.429 fact. As a hobby I enjoyed building, driving and detroying 00:02:09.429 --> 00:02:12.232 demolition derby cars, if there is any gear heads we'll talk 00:02:12.232 --> 00:02:17.137 cars. What we'll talk about. From a high level we're going to 00:02:17.137 --> 00:02:22.109 first talk about what is a USB rubber ducky those not familiar 00:02:22.109 --> 00:02:26.646 then talk about how the attack actually works. Then get into 00:02:26.646 --> 00:02:30.817 the details of each of the different payloads. First talk 00:02:30.817 --> 00:02:34.287 about the keyboard payload then we'll talk about the one 00:02:34.287 --> 00:02:37.958 involves both keyboard and USB mass storage. I'll demo the 00:02:37.958 --> 00:02:41.862 second variant of the attack, any time for questions, maybe 00:02:41.862 --> 00:02:43.864 we'll take some questions but it's probably going to take the 00:02:43.864 --> 00:02:47.834 full time. All right, so, again, those are not familiar with 00:02:47.834 --> 00:02:53.273 rubber ducky in simple description of what it is, think 00:02:53.273 --> 00:02:57.010 about if you were able to take a keyboard and apply some type of 00:02:57.010 --> 00:02:59.646 logic or some type of memory, what to send to a machine when 00:02:59.646 --> 00:03:05.585 you plug it in ultimately have the USB rubber ducky. They are 00:03:08.755 --> 00:03:14.027 sold by hack 5. Run by and support them. Really good group 00:03:14.027 --> 00:03:17.798 of guys. Like 40 bucks or a little better than 40 bucks, 00:03:17.798 --> 00:03:22.602 pretty cheap. Here is what the rubber ducky looks like. You'll 00:03:22.602 --> 00:03:29.609 notice that it is a very common form factor. Notice there on the 00:03:29.609 --> 00:03:34.581 far right for you guys, if you been to any of the trade shows 00:03:34.581 --> 00:03:38.151 like any of the I.T. security stuff, typically as vendors hand 00:03:38.151 --> 00:03:41.722 out swag a lot of times it wilt be actual form factor. If you go 00:03:41.722 --> 00:03:43.723 to some of those you look you probably have one that looks 00:03:43.723 --> 00:03:48.095 very similar to. That inside the enclosure you'll see it has 00:03:48.095 --> 00:03:51.631 micro SD card storage area. As well as a little micro 00:03:51.631 --> 00:03:55.035 processor, a little 32 bit chip. And again that's what kind of 00:03:55.035 --> 00:03:58.338 drives the memory part of the brain from that previous slide. 00:03:58.338 --> 00:04:05.645 And to kind of talk about the different ways that the ducky 00:04:05.645 --> 00:04:09.816 behaves it comes shipped -- the duck firmware which is that 00:04:09.816 --> 00:04:16.189 first bullet there. And again that is just keyboard input. But 00:04:16.189 --> 00:04:20.260 there's also the detour duck, but make note that have last 00:04:20.260 --> 00:04:25.198 variant of the firmware as well. That involves having both USB 00:04:25.198 --> 00:04:27.768 mass storage at your disposal when you plug the device in as 00:04:27.768 --> 00:04:31.772 well as programmable decord. Lot of powerful things can be done 00:04:31.772 --> 00:04:33.774 once you start adding mass storage, we'll see that in a 00:04:33.774 --> 00:04:38.845 demo later. For those that are like, thank you, he's trying to 00:04:38.845 --> 00:04:42.315 pedal their products. You don't have to go with the hack 5 00:04:42.315 --> 00:04:47.721 rubber ducky, there are other options out there. Sammy Cam car 00:04:47.721 --> 00:04:51.825 he's got presentation later today. I recommend you guys 00:04:51.825 --> 00:04:56.429 support him. Really smart guy. He developed the USB drive by he 00:04:56.429 --> 00:05:01.401 does the same kind of mentality with the device. So check his 00:05:01.401 --> 00:05:04.137 stuff out if you don't want to spring for the 40-some odd for 00:05:04.137 --> 00:05:11.511 the rubber ducky. As women as last year at Black Hat, Carson 00:05:11.511 --> 00:05:15.382 and Jacob did the bad USB, those that are familiar with that 00:05:15.382 --> 00:05:21.054 term. Then later at derby conadam called on Brandon Wilson 00:05:21.054 --> 00:05:27.894 released code to take off the shelf variant of a flash drive, 00:05:27.894 --> 00:05:30.797 flash their firmware to it and more or less it will run the 00:05:30.797 --> 00:05:34.601 same scripting language that the rubber ducky run. That is more 00:05:34.601 --> 00:05:39.773 or less free if you have those flash drive laying around. So, 00:05:39.773 --> 00:05:43.510 how does attack works? This slide just depicts the victim 00:05:43.510 --> 00:05:48.882 having a wireless connection to a little radio there you see the 00:05:48.882 --> 00:05:51.952 lock. Any SSL connection they have are working as they should. 00:05:51.952 --> 00:05:54.988 Everything is encrypted. Anything that this they are 00:05:54.988 --> 00:05:58.024 supposed to be encrypted is encrypted just standard 00:05:58.024 --> 00:06:01.761 connection before the attack. Then comes the rubber ducky, if 00:06:01.761 --> 00:06:05.966 the rubber ducky was USB flash drive was plugged in, first 00:06:05.966 --> 00:06:10.136 thing going to happen there's going to be a trust of 00:06:10.136 --> 00:06:13.506 certificate that's loaded on that victim's machine. After the 00:06:13.506 --> 00:06:20.013 trusted cert is loaded will move wireless connect over to a man 00:06:20.013 --> 00:06:23.216 in the middle machine which I will be running. If you kind of 00:06:23.216 --> 00:06:27.387 think about this in your head what just happened, not only are 00:06:27.387 --> 00:06:31.758 we now man in the middle, but since we provided that key 00:06:31.758 --> 00:06:35.929 there's nothing I cannot encrypt, right? It's kind of a 00:06:35.929 --> 00:06:41.768 bad situation for that victim. All right, so, first question I 00:06:41.768 --> 00:06:44.871 had when I bought it was, is this a novelty device? Yeah, 00:06:44.871 --> 00:06:47.907 it's great to roll your buddies with it, cool. Does this thing 00:06:47.907 --> 00:06:55.482 really have a place in the corporate environment for an 00:06:55.482 --> 00:07:01.855 actual pentest or is this a real useful tool for Black Hat for 00:07:01.855 --> 00:07:06.760 that matter. I was kind of astounded to see these numbers. 00:07:06.760 --> 00:07:10.063 You may have heard these before, but DHS obviously had the same 00:07:10.063 --> 00:07:13.400 thought they paid a third party to perform a study where they 00:07:13.400 --> 00:07:16.436 dropped flash drives around public areas, whether it be 00:07:16.436 --> 00:07:19.773 smoking areas, walkways, what have you. They found that an 00:07:19.773 --> 00:07:24.244 astounding 60% of people plugged them in once they picked them 00:07:24.244 --> 00:07:28.548 up. Well, that's scary enough. Then look at last bullet, if 00:07:28.548 --> 00:07:32.686 they add official logo that number jumped to 90%. The moral 00:07:32.686 --> 00:07:35.789 of the story is that you really don't need any clever social 00:07:35.789 --> 00:07:39.559 engineering for this attack to work. If someone really wanted 00:07:39.559 --> 00:07:43.396 to be bad and do this attack for $400 you got ten of them. 00:07:43.396 --> 00:07:46.933 Someone is going to plug it in your odds are pretty good. 00:07:46.933 --> 00:07:50.904 Speaking of official logo. If you recall the form factor of 00:07:50.904 --> 00:07:55.041 what the rubber ducky ships this is just a quick Google search of 00:07:55.041 --> 00:08:00.714 marketing USB drive, Ta-da the exact same form factor that the 00:08:00.714 --> 00:08:04.351 rubber ducky ships in for couple of bucks you can put whatever 00:08:04.351 --> 00:08:09.389 logo you want here because it's just a shield there that 00:08:09.389 --> 00:08:12.926 connects to it. You're up to your 90% mark according to the 00:08:12.926 --> 00:08:19.699 DHS study. Pretty useful stuff. I kind of want to talk about now 00:08:19.699 --> 00:08:23.136 why I actually made this payload. There's plenty much 00:08:23.136 --> 00:08:27.207 good ones already out there, rubber ducky is nothing new, 00:08:27.207 --> 00:08:31.911 product has been out there for awhile now. And Darren, the guy 00:08:31.911 --> 00:08:36.449 that runs hack 5 has his get hub is full of really good payloads 00:08:36.449 --> 00:08:39.986 that people have written. What I found is that most of those if 00:08:39.986 --> 00:08:44.057 not all of them would be stopped by the modern defenses that are 00:08:44.057 --> 00:08:46.659 deployed in most enterprise organizations. I'm not talking 00:08:46.659 --> 00:08:51.064 about your -- trying to attack random victim at Starbucks, I'm 00:08:51.064 --> 00:08:54.968 more focused on corporations and more secure area. The person 00:08:54.968 --> 00:08:59.672 I'll touch on is anti-virus. Lot of payloads that are out there 00:08:59.672 --> 00:09:04.711 will pull down tools of some type. Whether it be net cat or 00:09:04.711 --> 00:09:08.715 try to do some interpreter reverse shell, what have you. 00:09:08.715 --> 00:09:13.186 That's cool and all but if you pull those down on company asset 00:09:13.186 --> 00:09:15.188 your anti-virus is going to light up like a Christmas tree 00:09:15.188 --> 00:09:19.325 and stop in its tracks, it's too well-known at this point. The 00:09:19.325 --> 00:09:24.998 next bullet there, web filters and proxies. Some of the other 00:09:24.998 --> 00:09:28.334 attacks what they will do try to make you go out to some open 00:09:28.334 --> 00:09:32.806 storage place, Dropbox or box or something like that, well, most 00:09:32.806 --> 00:09:35.775 organizations, at least if they're more on the secure side 00:09:35.775 --> 00:09:38.778 of things are going to block those style of sites. Not let 00:09:38.778 --> 00:09:41.648 you go to any open storage pull down any random file you want. 00:09:41.648 --> 00:09:45.085 That's going to be stopped. Same kind of mentality below with the 00:09:45.085 --> 00:09:50.490 FTP wait list, trying to pull down through FTP, again, most 00:09:50.490 --> 00:09:54.093 companies if their level of any security knowledge at all 00:09:54.093 --> 00:09:56.362 they're not going to just allow to you FTP anywhere from any 00:09:56.362 --> 00:10:01.000 asset in the organization. Then the last bullet has nothing to 00:10:01.000 --> 00:10:04.404 do with corporate security, I'm sure most of you are familiar 00:10:04.404 --> 00:10:08.842 with HSTS those that are not. It's kind of tool that was 00:10:08.842 --> 00:10:13.313 designed just to stop this style of attack. So, the old school 00:10:13.313 --> 00:10:16.382 way of doing man in the middle attacks, once you got in the 00:10:16.382 --> 00:10:19.152 middle of the communication path, you would tell the victim 00:10:19.152 --> 00:10:23.389 just go ahead talk to me in clear text. Trust me. Talk clear 00:10:23.389 --> 00:10:26.126 text to me. Even though you want to talk encrypted so your 00:10:26.126 --> 00:10:29.462 banking site, I'll telling you to go ahead HTP so I can harvest 00:10:29.462 --> 00:10:32.465 the credentials. On the side talking to the real banking 00:10:32.465 --> 00:10:37.337 website you talk encrypted. It worked well for awhile until 00:10:37.337 --> 00:10:40.640 things like HSTS came along which is an actual browser-based 00:10:40.640 --> 00:10:45.445 security mechanism that says, if you're on this list of HSTS 00:10:45.445 --> 00:10:49.649 enabled sites no matter what the man in the middle machine tells 00:10:49.649 --> 00:10:54.354 you, you must always use encrypted traffic. That comes a 00:10:54.354 --> 00:10:59.492 problem because it thwarts the way old school way of attacking. 00:10:59.492 --> 00:11:02.228 Again, all your big sites are doing that, like a paid sites 00:11:02.228 --> 00:11:05.598 like you see, PayPal and your social media sites even DEF CON 00:11:05.598 --> 00:11:10.503 implemented this year, I guess DEF CON has some super speaker 00:11:10.503 --> 00:11:17.310 information in it. Let's talk attack. Enough pretalk. The 00:11:17.310 --> 00:11:20.647 first step is to actually set the man in the middle machine 00:11:20.647 --> 00:11:24.083 up. Because you have to have something for the victim to 00:11:24.083 --> 00:11:27.654 connect to. This is not the focus the attack I'm going to 00:11:27.654 --> 00:11:31.958 breeze through this stuff. Just to give you an idea of what I 00:11:31.958 --> 00:11:36.596 use when I set up the demo you're going to see in a minute. 00:11:36.596 --> 00:11:40.733 I use host APD. For wireless radio, I use DNS mask for the 00:11:40.733 --> 00:11:44.737 NDS server as well at DHPT server, I.P. tables to direct 00:11:44.737 --> 00:11:49.008 traffic over to a proxy, I mention the toolkit. Those guys 00:11:49.008 --> 00:11:52.712 actually have developed some really cool scripts that I use 00:11:52.712 --> 00:12:00.587 to kind of just adjust their stuff to work the way I wanted 00:12:00.587 --> 00:12:04.424 it. I mentioned proxies. The I.P. tables mover stuff over to 00:12:04.424 --> 00:12:06.993 proxy, you got to think about once you get the connections 00:12:06.993 --> 00:12:10.396 coming in to your man in the middle machine, and you've got 00:12:10.396 --> 00:12:12.632 the radio, it's listening, people connecting to you, you 00:12:12.632 --> 00:12:14.901 have to have some way to manipulate the traffic or view 00:12:14.901 --> 00:12:18.004 the traffic, what's the point of sending it through if you can't 00:12:18.004 --> 00:12:22.108 do anything with it. You have to set up some type of proxy, and 00:12:22.108 --> 00:12:25.678 my example I use burp suite doesn't mean you have to have 00:12:25.678 --> 00:12:29.983 burp suite it's easiest in my opinion. You can use SSL, quid, 00:12:29.983 --> 00:12:33.353 whatever. I do make note here that whatever proxy you want to 00:12:33.353 --> 00:12:35.822 use for this style of attack make sure you know how to pull 00:12:35.822 --> 00:12:39.859 the certificate out. Because we're going to have to convert 00:12:39.859 --> 00:12:42.862 that certificate to a base 64 encoding. I'll get into that in 00:12:42.862 --> 00:12:47.433 a little bit. For those not familiar with burp suite, I'm 00:12:47.433 --> 00:12:50.737 sure most of you have seen it, configuration I'm using today 00:12:50.737 --> 00:12:55.608 very, very simple, I got it listening on all interfaces, 00:12:55.608 --> 00:12:59.946 just pick the 880 port you'll see that invisible box as they 00:12:59.946 --> 00:13:04.150 call it is checked but, industry that's a transparent load proxy. 00:13:04.150 --> 00:13:07.987 I mentioned you have to export your certificate, well that's 00:13:07.987 --> 00:13:12.258 what the little button below that, you click there. Go 00:13:12.258 --> 00:13:16.129 through dialogue boxes to export the certificate. When do you 00:13:16.129 --> 00:13:19.999 that it's going to come out in a -- formatting, but at least I 00:13:19.999 --> 00:13:23.870 want to touch on this. The certificate if it's in Der 00:13:23.870 --> 00:13:27.874 formatting notice that top window there, that is text that 00:13:27.874 --> 00:13:31.210 I can't enter by keyboard, right? I want to make sure I 00:13:31.210 --> 00:13:34.947 convert that certificate to something that my ducky can type 00:13:34.947 --> 00:13:40.186 in easily. Using open SSL convert that Der formatting to 00:13:40.186 --> 00:13:44.524 the base 64 encoding and if it's done right you should look 00:13:44.524 --> 00:13:48.494 something like that bottom window. It's readable, all 00:13:48.494 --> 00:13:53.066 letters and numbers. Now we have the man in the middle machine 00:13:53.066 --> 00:13:56.102 set up let's talk about the payload itself that will be sent 00:13:56.102 --> 00:14:01.507 to the victim. What it's going to first bypass Windows UAC open 00:14:01.507 --> 00:14:05.178 command prompt window. If the user is logged in with admin 00:14:05.178 --> 00:14:09.015 credentials it's going to get admin credentials. If they are 00:14:09.015 --> 00:14:13.820 user, they get user credentials. The test that I'm going to do I 00:14:13.820 --> 00:14:17.457 have admin Creds I'll make note that this will work with user 00:14:17.457 --> 00:14:20.993 credentials. Without admin credits. Just going to have a 00:14:20.993 --> 00:14:25.965 few extra pop up boxes along the way. Second step it's going to 00:14:25.965 --> 00:14:31.571 do create that certificate from keyboard input the same thing we 00:14:31.571 --> 00:14:36.509 exported. Then it's going to add that certificate to the trusted 00:14:36.509 --> 00:14:42.715 route store using built in tool Cert Util. Then the profile then 00:14:42.715 --> 00:14:46.319 connect to that wireless profile then lastly it's going to clean 00:14:46.319 --> 00:14:48.654 up its tracks. Going to delete the files that it made in the 00:14:48.654 --> 00:14:53.760 process. So, before we actually look at the code I wanted to let 00:14:53.760 --> 00:14:56.662 everyone at least understand how simple this thing is to really 00:14:56.662 --> 00:15:00.366 write. DEF CON gave me a lot of credit by making me talk to you 00:15:00.366 --> 00:15:03.636 buys gut really it's pretty simple stuff. Again, very 00:15:03.636 --> 00:15:07.874 straight forward. Delay, delay in milliseconds. What you're 00:15:07.874 --> 00:15:13.246 actually typing to the machine, what you activate the payload 00:15:13.246 --> 00:15:15.681 then all your command keys like enter, Gui is the Windows 00:15:15.681 --> 00:15:22.522 command, remark, any question on that, get hub that Darren keeps 00:15:22.522 --> 00:15:26.359 up has pretty much all the documentation needed to any of 00:15:26.359 --> 00:15:30.463 the commands here that it supports. So here actually is 00:15:30.463 --> 00:15:33.232 the first step in the payload. Kind of broken it out here a 00:15:33.232 --> 00:15:36.869 little bit. You'll see how the code kind of works. Delays 00:15:36.869 --> 00:15:39.639 10 --> 000 that's 10 --> 000 milliseconds, that's ten 00:15:39.639 --> 00:15:43.309 seconds. The idea behind that when you plug the device into a 00:15:43.309 --> 00:15:45.378 machine the first time you're going to see Windows spinning 00:15:45.378 --> 00:15:48.881 there with the drivers, load drivers, load drivers, hopefully 00:15:48.881 --> 00:15:53.986 done in ten seconds. Then going to enter the issue of Gui R 00:15:53.986 --> 00:15:56.789 command those are not familiar with Gui railroad that will open 00:15:56.789 --> 00:15:59.592 run dialogue box going to delay 200 milliseconds to allow time 00:15:59.592 --> 00:16:02.862 for that box to top up and going to type a little Powershell 00:16:02.862 --> 00:16:06.632 command, start process command, all that does is open the dial 00:16:06.632 --> 00:16:10.970 up box, admin credentials if possible. A little side note 00:16:10.970 --> 00:16:15.675 here you'll see I put side note that Windows ten, as well as 8 00:16:15.675 --> 00:16:19.245 don't have to do that Powershell command, for those that got 00:16:19.245 --> 00:16:24.684 Windows 10 thing if you just do Gui X then type A. It opens up 00:16:24.684 --> 00:16:30.323 admin command prompt. A little side note. Next step we'll have 00:16:30.323 --> 00:16:33.593 to create that certificate on victim's machine with keyboard 00:16:33.593 --> 00:16:36.596 input. The way we're going to do that we're going to use a built 00:16:36.596 --> 00:16:39.665 in tool Windows called copycon is those are not familiar with 00:16:39.665 --> 00:16:44.503 copycon it's copycon, file name, anything below, you break out of 00:16:44.503 --> 00:16:50.943 it now you have a certificate. I had to put obligatory picture of 00:16:50.943 --> 00:16:56.449 the hacker in the presentation I noticed earlier on my slides 00:16:56.449 --> 00:16:59.418 this poor guy having hard time typing he's got like big thick 00:16:59.418 --> 00:17:05.558 winter gloves on. I don't know. That's Google search for hacker. 00:17:05.558 --> 00:17:08.794 We're going to use, in my opinion the climax of the 00:17:08.794 --> 00:17:12.398 attack, this is the part that it's doing bad things. Cert 00:17:12.398 --> 00:17:17.904 Util, enterprise, that's added to the machine root store adding 00:17:17.904 --> 00:17:19.906 that certificate we just created. This command succeeds, 00:17:19.906 --> 00:17:24.210 game over. Lastly we're going to create XML file those are not 00:17:24.210 --> 00:17:29.248 familiar, Windows handles wireless profiles just a little 00:17:29.248 --> 00:17:36.122 XML file, create that, then after we create it we then 00:17:36.122 --> 00:17:41.427 connect to it with net SH command. Again pretty straight 00:17:41.427 --> 00:17:44.997 forward stuff. Lastly just delete those XML file and 00:17:44.997 --> 00:17:50.836 certify that we created. All right. Here is what it looks 00:17:50.836 --> 00:17:57.610 like from the attacker's machine. This is again burp 00:17:57.610 --> 00:18:01.480 suite, we're looking at the proxy a view there I've 00:18:01.480 --> 00:18:05.451 highlighted there, people interested in post commands. 00:18:05.451 --> 00:18:08.454 I've kind of looked at post command to Wells Fargo. I'm not 00:18:08.454 --> 00:18:14.327 picking on Wells Fargo hopefully don't sue me. Any bank would 00:18:14.327 --> 00:18:18.397 work. You'll see at the bottom the details you've got user I.D. 00:18:18.397 --> 00:18:23.035 and password, clear text. That poor person's bank was just 00:18:23.035 --> 00:18:30.776 compromised. Alternatively this is what it looks like from the 00:18:30.776 --> 00:18:33.913 victim's point of view. There have been no pop-ups no 00:18:33.913 --> 00:18:36.549 warnings, no errors, no issues, no indications there was 00:18:36.549 --> 00:18:40.219 anything wrong, I've even opened up the certificate details to 00:18:40.219 --> 00:18:45.558 show that this -- probably can't read that it's issued by port 00:18:45.558 --> 00:18:48.427 swigger. Those are not familiar with port swigger company that 00:18:48.427 --> 00:18:51.831 writes burp suite they put their name in the certificate. Really 00:18:51.831 --> 00:18:59.205 bad day, Internet explorer, got the best of them. I'm sure some 00:18:59.205 --> 00:19:01.140 of you in the crowd are like, I don't ever use Internet 00:19:01.140 --> 00:19:05.311 exploder, I'm cool, I use chrome. There's no way you get 00:19:05.311 --> 00:19:11.717 me. Here's chrome. Same deal. Look at the credentials, look at 00:19:11.717 --> 00:19:16.122 the certificate details, you also see signed by port swigger, 00:19:16.122 --> 00:19:19.258 same story, no pop ups, no warnings, no errors, no issues, 00:19:19.258 --> 00:19:23.095 fully transparent to the user no way by at least certificate 00:19:23.095 --> 00:19:27.967 you'd ever know that somebody bad had happened. So again, they 00:19:27.967 --> 00:19:31.804 have no more money in their bank account. Firefox, though. How 00:19:31.804 --> 00:19:37.376 about Firefox. Yeah, yeah, clap. Bad day for me I'm glad y'all 00:19:37.376 --> 00:19:41.013 think it's funny. Firefox I'm sure inform you -- some of you 00:19:41.013 --> 00:19:44.717 know why this is the case. Firefox decided they're not 00:19:44.717 --> 00:19:50.723 going to trust Windows key store and trust store that they're 00:19:53.192 --> 00:19:56.696 going to implement their own key store and trust store. Those 00:19:56.696 --> 00:19:59.865 commands that I issued earlier with the Cert Util that's all 00:19:59.865 --> 00:20:01.967 for the Windows certificates. NSS labs has the tool you can 00:20:01.967 --> 00:20:09.575 download to actually manipulate Firefox Certs they have their 00:20:09.575 --> 00:20:15.581 own store. It's not installed on typical distribution, there for 00:20:15.581 --> 00:20:20.720 be very hard to use on victim's machine. I kind of banged my 00:20:20.720 --> 00:20:24.390 head against the wall for awhile. My face looked like that 00:20:24.390 --> 00:20:27.159 for quite a bit trying to figure out how in the world to get this 00:20:27.159 --> 00:20:31.697 to work. I just couldn't come up with anything clever. That 00:20:31.697 --> 00:20:35.835 brings me up to the next variant of the attack. The twin duck 00:20:35.835 --> 00:20:39.538 that I referred to earlier. So, twin duck firmware again just to 00:20:39.538 --> 00:20:44.343 recap, it mounts both a USB mass storage device as well as that 00:20:44.343 --> 00:20:47.146 same programmable keyboard mentality we just had before. 00:20:47.146 --> 00:20:53.119 So, to use the twin buck firmware, obviously have to 00:20:53.119 --> 00:20:56.055 reflash the device, not a big deal. Instructions are out there 00:20:56.055 --> 00:20:59.925 how to do that, very straight forward. And I will make one 00:20:59.925 --> 00:21:02.595 little side note if you're planning on making some attacks 00:21:02.595 --> 00:21:05.664 using the twin duck firmware it's not really designed for 00:21:05.664 --> 00:21:09.401 really fast IO, don't be trying to load some massive application 00:21:09.401 --> 00:21:14.206 up on your micro SD card and pull from it through command, 00:21:14.206 --> 00:21:16.509 it's probably going to behave a little differently what you 00:21:16.509 --> 00:21:20.679 expected. That's a cool quick side note there. Let's start 00:21:20.679 --> 00:21:25.985 this attack, what is different this time we have to set it up. 00:21:25.985 --> 00:21:30.890 First up, the steps are to create a new Firefox key store 00:21:30.890 --> 00:21:34.059 trust store. The easiest way to do that go ahead infect your own 00:21:34.059 --> 00:21:39.598 browser. So, go ahead open your own Firefox up and take that 00:21:39.598 --> 00:21:42.568 certificate that you just exported from your proxy, load 00:21:42.568 --> 00:21:45.604 it into your own browser. I've kind of listed here how to do 00:21:45.604 --> 00:21:47.606 that I'm sure you all know. Go ahead and click trust the 00:21:47.606 --> 00:21:49.909 certificate identity and website, yes, that way port 00:21:49.909 --> 00:21:56.215 swigger can sign anything through Firefox, okay. After do 00:21:56.215 --> 00:21:59.051 you that then you're going to pull your key store and trust 00:21:59.051 --> 00:22:03.189 store and copy it over to your micro SD card, it's located in 00:22:03.189 --> 00:22:07.193 the path there listed on the screen. That variable works for 00:22:07.193 --> 00:22:12.064 pretty much any basic install you see it uses variables. As 00:22:12.064 --> 00:22:16.535 well as wild card.default going to give it some crazy number 00:22:16.535 --> 00:22:21.373 stream.default that path right there if you just enter that 00:22:21.373 --> 00:22:24.510 into your machine it would go to your Firefox profile. Going to 00:22:24.510 --> 00:22:28.814 get those two files there listed in the bottom. Get the Cert ADD 00:22:28.814 --> 00:22:33.018 your key store and trust store for Firefox profile. So, again 00:22:33.018 --> 00:22:38.257 from, high level how this attack is going to work now done the 00:22:38.257 --> 00:22:42.027 prework set it all up. Same as before going to open a command 00:22:42.027 --> 00:22:44.930 prompt with admin CDs if it can get them. Then this time a 00:22:44.930 --> 00:22:48.067 little bit different going to create a script to identify 00:22:48.067 --> 00:22:51.237 where that mass storage was mapped. Again, got to think 00:22:51.237 --> 00:22:55.307 about this going to it blind we don't know what is on the 00:22:55.307 --> 00:22:58.677 machine once it's plugged in it could be mapped to E drive, F 00:22:58.677 --> 00:23:02.815 drive, who knows. A little script trying to find where the 00:23:02.815 --> 00:23:05.985 ducky mass storage is located. Then it will create another 00:23:05.985 --> 00:23:10.656 script, BSD script that will run batch file invisibly. Just run 00:23:10.656 --> 00:23:15.294 can in the background. And the idea behind that it's quicker to 00:23:15.294 --> 00:23:17.663 write a script on the screen because it's all done with 00:23:17.663 --> 00:23:21.100 keyboard input than it is to run -- write the whole batch file 00:23:21.100 --> 00:23:25.838 out. Just gives you a little less time to scroll across the 00:23:25.838 --> 00:23:30.009 screen. But what that batch file is going to do is going to first 00:23:30.009 --> 00:23:34.246 add just like before, going to add the Windows, trusted root 00:23:34.246 --> 00:23:40.219 certificate, it's then over write user's Firefox Cert and 00:23:40.219 --> 00:23:43.889 key store then create new wireless profile, connect to it, 00:23:43.889 --> 00:23:49.828 clean up. Here is what that batch file looks like. Just for 00:23:49.828 --> 00:23:55.100 those that are looking for the code part of the talk. You'll 00:23:55.100 --> 00:23:57.169 see here we obviously killed Firefox don't want to do 00:23:57.169 --> 00:24:01.340 anything while it's running. Same commands added to the 00:24:01.340 --> 00:24:05.477 Windows enterprise store of the machine store. Then you'll see 00:24:05.477 --> 00:24:11.517 over writes the Firefox profiles. A quick view, sheer 00:24:11.517 --> 00:24:16.655 what the micro SD card looks like on my device, I'm getting 00:24:16.655 --> 00:24:21.593 ready. You'll see the XML file, the wireless profile, you'll see 00:24:21.593 --> 00:24:26.298 the Cert file which we load the Windows, you'll see the Cert and 00:24:26.298 --> 00:24:30.169 key files for Firefox as well as batch file we just looked at. So 00:24:30.169 --> 00:24:33.405 there's the files that are needed to run in the twin duck 00:24:33.405 --> 00:24:38.210 mode. So, again, we'll go back to looking what it looks like 00:24:38.210 --> 00:24:41.146 from the user's point ever view or victim's point much view. 00:24:41.146 --> 00:24:47.553 Internet exploder, yeah, got 'em. Chrome, same story, no more 00:24:47.553 --> 00:24:52.324 money in their bank account. Firefox, yeah, Firefox. Sneaky 00:24:52.324 --> 00:24:57.262 bastards, got you. You'll see also been signed by port 00:24:57.262 --> 00:25:02.768 swigger, we got 'em. Again, because we loaded those trusted 00:25:02.768 --> 00:25:06.238 certificates into their own key store and trust store, this 00:25:06.238 --> 00:25:11.043 point I'm more or less consider the attack successful. We've got 00:25:11.043 --> 00:25:17.983 all three modern browsers and, yeah, they have all been -- with 00:25:17.983 --> 00:25:23.989 that being said. Thank you. [Applause] We'll dive into the 00:25:27.092 --> 00:25:29.928 demonstration now and I kind of want to set this up it makes 00:25:29.928 --> 00:25:34.133 somewhat of sense, I obviously don't have environment here to 00:25:34.133 --> 00:25:37.403 have someone over there getting attacked and want to show you 00:25:37.403 --> 00:25:41.940 guys. What is going to happen is hopefully, please no one in the 00:25:41.940 --> 00:25:47.179 crowd be that guy that tries to mess up my SSID, please. If you 00:25:47.179 --> 00:25:50.749 do, whatever, I've got a video. But I'd rather do it live. 00:25:50.749 --> 00:25:54.219 Please don't screw with it. There's going to be -- Windows 00:25:54.219 --> 00:25:58.557 machine which I'm presenting from that's going to be the 00:25:58.557 --> 00:26:02.094 victim. You'll see, Windows machines where I'll actually 00:26:02.094 --> 00:26:05.697 apply the rubber ducky payload. But there's going to be a Linux 00:26:05.697 --> 00:26:11.203 box to represent which is which, a Dabian background I have bunch 00:26:11.203 --> 00:26:15.174 of like USB connections up here I can't really show you. I have 00:26:15.174 --> 00:26:19.244 USB connection to hard wired out to the Internet as well as a 00:26:19.244 --> 00:26:23.649 wireless radio that is going to be hosting the SSID. From the 00:26:23.649 --> 00:26:27.953 VM. And when the payload is deployed hopefully the built in 00:26:27.953 --> 00:26:31.023 wireless on the Windows machine will connect to that wireless 00:26:31.023 --> 00:26:34.560 radio. It's all kind of in one but should depict what the 00:26:34.560 --> 00:26:39.431 attack would look like. Let's do that now without further adue. 00:26:43.969 --> 00:26:46.905 That's what the Windows machine is going to look like. I'm going 00:26:46.905 --> 00:26:52.911 to change it to clone the machine again. Should be able to 00:26:55.147 --> 00:27:01.253 see my desktop now. All right, so, here is going to be the 00:27:01.253 --> 00:27:07.259 victim. Let's go ahead pull up super secret password. Before I 00:27:14.299 --> 00:27:17.336 actually get started, my resolution is all whacked out 00:27:17.336 --> 00:27:22.608 now. This is the script that I was talking about, the toolkit 00:27:22.608 --> 00:27:29.014 script that I kind of modified. Again, for anyone that wants to 00:27:29.014 --> 00:27:35.020 take note using host APD again, using DNS mass and I.P. tables 00:27:37.256 --> 00:27:40.526 to redirect traffic. Let's actually do that. Actually 00:27:40.526 --> 00:27:44.830 before I kick it off, let me show you again, here is the -- 00:27:44.830 --> 00:27:48.467 I've got burp suite up and running it's just listening on 00:27:48.467 --> 00:27:53.739 any interface on port 8080 in transparent mode that's where 00:27:53.739 --> 00:27:58.277 again you go to export those certificates. Let's go ahead run 00:27:58.277 --> 00:28:04.216 that script. Hit enter to kill me that's a little brutal. Okay. 00:28:16.528 --> 00:28:22.534 At this point what I should see if I were to look. There's SSID 00:28:26.004 --> 00:28:30.909 being broadcast. It's actually trying to connect. I'm 00:28:30.909 --> 00:28:35.213 disconnect from it once to prove that this does work. Now again 00:28:35.213 --> 00:28:41.219 what I'm going to do I'm going to restart the payload. This 00:28:45.591 --> 00:28:49.828 would be indicative of me plugging in, I'm dumb user that 00:28:49.828 --> 00:28:52.497 picked it up and I decided I found a nice flash drive let me 00:28:52.497 --> 00:28:56.335 see what I can do with it. Ten seconds. This is where drivers 00:28:56.335 --> 00:28:58.337 will be loading but I already had the drivers on the machine. 00:29:05.644 --> 00:29:11.650 And payload has now started. And it's now done. That's how long 00:29:15.454 --> 00:29:21.460 it takes to do its magic. [Applause] It's connectings like 00:29:27.132 --> 00:29:31.470 it's supposed to be doing. Takes a little bit. You guys are being 00:29:31.470 --> 00:29:36.241 nice to me not kicking me off there. Appreciate that. Now 00:29:36.241 --> 00:29:40.612 we're going to -- you guys already probably know damage 00:29:40.612 --> 00:29:43.782 that can be done now that I've got this connection in this 00:29:43.782 --> 00:29:49.454 shape. But just for grins, we're going to a Facebook account 00:29:49.454 --> 00:29:54.893 created just for this presentation here please don't 00:29:54.893 --> 00:29:58.830 -- my Facebook account. Then we'll also go again, poor Wells 00:29:58.830 --> 00:30:05.771 Fargo, I could use another bank, they're not my bank that's why I 00:30:05.771 --> 00:30:11.777 chose them. All right. Let's go for DEF CON user. Some super 00:30:16.915 --> 00:30:22.921 secret password. Let's log in. Hope to God this is no one's 00:30:25.223 --> 00:30:30.028 password that would be awful. Obviously, didn't work. Okay, 00:30:30.028 --> 00:30:36.501 perfect. Just demonstrate, here we go. We got some data. The 00:30:36.501 --> 00:30:42.507 attack is working as we expect. Let's first look at Wells Fargo. 00:30:47.813 --> 00:30:50.849 You'll see like I had in the slides there's the 00:30:50.849 --> 00:30:55.320 authentication packet you'll see the post, the off log on. Just 00:30:55.320 --> 00:31:00.192 go here to parameters, I scroll a little bit. You guys hope you 00:31:00.192 --> 00:31:06.064 can see that -- DEF CON user, password DEFCON3d. Let's 00:31:06.064 --> 00:31:12.070 transfer all the money out of that account. Got 'em. 00:31:19.277 --> 00:31:24.382 [Applause] Scratch your head, dude, you forgot to put a 00:31:24.382 --> 00:31:30.021 password in Facebook. Good luck getting that password now. You 00:31:30.021 --> 00:31:32.891 messed the presentation up it was in one of those leave me 00:31:32.891 --> 00:31:37.929 always logged in which we know what that means use 00:31:37.929 --> 00:31:40.799 authentication cookies. That actually may be even worse 00:31:40.799 --> 00:31:44.569 because any of the Facebooks, anyone who is Facebook how they 00:31:44.569 --> 00:31:50.842 do their authentication cookies, drag it up to see it better. 00:31:50.842 --> 00:31:56.214 Every packet that you ever send to Facebook you'll see this DATR 00:31:56.214 --> 00:31:58.717 cookie that's authentication cookie. Every time you do 00:31:58.717 --> 00:32:02.921 anything in Facebook it sends it over and over so I can click on 00:32:02.921 --> 00:32:06.424 pretty much any of those posts you'll see, there it is again. 00:32:06.424 --> 00:32:10.595 And there it is again. What we'll do we'll go ahead say, let 00:32:10.595 --> 00:32:14.566 me just have those cookies for a minute. Then I'll go over here 00:32:14.566 --> 00:32:19.404 to this account, just prove there's no shenanigans going on 00:32:19.404 --> 00:32:22.441 I'm not logged in, I just refreshed, no one logged in 00:32:22.441 --> 00:32:25.343 here, with the help of a little tool foes that are familiar with 00:32:25.343 --> 00:32:29.548 grease monkey is crypting tool, I got the cookie inject for 00:32:29.548 --> 00:32:34.786 script loaded if I go in here to -- let's take those cookies I 00:32:34.786 --> 00:32:40.792 just stole and paste them in. Thank you, all right. Now we 00:32:44.629 --> 00:32:50.635 have hijacked the session. Gotcha. [Applause] Thank you. 00:32:54.606 --> 00:32:58.844 Again, the point being there not that Facebook is your end goal 00:32:58.844 --> 00:33:02.581 but so many sites that are using authentication cookies I think 00:33:02.581 --> 00:33:06.218 Facebook drives the point home anyone that use the cookies or 00:33:06.218 --> 00:33:09.087 passwords doesn't matter once you're encrypted in traffic the 00:33:09.087 --> 00:33:15.093 data is yours. Let's go back to presentation. Wait for it. Got 00:33:28.373 --> 00:33:33.578 it. So now since like I told you guys at the beginning I'm not a 00:33:33.578 --> 00:33:37.516 pentester I'm not a security researcher, I am a security 00:33:37.516 --> 00:33:40.819 engineer. So I am paid to defend against these attacks not create 00:33:40.819 --> 00:33:44.022 them. It's only fair that in a responsible thing that I talk 00:33:44.022 --> 00:33:49.361 about how to stop this kind of attack. First bullet is wireless 00:33:49.361 --> 00:33:56.234 intrution prevention system, Wips, they're very powerful. But 00:33:56.234 --> 00:33:58.470 this style attack would not work because as soon as I spin up 00:33:58.470 --> 00:34:04.676 that rogue AP start flooding me with packets just wouldn't work. 00:34:04.676 --> 00:34:08.013 If your organization employs a Wips environment you have to 00:34:08.013 --> 00:34:10.682 find some other mechanism to get into traffic to you other than 00:34:10.682 --> 00:34:16.621 through wireless. WIPS disable mass storage. This is more 00:34:16.621 --> 00:34:22.894 common there's lots of style of attacks, not to mention DLP, 00:34:22.894 --> 00:34:24.896 saying mass storage, that's also kind of a bummer if you're 00:34:24.896 --> 00:34:30.602 trying to do that second variant because you don't have mass 00:34:30.602 --> 00:34:33.872 storage available, you can't get all through browsers the way I 00:34:33.872 --> 00:34:38.576 did the payload. If you take that mentality step further a 00:34:38.576 --> 00:34:41.479 little more extreme, some companies even disabled USB 00:34:41.479 --> 00:34:45.350 ports entirely that would certainly limit the attack 00:34:45.350 --> 00:34:49.788 because none of the style of attacks would work if you won't 00:34:49.788 --> 00:34:53.525 turn on. Then this slide, this bullet, frankly that bullet 00:34:53.525 --> 00:34:58.029 could be in any DEF CON talk given this weekend in user 00:34:58.029 --> 00:35:00.565 training can always be encouraged to be more 00:35:00.565 --> 00:35:04.269 responsible with X. Just today it's USB usage because that's 00:35:04.269 --> 00:35:07.372 what I'm talking about. Yeah, you can always use more user 00:35:07.372 --> 00:35:12.477 training. To encourage responsible use of technology. 00:35:12.477 --> 00:35:18.750 Multi-factor authentication. If I was able to pull this attack 00:35:18.750 --> 00:35:22.887 off on you and you are using one-time use password or some 00:35:22.887 --> 00:35:26.758 token-based password it's going to be very difficult for me to 00:35:26.758 --> 00:35:31.997 reuse that credential. So, that's another check in a box 00:35:31.997 --> 00:35:35.734 for why you should use multi-factor authentication. 00:35:35.734 --> 00:35:39.504 Last one here may not be quite obvious but those familiar with 00:35:39.504 --> 00:35:42.374 cloud proxy agents, a lot of organizations are now starting 00:35:42.374 --> 00:35:45.877 to deploy them. On all the corporate assets, what that does 00:35:45.877 --> 00:35:49.247 it requires the company asset to talk directly out to a cloud 00:35:49.247 --> 00:35:53.585 resource for their proxy exceptions. And typically 00:35:53.585 --> 00:35:57.022 happens to both mechanism built in if I got that communication 00:35:57.022 --> 00:36:01.860 probably just break. It just wouldn't allow you to go 00:36:01.860 --> 00:36:06.765 anywhere I wouldn't be able to encrypt anything because it 00:36:06.765 --> 00:36:10.702 would have broken your connection. Couple of other 00:36:10.702 --> 00:36:15.473 things here, to consider. I use wireless as mechanism of getting 00:36:15.473 --> 00:36:18.710 the data to me. But that certainly doesn't have to be 00:36:18.710 --> 00:36:23.181 what you use. You can set up proxy that listens out in the 00:36:23.181 --> 00:36:25.950 cloud, right, instead of changing wireless settings you 00:36:25.950 --> 00:36:29.688 could go in let's monkey with some of the proxy settings to 00:36:29.688 --> 00:36:32.690 have it no matter if it's hard wired, wireless, whatever, you 00:36:32.690 --> 00:36:36.461 always connect out to say AWS proxy listener you can have the 00:36:36.461 --> 00:36:40.698 same kind of attack take place. And benefits there is, one, 00:36:40.698 --> 00:36:43.101 again, hard wire or wireless, but you also don't have to be in 00:36:43.101 --> 00:36:48.039 physical proximity. So you could deploy this thing no matter 00:36:48.039 --> 00:36:50.041 where they went it would be taken out to like a cloud 00:36:50.041 --> 00:36:54.446 listener. You could also increase the authenticity. What 00:36:54.446 --> 00:36:58.116 I mean by that is, again, I made this as just a proof of concept, 00:36:58.116 --> 00:37:03.655 the files are labeled what they are, you could certainly label 00:37:03.655 --> 00:37:07.759 them more suspicious things that people would be trying to click 00:37:07.759 --> 00:37:09.961 in, like if I was trying to make it more authentic probably put 00:37:09.961 --> 00:37:14.365 in file that says like salaries or something. And I'd corrupt it 00:37:14.365 --> 00:37:17.035 so they keep trying to open it, just buy me more time of that 00:37:17.035 --> 00:37:21.106 screen before they thought something was fishy, as well as 00:37:21.106 --> 00:37:23.575 talked about putting label on the device, company X put that 00:37:23.575 --> 00:37:29.581 label on it. Another note here that the syntax will need to be 00:37:32.016 --> 00:37:36.421 adjusted slightly for whatever your victim base will be. And 00:37:36.421 --> 00:37:39.958 the reason I say that certain OSs will have different dialogue 00:37:39.958 --> 00:37:42.460 boxes pop up at different times with warnings, pop up at 00:37:42.460 --> 00:37:46.765 different times as well as timers. If your timers are on 00:37:46.765 --> 00:37:49.200 like -- try to get very aggressive on your timers, you 00:37:49.200 --> 00:37:54.105 put into really slow old machine timers may not work out right it 00:37:54.105 --> 00:37:59.611 will break the whole attack. Go to the play with the timer, play 00:37:59.611 --> 00:38:03.314 with the syntax, the attack should work pretty much 00:38:03.314 --> 00:38:07.719 regardless of any version of Windows. Just a quick little 00:38:07.719 --> 00:38:11.356 shout out for the guys at hack 5. They have a form out there 00:38:11.356 --> 00:38:15.693 for people to share, collaborate, new payloads, 00:38:15.693 --> 00:38:18.963 pretty active community. If you're thinking about doing this 00:38:18.963 --> 00:38:22.267 style of attack or you're looking at new ways to get into 00:38:22.267 --> 00:38:25.236 this kind of thing I recommend you check them out. That's where 00:38:25.236 --> 00:38:28.006 I got a lot of the ideas, some of the code that I use for my 00:38:28.006 --> 00:38:34.379 attack. With that, I'll finish here with please, any questions 00:38:34.379 --> 00:38:38.116 you have, e-mail me. I'm not going to try to do the question 00:38:38.116 --> 00:38:42.086 thing in this forum, too many people. Find me out in the 00:38:42.086 --> 00:38:47.125 public areas and with, that thank you guys all for your 00:38:47.125 --> 00:38:50.328 attention, I appreciate it. [ Applause ]