00:00:00.033 --> 00:00:02.236 So I've been at Mississippi state for a number of years. Got 00:00:02.236 --> 00:00:06.306 my graduate degrees there and now I'm a research professor. I 00:00:06.306 --> 00:00:11.044 teach one class a semester. It's a security course that I turned 00:00:11.044 --> 00:00:15.749 into a penetration course and reverse engineering course that 00:00:15.749 --> 00:00:19.419 teaches students how to reverse engineer malware. I have a 00:00:19.419 --> 00:00:26.226 consultancy, where we provide interesting services and my 00:00:26.226 --> 00:00:28.829 interests are in vulnerability analysis, general cyber 00:00:28.829 --> 00:00:34.835 operations. I don't do a lot of defensive stuff. That is for 00:00:37.604 --> 00:00:41.475 other folks. What we're talking about today is option rational 00:00:41.475 --> 00:00:45.345 security for penetration testers or any other type of attackers. 00:00:45.345 --> 00:00:51.118 You may be on a scoped penetration test but generally 00:00:51.118 --> 00:00:57.124 you have the same concerns here. We're not trying to rip off the 00:00:59.226 --> 00:01:03.630 grunt here. But generally how to keep yourself safe and how to 00:01:03.630 --> 00:01:09.636 keep your client data safe during a penetration test. A lot 00:01:21.114 --> 00:01:24.384 of these are not straight bugs. The ones I demoed last year in 00:01:24.384 --> 00:01:27.154 gorilla fashion and those I'm going to do today, these are 00:01:27.154 --> 00:01:30.190 bugs in the tools and in the default insulations of them. A 00:01:30.190 --> 00:01:32.693 lot are communication and data security issues. The tool was 00:01:32.693 --> 00:01:34.962 never designed to have a security model to protect 00:01:34.962 --> 00:01:38.732 against it so it's not exactly a bug but it is a problem how you 00:01:38.732 --> 00:01:41.768 use it. You have to take that into account when dealing with 00:01:41.768 --> 00:01:45.906 this. I'm going to talk about how we can illustrate and 00:01:45.906 --> 00:01:51.044 classify the risk based on these tools. We're going to look at a 00:01:51.044 --> 00:01:55.482 selection of tools from Calli and Linux and while they're 00:01:55.482 --> 00:02:00.821 great tools and we use them on our tests, how they might have 00:02:00.821 --> 00:02:03.857 problems with regards to communication, security, and 00:02:03.857 --> 00:02:08.061 data storage. And provide some recommendations on how to change 00:02:08.061 --> 00:02:12.566 the practices to better secure these things. This talk is for 00:02:12.566 --> 00:02:16.203 penetration testers and those who hunt penetration testers. 00:02:16.203 --> 00:02:21.241 How many of you hunt penetration testers? There is more hands 00:02:21.241 --> 00:02:25.779 than penetration testers. I like that. Previously I discussed the 00:02:25.779 --> 00:02:30.183 vulnerabilities in the pony express phone plug. In that talk 00:02:30.183 --> 00:02:34.087 I warned people if they were buying pineapples in the vendor 00:02:34.087 --> 00:02:37.924 village somebody might find a bug and reck their pineapples 00:02:37.924 --> 00:02:43.964 and sure enough, the next year somebody did. We demoed those 00:02:43.964 --> 00:02:51.138 last year. It was a script running in my back off of a 00:02:51.138 --> 00:02:57.177 small TP linked router and one watt 90DBI and walking around 00:02:57.177 --> 00:03:02.616 autonomously popping these things. If you buy me a drink 00:03:02.616 --> 00:03:09.222 I'll show you the code for that. It was a PHP authentication 00:03:09.222 --> 00:03:16.396 bypass where it was being done in the footer of the PHP code 00:03:16.396 --> 00:03:20.500 for some reason. In general when we talk about this, it's not 00:03:20.500 --> 00:03:26.907 just physical devices, not just toys that you buy. It's the 00:03:26.907 --> 00:03:30.944 entire body of the tools that you're using that are software 00:03:30.944 --> 00:03:36.550 based. The standard operating procedures and how you handle 00:03:36.550 --> 00:03:40.987 data security. You have a lot of very valuable data as a 00:03:40.987 --> 00:03:46.526 penetration tester. You sort of 'em bred (audio blipped) extract 00:03:46.526 --> 00:03:52.566 out a bunch of stuff and generate a report and embarrass 00:03:52.566 --> 00:03:57.871 people and because that data is incredibly valuable, it has to 00:03:57.871 --> 00:04:02.109 do with personal information. It's going to be trade secrets 00:04:02.109 --> 00:04:06.413 and things like that. The value of the data that you're handling 00:04:06.413 --> 00:04:09.883 is very high. The awareness and understanding of the risks and 00:04:09.883 --> 00:04:12.219 vulnerabilities involved in these tools is fairly low. We 00:04:12.219 --> 00:04:16.723 understand how to figure out risk for a normal business and 00:04:16.723 --> 00:04:21.228 everything, but it seems like the training and books and 00:04:21.228 --> 00:04:24.498 material that we use to train ourselves up, those tools do not 00:04:24.498 --> 00:04:31.071 -- that training and material does not cover how to do it 00:04:31.071 --> 00:04:36.610 safely. The first thing you learn how to do is neck out a 00:04:36.610 --> 00:04:40.981 shell from a compromised host to yours. And a neck cat shell is 00:04:40.981 --> 00:04:47.687 tele net. That's the worst you can do. This is counter 00:04:47.687 --> 00:04:52.058 intuitive. You expect being a good penetration tester, you 00:04:52.058 --> 00:04:55.428 expect to be the smartest one in the room or the smartest one on 00:04:55.428 --> 00:05:00.000 the network and chances are you're not. You're the presumed 00:05:00.000 --> 00:05:03.703 expert of offense but you're not mindful of your own defenses. 00:05:03.703 --> 00:05:09.709 The reason is the training. The training material is focused on 00:05:12.646 --> 00:05:17.184 getting the lowest denominator as far as minimum pre-recs as 00:05:17.184 --> 00:05:21.855 possible into a training program to get them to the minimum point 00:05:21.855 --> 00:05:25.225 they need to start operating as a penetration tester. There is 00:05:25.225 --> 00:05:31.331 no time in a one-week course to spend on operational security or 00:05:31.331 --> 00:05:35.769 wrap things around encrypted tunnels. A lot of this they 00:05:35.769 --> 00:05:39.372 don't test, they don't teach in the classes and they don't write 00:05:39.372 --> 00:05:45.378 about it in the books. As the field matures and hopefully it 00:05:51.518 --> 00:05:54.221 will mature any day now, we need that. We need to treat that data 00:05:54.221 --> 00:06:02.162 more (audio blipped). The tool chain. I love Calli Linux and I 00:06:02.162 --> 00:06:09.603 use it. I use all the tools that are out there. But it's not a 00:06:09.603 --> 00:06:15.609 solid tool chain as far as end usage or usage are regards to 00:06:19.212 --> 00:06:24.217 security. There's a lack of documented instance. One last 00:06:24.217 --> 00:06:28.922 year with the Wi-Fi pineapples at DEFCON. But how many 00:06:28.922 --> 00:06:33.493 penetration testers get popped. There were for a time the 00:06:33.493 --> 00:06:39.499 anti-sect groups. I miss those guy, the ZFO ... Too young in oh 00:06:43.203 --> 00:06:49.209 my gosh. There is a lack of documented instances of security 00:06:54.014 --> 00:06:56.283 people getting hacked. So it's not a concern for me. So the 00:06:56.283 --> 00:06:59.085 idea here is when we lack the capability to understand our own 00:06:59.085 --> 00:07:02.756 tools we operate at the mercy of those that do. A lot of these 00:07:02.756 --> 00:07:06.459 devices, a classic example of that, the tool makes it easier. 00:07:06.459 --> 00:07:13.767 Automates the process, enables somebody to do these things. 00:07:13.767 --> 00:07:16.569 Without the underlying understanding of what is 00:07:16.569 --> 00:07:19.873 involved in doing this thing such as the man in the middle 00:07:19.873 --> 00:07:23.109 and Wi-Fi connection, without the understanding of that and 00:07:23.109 --> 00:07:28.014 the issues of how you interact with that device and what the 00:07:28.014 --> 00:07:32.085 other people on the network see, without that understanding the 00:07:32.085 --> 00:07:37.390 people that do understand it are going to wreck it. So to talk 00:07:37.390 --> 00:07:41.461 about this, we have to make assumptions about what a 00:07:41.461 --> 00:07:45.532 reasonable attack is, a realistic attack is. A lot of 00:07:45.532 --> 00:07:49.235 times the attack surface for penetration tester is not seen 00:07:49.235 --> 00:07:53.473 as something that's a serious vulnerability. A lot of times 00:07:53.473 --> 00:07:57.377 man in the middle attacks are given short shift. They're not 00:07:57.377 --> 00:08:01.848 seen as the most serious. It's not like I can hit you over the 00:08:01.848 --> 00:08:07.520 public internet and know your IP address, run MS8067 on you and 00:08:07.520 --> 00:08:10.990 pop you. I have to be in a certain place at a certain 00:08:10.990 --> 00:08:18.631 times. Those attacks are seen as being less severe. But in the 00:08:18.631 --> 00:08:22.102 case of a penetration tester it's not exactly the least 00:08:22.102 --> 00:08:26.706 realistic thing in the world. There is a good chance if you as 00:08:26.706 --> 00:08:30.143 a penetration tester are capable of getting into an organization 00:08:30.143 --> 00:08:33.480 remotely through whatever means you use, there is a good chance 00:08:33.480 --> 00:08:35.982 there is a guy already there that is not a penetration 00:08:35.982 --> 00:08:41.588 tester. That individual might be able to compromise you in the 00:08:41.588 --> 00:08:45.425 same sort of network domain as that. The assumptions here for 00:08:45.425 --> 00:08:47.927 this work is essentially an attacker may on the part with 00:08:47.927 --> 00:08:51.865 skills and resources that exceed the pentester. The bad guys are 00:08:51.865 --> 00:08:57.804 better than the pentester. The ideas behind this work and 00:08:57.804 --> 00:09:03.743 presenting this is we make and repair the [indiscernible]. If 00:09:03.743 --> 00:09:07.013 most penetration testers were aware of this sort of thing, 00:09:07.013 --> 00:09:12.585 they would work towards being mindful. And for the sake of 00:09:12.585 --> 00:09:17.724 addressing the man in the middle type situation, we have to 00:09:17.724 --> 00:09:22.395 assume that an attacker can be positioned physically or network 00:09:22.395 --> 00:09:26.132 wise convenient for the interception and modification of 00:09:26.132 --> 00:09:30.804 traffic. And if you're launching a penetration test across the 00:09:30.804 --> 00:09:35.942 internet, there is no telling how many hops between you and 00:09:35.942 --> 00:09:41.548 that target. And each one of those hops represents a point at 00:09:41.548 --> 00:09:45.752 which somebody with intercept that, somebody can change that. 00:09:45.752 --> 00:09:51.925 Man in the middle may not be a general script kitty thing, but 00:09:51.925 --> 00:09:56.095 an advance attacker is at least as skilled as the penetration 00:09:56.095 --> 00:10:00.433 tester. This is something reasonable. The value of the 00:10:00.433 --> 00:10:06.439 data makes it worth doing for an attacker. So the penetration 00:10:09.108 --> 00:10:12.111 tester is going to have multiple clients. They're going to be 00:10:12.111 --> 00:10:14.113 doing this over a long period of time. They're going to be going 00:10:14.113 --> 00:10:20.587 deep into organizations. So the pay back for compromising that 00:10:20.587 --> 00:10:26.926 is that you get to ride along with them. You get to ride along 00:10:26.926 --> 00:10:31.965 with them on future engagements if they're not securely wiping 00:10:31.965 --> 00:10:35.568 things. So the goals -- so basically the goal of doing this 00:10:35.568 --> 00:10:41.574 to somebody, so the victimology, who are you targeting? As an 00:10:43.643 --> 00:10:48.014 attacker I'm targeting the penetration tester or the 00:10:48.014 --> 00:10:52.118 clients themselves. For the penetration tester, it's a 00:10:52.118 --> 00:10:56.656 business just like any other. They have business information, 00:10:56.656 --> 00:11:01.761 compromise that. Sabotage, embarrassing leaks. ZFO type 00:11:01.761 --> 00:11:07.901 things. The client is the cool one, I think. So if I pop a 00:11:07.901 --> 00:11:11.371 penetration tester, then I have access to all of that client's 00:11:11.371 --> 00:11:14.207 sensitive information, the vulnerability that are in the 00:11:14.207 --> 00:11:17.944 systems and I can probably gain persistence in those systems as 00:11:17.944 --> 00:11:24.617 well. What is more, if I'm in a good situation, I'm really on my 00:11:24.617 --> 00:11:29.289 game as the bad, bad guy attacker, I can modify things in 00:11:29.289 --> 00:11:32.825 this penetration test. Maybe it looked like to the penetration 00:11:32.825 --> 00:11:38.164 tester that the exploit didn't work when in fact it did. And I 00:11:38.164 --> 00:11:43.202 stole it. Or perhaps I'm just stealthy and I collect all this 00:11:43.202 --> 00:11:49.075 information. This is either an attacker attacking a penetration 00:11:49.075 --> 00:11:55.448 tester, having a specific client in mind or riding along for a 00:11:55.448 --> 00:12:01.387 series of these engagements. So this is attractive. Targeting a 00:12:04.190 --> 00:12:08.161 client like this is way better. So even if you had the same 00:12:08.161 --> 00:12:12.198 vulnerabilities as the penetration tester, the same 00:12:12.198 --> 00:12:17.804 information, the same exploits, this is attractive to the tester 00:12:17.804 --> 00:12:21.007 because the penetration (audio blipped) culture and structure. 00:12:21.007 --> 00:12:25.979 This can help you. Instead of dealing with the help desk or 00:12:25.979 --> 00:12:32.885 the IT folks or the normal ways in, dealing with the penetration 00:12:32.885 --> 00:12:37.557 tester and compromising that is an alternative route. This is 00:12:37.557 --> 00:12:40.226 somebody that exists outside the culture and structure of the 00:12:40.226 --> 00:12:44.197 organization but winds up with ridiculous amounts of access to 00:12:44.197 --> 00:12:48.735 the system. They break policy by definition. Their job is to 00:12:48.735 --> 00:12:55.775 break policy. To break past all these measures. If you're riding 00:12:55.775 --> 00:12:58.911 along with a penetration tester you can do all these things, 00:12:58.911 --> 00:13:02.815 too, and it's not seen as strange. Ride along with them. 00:13:04.884 --> 00:13:08.321 You can steal tools and techniques. The assumption here 00:13:08.321 --> 00:13:12.358 is that the bad guys are better than the good guys and that 00:13:12.358 --> 00:13:16.262 anything that the penetration tester might have is probably 00:13:16.262 --> 00:13:22.335 not as good as the attacker has. Some people shell out the extra 00:13:22.335 --> 00:13:26.706 money for private exploits. Thieves of vulnerability 00:13:26.706 --> 00:13:32.311 information. Tools, licenses, things like that. And you can 00:13:32.311 --> 00:13:36.716 hide bugs from the testers and modify the results of the test. 00:13:36.716 --> 00:13:39.752 Just acts as a smoke screen. You come in with somebody who is 00:13:39.752 --> 00:13:43.990 probably very noisy and triggering every alert around 00:13:43.990 --> 00:13:50.229 there and you can avoid doing that yourself. The -- issues. 00:13:50.229 --> 00:13:56.069 Talking about the issues that you might have. So you're taught 00:13:56.069 --> 00:14:02.275 to find bugs or find known vulnerabilities in systems and 00:14:02.275 --> 00:14:05.511 you go out and research where the bugs are and download those 00:14:05.511 --> 00:14:09.582 exploits and everything. We all know about back doored exploits. 00:14:09.582 --> 00:14:15.188 That is pretty common. The shell code is a thing that spawns a 00:14:15.188 --> 00:14:19.492 shell on your system. It compromises the person that runs 00:14:19.492 --> 00:14:25.131 them. A lot of time ifs it's a memory corruption and it's shell 00:14:25.131 --> 00:14:29.435 code loaded into the system, that shell code is rarely 00:14:29.435 --> 00:14:33.639 annotated. You can see some people really good. They split 00:14:33.639 --> 00:14:37.944 off the strings and have an assembly line -- you don't know 00:14:37.944 --> 00:14:41.781 if that's where it assembles to unless you're really sharp. So 00:14:41.781 --> 00:14:45.451 those payloads are rarely annotated. The people using them 00:14:45.451 --> 00:14:51.457 are not equipped to evaluate them. How many penetration 00:14:53.526 --> 00:14:58.164 testers do you know that are sharp with assembly language? 00:14:58.164 --> 00:15:02.268 Not a whole lot. How many of those take the time to 00:15:02.268 --> 00:15:07.173 disassemble the code and make sure it does what it's doing? 00:15:07.173 --> 00:15:11.611 The comprehension is important. Most of the time if you're 00:15:11.611 --> 00:15:15.248 requiring a stand-alone exploit, you're doing so in desperation. 00:15:15.248 --> 00:15:20.987 There is no -- module for this one. You try to find whatever 00:15:20.987 --> 00:15:25.825 you can. You're happy when you find thing. And without 00:15:25.825 --> 00:15:30.363 discretion. You're so frustrated getting into the machine that 00:15:30.363 --> 00:15:33.266 you launch these without thinking about it. Maybe it does 00:15:33.266 --> 00:15:39.071 the attack, maybe it doesn't. Each encoded string in the 00:15:39.071 --> 00:15:44.710 exploit represents code nah the penetration tester has to fully 00:15:44.710 --> 00:15:48.581 understand or place trust by association with the source. I'm 00:15:48.581 --> 00:15:53.953 talking about exploit DB in a bit. It's a pretty trusted 00:15:53.953 --> 00:16:00.092 source for exploits. The way we interact with it is an issue. 00:16:00.092 --> 00:16:03.763 And this trust decision is forced. You have no choice. You 00:16:03.763 --> 00:16:07.934 succeed in the test or you don't. And so you're forced into 00:16:07.934 --> 00:16:11.437 this decision on code that you don't understand by a lack of 00:16:11.437 --> 00:16:13.506 training and skill and programming vulnerability 00:16:13.506 --> 00:16:17.376 analysis, exploit development. That is something that 00:16:17.376 --> 00:16:21.214 penetration testers don't get into until advanced classes if 00:16:21.214 --> 00:16:26.452 ever. From an early draft of the paper that I submitted for this, 00:16:26.452 --> 00:16:32.558 at the time that I wrote it, the DB, it operated over plan HTTP. 00:16:32.558 --> 00:16:38.564 The way Calli pulled updates was HTTP. The man in the middle 00:16:58.951 --> 00:17:02.555 could replace that code. Now it's HTTPS by default. The most 00:17:02.555 --> 00:17:06.592 recent Calli seems to pull it down over the app servers so 00:17:06.592 --> 00:17:09.896 that is more secure. So kudos. Then your trust is not in the 00:17:09.896 --> 00:17:13.232 network between you and DB, it's whoever is embedding the code 00:17:13.232 --> 00:17:20.306 there. You're a little safer there. Exploit DB did all they 00:17:20.306 --> 00:17:25.544 can. With the exploitation of the system, when running exploit 00:17:25.544 --> 00:17:29.949 against the system, how do you compromise the system without 00:17:29.949 --> 00:17:34.287 everyone in visibility knowing how you compromise that system. 00:17:34.287 --> 00:17:41.527 How do you establish, how do you trade that secret sauce of 00:17:41.527 --> 00:17:45.765 exploit code and payload with that unwitting system without 00:17:45.765 --> 00:17:48.634 everybody knowing how you compromised the system? There is 00:17:48.634 --> 00:17:51.604 mechanisms for securing your communications after you're on 00:17:51.604 --> 00:17:55.207 the system, but that initial exploitation it's like Alice and 00:17:55.207 --> 00:17:59.011 Bob but Bob doesn't know that he wants to communicate or know he 00:17:59.011 --> 00:18:01.781 is about to communicate. How do you establish secrets with him? 00:18:05.084 --> 00:18:08.521 And if you do have a good secure payload, how do you keep it from 00:18:08.521 --> 00:18:12.792 being modified in transit? Who knows. The idea here as far as I 00:18:12.792 --> 00:18:20.199 can tell is to exploit the target as close to the target 00:18:20.199 --> 00:18:25.438 (audio blipped) to reduce that exposure. So ship an appliance 00:18:25.438 --> 00:18:29.342 to the client, DPM into ha and launch the exploits from that. 00:18:29.342 --> 00:18:35.748 It's not as realistic as simulating an ATP against an 00:18:35.748 --> 00:18:43.155 organization but it's safer. Reduces the exposure. So -- the 00:18:43.155 --> 00:18:46.592 gold standard. The most versatile free payload you can 00:18:46.592 --> 00:18:52.598 ever find for any exploit is Meterprete re. Since 2009 it 00:18:54.767 --> 00:18:58.537 supported encryption. I have been shown shots of tools that 00:18:58.537 --> 00:19:04.477 can intercept. There is encryption in there but you have 00:19:07.880 --> 00:19:10.149 to wonder, if you're establishing the keys, when are 00:19:10.149 --> 00:19:15.955 the keys establish. It has to be after code is executing. There 00:19:15.955 --> 00:19:20.626 is this whole stage of set thing and setting up code execution 00:19:20.626 --> 00:19:24.930 before Meterpreter executes. This is mostly for evasion. To 00:19:24.930 --> 00:19:31.037 prevent IDS signatures from tracking in on Meterpreter 00:19:31.037 --> 00:19:37.043 packets. Otherwise how to you secure that. Extending the 00:19:40.479 --> 00:19:43.182 network. If you're a physical penetration tester and going on 00:19:43.182 --> 00:19:46.619 site and dropping the Wi-Fi pineapple or land turtle, 00:19:46.619 --> 00:19:51.023 whatever it is you're going to drop on the network, you have to 00:19:51.023 --> 00:19:54.226 be very concerned about extending the network. Our 00:19:54.226 --> 00:20:00.699 university IT folks get nervous when I extended the network by 00:20:00.699 --> 00:20:06.639 adding switches or routers or device they don't know about. 00:20:06.639 --> 00:20:10.276 Every time you do that you're adding to your attack surface. 00:20:13.479 --> 00:20:17.650 You're trying to alert people in on open Wi-Fi. There is not much 00:20:17.650 --> 00:20:23.656 good setting up WPA2 (ph.) to connect to. Cellular data. That 00:20:25.891 --> 00:20:28.694 is probably about the safest way to have a back channel into the 00:20:28.694 --> 00:20:34.333 network. SMS is good. These are the accessible things like rogue 00:20:34.333 --> 00:20:39.705 Wi-Fi and extra network cables running around. Those might open 00:20:39.705 --> 00:20:44.577 up attack surface. So that goes back to the Wi-Fi pineapple 00:20:44.577 --> 00:20:50.349 bugs. When we talk about data at risk, there is - so there's 00:20:50.349 --> 00:20:53.352 (audio blipped) stored in the process of this. I like to 00:20:53.352 --> 00:20:55.921 record engagements. I like to take lots of Screenshots for the 00:20:55.921 --> 00:20:59.291 reports afterwards. You only do one or two engagements where you 00:20:59.291 --> 00:21:03.762 don't document as you go and think you can write it up later 00:21:03.762 --> 00:21:09.668 and then you forget what you did and you have to do it all over 00:21:09.668 --> 00:21:14.373 again. You're storing a lot of sensitive information about a 00:21:14.373 --> 00:21:20.379 client. Where are you storing that? On the end point server or 00:21:24.784 --> 00:21:31.524 on the CalliVM with the password. On encrypted volume. 00:21:31.524 --> 00:21:36.729 It's not secure by default. Are the implanted devices storing 00:21:36.729 --> 00:21:42.735 sensitive data? Are they secure. Are you encrypting the data. 00:21:44.970 --> 00:21:48.641 Encrypting the volume and who has access to the keys and when 00:21:48.641 --> 00:21:52.244 do you delete the data. If you're going from engagement to 00:21:52.244 --> 00:21:55.781 engagement you're not wiping the system. You have the pentesting 00:21:55.781 --> 00:22:01.720 laptop and have an array of devices and whenever you're done 00:22:04.657 --> 00:22:09.762 with one engagement you RMF the folder with the client data 00:22:09.762 --> 00:22:14.834 hopefully. You can recover that later. Maybe you don't delete at 00:22:14.834 --> 00:22:20.839 all. You archive it. So in 6 months when you come back you 00:22:20.839 --> 00:22:26.846 have the old information. What do you keep and how long do you 00:22:26.846 --> 00:22:30.950 keep it. And point of contact. You have your get out of jail 00:22:30.950 --> 00:22:34.420 free card. The emergency contacts. Crap I knocked over 00:22:34.420 --> 00:22:40.659 the main server. Sorry. They're losing money constantly until 00:22:40.659 --> 00:22:43.963 it's back up. You have that emergency contact in there that 00:22:43.963 --> 00:22:45.965 you call when you get into trouble or get them into 00:22:45.965 --> 00:22:52.004 trouble. So this is how you set up the scope of a test. This is 00:22:52.004 --> 00:22:55.074 how you deliver your report. These channels need to be 00:22:55.074 --> 00:23:01.547 secure. You don't need to email the pen test report over plain 00:23:01.547 --> 00:23:06.652 text email. Are you going to teach them to use PGP? I don't 00:23:06.652 --> 00:23:10.990 know. You go and deliver by hand. This is the first slide 00:23:10.990 --> 00:23:17.396 with color in it for those watching on the TV. Classifying 00:23:17.396 --> 00:23:21.533 tool safety. I went through a small sampling of tools in Calli 00:23:21.533 --> 00:23:27.539 and ranked them on terms of how safe they are. These are not 00:23:27.539 --> 00:23:31.944 saying if this tool is red, dangerous, do not use it. 00:23:31.944 --> 00:23:35.814 Obviously do not. Use what you need to complete the job. You 00:23:35.814 --> 00:23:38.984 have to be mindful. Something that is dangerous, it may cause 00:23:38.984 --> 00:23:42.554 known vulnerabilities or the communications it has are 00:23:42.554 --> 00:23:48.560 subject to interceptor modification. And yellow is 00:23:48.560 --> 00:23:54.133 caution. Things that defaults lead to dangerous situations but 00:23:54.133 --> 00:23:58.637 it's easy to configure this thing to not be insecure or 00:23:58.637 --> 00:24:01.674 things that are essentially naturally safe. Safe for normal 00:24:01.674 --> 00:24:05.177 use, safe for normal configuration. And tools that 00:24:05.177 --> 00:24:09.548 didn't fit into this model that are not necessarily pentesting 00:24:09.548 --> 00:24:14.420 tools but they can improve the security of the other tools. 00:24:14.420 --> 00:24:18.657 This classification is not perfect. It's not a formalized 00:24:18.657 --> 00:24:24.963 model or anything like that. And one thing that I did not take 00:24:24.963 --> 00:24:29.902 into consideration is how saved results are stored. So few 00:24:29.902 --> 00:24:33.872 penetration testing tools make any attempt to save the data 00:24:33.872 --> 00:24:38.143 that we don't consider it here. It's down to use to use 00:24:38.143 --> 00:24:41.480 encrypted file systems. If you're using a small device off 00:24:41.480 --> 00:24:45.451 a battery that can't cope with an encrypted file system, I 00:24:45.451 --> 00:24:51.357 don't know what to tell you. This is reproduced in the 00:24:51.357 --> 00:24:55.260 report, in the paper that is on the disk. Don't worry about 00:24:55.260 --> 00:24:59.932 reading this. I wanted to put the table in to show you the 00:24:59.932 --> 00:25:04.069 idea. The top one is one of my favorite tools. Your hooked 00:25:04.069 --> 00:25:08.774 clients on beef are communicating over the 00:25:08.774 --> 00:25:16.115 unencrypted HTTP. I'm not that smart on using it. Perhaps there 00:25:16.115 --> 00:25:22.121 is a good way to change it. But by default and by normal 00:25:24.823 --> 00:25:28.060 configuration, they're communicating unencrypted with 00:25:28.060 --> 00:25:32.231 your server. And this may not be an additional concern in some 00:25:32.231 --> 00:25:37.202 situations because you acquired them over an unencrypted 00:25:37.202 --> 00:25:40.839 channel. You're not doing more things with them than the web 00:25:40.839 --> 00:25:44.710 application originally did. You have to be very careful. And 00:25:44.710 --> 00:25:51.350 then other tools, those are not necessarily opening up a 00:25:51.350 --> 00:25:54.620 vulnerability but they are leaking data over public 00:25:54.620 --> 00:25:59.558 networks and things. So you have to use those with care. And 00:25:59.558 --> 00:26:04.596 finally if we go down to the one naturally safe one on that 00:26:04.596 --> 00:26:09.067 table, N cat. It's net cat but with cell support that is very 00:26:09.067 --> 00:26:14.440 easy to use. Use that instead of net cat. No reason not to. Set 00:26:14.440 --> 00:26:19.845 the certificates for it and you're good to go. Implantable 00:26:19.845 --> 00:26:23.048 devices. Buying in the vendor village. Two years ago and I 00:26:23.048 --> 00:26:29.054 typo'd that. That is supposed to be DEFCON 21 there. But in 00:26:31.790 --> 00:26:37.796 DEFCON 21, I released a series of vulnerabilities in the pony 00:26:40.632 --> 00:26:44.536 express phone plug and I triggered, I used a crafted 00:26:44.536 --> 00:26:48.040 packet to trigger a scripting vulnerability in the web 00:26:48.040 --> 00:26:52.945 interface which then injected -- commands and wreck the whole 00:26:52.945 --> 00:26:58.951 thing. I had a nice pony express route kit going. Last year was 00:27:01.420 --> 00:27:06.191 the hat five Wi-Fi pineapple vulnerabilities. They have 00:27:06.191 --> 00:27:13.265 improved that device remarkably over the past year. They patched 00:27:13.265 --> 00:27:18.437 that. Patched a few other vulnerabilities. They even got 00:27:18.437 --> 00:27:24.409 it into a thing where they developed a secure way of 00:27:24.409 --> 00:27:27.346 setting up the device. You were just sitting out there in the 00:27:27.346 --> 00:27:30.582 open until you could quickly push the buttons to configure 00:27:30.582 --> 00:27:33.719 the way you wanted it before somebody came in with pineapples 00:27:33.719 --> 00:27:39.691 dot DY. They had it where you punch in a sequence of lights 00:27:39.691 --> 00:27:45.497 that were on the device blinking and tell it what the pattern 00:27:45.497 --> 00:27:49.234 was. That was easy to brute force. Now you set dip switches 00:27:49.234 --> 00:27:53.038 on it in a certain sequence. So you can't own the thing until 00:27:53.038 --> 00:27:59.144 it's fully configured. They worked hard on getting this up 00:27:59.144 --> 00:28:05.484 and going good. There are a couple new vulnerabilities 00:28:05.484 --> 00:28:11.123 (audio blipped) patched in the latest version of the firmware, 00:28:11.123 --> 00:28:18.030 he has a cool network based worm that's pretty cool that he uses 00:28:18.030 --> 00:28:22.401 to demo this. And today I'm going to demo a simple 00:28:22.401 --> 00:28:26.204 communication security man in the middle attack against it. 00:28:26.204 --> 00:28:30.309 The clone devices. There are lots of things you can buy that 00:28:30.309 --> 00:28:34.179 have the same -- they have the Wi-Fi pineapple tools ripped off 00:28:34.179 --> 00:28:38.216 and put in. Those are way worse. They don't get patched. So those 00:28:38.216 --> 00:28:44.756 are bad. Stuff that uses some of the pony express code. They 00:28:44.756 --> 00:28:49.027 don't get updates. It's a single person's project and they 00:28:49.027 --> 00:28:55.000 abandon it immediately. And even the older devices, the older 00:28:55.000 --> 00:28:58.737 Wi-Fi pineapple devices don't see updates either. Any bugs in 00:28:58.737 --> 00:29:02.441 those are likely to remain there. There is inherent 00:29:02.441 --> 00:29:06.178 problems with these low-powered devices that you have to be 00:29:06.178 --> 00:29:09.681 careful about. They're not doing things like defaulting to SSL 00:29:09.681 --> 00:29:15.621 and they're trying to conserve the power instead of using it to 00:29:15.621 --> 00:29:21.727 lock stuff down. Here is new pineapple stuff. That's a URL I 00:29:21.727 --> 00:29:28.767 released yesterday so folks can go on hunting expeditions. The 00:29:28.767 --> 00:29:34.206 network situation was getting kind of rough. There are a few 00:29:34.206 --> 00:29:37.576 of them popping up. So I released that. I'm not running 00:29:37.576 --> 00:29:43.215 around with a backpack, Wi-Fi pineapples like I did last year, 00:29:43.215 --> 00:29:49.187 that is y'all's job now. The script we have on this site is 00:29:49.187 --> 00:29:54.793 not completely weaponized. It demos it. It doesn't 00:29:54.793 --> 00:29:59.231 autonomously seek and destroy and the payload is just adding a 00:29:59.231 --> 00:30:06.738 user. Modify the code to do as you please. And use the I hunt 00:30:06.738 --> 00:30:12.310 -- y'all hunt pineapples tag to report your successes so that we 00:30:12.310 --> 00:30:19.418 can all point and laugh, right. So we're going to demo this. We 00:30:19.418 --> 00:30:24.923 can't have nice things, right. We can't have nice things 00:30:24.923 --> 00:30:29.761 because I can't turn on my Wi-Fi pineapple up here without one of 00:30:29.761 --> 00:30:34.633 you hacking it before I get a chance to demo it. So Sergi 00:30:34.633 --> 00:30:40.639 distract them while I hook this thing up via wired. I have a 00:30:45.077 --> 00:30:48.714 wired interface to the pineapple under me. Trust me it works 00:30:48.714 --> 00:30:55.887 across the interfaces. With a Wi-Fi pineapple you have a 00:30:55.887 --> 00:31:00.726 couple of wireless interfaces and wired interface. Logically 00:31:00.726 --> 00:31:07.599 you have the WPA2 network that is operator is configuring the 00:31:07.599 --> 00:31:13.805 device over and then you have an open network or series of open 00:31:13.805 --> 00:31:19.277 networks that is bringing in victims and you have a wired 00:31:19.277 --> 00:31:23.115 interface, up linker. All of these interfaces are bridged 00:31:23.115 --> 00:31:26.818 together and everybody on every interface gets an IP address on 00:31:26.818 --> 00:31:33.959 the same sub net. It's trivial to these folks. We can take a 00:31:33.959 --> 00:31:39.598 quick look at the code for that. If you go and grab it you get 00:31:39.598 --> 00:31:45.270 this. You get some information on how to use it. Places to put 00:31:45.270 --> 00:31:51.276 in automation. The idea is we set up spoofing between the 00:31:54.246 --> 00:31:56.848 pineapple itself and the operator. We're doing this from 00:31:56.848 --> 00:32:00.685 the open Wi-Fi interface or any interface on this. Make sure 00:32:00.685 --> 00:32:04.122 it's a Wi-Fi pineapple and not the official DEFCON. We sniff 00:32:04.122 --> 00:32:08.660 for the session cookie and CRF token and use that to insert 00:32:08.660 --> 00:32:14.666 commands. So it all happens very quickly. And so we have the 00:32:17.169 --> 00:32:24.976 Wi-Fi pineapple, I'm the jackass here trying to spoof network for 00:32:24.976 --> 00:32:29.581 everybody. I'm not actually doing that. Here I am playing 00:32:29.581 --> 00:32:35.587 around, laughing at people at Starbucks. And then on this 00:32:39.891 --> 00:32:45.096 side, hopefully I still have -- yes, I'm a victim. Or I'm a bad 00:32:45.096 --> 00:32:47.666 guy who is pretending to be a victim and I'm on the same 00:32:47.666 --> 00:32:53.505 network. I want to figure out who the operator is. The easiest 00:32:53.505 --> 00:32:59.344 way to do that is to do a broadcast ping out to the 00:32:59.344 --> 00:33:03.315 broadcast (audio blipped) and see who responds. So there are 00:33:03.315 --> 00:33:09.321 cleaner ways of doing this, but whatever. And of course 131 is 00:33:09.321 --> 00:33:11.790 the IP address of the operator. If you have multiple people 00:33:11.790 --> 00:33:14.526 responding, go with the lowest number. The first guy there is 00:33:14.526 --> 00:33:20.599 going to be the one. And if we run y'all hunt pineapples with 00:33:20.599 --> 00:33:25.470 no information it gives usage. Give it an interface and an 00:33:25.470 --> 00:33:31.810 operator IP address. Y'all hunt pineapples. (audio blipped) over 00:33:31.810 --> 00:33:37.082 the wired right. Boring, lame. But now we're going to target 00:33:37.082 --> 00:33:43.088 the operator. And this happens fast. I'm telling you. And we're 00:33:45.223 --> 00:33:51.229 in. Boom. So to recap the output. It figures out the gate 00:33:54.432 --> 00:34:00.705 way. Does it look like a pineapple. It looks for the 00:34:00.705 --> 00:34:06.478 Wi-Fi pineapple logo. Yep, trying this. Looks like it. 00:34:06.478 --> 00:34:11.283 Turns on IP porting. Sets up the poisoning. Looks for the cookie. 00:34:11.283 --> 00:34:17.822 There is always stuff going on back and forth between the web 00:34:17.822 --> 00:34:21.126 browser and the pineapple itself. And so they don't have 00:34:21.126 --> 00:34:23.495 to be interactive, they just have to have something up. It 00:34:23.495 --> 00:34:27.766 immediately finds the (audio blipped) and grabs the token and 00:34:27.766 --> 00:34:34.005 tears down the IP forwarding because it doesn't need it. Runs 00:34:34.005 --> 00:34:40.011 the payload that adds R00T user to the device. And then sets you 00:34:42.013 --> 00:34:46.918 up with an SSH connection where you're in. Fantastic. From here 00:34:46.918 --> 00:34:53.425 you just destroy the thing or something, or leave a nasty 00:34:53.425 --> 00:34:58.129 message. My favorite payload that somebody did is turned off 00:34:58.129 --> 00:35:03.668 IPD4 support so the person has to start learning IPD6. That's 00:35:03.668 --> 00:35:10.275 good. Be creative. Don't be as mean as I was last year. That 00:35:10.275 --> 00:35:16.281 was pretty rude. So that was my demo. My recommendations for 00:35:19.017 --> 00:35:22.287 this, you can tell this bottle of anti-acids is mostly empty. 00:35:22.287 --> 00:35:25.423 Just check 6. Be aware of the network and what you're 00:35:25.423 --> 00:35:31.429 transmitting and how valuable that information is versus the 00:35:36.401 --> 00:35:40.105 likely skill level of the attackers. Test your skills 00:35:40.105 --> 00:35:45.377 before operational use. Have a virtual network of EX server. 00:35:45.377 --> 00:35:50.615 Don't just throw things to the client that you downloaded. 00:35:50.615 --> 00:35:54.252 Reverse engineer those and figure out how they work. If you 00:35:54.252 --> 00:35:58.590 don't know how to do that, learn. Be aware of the exposed 00:35:58.590 --> 00:36:02.427 information and know the target environment. Minimize it. Keep 00:36:02.427 --> 00:36:09.768 the client data safe both at rest and in transit. Delete it 00:36:09.768 --> 00:36:14.372 between engagements. It's tempting to keep it around but 00:36:14.372 --> 00:36:20.445 unless you can be sure that you can do it securely, delete it. 00:36:20.445 --> 00:36:24.482 Secure that information with the client. Don't turn in the report 00:36:24.482 --> 00:36:32.023 over plain HTTP or plain email. Stay alert and as a community we 00:36:32.023 --> 00:36:36.828 have to improve the way we train penetration testers. We have to 00:36:36.828 --> 00:36:39.898 improve the education and instruction on this. If you have 00:36:39.898 --> 00:36:44.302 penetration testers that have the capability of doing this. So 00:36:44.302 --> 00:36:48.106 post exploitation you need a focus on establishing secure 00:36:48.106 --> 00:36:55.547 channels and infiltration. So the contribution and hopes and 00:36:55.547 --> 00:37:00.518 dreams, reduce client exposure, improve tools and training and 00:37:00.518 --> 00:37:04.422 the maturity and advancement of penetration testing. I'm not 00:37:04.422 --> 00:37:07.192 holding my breath on that but give it a shot. I'm not telling 00:37:07.192 --> 00:37:12.330 you to do shots. Maybe it's early for that. But take a shot 00:37:12.330 --> 00:37:19.838 at improving this. And so, do we have time? We have time. Talk to 00:37:19.838 --> 00:37:24.576 him about the land turtle as a bonus. Wi-Fi, hack five guys 00:37:24.576 --> 00:37:28.146 that created the Wi-Fi pineapple. They have a new 00:37:28.146 --> 00:37:32.684 device that I like. It's called a land turtle and it is a USB to 00:37:32.684 --> 00:37:36.821 ethernet adapter and presents its as one on the computer. But 00:37:36.821 --> 00:37:42.660 on the other end it's a separate interface and you the guts of a 00:37:42.660 --> 00:37:46.765 Wi-Fi pineapple without the Wi-Fi. Managed over SSH so that 00:37:46.765 --> 00:37:50.335 is cool as far as security. And it gives you man in the middle 00:37:50.335 --> 00:37:55.006 and persistent access with a very small device. It does a lot 00:37:55.006 --> 00:37:58.409 of things that the pony express would do but it's 50 bucks 00:37:58.409 --> 00:38:02.947 instead of a lot. I highly recommend picks one of these up, 00:38:02.947 --> 00:38:09.120 because they seem like a lot of fun. The day this thing came out 00:38:09.120 --> 00:38:14.592 I'm like, ha ha, I like land turtles. I was on my phone in a 00:38:14.592 --> 00:38:17.729 meeting and didn't have the computer on me. This is the 00:38:17.729 --> 00:38:21.065 process that I went through when this thing came out. Found the 00:38:21.065 --> 00:38:27.906 website. That looks cool. That's the device there. Google up the 00:38:27.906 --> 00:38:33.912 land turtle files. GitHub. This is like the delta between the 00:38:37.248 --> 00:38:44.289 base insulation and the land turtle and dive down into the 00:38:44.289 --> 00:38:48.426 user bin turtle update or whatever it was. The update 00:38:48.426 --> 00:38:54.832 script and this is the first place to go. Immediately running 00:38:54.832 --> 00:39:00.872 over HTTP and what it's doing on that secondary is grabbing a dot 00:39:00.872 --> 00:39:07.745 update file and then piping it ash. And so this kind of gets 00:39:07.745 --> 00:39:12.083 scary right here. This is where things get sketchy. What is in 00:39:12.083 --> 00:39:17.088 that dot update file? A script for updating device. The update 00:39:17.088 --> 00:39:20.592 process grabs the new update script that grabs the device. 00:39:20.592 --> 00:39:26.598 This has the hash values and location. This gives them 00:39:26.598 --> 00:39:31.903 flexibility on the update process but in general this is a 00:39:31.903 --> 00:39:35.974 very, very scary way of doing it. And a lot can go wrong here. 00:39:35.974 --> 00:39:39.377 For starters they know about this problem, when I told them 00:39:39.377 --> 00:39:42.680 about it, I just dropped it right there on Twitter and they 00:39:42.680 --> 00:39:48.286 were like, yeah, this is No. 1 on our tracker. We didn't have 00:39:48.286 --> 00:39:54.759 SSL so that is why it was like it. It's going to be fixed in 00:39:54.759 --> 00:39:58.529 probably the next revision. It's still a little scary. You have 00:39:58.529 --> 00:40:01.532 this HTTPS server that is serving you up a script that you 00:40:01.532 --> 00:40:06.337 just run. I was talking with them, I think there is probably 00:40:06.337 --> 00:40:10.408 some way of having digital signatures for these instead of 00:40:10.408 --> 00:40:13.578 verifying hash values that you get from somewhere. There is 00:40:13.578 --> 00:40:18.449 probably a way of signing things on these devices that would 00:40:18.449 --> 00:40:24.188 help. But how do you update the ones that are already out there. 00:40:24.188 --> 00:40:29.494 A Jesus take the wheel moment where everyone has to trust one 00:40:29.494 --> 00:40:34.332 update. That happens a lot in penetration testing. You just -- 00:40:34.332 --> 00:40:38.770 Jesus take the wheel. So it's scary but it's a really cool 00:40:38.770 --> 00:40:44.776 device. There seems to be a lot of focus on security these 00:40:54.886 --> 00:40:59.324 things and giving me a hard time and everything with each 00:40:59.324 --> 00:41:04.562 individual update. But they're good guys and it seems like this 00:41:04.562 --> 00:41:10.335 is a really cool device and I look forward to playing with 00:41:10.335 --> 00:41:16.107 mine. I'm going to be around. Ask me questions. There is a 00:41:16.107 --> 00:41:22.146 paper on the CD. This is my contact information. Hit me up. 00:41:22.146 --> 00:41:25.883 Ladies and gentlemen, please exit out the rear doors only, 00:41:25.883 --> 00:41:27.885 thank you.