1 00:00:00,000 --> 00:00:03,660 So, soon to be a good afternoon to everyone. 2 00:00:03,660 --> 00:00:07,720 And now it is my absolute pleasure to introduce you to Emilio. 3 00:00:10,740 --> 00:00:12,900 Thank you, thank you. 4 00:00:13,160 --> 00:00:14,660 Let's see, can you hear me? 5 00:00:15,280 --> 00:00:16,060 Good. 6 00:00:16,720 --> 00:00:22,140 Alright, I think, good morning, good afternoon, good evening, depending on which time zone you are. 7 00:00:22,700 --> 00:00:24,340 Let me start with... 8 00:00:24,340 --> 00:00:27,860 Today I'm going to present a tool called Circo. 9 00:00:29,300 --> 00:00:31,880 So let me first do some introductions. 10 00:00:33,180 --> 00:00:35,220 Hello, that's me. 11 00:00:35,740 --> 00:00:40,300 So, I come from Japan. 12 00:00:40,300 --> 00:00:44,680 I know that I don't look very Japanese yet, but I've been living there for 10 years. 13 00:00:45,040 --> 00:00:48,240 So, you can call me either way. 14 00:00:48,240 --> 00:00:52,040 It works both ways, Emilio, Emidio, or something like that. 15 00:00:52,240 --> 00:00:57,140 I like to play with networks, packets, and, you know, a bit of 3D printing as well. 16 00:00:57,660 --> 00:01:01,780 So, I did demo a few tools already in a couple of conferences. 17 00:01:01,940 --> 00:01:04,880 Some of them are in Japan, so you may be aware or not. 18 00:01:05,220 --> 00:01:08,980 And just keep in mind, I'm not a programmer. 19 00:01:09,380 --> 00:01:14,160 So, the code works, it's nice, and there's a lot of improvement to do. 20 00:01:14,220 --> 00:01:15,700 But it runs. 21 00:01:15,700 --> 00:01:18,960 As long as it runs, it's not good to go. 22 00:01:20,040 --> 00:01:24,180 Alright, for those of you who are not familiar with it, it's actually the tool itself. 23 00:01:24,400 --> 00:01:28,060 The idea is born, actually, from the automations. 24 00:01:28,400 --> 00:01:32,700 Within enterprise networks, we have a lot of automation tools. 25 00:01:32,700 --> 00:01:43,640 And those tools actually are just discovering every new device that connects to the network, and actually connecting and provisioning and doing a lot of really cool stuff. 26 00:01:43,800 --> 00:01:48,140 Sure, but what about if it's not the Cisco switch that you are connecting to? 27 00:01:48,140 --> 00:01:51,480 They're basically giving us the credentials for free. 28 00:01:51,480 --> 00:01:52,000 Great! 29 00:01:52,000 --> 00:01:53,760 That was a good idea, I thought. 30 00:01:53,760 --> 00:02:10,640 So, what came out, actually, was a way to make something camouflage, which is not going to be noticed, and put it in there when you do red teaming within meeting rooms, open space, secretary, those kind of places. 31 00:02:10,860 --> 00:02:14,480 So, I'm looking to find a way to do this. 32 00:02:14,600 --> 00:02:28,680 So , in this release 1.5, what is new is actually, before releases, I was not able to have an IP phone working, so I will go and unplug the IP phone and use that cable, but that's it, the IP phone will be off. 33 00:02:29,220 --> 00:02:34,920 That's something that people will notice, because either it's not working anymore, and I wasn't very comfortable. 34 00:02:35,460 --> 00:02:45,380 So, a few people pointed out as well, so this version I managed to remove the phone, but plug the phone back to the box itself, and it keep working as if nothing. 35 00:02:45,380 --> 00:02:48,500 So, we're going to dig into that. 36 00:02:48,680 --> 00:03:02,980 I did some coding updates, and also add some exfiltration techniques, and encryption for forensic, cell destroy switches, integration with Faraguy, and bypass NAC, basically. 37 00:03:03,620 --> 00:03:07,000 A lot of features, basically, between 1.4 to 1.5. 38 00:03:07,860 --> 00:03:09,740 So, who do we target? 39 00:03:09,740 --> 00:03:12,440 Well, pretty much any automation system out there. 40 00:03:12,440 --> 00:03:16,840 These are quite, quite a few known systems. 41 00:03:16,840 --> 00:03:18,680 HPNA is very popular. 42 00:03:19,180 --> 00:03:21,840 Of course, NetMRI as well. 43 00:03:21,840 --> 00:03:30,260 NAC itself is not an automation system for network provisioning, but what it does is try to prevent things that I'm trying to do, basically. 44 00:03:30,260 --> 00:03:32,720 So, I will get rid of NAC as well. 45 00:03:33,360 --> 00:03:39,360 And, of course, there's always some admin connecting to things, that trusts and put password everywhere. 46 00:03:40,800 --> 00:03:43,960 This is an example of things that happen with a Raspberry Pi. 47 00:03:44,220 --> 00:03:50,380 You know, some device in the network that nobody noticed, you've been exfiltrating data in the NSA. 48 00:03:50,380 --> 00:03:56,160 And this is not uncommon, because NAC is very hard to solve all our problems. 49 00:03:56,980 --> 00:03:59,440 So , it did happen. 50 00:04:00,640 --> 00:04:04,560 Okay, so what are my main issues for version 1.5? 51 00:04:04,560 --> 00:04:05,380 Power options. 52 00:04:05,380 --> 00:04:08,860 I'm going to put a Raspberry Pi, which I need power, okay? 53 00:04:08,860 --> 00:04:10,500 Battery, PoE. 54 00:04:10,620 --> 00:04:13,460 IP phone, when I plug it, that looks suspicious. 55 00:04:14,160 --> 00:04:24,620 Someone told me about, if you find the little enclosure and you open, you can see the keys, where the box is exfiltrating data, because it's just an SD card in Linux. 56 00:04:25,040 --> 00:04:28,900 Yes, so I need to add some forensics, prevent forensics on it. 57 00:04:28,900 --> 00:04:30,000 Encryption, basically. 58 00:04:30,000 --> 00:04:32,140 Which is a key, always a problem. 59 00:04:33,480 --> 00:04:37,220 Alright, so let's start with the first problem, that is the power. 60 00:04:37,220 --> 00:04:40,600 So, I came up with the paper idea. 61 00:04:40,600 --> 00:04:41,500 It's the easiest one. 62 00:04:41,500 --> 00:04:47,060 You just start drawing things and come up with a list of wishes that you want to do. 63 00:04:47,660 --> 00:04:54,080 So, this concept was, okay, the PoE negotiation is very complicated. 64 00:04:54,240 --> 00:04:57,100 And there's many standards and there's many different ways to do it. 65 00:04:57,100 --> 00:04:58,720 Many implementations are different. 66 00:04:58,820 --> 00:05:04,660 But there's one thing, one element, that the phone and the switch, they will do the negotiation of the power. 67 00:05:04,660 --> 00:05:07,120 How much power you need, how many watts, etc, etc. 68 00:05:07,320 --> 00:05:09,080 So, I didn't want to get into that. 69 00:05:09,080 --> 00:05:11,220 So, I say, okay, let the phone negotiate. 70 00:05:11,220 --> 00:05:14,440 Once that's done, I just hook the power. 71 00:05:14,440 --> 00:05:21,440 So, you come up with an idea that violates every principle in networking, pretty much. 72 00:05:21,480 --> 00:05:23,140 Okay, why not? 73 00:05:23,140 --> 00:05:24,160 Let's give it a try. 74 00:05:24,220 --> 00:05:28,800 So, once you have a paper idea, what you tend to do is breakboarding. 75 00:05:28,800 --> 00:05:30,640 Let's do, let's go, come on. 76 00:05:30,640 --> 00:05:32,820 Plug some cables and see what happens. 77 00:05:32,820 --> 00:05:34,480 Something will blow up for sure. 78 00:05:35,460 --> 00:05:41,980 So, you start to build up some ports and this breaks all network industry standards, by the way. 79 00:05:41,980 --> 00:05:43,600 So, trust me on that one. 80 00:05:44,440 --> 00:05:50,480 So , what tend to happen when you start to do this is at some point, without you noticing, this actually works. 81 00:05:50,480 --> 00:05:53,140 And I'm like, okay, this is actually a good thing. 82 00:05:53,360 --> 00:05:56,220 So, now you actually elaborate on it. 83 00:05:56,220 --> 00:05:58,520 So, you move into prototyping. 84 00:05:58,860 --> 00:06:06,240 So, this is a little board for just, because they keep coming out, the jumpers from the breadboard. 85 00:06:06,240 --> 00:06:09,540 So, you say, okay, let's make it a bit more stable. 86 00:06:09,540 --> 00:06:11,320 So, I did a prototype to see. 87 00:06:11,320 --> 00:06:18,420 Basically, it's four RJ45 and a DC to DC converter plus a USB socket. 88 00:06:18,420 --> 00:06:19,960 So, it was a very simple idea. 89 00:06:20,560 --> 00:06:23,040 It's all the wiring, the thing that goes underneath. 90 00:06:23,620 --> 00:06:26,080 So, again, I never designed a PCB. 91 00:06:26,100 --> 00:06:30,720 So, it would be nice to have a Raspberry Hub, maybe, or go into that. 92 00:06:30,840 --> 00:06:33,600 So, I'm still trying to figure out. 93 00:06:33,720 --> 00:06:35,360 So, prototyping is okay. 94 00:06:36,360 --> 00:06:40,540 All right, how Circo evolved between different releases. 95 00:06:40,820 --> 00:06:45,920 So, Circo has around one year old, maybe, around October 2018. 96 00:06:46,500 --> 00:06:49,440 So, it started like an idea in a box. 97 00:06:49,440 --> 00:06:52,260 When I mean in a box, I mean literally in a cardboard box. 98 00:06:53,200 --> 00:06:57,180 It was good because you can see the components and you can see, ah, this is this. 99 00:06:57,180 --> 00:06:58,660 You can even put labels on it. 100 00:06:58,660 --> 00:07:03,220 So , it was quite, yeah, it was fun. 101 00:07:03,220 --> 00:07:07,760 So, what happened here is that I used to use a PoE LAN modules. 102 00:07:08,200 --> 00:07:09,680 And I bought one that you see. 103 00:07:09,680 --> 00:07:15,160 So, basically, what it does is it does the PoE negotiation and then give you the LAN back and the power. 104 00:07:15,180 --> 00:07:16,700 So, I bought one, 12 volts. 105 00:07:16,700 --> 00:07:18,760 Okay, I need to convert this to 5 volts. 106 00:07:18,760 --> 00:07:20,600 And then I figure out they sell the 5 volts. 107 00:07:20,640 --> 00:07:23,920 So, this is the first release, right? 108 00:07:24,360 --> 00:07:26,540 So, then we evolved into a production. 109 00:07:26,680 --> 00:07:28,220 So, I say, okay, let's move on. 110 00:07:28,220 --> 00:07:31,020 So, I got some enclosures. 111 00:07:32,200 --> 00:07:37,020 They look like these boxes that you have under your desk, over your desk. 112 00:07:37,080 --> 00:07:40,020 So, the whole concept is, okay, let's work with what we have in the market. 113 00:07:40,020 --> 00:07:42,980 So, I look for these enclosures to put stuff in it. 114 00:07:45,380 --> 00:07:50,080 So, in this release, I only have, you see, there's only one cable going on. 115 00:07:50,100 --> 00:07:53,780 That's because I unplugged the phone and that's it. 116 00:07:54,240 --> 00:07:58,560 And also, the smaller version, that was a bit more tricky because there's less space. 117 00:07:58,560 --> 00:08:05,300 But you can use Raspberry Pi Zero, which is a bit cool, but you really need to work with space. 118 00:08:05,300 --> 00:08:07,060 Again, this version has only one LAN. 119 00:08:07,280 --> 00:08:10,480 So, you need to work with the LAN adapters on the Raspberry Pi. 120 00:08:10,760 --> 00:08:12,880 Right, so we move to this version. 121 00:08:13,040 --> 00:08:15,680 This version is actually this box. 122 00:08:15,900 --> 00:08:22,060 This box, because, remember, now I'm still in the phone and I'm going to plug back the phone here. 123 00:08:22,220 --> 00:08:26,200 So, what I'm going to do is use two different LAN adapters on the Raspberry Pi. 124 00:08:26,200 --> 00:08:29,740 So, that's the reason I have a USB LAN adapter plus the onboard. 125 00:08:30,800 --> 00:08:34,680 As well, there is on the bottom, you will see a DC-DC converter. 126 00:08:34,680 --> 00:08:38,680 The 48 volts of PoE back to 5 volts to power the Raspberry Pi. 127 00:08:39,380 --> 00:08:45,100 And on the yellow thing that you may see there, that's actually a magnet switch. 128 00:08:45,100 --> 00:08:49,520 It's a 3D print some handles to mount it. 129 00:08:49,520 --> 00:08:52,820 But it's basically a magnet and a tilt magnet switch. 130 00:08:52,820 --> 00:08:54,900 So, what it does, that is the key lock. 131 00:08:54,900 --> 00:08:57,900 When you open the case, it will detect that you open it. 132 00:08:57,900 --> 00:09:01,020 And , you know, you can RMRF, you can do whatever you want. 133 00:09:01,060 --> 00:09:02,180 Reboot, shutdown. 134 00:09:02,480 --> 00:09:09,300 So, this is to prevent forensic, in case some forensic go and don't unplug the cables and just open the suspicious case that they found. 135 00:09:09,580 --> 00:09:11,900 It will blow up, basically, if you want to. 136 00:09:12,040 --> 00:09:13,600 That was a bit dangerous to do. 137 00:09:14,240 --> 00:09:18,380 EPMs, you know, heatups, fire hazards. 138 00:09:18,500 --> 00:09:19,660 So, just be careful. 139 00:09:20,360 --> 00:09:24,360 Of course, the same thing into the smaller box as well. 140 00:09:24,400 --> 00:09:28,620 Here, what I need to do is choose USB LAN adapters and a hub. 141 00:09:28,800 --> 00:09:31,980 So, it gets tricky, but it still fits. 142 00:09:32,060 --> 00:09:37,340 So, depending on what you find in the market, as a discussed box, you can play around. 143 00:09:39,560 --> 00:09:43,060 So, how much does this cost? 144 00:09:43,060 --> 00:09:45,520 Because this must be a really expensive thing. 145 00:09:45,520 --> 00:09:48,720 Well, this is an example of how this box costs, right? 146 00:09:48,720 --> 00:09:52,880 So, to give you an idea, this is a Raspberry Pi Zero. 147 00:09:53,720 --> 00:10:01,600 The two USB LAN adapters, the USB, micro USB hub, are, like, ridiculously small. 148 00:10:01,940 --> 00:10:05,500 And just the outlet, which is one of the things more expensive. 149 00:10:05,860 --> 00:10:08,920 The outlet, I think, is $10 or something. 150 00:10:09,020 --> 00:10:10,720 So, yeah, you can get this for $50. 151 00:10:11,060 --> 00:10:13,360 So, if you don't want to go to pick it up. 152 00:10:13,360 --> 00:10:15,520 So, you do a pen testing, you leave it there. 153 00:10:15,720 --> 00:10:18,180 You are welcome to go and pick it up, or not. 154 00:10:18,720 --> 00:10:22,160 That's how well things finish on the pen testing report, right? 155 00:10:22,640 --> 00:10:26,020 So, you know, just in case you want to lose it. 156 00:10:27,300 --> 00:10:27,940 All right. 157 00:10:27,940 --> 00:10:30,240 So, the hardware is one thing. 158 00:10:30,240 --> 00:10:31,460 It's very simple components. 159 00:10:31,460 --> 00:10:36,600 It's LAN adapters, Raspberry Pi, plastic box, and some DC-DC bucket. 160 00:10:36,740 --> 00:10:39,040 So, now the question is what we are using as a software. 161 00:10:39,580 --> 00:10:44,060 Well, Circo is actually the little box, but we also have a few components. 162 00:10:44,060 --> 00:10:48,700 We have a component called Carpa, which is actually a software component only. 163 00:10:48,720 --> 00:10:50,220 Running on the internet. 164 00:10:50,220 --> 00:10:51,820 In a VPS, Python, and Linux. 165 00:10:51,820 --> 00:10:53,660 That's very simple components. 166 00:10:53,860 --> 00:10:54,860 So, that's software only. 167 00:10:54,860 --> 00:10:55,160 Why? 168 00:10:55,160 --> 00:11:00,500 Because once this box is infiltrated into the network, what is it going to do? 169 00:11:00,500 --> 00:11:02,640 Well, it's going to become a Cisco switch. 170 00:11:02,820 --> 00:11:04,120 To get discovered. 171 00:11:04,160 --> 00:11:08,840 So, all these lovely automation systems will connect to me and give me the credential. 172 00:11:08,840 --> 00:11:11,060 So, essentially, it's a honeypot, basically. 173 00:11:11,180 --> 00:11:13,180 But what happens once I have the credentials? 174 00:11:13,280 --> 00:11:16,300 SNMP, TEL, SSH, whatever the user sends to me. 175 00:11:16,340 --> 00:11:18,420 Great, now I need to exfiltrate to the internet. 176 00:11:18,720 --> 00:11:20,000 And this is the tricky part. 177 00:11:20,000 --> 00:11:22,660 Because I need something on the internet to receive it. 178 00:11:22,660 --> 00:11:25,700 And that's where Carpa comes into play. 179 00:11:26,120 --> 00:11:30,800 At the moment, I have a demo here, which I'm running on a Raspberry Pi, Linux. 180 00:11:30,800 --> 00:11:37,140 You can run it anywhere, any VPS on the internet, Amazon, or any VPS server will do. 181 00:11:37,340 --> 00:11:44,740 The only requirement is that you have a domain name assigned to NS records assigned to this public IP of your VPS. 182 00:11:44,740 --> 00:11:46,420 Or NATED, if you have a NATED. 183 00:11:46,420 --> 00:11:50,140 So, and then we have one more component, which is Haula. 184 00:11:50,160 --> 00:11:52,380 Haula is, again, a software component. 185 00:11:52,380 --> 00:11:56,420 You can run it on a Raspberry Pi with a power bank and a wireless adapter. 186 00:11:56,420 --> 00:12:00,100 What it does is, basically, you can also exfiltrate via wireless. 187 00:12:00,700 --> 00:12:05,600 So, it will do from the box itself to the internet, or via wireless. 188 00:12:05,600 --> 00:12:06,860 Or both, if you want to. 189 00:12:06,860 --> 00:12:09,140 But via wireless, of course, you need to be in proximity. 190 00:12:09,480 --> 00:12:12,440 Keep in mind here, we are not setting up any access point. 191 00:12:12,440 --> 00:12:16,700 This is not an access point, because that will be caught by WIPS, right? 192 00:12:17,060 --> 00:12:20,100 So, we don't want any WIPS to notice us. 193 00:12:20,540 --> 00:12:23,520 So, currently it's in Python 2. 194 00:12:24,240 --> 00:12:26,000 Coming to 3 soon. 195 00:12:26,000 --> 00:12:30,460 And it's all packet manipulation are mainly based in Scapi, in Python. 196 00:12:30,920 --> 00:12:36,800 And we are using some other tools from a different combination of people as well. 197 00:12:36,800 --> 00:12:38,920 For example, for the OS Fuller. 198 00:12:38,920 --> 00:12:44,140 Some part of the code of the OS Fuller to full NAC, effectively speaking. 199 00:12:44,720 --> 00:12:47,780 And what actually exfiltration we can use. 200 00:12:47,780 --> 00:12:55,280 We have ping, traceroute, NTP, HTTP, HTTPS, DNS, proxy and wireless. 201 00:12:55,460 --> 00:12:59,460 Of which, all of these are atomic. 202 00:12:59,460 --> 00:13:01,900 Basically, nothing come back, ever. 203 00:13:01,900 --> 00:13:05,420 So, from a firewall point of view, it's a timeout session, HOUT. 204 00:13:05,420 --> 00:13:09,740 So, there's never a session in none of those protocols that I just mentioned. 205 00:13:09,740 --> 00:13:12,000 Or established connection or anything back. 206 00:13:12,000 --> 00:13:15,660 So, basically the Carpa never send anything back to me. 207 00:13:16,640 --> 00:13:21,220 And another new feature that came out is just because I have a phone, right? 208 00:13:21,600 --> 00:13:23,080 And the phones keep working. 209 00:13:23,080 --> 00:13:25,880 I'm basically man in the middle between the phone and the network. 210 00:13:26,060 --> 00:13:30,640 However, most of the offices people connect the phone and the PC to the phone. 211 00:13:30,640 --> 00:13:36,060 So, that automatically give me free traffic from the PC as well. 212 00:13:36,120 --> 00:13:39,580 So, that was a free bug, kind of. 213 00:13:39,660 --> 00:13:46,440 So, effectively speaking, you can run different tools to capture TELNET, SSH, FTP. 214 00:13:46,440 --> 00:13:52,960 So , unencrypted protocols or hashes are exfiltrated as well. 215 00:13:52,960 --> 00:13:57,980 So, not just the network part, but also the PC, if any, connected to it. 216 00:13:59,120 --> 00:14:01,480 So, how I become a Cisco switch? 217 00:14:01,480 --> 00:14:05,060 Well, I need to be able to send a CDP, LLDPs. 218 00:14:06,020 --> 00:14:09,980 I need to be able to have an SNMP server agent basically running. 219 00:14:10,100 --> 00:14:11,800 And TELNET and SSH. 220 00:14:11,960 --> 00:14:14,080 And all my packets need to look like a Cisco switch. 221 00:14:14,240 --> 00:14:18,400 So, that was the triage, basically, of how we come up. 222 00:14:18,740 --> 00:14:24,760 So, for flows, I have a single mode that used to be when you don't connect the phone back. 223 00:14:24,760 --> 00:14:28,640 And the bridge mode, which is the most interesting for this talk. 224 00:14:31,080 --> 00:14:35,220 So, in bridge mode, this is how it will work the logic, right? 225 00:14:35,220 --> 00:14:44,500 So, once this box turns on, what it does is it does the discovery first to see what is the switch that is close to me, the real switch. 226 00:14:44,500 --> 00:14:45,960 And it tries to get the name. 227 00:14:45,960 --> 00:14:50,480 Once it gets the name, it will try to get one similar to itself. 228 00:14:50,480 --> 00:14:55,760 So, if this switch, for example, is switch Tokyo 01, it will become 03. 229 00:14:56,520 --> 00:14:59,080 It will change the last digit by two. 230 00:14:59,120 --> 00:15:00,620 The logic is very simple. 231 00:15:00,700 --> 00:15:03,060 There is always a fallback to test 01. 232 00:15:03,460 --> 00:15:07,500 We need to pretend to be a nice new brand Cisco switch in the network. 233 00:15:07,680 --> 00:15:10,220 So, we want to get that information first. 234 00:15:10,220 --> 00:15:14,420 Then we get an IP address and we start to set it up. 235 00:15:14,980 --> 00:15:17,360 Of course, the MAC address is of the Cisco switch. 236 00:15:17,360 --> 00:15:18,920 We change MAC address at the beginning. 237 00:15:18,920 --> 00:15:23,760 As well, one thing we want to do is to start to advertise CDP and LLDP to the switch. 238 00:15:23,760 --> 00:15:26,940 That's the way we get discovery of the automation tool. 239 00:15:27,440 --> 00:15:32,580 What tends to happen is the existing production switch is already hooked to automation tool. 240 00:15:32,580 --> 00:15:37,660 And when he sees CDP and LLDP new neighborhoods, he will discover that on the system. 241 00:15:37,660 --> 00:15:42,620 And the system, once a day, will connect and try to pull the config, etc., etc. 242 00:15:43,180 --> 00:15:45,320 Basically, give us the credentials. 243 00:15:45,320 --> 00:15:54,500 So, once this happens, once we get the credentials, we can set it up to how often we want to exfiltrate it. 244 00:15:54,880 --> 00:15:59,200 And I will cycle if we want to just do it once or do it every one hour. 245 00:15:59,200 --> 00:16:02,820 The same exfiltration and which method you want, all of them. 246 00:16:03,360 --> 00:16:11,780 So, to do this demo, I actually need to build a network with a proper switch and a firewall and a router and a DHCP and the internet. 247 00:16:11,780 --> 00:16:16,020 So, I used to have all this spread in the desk. 248 00:16:16,140 --> 00:16:17,460 It was very difficult to set it up. 249 00:16:17,460 --> 00:16:19,600 You always forget one cable and things don't work. 250 00:16:19,960 --> 00:16:25,760 So, because in Japan we have a Toyota that makes cars, right? 251 00:16:25,760 --> 00:16:29,100 So, it came out with Macaroni. 252 00:16:29,100 --> 00:16:34,300 This is our infrastructure in a box, basically, in a briefcase. 253 00:16:34,760 --> 00:16:36,920 And it only costs 200 bucks. 254 00:16:36,920 --> 00:16:39,380 It doesn't cost 20 grand like Toyota. 255 00:16:39,380 --> 00:16:42,920 But what it does is simplify things very much. 256 00:16:43,320 --> 00:16:47,580 And so, the lab itself... I know, everything has an acronym, right? 257 00:16:47,660 --> 00:16:49,760 It matches perfectly. 258 00:16:50,040 --> 00:16:52,480 So, the lab itself looks like this. 259 00:16:52,700 --> 00:16:56,060 It's basically a proper Cisco... you can look it up after if you want to. 260 00:16:56,060 --> 00:16:59,860 It's a proper Cisco switch and a CarPi simulated with a Raspberry Pi. 261 00:16:59,860 --> 00:17:05,340 I also hooked a Snort in the outside on the internet to see what the Snort will see. 262 00:17:05,340 --> 00:17:07,400 This Snort is configured as it comes. 263 00:17:07,400 --> 00:17:10,620 In the middle, there's no tuning. 264 00:17:10,640 --> 00:17:11,720 So, it's default, basically. 265 00:17:11,720 --> 00:17:12,280 All. 266 00:17:12,580 --> 00:17:15,580 So, it's supposed to catch even rubbish traffic as well. 267 00:17:16,560 --> 00:17:21,280 So, what I'm going to do is explain how the exfiltration technique works. 268 00:17:22,940 --> 00:17:29,200 So, for exfiltration, what I'm doing... I need to be able to tell my device in the internet... 269 00:17:29,200 --> 00:17:32,460 which... these credentials, who took it from. 270 00:17:32,460 --> 00:17:39,780 So, it came from my telnet daemon, my SSH daemon, through SNMP, or even the PC that was hooked. 271 00:17:39,960 --> 00:17:41,680 It's an optional work I'm working. 272 00:17:41,760 --> 00:17:46,220 Also, I want to know that this is enabled password of the switch, or is the user unpassword of the switch? 273 00:17:46,220 --> 00:17:48,360 And is SNMP the community of, basically? 274 00:17:48,420 --> 00:17:51,880 This work with SNMP 1, 2, V2 as well. 275 00:17:52,080 --> 00:17:53,460 3, not yet. 276 00:17:53,800 --> 00:17:56,760 Nobody used 3, actually, in any network that I'm aware of. 277 00:17:56,760 --> 00:18:06,040 So, this is the format and the source IP of the automation tool, or the laptop administrator, or whoever connects to my box. 278 00:18:06,760 --> 00:18:11,460 This is specifically the format that we want to exfiltrate. 279 00:18:11,460 --> 00:18:17,260 So, one way to exfiltrate this data is, first of all, we will encrypt it with AES-256. 280 00:18:18,040 --> 00:18:22,820 So, let me first go into Showtime. 281 00:18:24,280 --> 00:18:26,520 Let's start with the demo. 282 00:18:27,980 --> 00:18:29,920 Let me see if you can see. 283 00:18:38,320 --> 00:18:40,100 Let me close this. 284 00:18:51,790 --> 00:18:53,770 I cannot see, though. 285 00:18:54,610 --> 00:18:56,350 I cannot see what I'm typing. 286 00:18:58,290 --> 00:18:59,730 Let me bring back... 287 00:19:04,570 --> 00:19:05,670 Can I mirror? 288 00:19:17,820 --> 00:19:19,440 I don't know how to do this. 289 00:19:32,020 --> 00:19:33,280 Look better now? 290 00:19:35,490 --> 00:19:36,750 Look okay? 291 00:19:36,750 --> 00:19:38,370 Yep, right. 292 00:19:39,030 --> 00:19:45,410 So, this is my server in the Internet. 293 00:19:45,490 --> 00:19:50,930 So, when I run it, this gives me the options of the server. 294 00:19:51,650 --> 00:19:54,010 So, this is my snort. 295 00:19:54,170 --> 00:19:56,090 This is my administrator PC. 296 00:19:56,090 --> 00:19:58,410 And what I need now is my box. 297 00:19:58,890 --> 00:20:03,290 I also have this, because this version integrates with Faraday. 298 00:20:03,290 --> 00:20:06,590 So, let me log in. 299 00:20:09,840 --> 00:20:12,960 So, Faraday, I just have one workspace. 300 00:20:13,440 --> 00:20:15,160 And I have hosts. 301 00:20:15,200 --> 00:20:18,120 I only have one host with some vulnerabilities. 302 00:20:18,480 --> 00:20:21,200 All right, so let me do the magic. 303 00:20:29,240 --> 00:20:32,380 I do need to put a magnet, because I opened the lid. 304 00:20:32,940 --> 00:20:35,940 I need to hack the lid open 305 00:21:06,680 --> 00:21:07,160 . 306 00:21:07,600 --> 00:21:09,700 And there's a lot of flashing lights here. 307 00:21:09,800 --> 00:21:11,220 That is just a Raspberry Pi. 308 00:21:11,220 --> 00:21:12,940 Nothing more interesting than that. 309 00:21:12,940 --> 00:21:19,040 So, one thing that I did find out was how to prevent encryption. 310 00:21:19,040 --> 00:21:24,200 So, I'm going to use Lux to encrypt the partition, where I'm going to have the software here in case someone finds it. 311 00:21:24,200 --> 00:21:28,920 The problem with encryption is to decrypt and decrypt you need a key. 312 00:21:28,980 --> 00:21:32,580 So, what happens when you want to do that in a box that is already closed? 313 00:21:32,580 --> 00:21:33,740 You go there and put it. 314 00:21:33,740 --> 00:21:39,880 You don't have a laptop and installation system to put a keyboard to a Raspberry or whatever. 315 00:21:39,880 --> 00:21:48,020 So, what I came up with is I need a long key that I can use quickly to mount and encrypt this Raspberry Pi. 316 00:21:48,140 --> 00:21:51,180 So, I found that this Raspberry Pi has Bluetooth. 317 00:21:51,300 --> 00:21:52,260 Great. 318 00:21:52,320 --> 00:21:56,380 So, I created a million of applications. 319 00:21:56,380 --> 00:21:59,300 There's a Bluetooth application that you can create the services. 320 00:21:59,300 --> 00:22:01,460 You can do it from Linux as well. 321 00:22:01,460 --> 00:22:05,260 So, what I'm doing is I'm creating a service called Circo. 322 00:22:05,260 --> 00:22:09,860 And it has the UUID, which is 128 bits. 323 00:22:10,320 --> 00:22:11,560 So, guess what? 324 00:22:11,560 --> 00:22:12,720 That's my key. 325 00:22:13,340 --> 00:22:17,660 So, what this guy is doing, once he boot up, at the moment it's in demo mode. 326 00:22:17,660 --> 00:22:20,340 So, I should be able to access. 327 00:22:22,020 --> 00:22:32,400 So, if I do the F, the home drive I want to do is called PEncrypt. 328 00:22:32,420 --> 00:22:37,040 So, if I do, there's nothing because it's not mounted, right? 329 00:22:37,080 --> 00:22:39,840 So, what I'm going to do is turn on these Bluetooth services. 330 00:22:40,820 --> 00:22:43,400 It's a demo key, in case you are sniffing Bluetooth. 331 00:22:44,740 --> 00:22:46,760 It's not for production use, right? 332 00:22:47,360 --> 00:22:52,960 So, once I turn on, it runs every 5 seconds, I think I put it at 10 seconds. 333 00:22:53,260 --> 00:22:56,520 What it does, basically, is it's scanning to see if it found the services. 334 00:22:56,520 --> 00:22:59,580 And use that key to mount and decrypt looks. 335 00:23:00,540 --> 00:23:03,680 So, ideally this is all automatically, actually. 336 00:23:05,360 --> 00:23:09,860 Let me see, I think it's 10 seconds every... 337 00:23:09,860 --> 00:23:11,260 I don't remember where I put it. 338 00:23:11,900 --> 00:23:14,480 So, I create the services. 339 00:23:25,050 --> 00:23:25,850 System. 340 00:23:27,870 --> 00:23:28,670 Looks. 341 00:23:30,050 --> 00:23:33,350 Yeah, I create a little script, basically, to do that. 342 00:23:37,450 --> 00:23:38,790 Let me see, this is on. 343 00:23:40,250 --> 00:23:41,790 Or maybe I have Bluetooth. 344 00:23:42,610 --> 00:23:43,850 I will explain. 345 00:23:45,170 --> 00:23:46,530 There we go. 346 00:23:52,970 --> 00:23:54,890 Now it's jamming Bluetooth, right? 347 00:23:57,450 --> 00:23:58,790 Yeah, there you go. 348 00:24:03,970 --> 00:24:05,670 This is what happens with live demos. 349 00:24:07,090 --> 00:24:08,170 Come on. 350 00:24:19,860 --> 00:24:21,160 It did work before. 351 00:24:26,540 --> 00:24:27,460 Yes. 352 00:24:28,480 --> 00:24:29,900 Let me stop start. 353 00:24:34,950 --> 00:24:36,330 And let me do start. 354 00:24:57,130 --> 00:24:58,790 I think it's my phone, actually. 355 00:25:18,110 --> 00:25:19,030 Alright. 356 00:25:19,030 --> 00:25:20,270 Let's see. 357 00:25:56,440 --> 00:25:57,400 Alright. 358 00:26:01,000 --> 00:26:02,860 Let me do this manually. 359 00:26:10,240 --> 00:26:11,700 Let me create this. 360 00:26:19,980 --> 00:26:21,460 Oh, it did work. 361 00:26:21,860 --> 00:26:23,600 Oh, it was already mounted. 362 00:26:25,200 --> 00:26:25,900 Yeah. 363 00:26:27,360 --> 00:26:31,200 Playing with Bluetooth within DEF CON sometimes is not a good idea. 364 00:26:31,500 --> 00:26:33,720 So, let me turn this back off. 365 00:26:34,320 --> 00:26:36,020 Alright, it's already mounted. 366 00:26:36,020 --> 00:26:37,520 So, let me go to... 367 00:26:37,520 --> 00:26:40,980 This normally will start automatically, but... 368 00:26:40,980 --> 00:26:41,700 So... 369 00:26:42,720 --> 00:26:43,520 Oops. 370 00:26:43,800 --> 00:26:45,520 So, I'll just give you the menu. 371 00:26:45,520 --> 00:26:50,640 So, I have Carpa, which is the one in the Internet to receive the credentials, which I'm going to start in Verbose mode. 372 00:26:50,740 --> 00:26:53,300 And the plugin is a Faraday plugin. 373 00:26:54,120 --> 00:26:55,880 And the interface is here. 374 00:26:55,880 --> 00:27:00,100 And just a file where you want to put the output, the credentials you find. 375 00:27:01,800 --> 00:27:03,580 So, this is the Circo interface. 376 00:27:03,580 --> 00:27:07,120 So, what you do, first of all, we go into Bridge mode, where I put Verbose. 377 00:27:07,520 --> 00:27:11,700 We go into Bridge mode, because it's the one using the phone and the LAN at the same time. 378 00:27:11,700 --> 00:27:15,520 Still have backward compatibility, because that's a good way to do things. 379 00:27:15,900 --> 00:27:18,740 And then we can choose what exfiltration technique we want. 380 00:27:18,740 --> 00:27:20,680 You can choose either all, or... 381 00:27:20,680 --> 00:27:30,280 Can you ping DNS, HTTP, web, NTP, proxy... 382 00:27:30,280 --> 00:27:31,080 I don't know. 383 00:27:31,780 --> 00:27:34,320 I couldn't put minus A, actually. 384 00:27:34,540 --> 00:27:35,980 So, when you start it... 385 00:27:35,980 --> 00:27:36,400 Let me see. 386 00:27:36,400 --> 00:27:37,400 This one already started. 387 00:27:37,400 --> 00:27:38,300 I'm logging into Faraday. 388 00:27:38,300 --> 00:27:38,840 OK. 389 00:27:40,740 --> 00:27:43,520 Plugin to Faraday, what it does, basically, is... 390 00:27:43,520 --> 00:27:46,900 Every credential that he gets, he will inject it into Faraday directly. 391 00:27:47,220 --> 00:27:49,200 So, when the Circo starts, it's in Verbose mode. 392 00:27:49,200 --> 00:27:51,620 That's the reason you see all the steps of what it's doing. 393 00:27:51,920 --> 00:27:54,700 So, it starts becoming a Cisco MAC address switch. 394 00:27:54,700 --> 00:27:56,060 This is to bypass NAC. 395 00:27:56,060 --> 00:27:59,040 Due to the MAC address I'm using, it's a golden one. 396 00:27:59,220 --> 00:28:00,480 So, if you read through NAC... 397 00:28:00,480 --> 00:28:04,120 For Cloud NAC manual, there's a very small syntax that says... 398 00:28:04,120 --> 00:28:06,360 If you use this MAC address, you are always allowed. 399 00:28:07,380 --> 00:28:08,660 Just read the document. 400 00:28:08,660 --> 00:28:09,580 It should be fine, right? 401 00:28:09,580 --> 00:28:10,220 Guess what? 402 00:28:10,220 --> 00:28:11,360 That's what I'm using. 403 00:28:12,500 --> 00:28:13,080 Great. 404 00:28:13,080 --> 00:28:14,280 Thank you for the manual. 405 00:28:15,060 --> 00:28:16,120 So , it becomes a... 406 00:28:17,720 --> 00:28:19,040 Can you read, right? 407 00:28:19,440 --> 00:28:20,020 Yes? 408 00:28:20,560 --> 00:28:21,880 Do you know how we can make it bigger? 409 00:28:23,620 --> 00:28:24,680 That's too big? 410 00:28:24,920 --> 00:28:25,520 Better? 411 00:28:27,380 --> 00:28:29,200 So, what it does is... 412 00:28:29,200 --> 00:28:32,460 It becomes a MAC address switch. 413 00:28:32,460 --> 00:28:33,240 Discover. 414 00:28:33,240 --> 00:28:34,180 Start the ACP. 415 00:28:34,360 --> 00:28:36,840 This is all the configuration proxy. 416 00:28:37,020 --> 00:28:38,380 The proxy... 417 00:28:38,380 --> 00:28:40,640 I have three different techniques for the proxy. 418 00:28:40,640 --> 00:28:41,720 We'll go into details. 419 00:28:41,720 --> 00:28:43,420 This one is using the ACP. 420 00:28:43,820 --> 00:28:46,160 And then, from here onwards... 421 00:28:46,160 --> 00:28:48,880 It becomes a honeypot. 422 00:28:48,980 --> 00:28:49,520 Right? 423 00:28:49,520 --> 00:28:52,640 The last line you see is because the magnet I put there. 424 00:28:52,640 --> 00:28:54,960 The lid is open, but I put a magnet manually. 425 00:28:55,260 --> 00:28:57,940 So, if I take that magnet out, things will go crazy. 426 00:28:58,660 --> 00:29:00,260 So, now... 427 00:29:00,680 --> 00:29:02,880 I'm going to go to the real switch. 428 00:29:02,900 --> 00:29:04,180 This is my... 429 00:29:04,920 --> 00:29:06,200 Real switch. 430 00:29:06,920 --> 00:29:07,720 Right? 431 00:29:10,220 --> 00:29:11,940 This is Tokyo 01. 432 00:29:11,940 --> 00:29:13,400 It's my real switch. 433 00:29:13,400 --> 00:29:16,020 If I don't show CDP, neighbors... 434 00:29:16,020 --> 00:29:17,020 Guess what? 435 00:29:17,020 --> 00:29:18,400 I see a phone. 436 00:29:18,600 --> 00:29:20,960 I also see a switch called 03. 437 00:29:20,960 --> 00:29:22,460 It's a 2960. 438 00:29:23,000 --> 00:29:25,060 You can choose details. 439 00:29:25,780 --> 00:29:27,600 And this is... 440 00:29:27,600 --> 00:29:28,560 This is an IP address. 441 00:29:28,560 --> 00:29:29,880 This is a version. 442 00:29:29,900 --> 00:29:30,900 The port. 443 00:29:31,220 --> 00:29:31,860 The soft... 444 00:29:31,860 --> 00:29:33,120 It's a Cisco switch. 445 00:29:33,140 --> 00:29:36,380 So, I can see show CDP and show LLDP. 446 00:29:36,380 --> 00:29:38,140 As well, I can see LLDP. 447 00:29:38,240 --> 00:29:40,240 So, this switch, believe, is connect... 448 00:29:40,240 --> 00:29:42,240 Someone connected a new switch. 449 00:29:42,240 --> 00:29:45,260 Maybe in a meeting room, for a training or something. 450 00:29:45,800 --> 00:29:47,560 So, it does have an IP address. 451 00:29:47,560 --> 00:29:48,800 Which is 151. 452 00:29:48,900 --> 00:29:49,780 Right? 453 00:29:49,980 --> 00:29:52,380 So, this is my admin PC. 454 00:29:52,380 --> 00:29:54,700 What happens if I tell it that IP address? 455 00:29:58,400 --> 00:29:59,320 Okay. 456 00:29:59,320 --> 00:30:00,600 So, I type my... 457 00:30:01,800 --> 00:30:02,920 Superuser. 458 00:30:04,820 --> 00:30:06,720 And switch number 3. 459 00:30:06,720 --> 00:30:07,240 So, now... 460 00:30:07,240 --> 00:30:09,720 What I believe is a switch. 461 00:30:09,780 --> 00:30:11,020 I can run commands. 462 00:30:11,020 --> 00:30:11,740 Cisco commands. 463 00:30:11,740 --> 00:30:12,500 Show version. 464 00:30:12,500 --> 00:30:14,060 Yep, it's a 2960. 465 00:30:14,060 --> 00:30:15,700 This is the version running. 466 00:30:15,700 --> 00:30:17,580 Show IP route. 467 00:30:17,580 --> 00:30:19,440 Show IP app. 468 00:30:19,440 --> 00:30:20,840 Show MAC address. 469 00:30:20,840 --> 00:30:22,880 Show interface description. 470 00:30:23,020 --> 00:30:24,560 It is a Cisco switch. 471 00:30:24,560 --> 00:30:25,820 Well, I believe it. 472 00:30:26,580 --> 00:30:27,760 Show CDP. 473 00:30:27,760 --> 00:30:28,600 Neighbors. 474 00:30:29,340 --> 00:30:30,760 I need to type it correctly. 475 00:30:30,760 --> 00:30:32,240 Of course, it is a Cisco switch. 476 00:30:32,720 --> 00:30:35,160 Yeah, I can see now Cisco switch 1. 477 00:30:35,160 --> 00:30:36,040 The production one. 478 00:30:36,040 --> 00:30:38,900 So, they see each other in theory. 479 00:30:39,120 --> 00:30:41,480 Same with show LLDP. 480 00:30:42,040 --> 00:30:42,940 Neighbors. 481 00:30:42,940 --> 00:30:44,040 Yeah, I can see. 482 00:30:44,040 --> 00:30:45,060 So, from this switch... 483 00:30:45,060 --> 00:30:54,480 So, when automation systems connect to this switch, either by telnet or SSH, with the master credentials, they will run a set of commands to get the configuration, inventory, etc, etc. 484 00:30:54,480 --> 00:30:57,300 So, those are most of the commands that support. 485 00:30:57,300 --> 00:31:01,120 I did not code the whole iOS simulator just for fun. 486 00:31:01,360 --> 00:31:02,540 It wasn't fun. 487 00:31:03,880 --> 00:31:04,560 Yeah. 488 00:31:04,720 --> 00:31:07,220 The question mark also worked, by the way. 489 00:31:08,460 --> 00:31:08,960 Yeah. 490 00:31:08,960 --> 00:31:13,540 Oh, and if you want to go to show run, of course, you need to be enable mode. 491 00:31:13,540 --> 00:31:14,900 Okay, go enable. 492 00:31:15,240 --> 00:31:16,440 Yeah, sure. 493 00:31:16,880 --> 00:31:17,760 Great. 494 00:31:17,760 --> 00:31:18,500 Secret. 495 00:31:19,100 --> 00:31:20,580 Now, I can do show run. 496 00:31:20,720 --> 00:31:21,740 Yeah, that worked. 497 00:31:21,740 --> 00:31:23,720 What I can't do is config. 498 00:31:23,800 --> 00:31:25,100 No, that doesn't work. 499 00:31:25,100 --> 00:31:30,080 That's a common stack errors because I'm not going to prepare an iOS, basically. 500 00:31:30,080 --> 00:31:30,640 Right? 501 00:31:31,200 --> 00:31:33,200 So, this was a tenant I did. 502 00:31:33,200 --> 00:31:33,860 Right? 503 00:31:33,980 --> 00:31:37,440 So, you can see in the configuration that the community is public. 504 00:31:37,440 --> 00:31:38,680 The SNMP community. 505 00:31:38,680 --> 00:31:43,960 Now, what tend to happen is automation system will first try their own SNMP community. 506 00:31:43,960 --> 00:31:45,980 And if fail, it will try the public. 507 00:31:45,980 --> 00:31:47,900 You know, one of the least of the common ones. 508 00:31:48,040 --> 00:31:53,200 So, let's say I will try the system community. 509 00:31:53,200 --> 00:31:54,760 The one that they use in the company. 510 00:31:54,760 --> 00:31:55,320 Right? 511 00:31:56,180 --> 00:31:58,880 So, when I try that, that will not work. 512 00:31:58,980 --> 00:32:01,200 A, because it's public, the one that works. 513 00:32:01,400 --> 00:32:06,280 But, you did already give in the community with that command. 514 00:32:06,280 --> 00:32:07,980 So, when you do public... 515 00:32:10,400 --> 00:32:12,660 It has reply like a Cisco switch. 516 00:32:12,660 --> 00:32:15,780 It is actually a name, the uptime, the version. 517 00:32:15,780 --> 00:32:18,600 It is a full SNMP device that you can pull. 518 00:32:18,600 --> 00:32:22,160 Now, what happened when I went back to Carpa? 519 00:32:22,720 --> 00:32:25,500 Well, I start to receive this data. 520 00:32:25,520 --> 00:32:27,060 This is because it's verbose. 521 00:32:27,060 --> 00:32:44,900 So, basically tell me that something via ping from this public IP, telnet, usernetadmin, password Defcon, very smart, from this source IP they connect, which is internal IP of this administrator laptop automation system. 522 00:32:44,900 --> 00:32:50,040 And then I get the same password via ping DNS, traceroute. 523 00:32:50,040 --> 00:32:52,140 PDNS is proxy, by the way. 524 00:32:52,140 --> 00:32:59,620 HTTP, NTP, and then I also get this via here. 525 00:32:59,620 --> 00:33:08,000 So, oops, someone connect telnet enable, the E just standby enable with this super secret password. 526 00:33:08,000 --> 00:33:14,660 So, again, if I now do the same thing, let me open the... 527 00:33:15,800 --> 00:33:19,500 So, this is what this LPS is looking. 528 00:33:19,880 --> 00:33:23,020 Ignore the unreachable because I don't have internet connection, of course. 529 00:33:23,020 --> 00:33:29,580 But the only traffic that these guys can see, because I enable the default, is a ping. 530 00:33:29,620 --> 00:33:32,440 So, a Cisco switch is sending a packet ping. 531 00:33:32,440 --> 00:33:34,680 Nothing come back, but that's only alarm. 532 00:33:34,680 --> 00:33:39,620 Which I don't know anyone that has a snort with IC ping configured for alarms. 533 00:33:40,700 --> 00:33:43,080 That would be quite a lot of alarms. 534 00:33:43,280 --> 00:33:45,420 That's the only thing you can see on the snort side. 535 00:33:46,180 --> 00:33:55,260 So, again, when you see a P on the community, deleting the switch, my switch did not reply to the community, but you did give it to me. 536 00:33:55,480 --> 00:34:00,020 It did reply to public, but not to the community you give me, but I exfiltrate it. 537 00:34:00,340 --> 00:34:04,600 So, now if I go to Faraday, right? 538 00:34:04,600 --> 00:34:10,340 So, when I do a host, when I do refresh, now I have a new extra host. 539 00:34:10,340 --> 00:34:18,020 This 10.10.10.88 is the source IP of the automation tool or administrator, then whoever is connecting. 540 00:34:18,560 --> 00:34:27,340 So, what happen is if I go to the credentials, I can see the target, I can see the protocol, this comes with Telnet, the enabler, and the password. 541 00:34:27,340 --> 00:34:30,080 This is Telnet, the username, and the password. 542 00:34:30,180 --> 00:34:32,360 And this is SNMP. 543 00:34:32,400 --> 00:34:34,320 I should put SNMP instead of P. 544 00:34:34,620 --> 00:34:42,860 But, so now, as soon as I get them in Carpa, via an API, I can inject it in Faraday in real time. 545 00:34:43,040 --> 00:34:46,220 So, that's for helping the pen testing report side. 546 00:34:47,140 --> 00:34:50,860 So, now, what happen if I actually remove the magnet? 547 00:34:51,300 --> 00:34:51,940 You know? 548 00:34:53,440 --> 00:34:54,320 Careful. 549 00:34:57,590 --> 00:35:02,030 So, you start to see this alarm, alarm open, alarm open. 550 00:35:02,170 --> 00:35:04,770 That means that the, because I did not unplug it, right? 551 00:35:04,770 --> 00:35:06,570 I removed the magnet. 552 00:35:07,050 --> 00:35:17,730 So, what it does is when it detect that someone opened the case, the magnet get open, it will send a magic packet via exfiltration, saying that someone opened it. 553 00:35:17,730 --> 00:35:22,210 So, you know, maybe it's time to make the report. 554 00:35:23,450 --> 00:35:30,450 So, of course, you can make it, if you go here, for example, this was the circle running in debug mode, right? 555 00:35:30,450 --> 00:35:32,530 So, you see that it's sending the credentials. 556 00:35:33,030 --> 00:35:36,210 And here is when I took the magnet off, right? 557 00:35:36,290 --> 00:35:37,910 You can do this, for example. 558 00:35:37,910 --> 00:35:41,870 That command, what it does is immediately reboot. 559 00:35:42,790 --> 00:35:46,090 So, what it does, remember, because we have the Bluetooth encryption. 560 00:35:46,550 --> 00:35:51,970 So, unless I'm back close to this box with this thing enabled, that will not work if you reboot. 561 00:35:52,210 --> 00:35:56,030 So, if someone unplugged it and replugged it, it will not mount encryption. 562 00:35:56,030 --> 00:36:01,110 So, that is a balance between having encryption and functionality. 563 00:36:01,450 --> 00:36:04,470 So, if you want encryption, you want the Bluetooth, sure. 564 00:36:04,470 --> 00:36:08,290 But if someone by mistake unplugged and replugged it, it will not work again. 565 00:36:08,390 --> 00:36:11,810 You need to be back, walking around with your mobile in your pocket, right? 566 00:36:12,690 --> 00:36:14,190 So, yeah, you can do whatever you want. 567 00:36:14,190 --> 00:36:19,650 You can, you know, PGM pulls, I don't know, burn, fires, whatever you like there. 568 00:36:20,750 --> 00:36:24,070 So, this is the way that this stuff works. 569 00:36:24,110 --> 00:36:25,530 So, these are the components. 570 00:36:25,630 --> 00:36:28,450 So, let me go deep into the exfiltration. 571 00:36:34,340 --> 00:36:35,820 Something's in the middle, right? 572 00:36:37,660 --> 00:36:38,720 Excuse me. 573 00:36:38,720 --> 00:36:39,860 There you go. 574 00:36:40,700 --> 00:36:41,700 Go away. 575 00:36:48,770 --> 00:36:50,350 Alright, so how I do... 576 00:36:50,350 --> 00:36:52,210 So, this is basically a nice honeypot. 577 00:36:52,210 --> 00:36:53,770 Now, how do I take the data out? 578 00:36:53,770 --> 00:36:55,590 That's an interesting point. 579 00:36:55,670 --> 00:36:58,810 So, this is going back to basics. 580 00:36:58,810 --> 00:37:01,630 So, we are using protocols that are through firewalls. 581 00:37:01,630 --> 00:37:05,390 Some of them are blocking the company, some of them can't go through. 582 00:37:05,390 --> 00:37:09,730 So, for example, some companies do allow ping to go for troubleshooting or traceroute. 583 00:37:09,890 --> 00:37:12,430 So, these are the protocols I'm using. 584 00:37:12,430 --> 00:37:20,770 ICMP, I'm using specific TCP and IP and UDP packets fields to actually put my data. 585 00:37:20,770 --> 00:37:22,450 Remember, I have one line. 586 00:37:22,450 --> 00:37:27,490 It's a T, dash, comma, username, comma, password, comma, and IP address. 587 00:37:27,490 --> 00:37:35,610 That, what I do is encrypt it, AS256, and now chunk it in 2 bytes or 6 bytes. 588 00:37:35,610 --> 00:37:43,630 So, the way to work encryption, basically to decrypt it, you need to tell me how many packets I should expect, how long should my crypto be. 589 00:37:43,630 --> 00:37:49,830 So, I'm going to send you 13 bytes of crypto in 7 packets, 2 bytes each. 590 00:37:49,870 --> 00:37:54,190 So, first of all, I need to be able to tell that in advance before sending the packets. 591 00:37:54,190 --> 00:37:57,450 So, what I'm doing is, I'm sending one packet. 592 00:37:58,050 --> 00:38:00,290 These are the IP header. 593 00:38:00,290 --> 00:38:02,930 There's a field called identification in IP packets. 594 00:38:02,930 --> 00:38:05,590 That does not get changed by NAT. 595 00:38:05,590 --> 00:38:08,810 When you NAT through a firewall, that doesn't get changed. 596 00:38:09,030 --> 00:38:11,810 So, okay, it's 2 bytes that I can use for something. 597 00:38:12,770 --> 00:38:13,910 ICMP packets. 598 00:38:13,910 --> 00:38:18,050 Within the ICMP packet, you also have identification and sequence numbers. 599 00:38:18,050 --> 00:38:21,270 Again, 2 and 2 bytes that I can use for something. 600 00:38:22,030 --> 00:38:24,230 So, ICMP, how it works? 601 00:38:24,230 --> 00:38:28,250 Basically, I need to tell you my 13 bytes and 7 packets. 602 00:38:28,250 --> 00:38:35,150 So, I will send one packet saying that 213 is the IP ID, right? 603 00:38:35,150 --> 00:38:37,030 And the rest is just randoms. 604 00:38:37,030 --> 00:38:41,070 So, that means that the receiver knows that it's expecting 13 bytes, right? 605 00:38:41,070 --> 00:38:45,610 Then I'm going to send you 307 as the IP ID. 606 00:38:45,630 --> 00:38:49,650 300 means that actually you're expecting 7 packets, right? 607 00:38:49,650 --> 00:38:52,330 And then I will send you 7 packets, right? 608 00:38:52,330 --> 00:38:56,510 With the 500, 1, 500, 2 as a sequence ID. 609 00:38:56,510 --> 00:39:00,390 That is a sequence of a packet, in case they get a different order. 610 00:39:00,490 --> 00:39:08,770 And the crypto, within the ICMP sequence, which is 2 bytes, I will get that to become an integer, and that will be my crypto. 611 00:39:08,770 --> 00:39:11,550 So, I need 7 packets to do 13 bytes. 612 00:39:11,610 --> 00:39:12,670 Plus padding, right? 613 00:39:12,690 --> 00:39:14,450 One byte of padding. 614 00:39:14,710 --> 00:39:18,790 So, this is the way that most of the exfiltration technique works. 615 00:39:18,790 --> 00:39:25,090 It's basically chunking data into specific fields within different protocols. 616 00:39:25,090 --> 00:39:27,350 Like ping, for example, or traceroute. 617 00:39:27,770 --> 00:39:30,650 Traceroute, we are using the data payload. 618 00:39:30,690 --> 00:39:34,470 The Cisco switch, the last 4 bytes are rubbish. 619 00:39:34,530 --> 00:39:37,410 So, we are using those 4 bytes with X. 620 00:39:37,410 --> 00:39:39,330 My encrypted data becomes X. 621 00:39:39,330 --> 00:39:40,630 So, I encode it into X. 622 00:39:40,630 --> 00:39:43,170 It looks like an hexadecimal string. 623 00:39:43,190 --> 00:39:45,770 So, that's a good place to put 4 bytes. 624 00:39:46,690 --> 00:39:48,210 Again, similar concept. 625 00:39:48,210 --> 00:39:53,290 First, I need to tell you I'm sending 30 bytes and 7 packets, and then I send it one by one. 626 00:39:53,330 --> 00:39:58,610 Now, if we move into HTTP or HTTPS, remember, I'm not making a session. 627 00:39:58,610 --> 00:40:01,530 I'm just merely sending the same packet. 628 00:40:01,890 --> 00:40:02,810 That's it. 629 00:40:02,850 --> 00:40:09,550 So, there's something called window size in TCP, and do not change between the client and the server. 630 00:40:09,550 --> 00:40:10,230 Do not. 631 00:40:10,230 --> 00:40:12,570 So, you have not, and that thing doesn't change. 632 00:40:12,570 --> 00:40:13,570 Again, great. 633 00:40:13,570 --> 00:40:20,230 So, I have 1, 2 bytes that I can use that does not change between an internal client and an internet server. 634 00:40:20,430 --> 00:40:21,750 So, that's what I'm using. 635 00:40:21,910 --> 00:40:32,510 Similar concept, I'm using the sending 213, like we saw in ISMP, but I'm putting the crypto within the window size of the TCP packet. 636 00:40:32,510 --> 00:40:37,530 So, yeah, port 80, 443, or any port you like, 25 if you want to. 637 00:40:37,550 --> 00:40:41,590 But remember, most of the stuff probably don't have direct access to the internet. 638 00:40:41,590 --> 00:40:44,810 So, those exfiltration may not work. 639 00:40:46,110 --> 00:40:50,570 HTTP, HTTPS, actually any TCP port will be the same concept on this, right? 640 00:40:50,570 --> 00:40:56,330 You just send the SYN, nothing comes back, and the crypto goes into the window size. 641 00:40:56,390 --> 00:40:57,790 Of course, I become an integer, right? 642 00:40:57,790 --> 00:40:59,430 It's just supposed to be a number. 643 00:40:59,570 --> 00:41:01,570 So, from X, I convert it into an integer. 644 00:41:01,710 --> 00:41:04,290 And the whole process is in reverse on the other side. 645 00:41:04,290 --> 00:41:07,910 In the CARPA, it's the other side receiving, it's the whole thing the other way around. 646 00:41:09,470 --> 00:41:10,750 So, NTP. 647 00:41:10,750 --> 00:41:12,190 So , NTP was a bit fun. 648 00:41:12,370 --> 00:41:16,690 There's something called transmission timestamp, right? 649 00:41:16,690 --> 00:41:19,370 So, the transmission timestamp has this format. 650 00:41:19,770 --> 00:41:23,750 So, it's basically a timestamp plus a fraction. 651 00:41:23,890 --> 00:41:27,670 And the timestamp is 32 bits, and the fraction is 32 bits. 652 00:41:27,670 --> 00:41:31,530 Wait a minute, that's a lot of data I can put there into 32 bits. 653 00:41:31,690 --> 00:41:33,830 So, I'm using the fraction. 654 00:41:33,830 --> 00:41:46,970 So, basically the way that works is I'm using, I'm playing with the stratum and pole to tell them, again, my crypto is 13 bytes, and it will send 7 packets or 6 packets or whatever is the padding that I need to do. 655 00:41:46,970 --> 00:41:48,890 In this case, I can send 4 bytes. 656 00:41:48,890 --> 00:41:51,730 So, in reality, I don't need 7 packets because it's 13 bytes. 657 00:41:51,730 --> 00:41:53,610 So, maybe 4 packets will do. 658 00:41:53,970 --> 00:41:57,350 So, I need to tell them it's 4 packets for this protocol specifically. 659 00:41:57,770 --> 00:42:05,710 And then I put it in the fraction, convert it into an integer, so actually it's a float because it's 32 bits. 660 00:42:05,830 --> 00:42:07,730 And then the process is the other way. 661 00:42:07,730 --> 00:42:16,370 So, inside the NTP query, I'm putting the fraction timestamp of the transmission timestamp, 32 bits of it. 662 00:42:16,750 --> 00:42:18,690 DNS packet, this one is easy. 663 00:42:18,690 --> 00:42:24,250 It just uses subdomain, encrypted.mydomain.com. 664 00:42:24,250 --> 00:42:27,030 But I'm not sending a query to the internet. 665 00:42:27,030 --> 00:42:31,810 I'm sending an NS query to the actually internal DNS on the company. 666 00:42:31,810 --> 00:42:34,030 So, this attack is not direct. 667 00:42:34,650 --> 00:42:36,890 So, I don't have access to go outside. 668 00:42:36,990 --> 00:42:43,470 But the DNS server has internet resolution through a relay or direct maybe. 669 00:42:43,570 --> 00:42:48,950 So, what tends to happen when you do an NS query, what it does, it will do a recursion until you get it. 670 00:42:49,010 --> 00:42:52,530 Assuming your DNS actually has internet resolution. 671 00:42:52,790 --> 00:42:55,610 Again, this is a hash encrypted. 672 00:42:55,610 --> 00:42:59,490 It's 20 bytes, 13 bytes we talk, so it's not a very long chart. 673 00:42:59,490 --> 00:43:03,530 Uh, you send it one, one query. 674 00:43:03,530 --> 00:43:05,410 Here is, you don't need multiple. 675 00:43:05,810 --> 00:43:08,670 So, in this case it's the flow of the thing. 676 00:43:08,670 --> 00:43:13,830 You will send just to the DNS server, internal DNS server, and the DNS server will go just directly to the... 677 00:43:13,830 --> 00:43:21,390 The trick here is that NS server should be CARPA, the IP address, the public IP of course of that evil domain that you're using. 678 00:43:21,510 --> 00:43:25,770 Now, what happen when the company do not have DNS resolution as well? 679 00:43:25,770 --> 00:43:31,830 You know, no access to internet in any protocol, no DNS resolution, external DNS resolution. 680 00:43:32,210 --> 00:43:33,610 All right, proxy. 681 00:43:33,770 --> 00:43:35,010 They might have something. 682 00:43:35,510 --> 00:43:38,650 So , proxy works in a way, how you discover proxy? 683 00:43:38,790 --> 00:43:41,430 Well, through how you set up in PC's proxy. 684 00:43:41,430 --> 00:43:44,730 DHCP option 252, WAP, or GPO. 685 00:43:44,730 --> 00:43:48,750 This is the three main, or manually, but I don't think people do that anymore. 686 00:43:49,510 --> 00:43:51,450 Those are the three most common. 687 00:43:51,450 --> 00:44:00,770 Okay, so what I do for DHCP, I will do a DHCP inform to actually the DHCP server to see if that option 252 is there and get the pack file. 688 00:44:00,770 --> 00:44:03,150 Now, what you get is actually a pack file server, right? 689 00:44:03,150 --> 00:44:03,910 URL. 690 00:44:04,090 --> 00:44:11,070 Get there, connect, get the pack file, parse it to get the proxy IP and port, then connect to the proxy, right? 691 00:44:11,090 --> 00:44:14,430 And of course, all proxies are most likely authenticated. 692 00:44:14,650 --> 00:44:15,610 Doesn't matter. 693 00:44:15,610 --> 00:44:18,430 This doesn't need authenticate to the proxy to work. 694 00:44:18,510 --> 00:44:26,290 So, this is a bit tricky because this unfortunately works with all Bluecoats, McAfees, all the high-end proxies. 695 00:44:26,490 --> 00:44:29,130 Because they forgot about something. 696 00:44:29,130 --> 00:44:41,750 When I do a simple telnet to a proxy, and I do a get http, my crypto.mydomain, and of course, I do enter, enter, and I get a 403, right? 697 00:44:41,750 --> 00:44:42,890 From the proxy. 698 00:44:43,150 --> 00:44:52,790 However, the proxy will generate the log in the system saying this IP address tried to go to this URL and he got a 403. 699 00:44:53,050 --> 00:44:55,450 But a proxy does one more thing. 700 00:44:55,690 --> 00:45:00,390 He does an NSQuery of that URL to put in the log, the IP. 701 00:45:00,590 --> 00:45:01,810 Which there's no IP. 702 00:45:01,810 --> 00:45:09,950 But what that means is he, which has DNS resolution, now is querying my DNS server with a string that I want to send. 703 00:45:10,650 --> 00:45:11,310 So, he's... 704 00:45:12,310 --> 00:45:13,670 Okay, thank you. 705 00:45:13,670 --> 00:45:14,870 That will do. 706 00:45:15,510 --> 00:45:19,610 So, yes, it does generate one entry of 403 in a proxy logs. 707 00:45:19,610 --> 00:45:22,030 You know how many of those you get in a proxy constantly? 708 00:45:22,990 --> 00:45:23,830 Millions. 709 00:45:24,090 --> 00:45:25,510 So, yeah, great. 710 00:45:25,510 --> 00:45:28,190 That works if we have DHCP 0.252. 711 00:45:28,790 --> 00:45:32,530 Okay, sometimes you have WAP, if you still have WAP. 712 00:45:33,010 --> 00:45:39,870 Similar concept, I just will look for the WAP DNS entry, connect to the pack file, get the proxy, and do all over again. 713 00:45:40,070 --> 00:45:43,750 But again, no DHCP, no WAP, so most likely GPO. 714 00:45:43,950 --> 00:45:46,470 So, the last thing I can do is DNS guessing. 715 00:45:46,470 --> 00:45:57,570 Basically, you're given a array of names, like keywords, internet, or gateway, or GW, or PRX, or proxy, or gateway something. 716 00:45:57,570 --> 00:46:06,450 So, you do that list of 10, 15 words, and I will generate a dictionary with a dash, with an underscore, backward and forward. 717 00:46:07,110 --> 00:46:07,990 A matrix. 718 00:46:07,990 --> 00:46:11,370 And I will generate a list of 12, we'll say maybe 280. 719 00:46:11,590 --> 00:46:16,350 And then I will try, with a DNS internal, which one actually replied back to me. 720 00:46:16,470 --> 00:46:20,130 Then I will test, is this a proxy, a pack file server? 721 00:46:20,150 --> 00:46:22,270 So, I will try to connect and try to get a pack file. 722 00:46:22,390 --> 00:46:23,390 Could be something else. 723 00:46:23,390 --> 00:46:26,450 If it doesn't work, I will keep trying until I see something. 724 00:46:26,630 --> 00:46:29,210 So, this is the way to go around the GPO. 725 00:46:29,210 --> 00:46:32,350 Because GPOs, you need to have access to a Windows to actually see them. 726 00:46:32,350 --> 00:46:36,350 They're not in, it's per profile basically, so you can't really sniff it out of the network. 727 00:46:37,610 --> 00:46:39,670 And the last thing is the wireless. 728 00:46:39,890 --> 00:46:44,310 For wireless infiltration, remember I said I'm not setting up a wireless access point? 729 00:46:44,310 --> 00:46:45,870 I'm using beacons. 730 00:46:45,870 --> 00:46:49,930 Very short beacons of 500 milliseconds. 731 00:46:50,170 --> 00:46:58,150 So, what I'm doing is, within the beacons, I'm using the SSID names of the wireless at home and in many places. 732 00:46:58,150 --> 00:47:00,410 Normally tend to have like an X address. 733 00:47:00,410 --> 00:47:05,910 The last six digits of the MAC address of that home router is on the name of the wireless SSID. 734 00:47:05,970 --> 00:47:08,770 So, I'm taking the opportunity to mirror that. 735 00:47:08,770 --> 00:47:13,950 I'm broadcasting my standard MAC address, part of my crypto. 736 00:47:14,310 --> 00:47:17,250 Again, I have a 13 byte, I will chop it in three. 737 00:47:17,250 --> 00:47:18,990 I will have six, six, and one. 738 00:47:18,990 --> 00:47:20,250 We'll get padding. 739 00:47:20,250 --> 00:47:26,270 And then broadcast for 500 milliseconds that SSID of each of the three. 740 00:47:26,350 --> 00:47:33,190 And the receiver will be looking for, it's like a phone broadcasting SSIDs for a very short time of period. 741 00:47:33,190 --> 00:47:35,350 So, that's the reason WIPs will not see it. 742 00:47:35,590 --> 00:47:41,530 Basically, I'm using beacons as a back channel to push data out for credentials. 743 00:47:44,690 --> 00:47:46,610 And that's it. 744 00:47:53,790 --> 00:47:54,670 Questions? 745 00:47:59,080 --> 00:47:59,940 Oh, no. 746 00:48:03,870 --> 00:48:05,730 Can you defeat MACSEC? 747 00:48:06,490 --> 00:48:09,010 The thing is, when you connect the switch, right? 748 00:48:09,250 --> 00:48:11,690 What you have is actually a phone connected to the switch. 749 00:48:12,010 --> 00:48:18,050 So, most NAC systems, so if you like, you want to have a network with one MAC address allowed only. 750 00:48:18,190 --> 00:48:22,190 Well, most of the company has a phone, the phone tend to have a PC after. 751 00:48:22,190 --> 00:48:23,710 So, you need at least two. 752 00:48:24,090 --> 00:48:25,210 Minimum, right? 753 00:48:25,210 --> 00:48:30,370 So, because you are putting a Cisco switch and the MAC address that... 754 00:48:30,830 --> 00:48:31,830 Raspberry Pi. 755 00:48:31,830 --> 00:48:34,970 The MAC address I'm using is actually a golden MAC. 756 00:48:35,030 --> 00:48:36,790 NAC cannot block that one. 757 00:48:36,790 --> 00:48:39,270 Because the trick is very simple. 758 00:48:39,270 --> 00:48:43,650 There's a MAC address for virtual, like, HSRP or VRRP services. 759 00:48:43,710 --> 00:48:47,250 Cisco HSRP is a routing gateway, right? 760 00:48:47,250 --> 00:48:50,270 So, what it does is, they have virtual MAC address that they create. 761 00:48:50,270 --> 00:48:54,590 Those virtual MAC address are whitelisted by default in all NACs. 762 00:48:54,770 --> 00:48:56,350 Based on the documentation. 763 00:48:56,770 --> 00:48:58,410 I did not write it. 764 00:48:58,490 --> 00:49:00,030 So, I'm using one of those. 765 00:49:06,650 --> 00:49:07,810 Any other question? 766 00:49:11,000 --> 00:49:11,460 Yeah? 767 00:49:11,460 --> 00:49:12,100 Where? 768 00:49:15,550 --> 00:49:16,390 This one? 769 00:49:17,210 --> 00:49:18,050 Ah, sorry. 770 00:49:20,510 --> 00:49:23,830 Yeah, I will release the version after DEF CON. 771 00:49:23,830 --> 00:49:25,210 No time over DEF CON. 772 00:49:25,210 --> 00:49:26,190 It's procrastination. 773 00:49:26,190 --> 00:49:29,830 I will push it out to GitHub, the newest version. 774 00:49:29,990 --> 00:49:34,330 And the guide for the building is quite straightforward. 775 00:49:34,410 --> 00:49:37,030 It doesn't require electronics to do that. 776 00:49:37,030 --> 00:49:39,010 Just Raspberry Pi and a few things. 777 00:49:39,970 --> 00:49:43,630 And the presentation, I believe, the slides will be up soon. 778 00:49:43,630 --> 00:49:45,410 We put it in the website as well. 779 00:49:45,490 --> 00:49:46,530 There's a website somewhere? 780 00:49:46,530 --> 00:49:47,130 Yeah. 781 00:49:52,780 --> 00:49:54,340 There's stickers on the back. 782 00:49:54,340 --> 00:49:55,740 If someone wants stickers. 783 00:49:56,500 --> 00:49:57,760 If not, let me know. 784 00:49:57,760 --> 00:49:59,000 I still have some stickers. 785 00:50:00,440 --> 00:50:04,060 If no more questions, thank you very much for listening.