00:00:00.000 --> 00:00:03.604 I'm excited about this. Yes, we're starting a little early, 00:00:03.604 --> 00:00:06.740 but you guys were at the program. We will cover a lot in 00:00:06.740 --> 00:00:10.077 a short amount of time. Real quick anecdote. I'm a big fan of 00:00:10.077 --> 00:00:16.316 social engineering tool kit and all the stuff you guys do. When 00:00:16.316 --> 00:00:19.119 I'm back home I do security awareness talks for other 00:00:19.119 --> 00:00:24.625 attorneys, and this spring I did a live demo of the social 00:00:24.625 --> 00:00:27.527 engineer tool kit. Who is in the audience? The chief justice of 00:00:27.527 --> 00:00:31.665 the Missouri Supreme Court. So you're terrifying a lot of 00:00:31.665 --> 00:00:34.101 powerful people for a long time, so I'm excited to see some new 00:00:34.101 --> 00:00:46.480 stuff. Let's give him a big hand. >> It's Sunday and you all 00:00:46.480 --> 00:00:52.786 are still here. A round of applause for you. I've 00:00:52.786 --> 00:00:56.256 experiencing delayed reactions and headaches. So we have 00:00:56.256 --> 00:01:00.360 shrieking and loud noises throughout the presentation to 00:01:00.360 --> 00:01:05.198 keep it fresh content-wise. I'm Dave Kennedy, and I started my 00:01:05.198 --> 00:01:12.973 companies, and it's funny I just saw somebody here I used to work 00:01:12.973 --> 00:01:15.876 with in the military. It's funny how you kind of see all the 00:01:15.876 --> 00:01:19.379 people that you kind of go through this industry with as 00:01:19.379 --> 00:01:23.250 well as a whole bunch of new people coming into the industry. 00:01:23.250 --> 00:01:26.119 I got a hug yesterday -- I'm a big hugger guy. I got a hug from 00:01:26.119 --> 00:01:29.089 somebody into the industry saying I'm so passionate and am 00:01:29.089 --> 00:01:35.395 learning from all of this. When I was coming into DEF CON, I 00:01:35.395 --> 00:01:39.533 think DEF CON 8 or 9 was my first. I learned from other 00:01:39.533 --> 00:01:42.836 people, because everybody is so damn smart in the industry and 00:01:42.836 --> 00:01:47.874 no one inning everything else that the other person knows. 00:01:47.874 --> 00:01:49.276 It's about that and that community. DEF CON is a great 00:01:49.276 --> 00:01:51.478 place for that. I give a round of applause for everyone that 00:01:51.478 --> 00:01:55.515 makes it possible. The goons that clear up all the traffic 00:01:55.515 --> 00:01:58.585 flow after the first day giving their nights over and over 00:01:58.585 --> 00:02:03.623 again. Let's give a round of applause for everybody at DEF 00:02:03.623 --> 00:02:12.633 CON. ( Applause ) So I authored the social engineered tool kit 00:02:12.633 --> 00:02:16.470 and other tools. I'm going to show one today which I had a new 00:02:16.470 --> 00:02:20.440 modular for Pivoter that Geoff wrote we will release today. 00:02:20.440 --> 00:02:26.880 This is Geoff's first time presenting at DEF CON. Can we 00:02:26.880 --> 00:02:28.582 give him a round of applause for getting up here and having 00:02:28.582 --> 00:02:38.692 balls? ( Cheers and applause ) >> As Dave already introduced 00:02:38.692 --> 00:02:42.929 me, I'm Geoff Walton. I'll a senior security consultant. What 00:02:42.929 --> 00:02:46.566 I do on the side when I have time is to write tools and 00:02:46.566 --> 00:02:49.836 create some things. I've authored a tool called Chips 00:02:49.836 --> 00:02:53.540 that is pretty popular and recently I wrote a tool called 00:02:53.540 --> 00:03:01.848 Pivoter, so that's kind of who I am. So Dave is going to talk 00:03:01.848 --> 00:03:04.885 more about the history of pin testing and stuff like that and 00:03:04.885 --> 00:03:09.056 what we do. >> So really quick we come up with acronyms for 00:03:09.056 --> 00:03:13.827 tools, CHIPS was going to be chips because one guy ate seven 00:03:13.827 --> 00:03:16.930 bags of chips in one sitting. We were going to name it after the 00:03:16.930 --> 00:03:21.768 tool, but we didn't have a acronyms. We changed it to 00:03:21.768 --> 00:03:28.542 S.H.I.P.S. Pivoter sounded cool. What was your original name for 00:03:28.542 --> 00:03:34.314 it? Proxy something or other? >> This is -- the mic is not hot. 00:03:34.314 --> 00:03:37.284 This is kind of funny. Dave seems to have a habit. I come up 00:03:37.284 --> 00:03:40.587 with very boring, restrictive names for my tools that say what 00:03:40.587 --> 00:03:43.990 they do. I called this proxy kit, and like every other thing 00:03:43.990 --> 00:03:47.828 I write, Dave immediately renamed it, which is awesome. 00:03:47.828 --> 00:03:51.031 Dave's names are alley better. >> Sweet. All right. We'll get 00:03:51.031 --> 00:04:00.340 into the talk here. A little bit about the history of how 00:04:00.340 --> 00:04:01.708 attackers kind of move and kind of our challenges as pin testers 00:04:01.708 --> 00:04:09.316 in the past. If you look at pin testing in general, we go after 00:04:09.316 --> 00:04:11.585 an infrastructure and try to find an exposure, whether it's 00:04:11.585 --> 00:04:14.688 social engineering or going after a specific attack in a 00:04:14.688 --> 00:04:20.627 web, and we find a flaw and compromise that and get access 00:04:20.627 --> 00:04:25.465 to one system, right? We get access to one system, if we have 00:04:25.465 --> 00:04:28.268 elevated rights, we have the ability to move into other 00:04:28.268 --> 00:04:29.970 systems, right? From there we go after other things and get more 00:04:29.970 --> 00:04:35.275 information. It's like a puzzle. We put it together until we get 00:04:35.275 --> 00:04:38.578 access to stuff we want access to. If you look at that, the 00:04:38.578 --> 00:04:43.083 whole lateral movement thing is a big talk right now. It's been 00:04:43.083 --> 00:04:46.720 difficult for us in the industry until you use pro versions, they 00:04:46.720 --> 00:04:51.825 have a VPN functionality that works and tunnel and pivot 00:04:51.825 --> 00:04:55.295 through a session. Cobalt strikers has the ability to if 00:04:55.295 --> 00:05:00.233 you have administrative overwrites, right? They're 00:05:00.233 --> 00:05:05.605 concepts we use every single day to go after specific targets and 00:05:05.605 --> 00:05:09.810 from there move across the network. To talk about that, you 00:05:09.810 --> 00:05:12.312 look at lateral movement, you compromise one system, right? 00:05:12.312 --> 00:05:15.549 It's random Chuck Norris things through the presentation. If you 00:05:15.549 --> 00:05:20.620 look at lateral movement in the organization, it's about 00:05:20.620 --> 00:05:22.389 compromising a system. Getting information whether it's 00:05:22.389 --> 00:05:27.727 credentials and spring across a network and going to other 00:05:27.727 --> 00:05:32.165 systems to get access to them. We look at it and say, well, 00:05:32.165 --> 00:05:35.302 it's difficult in a lot of cases to he escalate permissions 00:05:35.302 --> 00:05:39.940 sometimes. Let's say you have an organization that doesn't run 00:05:39.940 --> 00:05:43.376 administrative rights or compromise a network service 00:05:43.376 --> 00:05:45.512 account, something you had the ability to target and have 00:05:45.512 --> 00:05:49.015 access to a system but maybe there's not information in the 00:05:49.015 --> 00:05:51.384 system to get you to another one to move laterally in the 00:05:51.384 --> 00:05:54.688 environment. That's been or experience that you target an 00:05:54.688 --> 00:05:59.292 individual and organization that has limited permissions to 00:05:59.292 --> 00:06:04.297 actually go about that. So, you know, we look at that. We look 00:06:04.297 --> 00:06:11.805 -- what we do at PIN testers, it's about thinking outside the 00:06:11.805 --> 00:06:16.476 box. We have to navigate security restrictions to stop us 00:06:16.476 --> 00:06:18.612 from attacking different things. In most cases we do. We get 00:06:18.612 --> 00:06:21.248 crafty. We find one exploitation wasn't successful, right? We go 00:06:21.248 --> 00:06:25.051 to another avenue that may have been successful and we may go to 00:06:25.051 --> 00:06:28.221 other systems that get us the types of information that we 00:06:28.221 --> 00:06:32.125 need. It requires us to think outside the box. Unfortunately 00:06:32.125 --> 00:06:36.496 today the focus is really around just getting domain admin 00:06:36.496 --> 00:06:38.665 rights, right? I see someone taking a picture of that screen. 00:06:38.665 --> 00:06:45.272 I apologize. Don't Google clock and forget the L. When you look 00:06:45.272 --> 00:06:48.708 at a lot of the types of attacks we do and the types of methods 00:06:48.708 --> 00:06:51.244 we do, it's about getting domain administrative rights, right? 00:06:51.244 --> 00:06:55.749 That's how we target our tests, but that's what we see as far as 00:06:55.749 --> 00:06:59.486 attackers. They want access to information and things that make 00:06:59.486 --> 00:07:03.890 us unique organizations. For example, everyone is worried 00:07:03.890 --> 00:07:06.693 about PII and credit card data. For manufacturing that's less of 00:07:06.693 --> 00:07:09.896 a concern. Manufacturing is focused more on how do we make 00:07:09.896 --> 00:07:15.835 the product, the chemical compounds and who the suppliers 00:07:15.835 --> 00:07:19.739 are and how much we pay. Those are property pieces that make 00:07:19.739 --> 00:07:24.210 that company unique as an organization, and we don't 00:07:24.210 --> 00:07:28.348 target that as part of what we simulate as an attack. We're at 00:07:28.348 --> 00:07:31.484 a disadvantage and simulating how attackers go after a 00:07:31.484 --> 00:07:36.056 situation to attack the different areas. For me, looking 00:07:36.056 --> 00:07:40.493 at this, we have to evolve to a different type of framework and 00:07:40.493 --> 00:07:44.030 way of attacking organizations. It's not to say what we're doing 00:07:44.030 --> 00:07:46.900 is not right. We need to think differently in our mind about 00:07:46.900 --> 00:07:51.204 going in. It's not about smashing and using root to get 00:07:51.204 --> 00:07:54.474 access to the system and own them and high-five each ear and 00:07:54.474 --> 00:07:59.579 give a report, right? How do we go after an organization and 00:07:59.579 --> 00:08:02.916 figure out what makes them tick and unique and how to target 00:08:02.916 --> 00:08:05.185 them to go after them in a way beneficial? Can we do that with 00:08:05.185 --> 00:08:08.588 the types of techniques the attackers are using? That's what 00:08:08.588 --> 00:08:14.494 we talk about Pivoter and the release of Pivoter and what that 00:08:14.494 --> 00:08:19.999 actually does. For me, if I'm a sophisticated attacker, I go 00:08:19.999 --> 00:08:23.069 after what makes a company unique. I go after what makes 00:08:23.069 --> 00:08:27.073 them unusual. What's interesting today is that if you look at the 00:08:27.073 --> 00:08:31.511 history of breaches, you saw -- I hate to mention the specific 00:08:31.511 --> 00:08:34.647 breaches because we've all had hype in the media. This is a 00:08:34.647 --> 00:08:38.118 specific point. When Target happened, executives were fired, 00:08:38.118 --> 00:08:42.389 right? If you look at the five breaches in the past year and a 00:08:42.389 --> 00:08:45.859 half, you notice they blame them on sophisticated hackers. It's 00:08:45.859 --> 00:08:48.428 like a crux of hey, we got targeted by fist indicated 00:08:48.428 --> 00:08:50.930 hackers even they we neglected security for the past ten years 00:08:50.930 --> 00:08:56.469 and we haven't funded it and given it light of day, we got 00:08:56.469 --> 00:08:58.471 targeted by sophisticated attacks. Now that's okay, right? 00:08:58.471 --> 00:09:03.977 ( Applause ) By the way the sophisticated attacks are four 00:09:03.977 --> 00:09:15.255 lines BASH. You're all APTs. Congratulations. Sophisticated 00:09:15.255 --> 00:09:18.825 attacks are bullshit. It's about everybody being targeted. It's 00:09:18.825 --> 00:09:23.797 how often your security program is up-to-date and refreshed as 00:09:23.797 --> 00:09:26.533 an organization. If you look at that, we have an excuse in 00:09:26.533 --> 00:09:33.006 security to say if I'm targeted to North Korea, China or Russia, 00:09:33.006 --> 00:09:36.176 it's a sophisticated attack, so it's okay. It's not okay. We 00:09:36.176 --> 00:09:42.615 need to build defenses against them. I'll talk about a targeted 00:09:42.615 --> 00:09:45.485 attack that looks like that we struggle with doing PIN tests. 00:09:45.485 --> 00:09:48.455 This was a fun one. You get the traditional testing, we have an 00:09:48.455 --> 00:09:54.594 external or internal PIN testing pour PCI or whatever. A customer 00:09:54.594 --> 00:09:59.399 wants a full-scale red team engagement, right? There's 00:09:59.399 --> 00:10:01.367 different material levels of that. Customers really want you 00:10:01.367 --> 00:10:06.673 to do a red team engagement, but you have to do it between 3:00 00:10:06.673 --> 00:10:10.076 and 4:00 p.m. on Tuesday. You can't break into anything, and 00:10:10.076 --> 00:10:13.746 you can only talk to one person. So in cases like that, it's not 00:10:13.746 --> 00:10:17.484 a red team, right? In this case this customer is awesome and 00:10:17.484 --> 00:10:20.286 wanted us to do an attack and any method was available. 00:10:20.286 --> 00:10:24.624 Whatever you wanted to do aside from breaking windows and 00:10:24.624 --> 00:10:29.696 punching people in the face. If we get busted, can we punch 00:10:29.696 --> 00:10:34.501 people in the face and run away in no. I'm a hugger. I would hug 00:10:34.501 --> 00:10:38.605 them. The whole purpose was this. They spent a lot of time 00:10:38.605 --> 00:10:41.374 on R & D and protecting research and development for the future 00:10:41.374 --> 00:10:44.577 products, and why it's important, manufacturing 00:10:44.577 --> 00:10:46.980 companies, the sustainability of them depends on the product and 00:10:46.980 --> 00:10:50.149 how to refresh the products. If someone gets ahold of them well 00:10:50.149 --> 00:10:54.988 ahead of them releasing, it's disastrous, especially if it's 00:10:54.988 --> 00:10:57.590 other countries competing against them or other 00:10:57.590 --> 00:11:00.593 competitors. The R and D piece where they do the next 00:11:00.593 --> 00:11:05.665 generation product line, a lot of times that's the most 00:11:05.665 --> 00:11:08.968 important thing, the sustainability long term of the 00:11:08.968 --> 00:11:11.571 organization that still compete. I came from a company that had a 00:11:11.571 --> 00:11:14.874 tough time diversifying the markets they're in. They're 00:11:14.874 --> 00:11:19.045 still suffering because they couldn't keep up with what 00:11:19.045 --> 00:11:22.348 they're trying to do. In this case they go after them in a way 00:11:22.348 --> 00:11:26.452 that compromises them when they want to. This is phishing, 00:11:26.452 --> 00:11:33.359 right? Phishing creates a scenario or something as 00:11:33.359 --> 00:11:37.330 believable as the most important pieces, so creating a fantasy. I 00:11:37.330 --> 00:11:42.201 look at what I can do to compromise them. So I start to 00:11:42.201 --> 00:11:44.437 look at their outside, and I found a foul up for 00:11:44.437 --> 00:11:48.107 vulnerability on web shell. If you've been under web shell, 00:11:48.107 --> 00:11:52.812 very limited, right? You don't have squat to do anything with 00:11:52.812 --> 00:11:54.781 network service. You can't escalate permissions and you're 00:11:54.781 --> 00:12:01.087 restricted to the I-net public directory, and sometimes you can 00:12:01.087 --> 00:12:04.524 find a web file and sometimes sensitive data to use and tunnel 00:12:04.524 --> 00:12:08.795 and piggyback to a SQL server and things like that. A lot of 00:12:08.795 --> 00:12:14.100 ways you're pigeonholed in that environment. I was at a dead end 00:12:14.100 --> 00:12:19.472 at this point. We hadn't made Pivoter yet. Geoff, thank you. I 00:12:19.472 --> 00:12:24.777 had to do hard work here. What we did is used the website and 00:12:24.777 --> 00:12:29.148 creating a subwebsite of that website to be like a survey type 00:12:29.148 --> 00:12:31.084 of thing. We had a password field and stuff like that in 00:12:31.084 --> 00:12:36.089 there. If I go and create a website that's on the customer's 00:12:36.089 --> 00:12:38.391 domain that can send e-mails to a customer with a domain in 00:12:38.391 --> 00:12:42.829 there, it's probably pretty legit. What we ended up doing is 00:12:42.829 --> 00:12:46.032 send it off to a couple of folks and we ended compromising 00:12:46.032 --> 00:12:48.167 someone in the sales organization. The sales people 00:12:48.167 --> 00:12:51.204 are phenomenal and great. You can have sales people do 00:12:51.204 --> 00:12:54.173 anything you want to. Especially if you give them money, that's 00:12:54.173 --> 00:12:56.776 the best. Can you disable this antivirus to open up this virus. 00:12:56.776 --> 00:13:05.018 No problem. Cool. Do I still get the sale? No problem. Cool. We 00:13:05.018 --> 00:13:08.521 compromised them and got access to it. I don't understand 00:13:08.521 --> 00:13:13.226 companies. Predominantly 90% of the customers we run into, VPN 00:13:13.226 --> 00:13:17.463 is two factor and the OWA is not. So you have access to full 00:13:17.463 --> 00:13:21.968 access, but you don't have it to VPN, which OWA is for a hacker 00:13:21.968 --> 00:13:26.339 is the best piece that can ever happen. You have established 00:13:26.339 --> 00:13:29.008 lines of communication and trust. If you have trust 00:13:29.008 --> 00:13:31.244 already, you already have communications where someone is 00:13:31.244 --> 00:13:33.913 talking and sending e-mails back and forth, it's easy to send 00:13:33.913 --> 00:13:37.116 them something and click it and they're compromised, right? It's 00:13:37.116 --> 00:13:40.486 easy to attack other people, and what's funny about two factor 00:13:40.486 --> 00:13:47.794 for example. The mayor of ( inaudible ). Does anybody have 00:13:47.794 --> 00:13:52.632 the one where it calls and issing if you're logging in or 00:13:52.632 --> 00:13:56.269 give you a push notification to allow you to log in or not? Do 00:13:56.269 --> 00:14:03.543 you know how bad that? Seven to ten PIN tests where it calls you 00:14:03.543 --> 00:14:07.847 and asking if you're logging in. They allow it because they're 00:14:07.847 --> 00:14:13.619 logging in somewhere. I rented a penthouse one time and logged in 00:14:13.619 --> 00:14:19.292 with the user name and password. Please call. I'm like, oh, crap. 00:14:19.292 --> 00:14:21.994 I'm busted. There's my whole Phish and two days worth of 00:14:21.994 --> 00:14:26.632 work. You log in, and you're sitting there on the screen. All 00:14:26.632 --> 00:14:29.569 of a sudden you log in. That was weird. So whenever you give the 00:14:29.569 --> 00:14:40.313 users the able to err, what will they too? They will err, right? 00:14:40.313 --> 00:14:43.483 Unless you teach them right. In most cases two fact 00:14:43.483 --> 00:14:45.017 authentication is a problem. They didn't have it. What was 00:14:45.017 --> 00:14:52.792 interesting is I wrote is unicorn that does PowerShell 00:14:52.792 --> 00:14:58.131 injection true PowerShell and injects into memory and gives 00:14:58.131 --> 00:15:04.604 you a shell through there, right? The last version of 00:15:04.604 --> 00:15:09.575 Unicorn they're from a good hub sites, they're literally running 00:15:09.575 --> 00:15:12.812 this command and gives you a one-liner command on any system 00:15:12.812 --> 00:15:18.251 and it gives you a shell. It's like magic. That's why it's 00:15:18.251 --> 00:15:25.691 called Magic Unicorn. It's awesome. There's another attack 00:15:25.691 --> 00:15:31.130 with Excel injection. What's great about Mappos, because 00:15:31.130 --> 00:15:36.969 they're in the past. Those usually get flagged, but with a 00:15:36.969 --> 00:15:39.872 lot of macros do straight PowerShell injection and never 00:15:39.872 --> 00:15:46.312 tough the disk. It's a white-listed application, so you 00:15:46.312 --> 00:15:48.781 have the ability to get remote. The execution on the system that 00:15:48.781 --> 00:15:51.617 has next generation stuff which is all a memory that is 00:15:51.617 --> 00:15:56.088 fantastic. What we found out is they're using a sandbox 00:15:56.088 --> 00:16:00.126 technology. They had some sort of virtualization technology. 00:16:00.126 --> 00:16:03.529 Does everybody know how that works, right? Something comes in 00:16:03.529 --> 00:16:07.166 via an e-mail, whether incoming or via gateway, if it doesn't 00:16:07.166 --> 00:16:12.004 look right it will virtualize in the sandbox and look at the 00:16:12.004 --> 00:16:16.809 calls and anything like this. In this case they had something 00:16:16.809 --> 00:16:21.314 like that. When I sent the macro, I got to the initial 00:16:21.314 --> 00:16:23.783 stage and just stopped. They were using virtualization 00:16:23.783 --> 00:16:30.022 technology. I'm not going to say what it was. We ended up writing 00:16:30.022 --> 00:16:37.430 bypass sandbox technology. It's complex and took multiple months 00:16:37.430 --> 00:16:44.136 to get around it. We will list it today, which is awesome. Just 00:16:44.136 --> 00:16:46.939 kidding. It's like three lines of Python code. It took about 14 00:16:46.939 --> 00:16:52.478 minutes. Most virtualization technology, the way it works is 00:16:52.478 --> 00:16:56.649 that they virtualize in a very predictable sandbox environment. 00:16:56.649 --> 00:16:59.919 If you detect you're in a sandbox environment, if auto I'm 00:16:59.919 --> 00:17:02.855 in something that's this pattern, don't do anything, 00:17:02.855 --> 00:17:05.958 right? In this case this specific sandbox technology that 00:17:05.958 --> 00:17:10.329 worked for two of the main three, I think, if they use more 00:17:10.329 --> 00:17:16.002 than two CPU cores -- does anybody have a computer with one 00:17:16.002 --> 00:17:20.973 CPU core? Sir, I'd like to talk to you. I probably couldn't hack 00:17:20.973 --> 00:17:28.314 you. Can't see you that far. This is ice? It's not. Thank 00:17:28.314 --> 00:17:40.726 God. I thought it was ice for a second there. I've got to do it? 00:17:40.726 --> 00:17:53.873 I'll do it. ( Applause ) That was easy. I thought it was going 00:17:53.873 --> 00:17:58.711 to be a warm ice. That would have been terrible. So in most 00:17:58.711 --> 00:18:01.747 cases they use more than one CPU core or less than CPU cores. In 00:18:01.747 --> 00:18:07.019 this environment, don't do anything and make changes to 00:18:07.019 --> 00:18:10.756 everything else. Just shut it down and quit. It's all quick 00:18:10.756 --> 00:18:14.327 and cool and passes it over to the end user. I built it into 00:18:14.327 --> 00:18:19.332 PowerShell. I checked to see if it was in a specific CPU core, 00:18:19.332 --> 00:18:24.270 and it got past the technology which was great. About 14 00:18:24.270 --> 00:18:29.208 minutes. So stupid. Anyway, so we end up compromising one of 00:18:29.208 --> 00:18:32.745 the boxes and one of the people. I spent a good 20 going through 00:18:32.745 --> 00:18:36.415 a lot of boxes and compromised one. It took some time, but what 00:18:36.415 --> 00:18:40.620 was great is I already had the environment so I had a shell, 00:18:40.620 --> 00:18:43.422 which was great. The customer did a great job at never 00:18:43.422 --> 00:18:46.859 segmentation, so we spend a lot time getting to the information 00:18:46.859 --> 00:18:52.498 and I couldn't get access to it. I found the physical access 00:18:52.498 --> 00:18:57.303 system that allows badges. We found the Internet site. Step 00:18:57.303 --> 00:19:01.674 one, step two, step three do this and did all of that and and 00:19:01.674 --> 00:19:05.778 created abadge. This is live footage on the right. We walked 00:19:05.778 --> 00:19:10.116 into the building, pick up a badge, walked into the facility. 00:19:10.116 --> 00:19:14.587 So, you know, I addressed the part right. This is a suit and 00:19:14.587 --> 00:19:18.824 tie type of thing. I wore a suit and everything and went to this 00:19:18.824 --> 00:19:23.629 R & D place with smoke glass windows and everything. They 00:19:23.629 --> 00:19:26.465 spent a lot of time and money on this, right? I badge in and have 00:19:26.465 --> 00:19:30.069 a PIN to walk into the place and a PIN number. It's a moment 00:19:30.069 --> 00:19:34.273 where you walked into the wrong place. They're in jeans and 00:19:34.273 --> 00:19:37.677 T-shirts and I'm in a suit, right? I walk in, and they're 00:19:37.677 --> 00:19:41.013 having a massive meeting of 50 people and everybody stops 00:19:41.013 --> 00:19:44.617 talking and looks at me. At this point you're like, oh, shit, do 00:19:44.617 --> 00:19:49.722 I walk in and do something or go wrong room? I walk around the 00:19:49.722 --> 00:19:55.795 side, and they start talking. The worst thing happened. I 00:19:55.795 --> 00:19:58.831 wasn't paying attention. I was nervous because people were 00:19:58.831 --> 00:20:03.636 around me like who is this dude in a suit. I see this trash can, 00:20:03.636 --> 00:20:09.108 a metal trash can. There's like mustard everywhere all over my 00:20:09.108 --> 00:20:11.310 suit and people are picking it up over the ground. I sprained 00:20:11.310 --> 00:20:15.181 my ankle. It was terrible. You never want it to happen in real 00:20:15.181 --> 00:20:18.684 life and it did and you're like, that's really me that did that. 00:20:18.684 --> 00:20:22.721 They picked it up off the ground and pick up the mustard. It 00:20:22.721 --> 00:20:27.927 worked out okay, but I planted this device in. I'm going to 00:20:27.927 --> 00:20:31.731 open source this next week. It's called the implant twice, the 00:20:31.731 --> 00:20:35.801 tap device I've been working on for a year. What it is when 00:20:35.801 --> 00:20:39.839 doing physicals, you replace or drop something, you use an Intel 00:20:39.839 --> 00:20:47.079 Nook. It's a Tyne any thing. I usually put 28 gigs of memory in 00:20:47.079 --> 00:20:52.151 it and put 8 gigs of RAM. What it does is it's a software that 00:20:52.151 --> 00:20:58.591 uses the LT network to do a reverse SSH out of the network 00:20:58.591 --> 00:21:01.160 and finds different ways out. It uses the LT network first and 00:21:01.160 --> 00:21:07.233 the regular network second. Jeff wrote some software that does a 00:21:07.233 --> 00:21:12.471 full transparent into the environment. You can print or 00:21:12.471 --> 00:21:18.210 tap off of your device onto the network itself. If anyone has 00:21:18.210 --> 00:21:23.382 used SSH, it's like that but more stable. If you've done a 00:21:23.382 --> 00:21:26.418 scan over it, it doesn't work. This is a full tap interface and 00:21:26.418 --> 00:21:31.857 you can VPN in the environment and too what you want. It's not 00:21:31.857 --> 00:21:34.193 a tap device you implant. You deploy tap and you find a port 00:21:34.193 --> 00:21:42.468 out and it will have a connection and you VPN into the 00:21:42.468 --> 00:21:46.906 environment itself. What's nice is it's self-healing, so an 00:21:46.906 --> 00:21:49.808 issue with the operating system or an issue with the tunnel 00:21:49.808 --> 00:21:52.912 restructures and rebuilds it. If you want to keep all the tools 00:21:52.912 --> 00:21:58.417 local in itself, you use the reverse SSH to update it for 00:21:58.417 --> 00:22:02.421 you. You don't have to worry about outbound filters on the 00:22:02.421 --> 00:22:05.758 network itself for tools and updates. I'll go and release 00:22:05.758 --> 00:22:09.795 that this coming week here shortly. You should see that in 00:22:09.795 --> 00:22:11.964 the repos this week. On that I could have skipped all the steps 00:22:11.964 --> 00:22:23.142 tripping over the trash can, the mustard if Geoff had written 00:22:23.142 --> 00:22:26.779 Pivoter earlier. We can Blake Geoff for this one and me having 00:22:26.779 --> 00:22:28.814 a sprained ankle. It's still bothering me. We'll go ahead and 00:22:28.814 --> 00:22:38.224 introduce Pivoter. >> Okay. It all started around this time 00:22:38.224 --> 00:22:40.593 last year when Dave was talking to me about some of the 00:22:40.593 --> 00:22:44.496 engagements he'd been on and trials he'd had. Specifically is 00:22:44.496 --> 00:22:48.167 there anything like SSH for Windows that wouldn't need 00:22:48.167 --> 00:22:50.603 privileges so we could move forward? I thought about it a 00:22:50.603 --> 00:22:53.706 little bit. I thought it seems kind of do-able. It's a reverse 00:22:53.706 --> 00:23:00.212 proxy what you're describing, and you know, we can implement 00:23:00.212 --> 00:23:02.982 that. Of course, I didn't get around to doing it until I 00:23:02.982 --> 00:23:06.619 started to do more of my own PIN tests and needed it myself and 00:23:06.619 --> 00:23:12.458 suddenly it was a lot more important to me like Dave said. 00:23:12.458 --> 00:23:17.496 What I've been finding on a locality of PIN tests is that 00:23:17.496 --> 00:23:23.035 mostly big companies are doing good things and have 00:23:23.035 --> 00:23:30.175 configurations in place. It's not like where you install all 00:23:30.175 --> 00:23:33.879 of the SQL server management tools and stuff on every web 00:23:33.879 --> 00:23:35.614 server and stuff like that so you can count on it being there 00:23:35.614 --> 00:23:43.355 once you got on a box. You get on a fully patched server 2008 00:23:43.355 --> 00:23:47.192 R2 box with nothing but the minimal support libraries with 00:23:47.192 --> 00:23:53.032 the web application they're running. There's still the five 00:23:53.032 --> 00:23:57.936 or seven-year-old PDF in house I can take advantage of that. 00:23:57.936 --> 00:24:06.312 There's tools on the Linux side that can kind of do this, and 00:24:06.312 --> 00:24:11.550 certainly as Dave mentioned in Pro, you have the VPN 00:24:11.550 --> 00:24:13.719 functionality. That's not available to everybody, but I 00:24:13.719 --> 00:24:18.524 wanted something others can use and also I find there's a lot of 00:24:18.524 --> 00:24:24.430 times when I don't want toe use it for one reason or another. So 00:24:24.430 --> 00:24:28.934 I kind of came up with some basic objectives. I wanted to 00:24:28.934 --> 00:24:32.071 have something that would be relatively small payload. As 00:24:32.071 --> 00:24:36.141 long as I'm dropping on a server that has the visual on time 00:24:36.141 --> 00:24:39.511 installed I can get it down to 30 K today. I do believe that we 00:24:39.511 --> 00:24:48.387 can get that a little bit smaller as we work on it some 00:24:48.387 --> 00:24:51.357 more. I definitely wanted something that didn't need any 00:24:51.357 --> 00:24:54.259 elevated privileges, because it tended up to a case that I was 00:24:54.259 --> 00:24:58.430 IIS user or local user on the machine. You usually don't have 00:24:58.430 --> 00:25:01.600 a good escalation path. I may not have a good shell. I may be 00:25:01.600 --> 00:25:06.305 working with a lousy westbound shell. I wanted to support 00:25:06.305 --> 00:25:12.144 simultaneous connections and stuff so I'd be able to go ahead 00:25:12.144 --> 00:25:17.616 and do things like port scans with some efficiency. So we have 00:25:17.616 --> 00:25:21.854 a few slides here that show how you use the tool. The first 00:25:21.854 --> 00:25:25.290 thing is I went with environment variables to set things up. If 00:25:25.290 --> 00:25:32.564 you do you know it acts as a library wrapper or whatever 00:25:32.564 --> 00:25:37.269 information you want to execute. They're not designed to take 00:25:37.269 --> 00:25:41.707 some of these inputs. Dave, I don't think we have the picture 00:25:41.707 --> 00:25:44.643 up, but that's all right. >> I'm doing interpretive dances in a 00:25:44.643 --> 00:25:48.680 second, so it will be fine. >> A lot of times the tools don't 00:25:48.680 --> 00:25:51.884 have the ability to take the input information I need says, 00:25:51.884 --> 00:25:54.186 so I thought the easiest way is to communicate with environment 00:25:54.186 --> 00:25:57.856 variables and the other piece to this we introduce in a minute, 00:25:57.856 --> 00:26:01.393 the connection broker uses the same variables so the setup is a 00:26:01.393 --> 00:26:05.664 little easier. The next step is to start the broker, and what 00:26:05.664 --> 00:26:10.335 that broker does is it will be listening to the the incoming 00:26:10.335 --> 00:26:13.572 connections from the service proxy component that you drop 00:26:13.572 --> 00:26:16.275 and any application that you run when it makes connections 00:26:16.275 --> 00:26:20.846 outbound. The next step is somehow on our victim we need to 00:26:20.846 --> 00:26:24.349 start the service proxy. Again, it doesn't need special 00:26:24.349 --> 00:26:28.387 permissions and not trying to bind ports or have firewall 00:26:28.387 --> 00:26:31.924 rules open so we go out on something that we know is open 00:26:31.924 --> 00:26:37.229 like 80 and all the connections are outbound. So we're not 00:26:37.229 --> 00:26:43.802 listening. And finally our last step is we go ahead and start 00:26:43.802 --> 00:26:47.306 the application. Anybody who sees Linux is probably somewhat 00:26:47.306 --> 00:26:52.644 familiar with using LD Freeload. Load this library first, so when 00:26:52.644 --> 00:26:57.049 the dynamic linker comes along and gets a call to connect it 00:26:57.049 --> 00:27:04.623 comes across mine first and does that. It steers the traffic over 00:27:04.623 --> 00:27:08.026 to the broker, and then basically the connection and 00:27:08.026 --> 00:27:12.531 side effects of Connect would perform within the program. So 00:27:12.531 --> 00:27:21.106 if you have seen a proxy before maybe used sox cap or something 00:27:21.106 --> 00:27:24.643 like that on Windows OC sox on windows there's two out there 00:27:24.643 --> 00:27:32.150 and you have the wrapper. Basically I cut a third piece 00:27:32.150 --> 00:27:37.322 out and with the connection broker away from the proxy 00:27:37.322 --> 00:27:39.858 service itself so it can do all the listing locally on your 00:27:39.858 --> 00:27:44.129 machine and we can have a single connection back from the proxy 00:27:44.129 --> 00:27:48.800 server back to the server so we don't see multiple firewall 00:27:48.800 --> 00:27:55.407 events and stuff that give us away if we opened a lot of 00:27:55.407 --> 00:28:02.814 connections outs. Once we have the proxy connected up, our 00:28:02.814 --> 00:28:06.251 library wrapper will read the environment and make sure the 00:28:06.251 --> 00:28:09.922 connect events gets hosted by name. That goes over to a 00:28:09.922 --> 00:28:16.528 broker. He listens to the messages, accepts those proxy 00:28:16.528 --> 00:28:21.900 connections, and then creates a simple message it can send the 00:28:21.900 --> 00:28:26.605 existing socket over to the proxy and using a fairly 00:28:26.605 --> 00:28:30.509 protocol to do that. It's fixed sized, which I will show you on 00:28:30.509 --> 00:28:36.148 the next page here. You see actually I've got -- oh, boy. I 00:28:36.148 --> 00:28:40.552 moved it again. Anyway. Typically in a SOAP proxy what 00:28:40.552 --> 00:28:45.023 we had in the past was one connection to the proxy server, 00:28:45.023 --> 00:28:48.026 one connection to the remote host. Obviously, that went going 00:28:48.026 --> 00:28:50.729 to work in this case, so I had to come up with another method 00:28:50.729 --> 00:28:55.434 of letting the proxy server keep order as far as where replies 00:28:55.434 --> 00:28:57.235 needed to go and things like that. I decided that basically 00:28:57.235 --> 00:29:01.306 process ID and the file descriptor in the process should 00:29:01.306 --> 00:29:08.113 be unique enough. It's an integer type value enumerated 00:29:08.113 --> 00:29:19.024 and usually it's connect, get host by name. As I was 00:29:19.024 --> 00:29:22.894 interpreting it, I ran into a few surprising. Even though we 00:29:22.894 --> 00:29:27.666 know when sox evolved from BST sockets, the status codes and 00:29:27.666 --> 00:29:30.268 return values were different. I had to do a little bit of 00:29:30.268 --> 00:29:34.573 mapping before fed the values back to the Linux programs I was 00:29:34.573 --> 00:29:43.782 running. It led to interesting chaos that exercised some code 00:29:43.782 --> 00:29:47.953 and things like net cap that never were intended to be hit 00:29:47.953 --> 00:29:52.457 mainly because, you know, things would happen like a valid file 00:29:52.457 --> 00:30:01.733 desscriptor so the behavior was rather ( inaudible ). It turned 00:30:01.733 --> 00:30:07.639 out on the library side I didn't need to enter functions, because 00:30:07.639 --> 00:30:10.876 it was relative thin wrapper around the connect call most of 00:30:10.876 --> 00:30:14.246 the time or around name or get at our info type functions. 00:30:14.246 --> 00:30:19.184 Those actually then just performed the connect to the 00:30:19.184 --> 00:30:23.789 broker piece of it away. So didn't have to reimplement the 00:30:23.789 --> 00:30:26.658 actual socket function or anything like that. I didn't 00:30:26.658 --> 00:30:29.695 have to get into all the flow controls that would have been 00:30:29.695 --> 00:30:35.467 more complicated. Just a few other things before I launch 00:30:35.467 --> 00:30:39.571 into our demo here. I did look around for some code on the 00:30:39.571 --> 00:30:42.174 Internet before I wrote anything, of course, because you 00:30:42.174 --> 00:30:45.444 never want to reinvent the wheel and most people are better 00:30:45.444 --> 00:30:47.846 programmers than I am even though I did it for a number of 00:30:47.846 --> 00:30:51.249 years. What I found with the open source proxies out there is 00:30:51.249 --> 00:30:56.221 they were implemented with that idea of one connection in would 00:30:56.221 --> 00:30:59.758 be one connection out kind of at their very core, so they didn't 00:30:59.758 --> 00:31:03.128 have a lot of internal housekeeping to leverage when I 00:31:03.128 --> 00:31:07.499 had to route things back based on file descriptor so I couldn't 00:31:07.499 --> 00:31:19.211 use a lot of that code so I decided to write my own thing. I 00:31:19.211 --> 00:31:23.415 made decisions along the way that every programmer is 00:31:23.415 --> 00:31:27.819 familiar with. I used link list to keep the traffic flowing in 00:31:27.819 --> 00:31:34.526 and basically always ready to read on the wire and connected 00:31:34.526 --> 00:31:40.098 sockets on the outside to remote host sorted in form. I wish I 00:31:40.098 --> 00:31:43.602 used a thick sized array and stepped over it like that. It 00:31:43.602 --> 00:31:46.438 would have been a much simpler data structure and a simpler 00:31:46.438 --> 00:31:50.842 implementation, although it seems like the binary performs 00:31:50.842 --> 00:31:54.913 very well. So I decided to continue to live with that for a 00:31:54.913 --> 00:31:59.017 while. We'll see how things evolve. I have a video of the 00:31:59.017 --> 00:32:03.822 demo today because I'm a terrible typist and you don't 00:32:03.822 --> 00:32:08.827 want to sit here while I make errors and things like that. 00:32:08.827 --> 00:32:11.830 We're going to do pretending. I have a vulnerable web 00:32:11.830 --> 00:32:15.433 application here. This is a software testing tool from a 00:32:15.433 --> 00:32:19.304 little while ago and it's running on a pub 172 IP. There's 00:32:19.304 --> 00:32:23.708 other stuff that gets to on another 172 space that my 00:32:23.708 --> 00:32:26.511 attacking PCs can't see directly. First thing I'm doing 00:32:26.511 --> 00:32:31.616 here is taking advantage of the testing tool a little bit. I'm 00:32:31.616 --> 00:32:34.119 setting up a test that's going to call PowerShell and rig up a 00:32:34.119 --> 00:32:38.356 file drop. It will make the request back to an Apache server 00:32:38.356 --> 00:32:42.627 I have running. So it's run there, and it's continuing to 00:32:42.627 --> 00:32:45.530 run here. We're going to see in a second that I actually get an 00:32:45.530 --> 00:32:48.099 error back from PowerShell. That's important later. It tells 00:32:48.099 --> 00:32:53.104 me extra stuff is on the command line. You see me use PowerShell 00:32:53.104 --> 00:32:59.911 again to manage the arguments to get past. I go over and look at 00:32:59.911 --> 00:33:03.782 the Apache log and see that request happened. I know my file 00:33:03.782 --> 00:33:06.952 drop was at least partially successful. The request happened 00:33:06.952 --> 00:33:18.763 and got written to the disk. So the next thing we need to do is 00:33:18.763 --> 00:33:23.401 start getting stuff set up on the tacking box. You see me go 00:33:23.401 --> 00:33:28.006 ahead twice here with two different tabs. I can set up the 00:33:28.006 --> 00:33:29.174 environment once and background the broker. I'm choosing not to 00:33:29.174 --> 00:33:31.943 do that. I want to run the broker but the defrags, enables, 00:33:31.943 --> 00:33:36.414 and runs the library without them. The main reason not to run 00:33:36.414 --> 00:33:40.819 it with them it introduces a lot of stuff on standard error that 00:33:40.819 --> 00:33:44.789 confuses it and makes it difficult to work with. It's 00:33:44.789 --> 00:33:48.960 there so you can debug what's going on if something is not 00:33:48.960 --> 00:33:51.096 working the way you think it should. However, you get a lot 00:33:51.096 --> 00:33:55.166 of good debug output from the broker itself that letsmen 00:33:55.166 --> 00:33:57.602 what's going on. I run the brokering typically in a second 00:33:57.602 --> 00:34:04.809 tab. It is possible to do this tool with some shell injection 00:34:04.809 --> 00:34:08.313 and by PowerShell reflective injection and stuff like that. I 00:34:08.313 --> 00:34:13.151 went with a simple file drop for the sake of of a demo. It's 00:34:13.151 --> 00:34:17.689 easier to do that, obviously, and it works. Typically in terms 00:34:17.689 --> 00:34:21.726 of cleanup, it's not that hard because it's one file to delete 00:34:21.726 --> 00:34:27.832 later. So not too many issues there. So we're getting ready 00:34:27.832 --> 00:34:33.004 here with the rest of the environment variables. And I 00:34:33.004 --> 00:34:42.414 hope that's big enough people can see it. I don't know. >> We 00:34:42.414 --> 00:34:47.719 can do it. >> I got it. Don't you worry. >> All right. >> I 00:34:47.719 --> 00:34:51.923 may have deleted the videos. >> I hope you didn't delete the 00:34:51.923 --> 00:34:54.359 videos. >> Excellent. >> What is that? 2? >> I think we're on 2. 00:34:54.359 --> 00:35:02.634 Hold on a second. >> Can you see that a little better? I'm going 00:35:02.634 --> 00:35:05.070 to start interpretive dances here. >> Dave will do the 00:35:05.070 --> 00:35:08.039 interpretive dances. I don't know if I mentioned this before, 00:35:08.039 --> 00:35:11.643 but I'm stopping Apache. I'm doing that because I instruct my 00:35:11.643 --> 00:35:14.612 proxy to come back out on port 80. Why? I know it's open. I 00:35:14.612 --> 00:35:27.325 don't have to fool with guessing whether the firewall will let me 00:35:27.325 --> 00:35:41.306 out. Okay. So at this point we are ready to start the broker. 00:35:41.306 --> 00:35:47.412 We have our environment set up. We'll get the separate second 00:35:47.412 --> 00:35:51.216 tab going, and once I get this environment set up, I'm going to 00:35:51.216 --> 00:35:53.451 pivot to network that's surprisingly interesting to 00:35:53.451 --> 00:35:56.354 pivot to that I didn't imagine would be so interesting at 00:35:56.354 --> 00:36:01.526 first. The 127 network. A lot of people write firewall rules that 00:36:01.526 --> 00:36:05.864 trust local hosts a lot. When you open a new socket usually 00:36:05.864 --> 00:36:09.200 the source IP address will take the adapter that that network is 00:36:09.200 --> 00:36:15.006 native on. Traffic looks like it comes from local hosts and looks 00:36:15.006 --> 00:36:24.215 like it goes to local hosts once we do this. Now the next step 00:36:24.215 --> 00:36:27.419 here I think -- can you go to the next video, Dave? Can you do 00:36:27.419 --> 00:36:35.527 that for me? >> Computers are hard. >> Computers are hard. I'm 00:36:35.527 --> 00:36:38.830 going to use the same injection technique to invoke my proxy. 00:36:38.830 --> 00:36:44.602 Basically I set up another test here. >> All these commands we 00:36:44.602 --> 00:36:48.306 have, you know, we have all of this and all the source and all 00:36:48.306 --> 00:36:51.142 that good stuff. This is a little difficult, but we have 00:36:51.142 --> 00:36:54.846 all the commands on your website that we put a blog post on. >> 00:36:54.846 --> 00:37:00.618 Once again, I just did a really simple PowerShell wrapper there 00:37:00.618 --> 00:37:04.022 just to swallow the extra stuff that comes on the end of it so 00:37:04.022 --> 00:37:07.325 it doesn't confuse my application. I have something in 00:37:07.325 --> 00:37:09.527 the little toolbox we'll talk about later that substitutes 00:37:09.527 --> 00:37:14.299 some IP addresses into the binary without recompiling it 00:37:14.299 --> 00:37:18.636 just to simplify things a little bit. We're into the next video 00:37:18.636 --> 00:37:31.916 here, Dave. Now I'm using all the preload and I'm using our 00:37:31.916 --> 00:37:37.021 desktop and hit the box on local host. Again, the reason for that 00:37:37.021 --> 00:37:40.558 is essentially now even though I'm sure the firewall won't let 00:37:40.558 --> 00:37:44.729 3389 in, now I'm going through my tunnel and going from local 00:37:44.729 --> 00:37:46.998 host and going to local host, even if they're running a local 00:37:46.998 --> 00:37:52.103 software firewall on the box. I'm going to be likely to do 00:37:52.103 --> 00:37:56.708 that, and I have PowerShell. Not PowerShell. Remote desktop. The 00:37:56.708 --> 00:38:00.378 other reason I wanted to run remote Desktop is to show we can 00:38:00.378 --> 00:38:04.549 support more than protocols and feed a fair amount of data at a 00:38:04.549 --> 00:38:08.920 recent rate. This is just me playing around. I'm guessing 00:38:08.920 --> 00:38:12.824 that maybe the application or the password that worked in the 00:38:12.824 --> 00:38:15.693 web application will work on the desktop. It doesn't look like 00:38:15.693 --> 00:38:18.730 I'm being real successful. I don't need to get any terrible 00:38:18.730 --> 00:38:23.234 access to the bock. We can continue this attack on other 00:38:23.234 --> 00:38:40.518 network hosts behind it. ( Applause ) So at this point I'm 00:38:40.518 --> 00:38:45.323 going to try some other attacks here. I think we're playing the 00:38:45.323 --> 00:38:50.495 wrong video, but that's fine. We'll go with it. This is an 00:38:50.495 --> 00:38:55.833 example of scanning with a net cat. I can't scan with in map 00:38:55.833 --> 00:38:58.937 directly. They want to use raw sockets and things like that, 00:38:58.937 --> 00:39:02.941 which are hard to work with, unfortunately, and we wouldn't 00:39:02.941 --> 00:39:07.145 be able to complement on the Windows side without privileges. 00:39:07.145 --> 00:39:11.649 I'm just using the switches on net cat and scans for 445. 00:39:11.649 --> 00:39:17.121 Pretty good way to find Windows host. The proxy, of course, can 00:39:17.121 --> 00:39:20.291 handle multi-that Redding in terms of outbound connections on 00:39:20.291 --> 00:39:22.927 the remote side. You can certain run multiple net CAT scans and 00:39:22.927 --> 00:39:30.868 parallel what you want to scan into blocks of ten or something 00:39:30.868 --> 00:39:36.307 like that and run three or four wide at a time is what I usually 00:39:36.307 --> 00:39:41.446 do. I'm going to continue to let you drive, Dave, rather than try 00:39:41.446 --> 00:39:45.016 to. >> That's scary. >> Figure out how to use your track bed 00:39:45.016 --> 00:39:51.122 settings. So I did find a box. We're PIN-testing a web 00:39:51.122 --> 00:39:52.523 application here. I'm going to go ahead and see if it works. 00:39:52.523 --> 00:40:00.999 You see me editing my command there. Again, you know, in an 00:40:00.999 --> 00:40:06.004 actual attack scenario without having compromised that box, I 00:40:06.004 --> 00:40:07.839 have to put a lot more footprint on it and drop tools to interact 00:40:07.839 --> 00:40:12.644 with the database and any other tool to use and any other I want 00:40:12.644 --> 00:40:17.215 to do and things of that nature. Those utilities around probably 00:40:17.215 --> 00:40:21.653 on the box. What Pivoter will allow me to do is use tools that 00:40:21.653 --> 00:40:26.524 I natively have installed and attack the other VMs -- or those 00:40:26.524 --> 00:40:33.498 other machines on that DMZ behind that victim box. Turns 00:40:33.498 --> 00:40:36.801 out apparently that this database won't talk to me, which 00:40:36.801 --> 00:40:45.810 is interesting. I guess we'll go to the next video. So there's a 00:40:45.810 --> 00:40:49.814 little situation with DNS that doesn't always work the way we 00:40:49.814 --> 00:40:53.017 would have hoped it would. To that end I wrote another tool 00:40:53.017 --> 00:40:56.321 that helps me do additional DNS recon while using Pivoter. Since 00:40:56.321 --> 00:41:02.126 we have that one host we know about, I'm going to do things we 00:41:02.126 --> 00:41:07.198 test with any company with any size with Intranet. Sure enough, 00:41:07.198 --> 00:41:11.903 I got back the same address I had before. That probably tells 00:41:11.903 --> 00:41:16.207 me that maybe that database there is actually to support 00:41:16.207 --> 00:41:19.811 another web app or something like that. Finally, I looked up 00:41:19.811 --> 00:41:22.814 an outside address. That's another thing I do here to show 00:41:22.814 --> 00:41:27.452 you I can get back all the addresses with this tool. If we 00:41:27.452 --> 00:41:32.924 see different DNS resolution inside versus outside, there's 00:41:32.924 --> 00:41:38.029 things about how the network is set up as well. Just to point 00:41:38.029 --> 00:41:41.799 out what's going on with performing the DNS resolutions 00:41:41.799 --> 00:41:45.003 by the proxy. It's happening from the perspective of the 00:41:45.003 --> 00:41:49.407 victim box, not my local Cally box here. I can see the enter 00:41:49.407 --> 00:41:54.212 DNS space. Another thing I decided to do with DNS 00:41:54.212 --> 00:41:58.816 resolution is I went ahead and -- even if you use the get host 00:41:58.816 --> 00:42:04.422 family of functions on the Linux side, they went back to the old 00:42:04.422 --> 00:42:07.825 host by name function on the Windows side. That falls back to 00:42:07.825 --> 00:42:22.106 wins. I get that even with no DNS response. Anyway, more to 00:42:22.106 --> 00:42:25.710 come. Certainly there's a lot more work to do. There are some 00:42:25.710 --> 00:42:29.313 limitations with the tools. I talked about DNS a little bit. I 00:42:29.313 --> 00:42:36.220 think we're a few slides back. Yes. There's some work-arounds 00:42:36.220 --> 00:42:42.827 DNS recon. It's a simple DNS resolver and looks it up. It's 00:42:42.827 --> 00:42:47.598 not Pivoter aware in any way. When you call it, as you saw in 00:42:47.598 --> 00:42:51.536 the demo, you actually wrap it with the libraries the way you 00:42:51.536 --> 00:42:55.606 would anything else. And talk quickly about how to speed up 00:42:55.606 --> 00:43:03.915 scanning with net cap. Yes, there's definitely more work to 00:43:03.915 --> 00:43:08.019 do. We certainly want to wrap more sox calls. It would be nice 00:43:08.019 --> 00:43:11.823 to do interpretive integration to make it easy. Overall the 00:43:11.823 --> 00:43:15.326 tools at that point where we had that lump of enriched uranium on 00:43:15.326 --> 00:43:17.728 top of the tower in the desert with a bunch of explosives 00:43:17.728 --> 00:43:20.631 around it, we can make it go boom. I'm altering it and doing 00:43:20.631 --> 00:43:27.305 a customer compile all the time but it does work and let us 00:43:27.305 --> 00:43:31.876 continue on. I guess I'll hand it back to Dave here. >> I've 00:43:31.876 --> 00:43:35.513 been working on the set integration, too, so the new 00:43:35.513 --> 00:43:42.353 version of S.E.T. 5.7 should be out in the next week or so. When 00:43:42.353 --> 00:43:45.957 you go in and do your payloads, it running the terrible tool on 00:43:45.957 --> 00:43:47.492 top of it. You can do most of the PIN testing work inside most 00:43:47.492 --> 00:43:54.999 of your tools you use on a PIN test as part of it. >> I don't 00:43:54.999 --> 00:43:59.403 know if anyone has a chance to see the framework, but I'll show 00:43:59.403 --> 00:44:02.106 you a quick demo of this. I released this about two weeks 00:44:02.106 --> 00:44:11.149 ago. The biggest issue that you have with PIN test distribution 00:44:11.149 --> 00:44:16.754 is we love CALI, and it's near and dear to our heart. We also 00:44:16.754 --> 00:44:21.425 write our own tools and distributions. The biggest thing 00:44:21.425 --> 00:44:26.964 with a test you are all toot time is making sure I have all 00:44:26.964 --> 00:44:30.001 the greatest and latest tools out there. It's a modular 00:44:30.001 --> 00:44:33.070 framework around keeping the tools up to date. There's up to 00:44:33.070 --> 00:44:40.111 46 modules for tools. You can clone it from GitHub. I like it 00:44:40.111 --> 00:44:51.355 in my armpit. It's good in my armpit. Clone it from GitHub. It 00:44:51.355 --> 00:45:02.300 will grab the latest distribution for it. Every time 00:45:02.300 --> 00:45:06.204 you run it from there on out, it will update itself. Whenever a 00:45:06.204 --> 00:45:08.606 new module is added, it will go through there. I don't know if 00:45:08.606 --> 00:45:15.212 anyone saw the empire tool out there. Really great talk. Within 00:45:15.212 --> 00:45:19.150 an hour someone wrote a module for that and pushed for the PTF 00:45:19.150 --> 00:45:24.121 framework and get the tool as soon as it's released. Push it 00:45:24.121 --> 00:45:30.528 for Pivoter, and we'll show you how easy it is. Just try the 00:45:30.528 --> 00:45:38.502 connection first and try to pup date itself. It's all set. Any 00:45:38.502 --> 00:45:45.710 tools has to have that, and then it's like ( inaudible ). Show 00:45:45.710 --> 00:45:48.012 the modules. You can see all the different tools that are 00:45:48.012 --> 00:45:51.248 available. So big screens are kind of broken up. You see SQL 00:45:51.248 --> 00:45:56.520 map inception. All of those are there. If you want to install 00:45:56.520 --> 00:46:04.629 it, just hit use modules and use exploitation set and Gadzuric 00:46:04.629 --> 00:46:07.298 and run. It installs it all for you. If you want to keep it up 00:46:07.298 --> 00:46:15.606 to date, as soon as you hit run again, it's been solved and 00:46:15.606 --> 00:46:17.942 updated for you. Let's say you want to do all tools. There's an 00:46:17.942 --> 00:46:20.911 option here. It will hit modules and/install or update all. It 00:46:20.911 --> 00:46:27.318 will install or up date it for you. You'll have a common 00:46:27.318 --> 00:46:31.122 distribution point for all the tools. I don't know if anybody 00:46:31.122 --> 00:46:33.624 used backtrack or anything below. We structured everything 00:46:33.624 --> 00:46:38.529 around the PIN test. Exploitation posts, exploitation 00:46:38.529 --> 00:46:43.401 reconnaissance are all structureded within the 00:46:43.401 --> 00:46:52.543 framework. I've also added Pivoter. So you can search for 00:46:52.543 --> 00:46:55.246 Pivoter. It's in there as well. We use this module. Go ahead and 00:46:55.246 --> 00:47:09.560 run it. It takes a second. The Internet is slow, and it's hard. 00:47:09.560 --> 00:47:14.699 It's done. You have Pivoter. Easy to go. So really easy 00:47:14.699 --> 00:47:19.203 framework. The way that you actually add a module real quick 00:47:19.203 --> 00:47:23.207 is you go under modules. I created a whole framework around 00:47:23.207 --> 00:47:26.210 building modules that you don't have to require any type of 00:47:26.210 --> 00:47:29.914 coding background whatsoever. You can create in about three 00:47:29.914 --> 00:47:34.418 minutes. Go to exploitations and go to set. The author of the 00:47:34.418 --> 00:47:38.522 module, the description of the module, right? So a description 00:47:38.522 --> 00:47:38.889 is this is the social engineer and install types and supports. 00:47:38.889 --> 00:47:48.332 Get SVN and file. If it's a zip file, grab it and extract it for 00:47:48.332 --> 00:47:57.208 you into the directory. The process location goes to pull 00:47:57.208 --> 00:48:03.814 it. Right now I have DEVIAN as the main support. After commands 00:48:03.814 --> 00:48:10.721 are what occurs after you install it? Your commands will 00:48:10.721 --> 00:48:18.829 sequence through on all the commands. It does all the 00:48:18.829 --> 00:48:22.299 information for you to install it after it's done getting 00:48:22.299 --> 00:48:27.605 everything out and installs all those other things. It's pretty 00:48:27.605 --> 00:48:31.842 efficient going into all the modules for you and solve them 00:48:31.842 --> 00:48:35.913 realtime. You sort of go in and install it for you 00:48:35.913 --> 00:48:47.057 automatically, which is great. So Pivoter is now released. Go 00:48:47.057 --> 00:48:54.598 to GitHub.com and it has the latest code base into it. It 00:48:54.598 --> 00:48:58.068 links you to a blog to walk you through how to set it up and 00:48:58.068 --> 00:49:01.705 what you need to do to route your traffic through Pivoter. 00:49:01.705 --> 00:49:07.678 Hopefully it's an evolution so we make it better as we go 00:49:07.678 --> 00:49:12.016 along. One of the things Geoff is doing is continuously up 00:49:12.016 --> 00:49:15.719 dating it as it goes along and we will add different changes to 00:49:15.719 --> 00:49:19.757 it. All the codes are there, and I appreciate everybody coming 00:49:19.757 --> 00:49:22.193 out to the talk and hopefully you get some sleep here in the 00:49:22.193 --> 00:00:00.000 next three weeks. >> Thanks, everybody. ( Applause )