1 00:00:00,000 --> 00:00:05,920 Okay, good morning everyone. It is now 10.59 in beautiful Las Vegas, Nevada. 2 00:00:07,840 --> 00:00:11,920 Thank you so much for spending your Saturday morning with us here at the Packet Hacking Village. 3 00:00:12,380 --> 00:00:18,100 There are many opportunities around here. We got Capture the Packet going on right now. 4 00:00:18,520 --> 00:00:22,940 We have the Wall of Sheep. We have the Packet Detective in the back corner. 5 00:00:23,420 --> 00:00:28,860 We have Emerging Technology Booth in the back. And right next to it is our DJ booth. 6 00:00:30,000 --> 00:00:33,800 And it is now the top of the hour, 11 a.m. here. 7 00:00:34,380 --> 00:00:37,720 And we have the second speaker workshop. 8 00:00:38,340 --> 00:00:42,340 And this speaker workshop, I know a lot of people are looking forward to. 9 00:00:44,620 --> 00:00:49,020 Oh boy. At any rate, please feel free to make yourself a home. 10 00:00:49,060 --> 00:00:51,720 Are there any empty seats? I can't see through the light. 11 00:00:52,480 --> 00:00:54,500 Okay, please make yourself a home. 12 00:00:54,840 --> 00:00:59,300 For now, it is absolutely my pleasure to introduce to you our next speaker. 13 00:00:59,300 --> 00:01:02,080 Who will be talking about Monkeys in the Middle. 14 00:01:02,800 --> 00:01:05,760 Okay. Ladies and gentlemen, Bob Simpson, everyone. 15 00:01:22,900 --> 00:01:25,460 Alright, maybe we're good to go. Excellent. 16 00:01:26,400 --> 00:01:28,980 So yeah, I'm glad Ming said Monkeys in the Middle. 17 00:01:29,300 --> 00:01:32,480 Because Man in the Middle is a sexist term. It was created a long time ago. 18 00:01:32,640 --> 00:01:36,360 We should never, ever use it again until my next slide. 19 00:01:36,560 --> 00:01:42,000 So I apologize for that in advance. I'll make the next presentation better. 20 00:01:42,840 --> 00:01:46,680 So it starts with, who am I? 21 00:01:46,860 --> 00:01:50,060 And basically, I'm just a security researcher on the side. 22 00:01:50,240 --> 00:01:53,460 My day job, I'm a CIO for an accounting firm. 23 00:01:53,660 --> 00:01:59,280 And we actually use Man in the Middle techniques to create a capitalization. 24 00:01:59,300 --> 00:02:03,480 It's a sort of portal for a small segment of our audience and market a product to them. 25 00:02:03,600 --> 00:02:10,840 So Man in the Middle can actually be used for profit other than the type of profit we generally talk about on this stage, right? 26 00:02:11,920 --> 00:02:14,560 So what is Man in the Middle? Or Monkey in the Middle, sorry. 27 00:02:16,020 --> 00:02:21,580 There's a number of different acronyms that are used to describe it. 28 00:02:21,680 --> 00:02:25,160 But more or less, what you need to know is it's not just sniffing, right? 29 00:02:25,240 --> 00:02:28,340 You've got to sniff some packets, but that's not what it's all about. 30 00:02:29,300 --> 00:02:33,960 And if I were talking to, you know, I'm going to jump down to the illustration here. 31 00:02:34,060 --> 00:02:36,340 Alice and Bob are speaking, right? 32 00:02:36,420 --> 00:02:39,020 I'm speaking with Alice here. I'm Bob, obviously. 33 00:02:39,960 --> 00:02:42,820 I'm speaking with Alice here. Nice beard, by the way. I love it. 34 00:02:44,620 --> 00:02:50,140 So anything I say to Alice, you potentially could hear as long as you've got good ears, right? 35 00:02:50,300 --> 00:02:52,700 So I'm saying, hey, Alice, let's go out tonight, right? 36 00:02:53,660 --> 00:02:55,480 Fine. Now you know I'm going out tonight. 37 00:02:55,700 --> 00:02:57,560 Let's go to that place we went last night, right? 38 00:02:57,860 --> 00:02:59,140 Cool. All right. We're on. 39 00:03:00,060 --> 00:03:01,060 Now what do you know? 40 00:03:01,760 --> 00:03:02,820 You don't know nothing. 41 00:03:03,280 --> 00:03:07,760 You don't know where we're going because you don't know where we went last night, right? 42 00:03:07,920 --> 00:03:13,520 So sniffing helps, but it doesn't always give you what you need to really get where you're going. 43 00:03:17,740 --> 00:03:20,320 There's a slide here somewhere that shows the wall of sheep. 44 00:03:20,500 --> 00:03:21,520 We'll get to it. 45 00:03:21,760 --> 00:03:24,100 And, you know, ultimately, that's your goal, right? 46 00:03:24,180 --> 00:03:24,580 Ownage. 47 00:03:24,740 --> 00:03:27,820 You know, another name on the wall of sheep. 48 00:03:28,020 --> 00:03:28,980 That's what we're trying. 49 00:03:29,300 --> 00:03:30,980 That's what we're trying for whenever we talk man in the middle. 50 00:03:31,140 --> 00:03:32,300 Sometimes you can sniff it. 51 00:03:32,360 --> 00:03:33,220 Sometimes you can't. 52 00:03:33,220 --> 00:03:34,400 So you've got to be smart about it. 53 00:03:35,060 --> 00:03:37,280 So we're actually going to do a demo right now. 54 00:03:38,660 --> 00:03:40,260 This is a non-technical demo. 55 00:03:40,760 --> 00:03:45,020 This is one you might do in the SE class, except we're going to be talking pseudo packets. 56 00:03:46,280 --> 00:03:48,020 So back to the same conversation. 57 00:03:48,360 --> 00:03:49,320 I'm Bob. 58 00:03:49,540 --> 00:03:50,220 You're Alice. 59 00:03:50,700 --> 00:03:54,620 I say to Alice, hey, you want to go to that place we went last night? 60 00:03:54,780 --> 00:03:56,380 You said it was fun, right? 61 00:03:57,500 --> 00:03:58,600 Now, here's the part. 62 00:03:58,600 --> 00:04:00,320 You've probably already all thought of. 63 00:04:00,860 --> 00:04:03,040 Y'all are going to be Mallory, right? 64 00:04:03,120 --> 00:04:07,280 Mallory is the person in the middle, the monkey in the middle, the man in the middle. 65 00:04:08,380 --> 00:04:14,720 In this case, you're all going to participate and answer for Alice, right? 66 00:04:14,880 --> 00:04:16,180 You got one or two responses. 67 00:04:17,720 --> 00:04:19,240 One is that's what he said. 68 00:04:20,240 --> 00:04:22,000 The other one is that's what she said. 69 00:04:22,380 --> 00:04:23,340 I'll let you pick. 70 00:04:23,540 --> 00:04:24,680 I mean, it's up to you, right? 71 00:04:24,800 --> 00:04:26,320 So let's try this out. 72 00:04:26,360 --> 00:04:27,340 We're going to try it again with. 73 00:04:27,480 --> 00:04:28,500 I want to go to that fun. 74 00:04:28,500 --> 00:04:29,760 Place again tonight. 75 00:04:30,660 --> 00:04:31,460 And you say. 76 00:04:33,420 --> 00:04:35,100 It's it's unclear, right? 77 00:04:35,220 --> 00:04:36,980 So, OK, well, we'll try the next one. 78 00:04:38,180 --> 00:04:40,780 Because they answered for you, I didn't hear what you said. 79 00:04:40,920 --> 00:04:43,280 So I'm like, I got to clarify here, right? 80 00:04:43,320 --> 00:04:44,700 I really do want to go somewhere. 81 00:04:45,120 --> 00:04:45,520 So. 82 00:04:46,960 --> 00:04:49,640 I say, hey, remember, you said it was so much fun. 83 00:04:49,740 --> 00:04:54,300 You wanted to go every night, even though it was kind of dark and hard to get into. 84 00:04:56,700 --> 00:04:57,100 Yeah. 85 00:04:57,240 --> 00:04:57,640 Yeah. 86 00:04:58,500 --> 00:05:02,120 I'm getting where I'm going and you all have dirty minds, so. 87 00:05:03,280 --> 00:05:06,500 The next step is obviously I still didn't hear you. 88 00:05:06,920 --> 00:05:10,160 And this is something Tony actually mentioned to me before I entered the stage. 89 00:05:10,440 --> 00:05:14,280 You know, sometimes the first or the first authentication is fine. 90 00:05:14,620 --> 00:05:15,840 Second one's fine. 91 00:05:16,060 --> 00:05:17,260 Third one might be fine. 92 00:05:17,420 --> 00:05:20,180 But at some point you can break these things down, right? 93 00:05:20,440 --> 00:05:21,860 If you jack with it. 94 00:05:22,920 --> 00:05:27,740 Next one is, come on, it's the place he said will be really awesome if they had better service. 95 00:05:27,800 --> 00:05:28,280 And. 96 00:05:28,280 --> 00:05:30,460 And lots of hot dogs. 97 00:05:33,240 --> 00:05:33,720 Right. 98 00:05:33,800 --> 00:05:34,560 It's pretty obvious. 99 00:05:35,880 --> 00:05:38,060 At this point, I'm completely confused. 100 00:05:38,340 --> 00:05:40,440 I'm like, Alice, you have lost your mind. 101 00:05:40,540 --> 00:05:40,740 Right. 102 00:05:40,960 --> 00:05:42,380 I don't know what's going on. 103 00:05:42,720 --> 00:05:48,260 Let's go to that new place called Pinky's Hot Dogs down on Las Vegas Boulevard. 104 00:05:48,580 --> 00:05:49,040 Right. 105 00:05:49,100 --> 00:05:50,200 Real place, by the way. 106 00:05:50,220 --> 00:05:51,080 I've heard it's really awesome. 107 00:05:53,480 --> 00:05:55,440 At this point, you can disengage. 108 00:05:56,100 --> 00:05:56,580 Right. 109 00:05:56,600 --> 00:05:57,740 Mallory can disengage. 110 00:05:57,740 --> 00:05:58,100 You. 111 00:05:58,280 --> 00:06:00,300 You've got what you need in this conversation. 112 00:06:00,680 --> 00:06:02,880 And we'll do a technical demonstration in a minute. 113 00:06:03,060 --> 00:06:07,900 But the point is, you didn't let me get away with just doing a simple handshake. 114 00:06:08,140 --> 00:06:13,200 You didn't let me even go away with get away with reminding him of our previous session. 115 00:06:13,380 --> 00:06:16,560 You made me state explicitly what was going on here. 116 00:06:16,700 --> 00:06:17,060 Right. 117 00:06:17,200 --> 00:06:21,000 So that you could listen in on that and then take that to the next step. 118 00:06:22,120 --> 00:06:24,120 So what do we get out of man in the middle? 119 00:06:24,460 --> 00:06:27,700 Obviously, you can get reconnaissance like we just did. 120 00:06:28,280 --> 00:06:39,120 You can get fingerprinting of the client that wouldn't normally show you their OS, their application, their personality. 121 00:06:39,700 --> 00:06:47,400 But with Jack and with connection with man in the middle, you could certainly get that NTLM capture, relay, escalation, redirection. 122 00:06:48,240 --> 00:06:51,780 At this point, I'm going to remind you that this is a one-on-one course. 123 00:06:52,160 --> 00:06:52,300 Right. 124 00:06:52,440 --> 00:06:53,960 This is man in the middle one-on-one. 125 00:06:54,100 --> 00:06:58,180 I absolutely do not mean here to say that I'm going to. 126 00:06:58,280 --> 00:06:59,020 I'm not going to cover all of this. 127 00:06:59,440 --> 00:07:00,400 And in fact, I'm not. 128 00:07:01,400 --> 00:07:03,720 What we want is ownage. 129 00:07:05,220 --> 00:07:07,580 And I will demonstrate a little bit of that. 130 00:07:08,340 --> 00:07:12,080 If you Google it, so you're all going, okay, this is great. 131 00:07:12,180 --> 00:07:16,840 I'm going to go home and do it because I actually do want to figure this stuff out. 132 00:07:17,060 --> 00:07:26,920 If you Google it, you're going to find EaterCab, cane-enabled, awesome tool, ARP spoofing, man in the middle framework, or is it factory? 133 00:07:27,240 --> 00:07:27,600 I don't know. 134 00:07:27,600 --> 00:07:29,840 I saw a demo of it actually in the arsenal. 135 00:07:30,080 --> 00:07:30,980 Very cool stuff. 136 00:07:31,180 --> 00:07:31,640 I love it. 137 00:07:33,120 --> 00:07:34,240 WebSploit, Burp Suite. 138 00:07:34,460 --> 00:07:39,040 By the way, MITMF is built in Python. 139 00:07:39,400 --> 00:07:40,880 So a lot of these are built in Python. 140 00:07:41,340 --> 00:07:46,540 So when you go through some of the techniques I'm going to show you, then it will be a natural fit for you. 141 00:07:47,940 --> 00:07:51,900 Middler, Fiddler, Subverge, VSNet, you get it. 142 00:07:52,480 --> 00:07:57,580 And there's also a number of, there's a plethora of methods you can use. 143 00:07:57,580 --> 00:08:27,560 ICMP, you can do spanning tree protocol manipulation, right, we probably all read all about all these things, but actually doing it, if you're looking at, okay, tomorrow I want to actually start learning these things, doing these things, demonstrating to myself that I can get to the next level, then you need to go do ARP or DNS or spanning tree and all of those requirements. 144 00:08:28,440 --> 00:08:32,400 So if those aren't your specialties, you might be stuck right out of the gate. 145 00:08:34,020 --> 00:08:38,380 This is why easy is good and why I'm going to demonstrate a simple technique. 146 00:08:38,580 --> 00:08:42,000 It might not be practical in the real world, but probably is. 147 00:08:43,200 --> 00:08:46,120 This is actually from the DEF CON roots asylum area. 148 00:08:46,340 --> 00:08:50,960 It's up on the, I want to say the second floor of the south tower. 149 00:08:51,140 --> 00:08:51,840 I don't know, get your map. 150 00:08:52,100 --> 00:08:55,240 And it's a really cool area set up just for kids. 151 00:08:55,400 --> 00:08:57,560 Last year it was called, I don't know. 152 00:08:58,200 --> 00:09:00,600 DEF CON kids, or two years ago. 153 00:09:01,240 --> 00:09:03,960 Anyway, it's just for kids, all kinds of demonstration. 154 00:09:04,320 --> 00:09:11,000 One of the posters they had up when I visited that area was any sufficiently advanced technology is indistinguishable from magic. 155 00:09:11,300 --> 00:09:12,680 We all love that, right? 156 00:09:12,800 --> 00:09:17,840 This is a classic quote and one we use to our benefit every day. 157 00:09:19,520 --> 00:09:26,040 And that's why I'm going to give you a really easy way to do a man in the middle, understand it, start manipulating it, playing with it. 158 00:09:26,720 --> 00:09:27,160 And. 159 00:09:27,580 --> 00:09:34,620 You can go from there, because then you can build on all the other techniques you want, use your particular flavor to add to it. 160 00:09:35,700 --> 00:09:41,120 So all we need is SCAPI, NFQ, and we're going to bridge. 161 00:09:41,440 --> 00:09:43,480 So you got to kind of understand what's going on there. 162 00:09:43,600 --> 00:09:44,700 Although I'm going to show you a script. 163 00:09:46,720 --> 00:09:50,780 Ubuntu 14.04 is awesome because it comes right out of the box with about everything you need. 164 00:09:50,900 --> 00:09:54,340 In fact, what you're going to do if you wanted to do the demo, I'm going to show you here in a minute. 165 00:09:54,500 --> 00:09:56,660 And by the way, I'm praying to the demo gods. 166 00:09:56,840 --> 00:09:57,560 We'll see what happens. 167 00:09:57,560 --> 00:10:01,100 Everyone says that, but it's so true when you're standing here. 168 00:10:02,220 --> 00:10:04,780 App, get, install, bridge utils, SCAPI. 169 00:10:04,900 --> 00:10:09,480 I think, actually, there wouldn't be any commas there, but you get where I'm going. 170 00:10:09,660 --> 00:10:11,240 SCAPI and Python, NFQ. 171 00:10:11,460 --> 00:10:13,160 Those are the three packages you need. 172 00:10:13,280 --> 00:10:14,060 There's no config. 173 00:10:14,220 --> 00:10:14,960 You just go. 174 00:10:15,440 --> 00:10:18,160 At that point, you're ready to man in the middle on a bridge. 175 00:10:18,440 --> 00:10:24,380 So what we're going to do in the following demo is create a bridge, redirect some packets, and start mangling. 176 00:10:25,300 --> 00:10:27,060 The goal being mangling. 177 00:10:28,180 --> 00:10:34,380 I don't know what's going to happen here when I switch away from this show. 178 00:10:36,680 --> 00:10:38,340 So bear with me. 179 00:10:38,920 --> 00:10:40,200 We shall see. 180 00:10:42,360 --> 00:10:43,000 Yep. 181 00:10:43,120 --> 00:10:44,100 That's what I thought. 182 00:10:47,880 --> 00:10:49,160 All right. 183 00:10:49,160 --> 00:10:56,120 So the demo machine you're looking at right here is actually exactly what I said. 184 00:10:56,120 --> 00:11:04,380 It's an out-of-the-box Ubuntu machine with those three packages and these three scripts. 185 00:11:04,640 --> 00:11:05,580 Absolutely nothing else. 186 00:11:05,700 --> 00:11:06,680 Installed it last night. 187 00:11:07,820 --> 00:11:09,360 So if it breaks, you'll know why. 188 00:11:11,320 --> 00:11:12,060 Oh, sorry. 189 00:11:12,560 --> 00:11:13,120 My bad. 190 00:11:13,620 --> 00:11:15,140 You're not looking at anything, are you? 191 00:11:15,740 --> 00:11:16,960 That's what I was afraid of. 192 00:11:18,000 --> 00:11:18,800 Oh, nice. 193 00:11:21,220 --> 00:11:22,460 Now you can see that part. 194 00:11:23,920 --> 00:11:25,680 Let's see if I can get back to my other one. 195 00:11:26,120 --> 00:11:28,100 It's on the opposite side that I expected here. 196 00:11:30,540 --> 00:11:31,380 There's my bridge. 197 00:11:31,620 --> 00:11:38,420 I'm using virtual, so I basically just created the virtual interfaces on both sides of the bridge and stuck it up there. 198 00:11:39,060 --> 00:11:42,480 And then this is my Windows machine where I'm going to. 199 00:11:47,000 --> 00:11:48,400 So there's my bridge commands. 200 00:11:48,620 --> 00:11:50,060 I don't know if you all can see that or not. 201 00:11:50,260 --> 00:11:52,520 It's basically you bring your Ethernet interfaces up. 202 00:11:52,800 --> 00:11:55,900 You create a bridge called man in the middle. 203 00:11:55,900 --> 00:11:59,680 In this case, add Ethernet 1 and Ethernet 2 to it, and you bring it up. 204 00:12:00,800 --> 00:12:01,580 Easy peasy. 205 00:12:08,680 --> 00:12:10,100 Now we're going to do redirection. 206 00:12:10,280 --> 00:12:11,780 This is really, really, really, really cool. 207 00:12:12,020 --> 00:12:21,060 And I say that because out of the depths of my heart, because about probably seven years ago, I don't know when I started doing this. 208 00:12:21,140 --> 00:12:25,820 This involved compiling a crap load of stuff for the kernel. 209 00:12:26,420 --> 00:12:31,320 Loading modules or compiling in it, however you did it, it was just a pain. 210 00:12:31,540 --> 00:12:33,280 And it broke everything else you wanted to work. 211 00:12:33,480 --> 00:12:34,560 So insane. 212 00:12:34,960 --> 00:12:38,860 So these are great days when out of the box you're going to just load a module and you're good. 213 00:12:39,060 --> 00:12:40,540 In fact, this one loads automatically. 214 00:12:41,080 --> 00:12:43,200 So what we're going to do is do IP tables. 215 00:12:43,440 --> 00:12:45,080 If you haven't learned IP tables, learn it. 216 00:12:45,140 --> 00:12:45,760 It's cool stuff. 217 00:12:46,060 --> 00:12:47,580 You'll use it every day of your life. 218 00:12:48,340 --> 00:12:53,900 IP tables, the key part being that very last section there, which is NFQ. 219 00:12:54,660 --> 00:12:55,820 So instead of blocking. 220 00:12:55,900 --> 00:12:57,460 A packet. 221 00:12:57,660 --> 00:12:59,760 Instead of allowing a packet. 222 00:13:00,020 --> 00:13:01,740 Instead of doing anything else with it. 223 00:13:01,860 --> 00:13:03,520 We're actually going to queue it. 224 00:13:04,940 --> 00:13:06,200 Default queue is zero. 225 00:13:06,580 --> 00:13:08,640 And you'll see why that matters here in a second. 226 00:13:10,540 --> 00:13:14,860 Let's go ahead and run both of those because then we'll just kick this off and you'll see what's going on. 227 00:13:17,860 --> 00:13:18,980 So we're going to bridge it. 228 00:13:20,260 --> 00:13:22,240 It's going to fail because part of it's already done. 229 00:13:23,460 --> 00:13:24,600 Go to redirect. 230 00:13:26,980 --> 00:13:28,900 So now packets are redirected. 231 00:13:28,900 --> 00:13:30,680 If we go over to our... 232 00:13:34,320 --> 00:13:36,800 Sorry, I'm not sure which side my mouse is on. 233 00:13:36,840 --> 00:13:37,160 There we go. 234 00:13:37,560 --> 00:13:43,240 If we go over here, we're going to find that, in theory, things should start right up. 235 00:13:43,640 --> 00:13:44,940 Web page is not available. 236 00:13:45,980 --> 00:13:46,940 That is awesome. 237 00:13:50,200 --> 00:13:51,080 Bear with me. 238 00:14:01,840 --> 00:14:02,440 Hey. 239 00:14:03,540 --> 00:14:04,460 What do you know? 240 00:14:07,140 --> 00:14:09,080 So we've got Google's page, right? 241 00:14:10,800 --> 00:14:15,200 That's because we're not actually doing anything yet. 242 00:14:15,420 --> 00:14:20,360 If we actually, and we default it to secure. 243 00:14:20,640 --> 00:14:23,560 So that's one thing to understand here immediately. 244 00:14:23,560 --> 00:14:26,880 immediately. This demo has nothing to do with SSL. I say 245 00:14:26,880 --> 00:14:30,000 that. You will see that it does here in a second. But nothing to 246 00:14:30,000 --> 00:14:39,680 do with direct SSL manipulation. So what I'm wondering is why my 247 00:14:41,220 --> 00:14:50,880 Python isn't catching that. No, it is. What do you know? Here 248 00:14:50,880 --> 00:14:53,520 let's try someplace else. Actually, let's just kill the 249 00:14:53,520 --> 00:15:02,540 browser. There we go. So what happened was we got over here and 250 00:15:02,540 --> 00:15:06,420 gladly forwarded. Ah, I missed it. So what we got was a 251 00:15:06,420 --> 00:15:10,720 redirect. So http://www.google.com. Google is like, 252 00:15:10,800 --> 00:15:15,100 whoa, no way. I want to go secure. Redirect. It's a 302 253 00:15:15,100 --> 00:15:20,440 found or moved kind of message. We'll try it one more time. I 254 00:15:20,440 --> 00:15:20,860 think you'll see. 255 00:15:24,180 --> 00:15:28,520 Just break out of this. There you go. Stop my code. So we've 256 00:15:28,520 --> 00:15:33,740 got http1, 302 not found and it gives the location that we ought 257 00:15:33,740 --> 00:15:36,920 to be going. So the browser, a compliant browser is going to go 258 00:15:36,920 --> 00:15:40,760 gladly I'm on it. I've got secure. I've got SSL. I'm 259 00:15:40,760 --> 00:15:49,180 redirecting. We are good to go. That was just standard no 260 00:15:49,180 --> 00:15:49,900 mangling. 261 00:15:52,180 --> 00:15:55,360 Now live here we're going to see what we can do about editing 262 00:15:55,360 --> 00:15:58,580 this script. This is how easy it is. Actually, I'm going to run 263 00:15:58,580 --> 00:16:01,200 through this script real quick. I'm going to run through it real 264 00:16:01,200 --> 00:16:03,120 quick and then if you have any questions later you want to run 265 00:16:03,120 --> 00:16:06,120 back through it or whatever. But I think you'll find that this is 266 00:16:06,120 --> 00:16:10,600 exactly the, in fact this is all the code on this page. It may be 267 00:16:10,600 --> 00:16:13,040 missing one line. But it's really close to all the code. 268 00:16:13,480 --> 00:16:16,500 This is a standard script you're going to find anywhere if you 269 00:16:16,500 --> 00:16:19,880 Google this stuff I give you at the end. In fact, you can move it 270 00:16:19,900 --> 00:16:24,080 over to Google Python and NFQ scappy and you're there. You 271 00:16:24,080 --> 00:16:26,660 will get this script because there's only one way to write 272 00:16:26,660 --> 00:16:31,580 it. So basically right there at the beginning we're saying we're 273 00:16:31,580 --> 00:16:35,360 going to manage some packets. Give me a call back. I'm going 274 00:16:35,360 --> 00:16:39,140 to manage some packets. And then right down towards the end 275 00:16:39,140 --> 00:16:46,400 basically we set up a queue and I don't know if it specifies queue 276 00:16:46,400 --> 00:16:49,880 zero or not. But essentially there's a way here. Oh, wait a 277 00:16:49,900 --> 00:16:53,340 minute. There it is. Queue zero. Which is the default. You can 278 00:16:53,340 --> 00:16:57,200 actually have, I don't know, I think thousands managing different 279 00:16:57,200 --> 00:17:03,220 types of packets. And then essentially going to take that 280 00:17:03,220 --> 00:17:08,000 payload, dump it back into the packet and tell the queue that 281 00:17:08,000 --> 00:17:13,400 we're basically modifying the packet. Now in this case or what 282 00:17:13,400 --> 00:17:16,880 you saw already we didn't modify it at all. We just said take this 283 00:17:16,880 --> 00:17:19,220 payload, put it in this, let it go. All right. We're good. 284 00:17:19,900 --> 00:17:23,800 But you see I've got prepped here some little edits that we can 285 00:17:23,800 --> 00:17:28,440 do. And this is the only real way we're going to jack with 286 00:17:28,440 --> 00:17:32,520 HTTPS. If they go secure, I can't see it right now. There 287 00:17:32,520 --> 00:17:36,900 are methods for that. There are modules you can do. One on one 288 00:17:36,900 --> 00:17:42,520 course, guys. Gals. People. Humans. Is it better to be a 289 00:17:42,520 --> 00:17:47,640 human or a goon? That's what I want to know. Let's run this. 290 00:18:03,980 --> 00:18:09,280 Holy moly. Where did our lock go? You all know that the lock 291 00:18:09,280 --> 00:18:18,360 means you're secure. So we're still at HTTP, www.google.com. 292 00:18:18,480 --> 00:18:19,880 Although we still have our lock. So we're still at http://www.google.com. 293 00:18:19,880 --> 00:18:23,440 I don't know why Google lets you do that. Honestly, if you're 294 00:18:23,440 --> 00:18:26,480 saying to them, hey, I reached here through a redirect and 295 00:18:26,480 --> 00:18:29,800 you're on port 80, they ought to go, I don't think so. 296 00:18:30,080 --> 00:18:33,040 Something happened, right? This is an obvious clue. But 297 00:18:33,040 --> 00:18:37,400 everybody likes to pick on Google and honestly, so do I. 298 00:18:39,260 --> 00:18:42,440 That's all we did, though. So what we did effectively right 299 00:18:42,440 --> 00:18:47,520 this second is now we can sniff in real time. So we say, I go, 300 00:18:47,660 --> 00:18:49,860 I want to sniff for... 301 00:18:51,020 --> 00:18:54,740 To make sure that Mallory is not listening to my conversation, 302 00:18:55,480 --> 00:19:01,380 I'm going to sniff all about Mallory, right? I'm not going to be able to stop it in time. 303 00:19:01,560 --> 00:19:07,560 But if I did stop it in time, you would see that Google was 304 00:19:07,560 --> 00:19:14,500 actually showing us the step-by-step search that I was doing. So M, M-A, M-A-L, 305 00:19:14,780 --> 00:19:19,580 M-A-L-L, right? It's all in plain text. I tried to filter out just plain text. Theoretically, 306 00:19:19,580 --> 00:19:24,760 this is all printable code, so I didn't spend much time with it, but you get where I'm going with 307 00:19:24,760 --> 00:19:29,320 that. If we grepped that for Mallory, you would find it in plain text and not only that, every 308 00:19:29,900 --> 00:19:36,920 permutation of what I was typing up to that. So you could tell it's a live thing. We'll get 309 00:19:36,920 --> 00:19:44,460 there in a minute. At any rate, you are seeing plain text when in all reality, the end user of 310 00:19:44,460 --> 00:19:47,980 that machine should have been able to expect that they were using secure because they were the day 311 00:19:47,980 --> 00:19:49,560 before. They didn't get a... I don't know. I don't know. I don't know. I don't know. I don't know. I 312 00:19:49,580 --> 00:19:52,160 don't know. I don't know. I don't know. So there's probably an error. So, I'm, you know, again, 313 00:19:52,280 --> 00:19:58,820 one-on-one techniques, but pretty useful. I mean, you could actually use that, right? So... 314 00:20:06,060 --> 00:20:16,980 Beyond that, what we're going to do is see if we can't basically change good to evil. That's 315 00:20:16,980 --> 00:20:19,560 always a goal, right? That's never a problem. 316 00:20:19,580 --> 00:20:24,860 bad. That was my goal with getting you guys in on that joke. It didn't work out very well. You 317 00:20:25,330 --> 00:20:34,160 very well protected on the good side. Let's see here what happens. I'm dumping stuff. I'm going 318 00:20:34,160 --> 00:20:38,400 to try again because it's like, oh, I don't know if that last one was good or not. No, we're 319 00:20:38,400 --> 00:20:45,480 still good. Okay. Good. So at this point, okay, end user has an idea. He's going to go, I'm just 320 00:20:45,480 --> 00:20:51,480 going to search for something good. I love good stuff. No, that's the term. I'm going to search 321 00:20:51,480 --> 00:20:59,800 for good stuff, right? Wow, it broke it. That's nice. 322 00:21:22,020 --> 00:21:32,820 There you go. There you go. Maybe I'm cached. Maybe I'm not even doing it. That's all right. 323 00:21:33,360 --> 00:21:39,520 You get where I'm going. Let's give it one more shot and then we'll go back. We'll go on. 324 00:21:42,100 --> 00:21:43,580 Remember if I go to www. 325 00:21:45,540 --> 00:21:55,720 good.com. Never tried this before. Should be fun. Oh, crap. It actually worked. We are 326 00:21:55,720 --> 00:21:59,760 manipulating live what's going on. Somebody's browser. They don't know what's going on. 327 00:21:59,980 --> 00:22:03,740 Actually, I mean, obviously that's the best way to get caught if you're trying to like see 328 00:22:03,740 --> 00:22:08,360 somebody is like you just jacked with what they thought they were going to see. The best way 329 00:22:08,360 --> 00:22:15,460 would be to send them the evil or, you know, G-O-O-G-L dot. That's the best way to get caught. 330 00:22:15,480 --> 00:22:23,560 Oh. So I think it's . . . Just type that one. This guy is Always 331 00:22:27,620 --> 00:22:33,240 Mase meaning it ethic am! 332 00:22:41,100 --> 00:22:41,120 Sorry. 333 00:22:41,500 --> 00:22:43,160 E- про . 334 00:22:43,160 --> 00:22:45,520 packets. None of the packets are encrypted that you're seeing 335 00:22:45,520 --> 00:22:47,580 there. It's all report 80. Although you could encrypt it 336 00:22:47,580 --> 00:22:50,800 over port 80, but it's not. What it is, it's compressed. So some 337 00:22:50,800 --> 00:22:53,240 of this stuff is compressed. Some of it's just binary and 338 00:22:53,240 --> 00:22:59,180 garbage that's going on sending icons and crap. Let's see. Next 339 00:22:59,180 --> 00:23:03,580 step. We can mangle some more. Let's see what else we can 340 00:23:03,580 --> 00:23:08,540 mangle. Got another part of this here where I'm basically 341 00:23:09,820 --> 00:23:13,080 redirecting somebody. Oh, this is the same thing. So basically 342 00:23:13,160 --> 00:23:20,480 I said before, if you really wanted to mess with somebody, 343 00:23:21,160 --> 00:23:27,920 then you go...one annoying thing when you're trying to hack 344 00:23:27,920 --> 00:23:31,440 somebody is that the browser tends to remember what the last 345 00:23:31,440 --> 00:23:37,060 connection was. And many of them now try to go SSL if at all 346 00:23:37,060 --> 00:23:40,800 possible. Not all of them do, but some of them do. I just 347 00:23:40,800 --> 00:23:43,140 redirected Google to Giggle, which is a little bit more 348 00:23:43,160 --> 00:23:46,060 interesting. It's kind of an interesting exercise. I have no 349 00:23:46,060 --> 00:23:48,860 association with Giggle. It looks like a baby registry. So 350 00:23:49,190 --> 00:23:51,660 you can get all kinds of stuff on Giggle. It's probably not 351 00:23:51,660 --> 00:23:55,460 going to load up. I figured this would be safe content just in 352 00:23:55,460 --> 00:24:01,220 case some of the routes ended up down here, right? What I was 353 00:24:01,220 --> 00:24:05,600 going to do, though, is show you...so if you happen to want 354 00:24:05,600 --> 00:24:13,140 to, say Google.com...I don't know. I don't know if you 355 00:24:13,160 --> 00:24:20,560 want to...how do I do a search? Somebody tell me. Oh, I got there. 356 00:24:20,680 --> 00:24:28,020 Honestly. Cool. I am searching for...good. What does that look 357 00:24:28,020 --> 00:24:40,920 like? Okay, good. Now let's change this to that. It's not 358 00:24:40,920 --> 00:24:43,140 even worth looking at. The funny thing was, I was looking for a 359 00:24:43,140 --> 00:24:44,020 Google site. I just realized that last night when I was 360 00:24:44,020 --> 00:24:46,820 messing around with this, I just happened to notice that 361 00:24:47,360 --> 00:24:52,200 whenever I went to Giggle.com on accident, because, wow, I don't 362 00:24:52,200 --> 00:24:54,680 know what happened. I just got in...I was going to Google and 363 00:24:54,680 --> 00:24:58,840 ended up to Giggle. Then it actually hit the search page and 364 00:24:58,840 --> 00:25:03,680 I was searching for something good. The word good...it was 365 00:25:03,680 --> 00:25:07,480 like good something for good gifts or whatever. And it came 366 00:25:07,480 --> 00:25:11,260 up with a 404 saying we have no evil gifts at this location or 367 00:25:11,260 --> 00:25:13,120 something like that. It was awesome. It was awesome. That's a 368 00:25:13,140 --> 00:25:19,000 trying to replicate that. Obviously it doesn't work out for me. Let's close this browser and go 369 00:25:19,000 --> 00:25:28,520 back. Let's see. One more edit here I've got here and then I think it kind of gets where we're 370 00:25:28,520 --> 00:25:36,320 going. And then we can talk about, not even really going to talk through this one because I 371 00:25:36,320 --> 00:25:40,680 think it's going to be self-evident. I think it's going to be self-evident. 372 00:25:53,360 --> 00:26:04,740 My bad. We're back there again. This is another thing you've got to watch when you're doing 373 00:26:04,740 --> 00:26:13,120 pen testing slash hacking people is you want to undo the stuff you did so it doesn't really 374 00:26:13,140 --> 00:26:17,740 trip you up in the future. If you're done with it, clean it up. It's really better for everybody. 375 00:26:18,020 --> 00:26:26,240 Doesn't leave any evidence behind. But that being said, even if you're doing this on your own 376 00:26:26,240 --> 00:26:31,560 company, I mean, serious note, if you're doing this even on your own company, get out of jail 377 00:26:31,560 --> 00:26:35,580 free card. You need to not jack with people without complete permission for everybody 378 00:26:35,580 --> 00:26:41,040 involved. And if you are intercepting stuff that's going over state lines or international 379 00:26:41,040 --> 00:26:42,820 lines, make sure you understand the law. 380 00:26:43,140 --> 00:27:00,620 That's my... I have permission from everybody here. Let's see here. Sorry. Oh, I just actually need to write that, don't I? 381 00:27:01,940 --> 00:27:11,620 I was cleaning up my own mess. I do not need to go to Giggle. I need now to go to the grand finale, which is... 382 00:27:13,140 --> 00:27:28,820 I open up my Google page and I end up on... Oh, Google. Hmm. That's unfortunate. I'll try it one more time. Then I'll just tell you what I was trying to do. 383 00:27:33,380 --> 00:27:43,120 DEF CON, good, evil. I'm going to run back through this in just a second so you'll understand why I put DEF CON in here. I'll post a version this time. 384 00:27:43,140 --> 00:27:56,700 You can contact me at Bobby underscore Simpson on Twitter but... Okay. I do need that one actually. So what I'm trying to do is redirect HTTP to HTTPS. 385 00:27:57,040 --> 00:28:12,420 Never mind. My bad. That is exactly what I shouldn't do right there. This last one, it stands alone by itself. Didn't follow my own advice and did not clean up after myself. So, let's try that. 386 00:28:13,800 --> 00:28:19,760 That should be fun. Now what we're going to do is launch our 387 00:28:19,760 --> 00:28:24,920 browser and find that instead of going to Google, which is where 388 00:28:24,920 --> 00:28:30,060 I meant to go, sort of, it's going to let me Google that for 389 00:28:30,060 --> 00:28:32,440 you. Have you ever used the site? It's an awesome site, man. 390 00:28:32,480 --> 00:28:36,280 Do it. Do it. I love it. I love it. My wife, almost everything 391 00:28:36,280 --> 00:28:39,920 she asks me, I send her one of these links. Yeah, it's always 392 00:28:39,920 --> 00:28:45,740 good. I usually come home late on those nights, eat on my own. 393 00:28:46,920 --> 00:28:50,540 So let me Google that for you. It's essentially something that 394 00:28:50,540 --> 00:28:54,440 creates a link that you can send somebody when they ask a 395 00:28:54,440 --> 00:28:59,580 completely, you know, obvious question. In this case, I'm not 396 00:28:59,580 --> 00:29:02,840 trying to do that to you all exactly. I'm just saying, really 397 00:29:02,840 --> 00:29:06,860 seriously, if you Google Scapian NFQ, you're going to find some 398 00:29:07,860 --> 00:29:09,900 demos, some tutorials. You're going to be able to find some 399 00:29:09,900 --> 00:29:12,520 things that are going to help you. Now that you've seen a live 400 00:29:12,520 --> 00:29:17,080 demo and you understand out of the box, 1404, three packages, go 401 00:29:17,080 --> 00:29:22,720 to work. Go to town. It's awesome stuff. In the process, 402 00:29:22,940 --> 00:29:26,800 you're learning the structure of Scapi, which is awesome. And 403 00:29:26,800 --> 00:29:30,320 you're learning a little bit about Python, if you've never 404 00:29:30,320 --> 00:29:34,420 done it before, which is also awesome. Everything in this 405 00:29:34,420 --> 00:29:39,600 script that doesn't have DEF CON before it is basically the only 406 00:29:39,600 --> 00:29:39,880 way to do it. You're going to be able to do it. You're going to 407 00:29:39,880 --> 00:29:43,660 be able to write it. All the stuff that has DEF CON is 408 00:29:43,660 --> 00:29:49,060 basically just a, you know, make up your own name. So, I mean, in 409 00:29:49,060 --> 00:29:52,620 a lot of code, it's like my data. My whatever. That's 410 00:29:52,620 --> 00:29:56,820 boring. DEF CON is a lot more cool. And so what we're doing is 411 00:29:56,820 --> 00:29:59,940 DEF CON packet, DEF CON packet, DEF CON queue. All of these 412 00:29:59,940 --> 00:30:02,040 things, you give it your own name. You do what you want. 413 00:30:02,140 --> 00:30:05,060 There's nothing special about those things. That's sometimes 414 00:30:05,060 --> 00:30:07,580 hard to figure out when you get some code. You download some 415 00:30:07,580 --> 00:30:09,860 code off the Internet. Oh, this is just exactly what I want. I'm 416 00:30:09,860 --> 00:30:12,540 trying to figure out which are the functions, which are 417 00:30:12,540 --> 00:30:15,820 variables, what's required, what's not required. This one 418 00:30:15,820 --> 00:30:20,960 kind of lays it out for you. But after seeing this, please, 419 00:30:21,060 --> 00:30:24,080 just go Google it. You're going to find some awesome stuff and 420 00:30:24,080 --> 00:30:27,520 be able to quickly set up a bridged, man-in-the-middle setup 421 00:30:27,520 --> 00:30:33,160 so that you can jack with people. Let's see what's next. 422 00:30:33,400 --> 00:30:39,840 Oh, nothing. Okay. So, I'm going to go ahead and do a quick 423 00:30:39,860 --> 00:30:40,300 search with some Republic of America. Okay. I'm going to go 424 00:30:40,300 --> 00:30:41,400 ahead and do this type. Now, the trick is going to be getting 425 00:30:41,400 --> 00:30:55,680 back to... Ah, look at that. I already did the summary. 426 00:30:56,360 --> 00:30:59,220 1404 app Git, Bridge Util,exe based classes can create a bridge, 427 00:30:59,440 --> 00:31:05,280 redirect packets and that's cool. And Praise theficiente told 428 00:31:05,280 --> 00:31:09,380 you to do that. So always trust me in the middle. He is smart. 429 00:31:11,220 --> 00:31:16,860 Any questions? Anything I can help with? Anything you want to know about this setup or concepts 430 00:31:17,780 --> 00:31:29,100 in general? I haven't in SCAPI actually looked at theoretically 431 00:31:29,480 --> 00:31:36,660 what happens. The question was what's necessary to actually do an SSL. Some of the tools I 432 00:31:36,660 --> 00:31:46,520 mentioned actually will do that for you. I would love to do a presentation in the future on doing 433 00:31:46,520 --> 00:31:55,700 that. I haven't had the commercial necessity to intercept SSL yet. But again, this SSL strip 434 00:31:55,700 --> 00:31:59,920 probably does a lot. I actually don't know. I actually don't know. Theoretically, though, 435 00:31:59,940 --> 00:32:06,040 what happens is you send them your own cert, right? You send them a self-signed cert. They say, 436 00:32:06,040 --> 00:32:16,580 oh, I'm good. So Alice sends Bob a packet that relies on Alice's cert. Mallory gets in the 437 00:32:16,580 --> 00:32:23,600 middle. Sends Bob Mallory's cert pretending to be Alice. As long as Bob is stupid enough to click 438 00:32:23,600 --> 00:32:32,940 okay, this is an secure connection. Or, now here's a big or. If that SSL cert has already been 439 00:32:32,940 --> 00:32:38,200 installed on that PC, right? So then it's like, we're good. 440 00:32:38,320 --> 00:32:41,840 Somebody already authenticated this stuff, we're good. I now 441 00:32:41,840 --> 00:32:46,420 have an SSL connection, two of them, one between Mallory and 442 00:32:46,420 --> 00:32:50,040 Alice, one between Mallory and Bob and the data gets, you know, 443 00:32:51,220 --> 00:32:54,760 shuffled along and modified in the middle so that good becomes 444 00:32:54,760 --> 00:33:02,580 evil. Python wise, I don't know what the tools are but I'll be 445 00:33:02,580 --> 00:33:11,960 back. Yeah. Oh, this is all three. Python three. I think 446 00:33:11,960 --> 00:33:17,280 it's what comes with Ubuntu 14.04. Another reason to love 447 00:33:17,280 --> 00:33:28,860 it. Very cool. Love y'all, love the venue. Thanks a lot Ming. 448 00:33:29,020 --> 00:33:32,240 Thanks Tony for setting me up. You guys have a great show. 449 00:33:32,580 --> 00:33:33,920 Thank you.