1 00:00:00,000 --> 00:00:01,900 I'm going to announce Chris McCoy. 2 00:00:01,900 --> 00:00:03,300 He's a good friend of mine. 3 00:00:03,320 --> 00:00:05,500 He's been at Cisco for 12 years. 4 00:00:05,580 --> 00:00:10,100 He's in this super spooky group called ASIC, like he mentioned. 5 00:00:10,100 --> 00:00:12,820 Nobody knows much about that village. 6 00:00:13,700 --> 00:00:17,360 I mean, much about that portion of Cisco. 7 00:00:17,360 --> 00:00:20,340 He's going to explain quite a bit about what they do. 8 00:00:20,480 --> 00:00:24,680 And then also open up some other information that I think you'll enjoy. 9 00:00:25,220 --> 00:00:27,660 He's a... well, you can see. 10 00:00:27,660 --> 00:00:29,500 He's a principal engineer for Cisco. 11 00:00:29,500 --> 00:00:31,820 He actually is going to be next door. 12 00:00:31,820 --> 00:00:35,060 He's been helping with setting up and running the village with us. 13 00:00:35,060 --> 00:00:38,020 So give a warm welcome to Chris McCoy. 14 00:00:38,020 --> 00:00:38,840 Thank you. 15 00:00:39,720 --> 00:00:41,100 Thank you, Joseph. 16 00:00:41,220 --> 00:00:41,860 Thank you. 17 00:00:43,000 --> 00:00:44,420 Thank you, Joseph. 18 00:00:44,720 --> 00:00:46,860 So yeah, my name is Chris McCoy. 19 00:00:46,920 --> 00:00:52,320 I am with ASIC, the Advanced Security Initiatives Group in Cisco. 20 00:00:52,720 --> 00:00:54,960 And we're primarily based out of Knoxville. 21 00:00:54,960 --> 00:00:56,180 We have people in Austin. 22 00:00:56,180 --> 00:00:59,220 We have people in RTP and all over, really all over the world. 23 00:00:59,220 --> 00:01:05,960 And what we do is we are the primary white hat hacker organization for Cisco. 24 00:01:05,960 --> 00:01:07,620 So let me go ahead and get into this. 25 00:01:07,620 --> 00:01:15,620 I'm actually going to show you a real security evaluation that we did on application-centric infrastructure and the results that we had. 26 00:01:16,100 --> 00:01:18,080 And anyway, let's just get into it. 27 00:01:18,580 --> 00:01:19,780 Hopefully you can see this. 28 00:01:19,780 --> 00:01:21,280 So these are the greats that fly. 29 00:01:21,280 --> 00:01:22,840 Nicholas, thank you so much. 30 00:01:22,840 --> 00:01:24,460 Everett, thank you so much. 31 00:01:24,460 --> 00:01:26,600 Amit, you know who you are. 32 00:01:26,600 --> 00:01:31,900 Omar and the rest of the ASIC crew, Terry, I couldn't have done this without you, so thank you. 33 00:01:31,900 --> 00:01:34,940 And audience, please save your questions until the end. 34 00:01:34,940 --> 00:01:37,980 I have a lot to get through, and I have a lot I want to show you. 35 00:01:38,120 --> 00:01:42,800 So just wait until the end, and then I'll answer any questions you have within reason. 36 00:01:42,960 --> 00:01:43,540 Okay? 37 00:01:46,180 --> 00:01:47,560 All right, so disclaimer. 38 00:01:47,560 --> 00:01:49,680 I am speaking for myself and not Cisco. 39 00:01:49,680 --> 00:01:53,140 I am not officially here on behalf of Cisco. 40 00:01:53,200 --> 00:01:54,640 I am in a Cisco group. 41 00:01:54,640 --> 00:01:56,840 This information is three years old. 42 00:01:56,960 --> 00:02:00,400 So these vulnerabilities that I am sharing with you have been around a long time. 43 00:02:00,400 --> 00:02:02,820 Just to give you an idea about when we got started. 44 00:02:02,820 --> 00:02:11,760 We got started on ACI just right after Cisco acquired NCME, which is the business unit that this came from. 45 00:02:12,180 --> 00:02:16,260 And so this is... a lot of this stuff has already been disclosed. 46 00:02:16,260 --> 00:02:18,820 It's already been released to customers a long time ago. 47 00:02:18,820 --> 00:02:23,000 And if this stuff still affects your network customers, it's because you aren't patching. 48 00:02:23,000 --> 00:02:24,180 Please patch. 49 00:02:24,680 --> 00:02:25,080 Okay. 50 00:02:25,280 --> 00:02:28,360 And this is not a rebuttal to the Black Hat 2019 talk. 51 00:02:28,360 --> 00:02:32,840 There was a talk called Apex Adventure in ACI Wonderland by Oliver and Frank Block. 52 00:02:33,640 --> 00:02:36,500 The findings might be interesting to those that have seen that. 53 00:02:36,500 --> 00:02:40,380 But if you haven't seen that before, it looks like I need to stay away from that speaker. 54 00:02:41,180 --> 00:02:44,940 But the findings may be interesting if you've seen that talk. 55 00:02:44,940 --> 00:02:47,660 But if you haven't seen that talk, then I'll actually go through this whole thing. 56 00:02:48,240 --> 00:02:52,640 Security and Trust Organization is who I'm part of with the Advanced Security Initiatives Group. 57 00:02:52,640 --> 00:02:54,360 And so we're security-focused. 58 00:02:54,360 --> 00:03:01,140 We try to find security vulnerabilities as early as possible in the product lifecycle. 59 00:03:01,140 --> 00:03:06,280 So we have... usually we work in about three or four team members. 60 00:03:06,280 --> 00:03:08,180 And we just hammer on a product. 61 00:03:08,180 --> 00:03:08,980 It could be for a month. 62 00:03:08,980 --> 00:03:10,400 It could be for six months. 63 00:03:10,400 --> 00:03:16,500 It's basically like a red team that lasts a long, long time looking for vulnerabilities. 64 00:03:16,500 --> 00:03:20,540 And we discover those zero days and we get them patched out and get our customers protected. 65 00:03:20,540 --> 00:03:21,500 That's what we're here for. 66 00:03:23,300 --> 00:03:26,440 I also wanted to tell you that networks are not that boring. 67 00:03:26,440 --> 00:03:29,960 I've made an entire career out of hacking networks. 68 00:03:30,220 --> 00:03:31,300 It's amazing. 69 00:03:31,640 --> 00:03:36,580 There are so many things and so many opportunities for red teaming networks you have no idea. 70 00:03:37,140 --> 00:03:39,740 Apps and operating systems I actually find a little bit boring. 71 00:03:39,740 --> 00:03:40,900 I like the plumbing. 72 00:03:41,140 --> 00:03:47,640 Because the plumbing has a lot of opportunities for attack surfaces and all kinds of things. 73 00:03:47,640 --> 00:03:48,860 And I'm going to show you one. 74 00:03:49,620 --> 00:03:53,080 Okay, so I'm going to get into software-defined networking, SDN. 75 00:03:53,240 --> 00:03:55,240 SDN means a lot of things to a lot of people. 76 00:03:55,240 --> 00:03:56,880 It has a bunch of different definitions. 77 00:03:57,180 --> 00:03:59,680 This is really what it is, kind of boiling it down. 78 00:04:03,460 --> 00:04:07,580 So, boiling down software-defined networking, it is really about a central point of management. 79 00:04:07,580 --> 00:04:08,640 That's what you want. 80 00:04:08,660 --> 00:04:12,940 You want to optimize your network for physical, virtual machines and containers. 81 00:04:13,260 --> 00:04:19,040 You also want to do some kind of policy enforcement so that you have what are called micro-segmentation. 82 00:04:19,040 --> 00:04:22,340 Where only certain services can talk to other services. 83 00:04:22,340 --> 00:04:24,000 And I'll get into that a little bit more. 84 00:04:24,380 --> 00:04:27,180 But really what you need is you need programmability. 85 00:04:27,180 --> 00:04:30,360 You need to adapt the network to the endpoints, the agile forwarding path. 86 00:04:30,360 --> 00:04:32,040 And you need to have some kind of discovery. 87 00:04:32,040 --> 00:04:34,180 You need to know where things are located. 88 00:04:34,500 --> 00:04:38,320 In ACI, in Cisco ACI, this is made for a data center. 89 00:04:38,420 --> 00:04:41,860 It is designed to scale up to one million endpoints. 90 00:04:41,900 --> 00:04:45,480 And an endpoint can be a VM, it's an IP address, MAC address. 91 00:04:45,480 --> 00:04:49,860 It scales up to that large of a data center. 92 00:04:50,200 --> 00:04:54,100 It also has the property of multi-tenancy. 93 00:04:54,380 --> 00:04:58,860 So you have many different customers that are all connecting to the same data center network. 94 00:04:58,860 --> 00:05:01,000 And they all want to be able to control their own policies. 95 00:05:01,000 --> 00:05:02,800 So it's a multi-tenant environment. 96 00:05:03,100 --> 00:05:06,320 You also want to control how endpoints communicate. 97 00:05:06,320 --> 00:05:10,940 What TCP ports are available from one source to a destination. 98 00:05:11,440 --> 00:05:13,700 You also want to be able to insert middle boxes. 99 00:05:13,700 --> 00:05:18,780 You want to do things like load balancing, real firewalls, NAT. 100 00:05:18,780 --> 00:05:21,640 If you're doing carrier-grade NAT, maybe you need something like that. 101 00:05:21,680 --> 00:05:27,260 And so the answer to all of this is the application-centric infrastructure or ACI, Cisco's ACI. 102 00:05:27,660 --> 00:05:29,460 And so this is the way the fabric looks. 103 00:05:29,460 --> 00:05:34,900 The fabric is made up of switches that are in the rolls of leafs and spines. 104 00:05:35,000 --> 00:05:39,680 So this is what's called a cloth network, if you've ever heard of this, a bipartite graph. 105 00:05:39,680 --> 00:05:46,660 You have a spine, and the spines are really responsible for routing traffic from one leaf to the other. 106 00:05:46,660 --> 00:05:51,280 The leafs are fully meshed up to the spines, and the spines are fully meshed down to the leafs. 107 00:05:51,320 --> 00:05:54,480 And the idea is that you can load balance across the spines. 108 00:05:54,760 --> 00:05:56,300 And this is just one layer. 109 00:05:56,300 --> 00:06:01,000 You have very large networks, like at Facebook, where they have multiple layers of leaf and spines. 110 00:06:01,800 --> 00:06:05,200 They also have other layers down here, too, where you have maybe top-of-rack switches. 111 00:06:05,200 --> 00:06:06,960 But typically, this is what it looks like. 112 00:06:06,960 --> 00:06:10,740 And then attached to the leafs, you have the controllers. 113 00:06:10,740 --> 00:06:12,260 Those are called your APICs. 114 00:06:12,260 --> 00:06:17,320 That's your Advanced Policy Infrastructure Controller, is what an APIC stands for, APIC. 115 00:06:18,560 --> 00:06:21,080 And attached to your leafs, you've got your servers. 116 00:06:21,080 --> 00:06:22,580 You've also got something called VLEAFS. 117 00:06:22,580 --> 00:06:30,320 This is your hypervisors that actually are running the code, the ACI code, to be able to do the fine-grained policy that I was talking about earlier. 118 00:06:30,360 --> 00:06:33,180 You have virtual machines and containers that are running in there. 119 00:06:33,180 --> 00:06:34,920 You've got your firewalls. 120 00:06:34,920 --> 00:06:39,100 These are your services, your Layer 4 through 7 services that you're doing for load balancing. 121 00:06:39,320 --> 00:06:41,220 And then you have external networks of some kind. 122 00:06:41,220 --> 00:06:43,140 You have to connect this somewhere. 123 00:06:43,480 --> 00:06:48,020 You have to connect to routers and switches that go outside. 124 00:06:48,020 --> 00:06:50,020 You need to sometimes maybe connect to the Internet. 125 00:06:50,020 --> 00:06:51,980 You need to connect to your intranet. 126 00:06:51,980 --> 00:06:53,420 And you'll have an external network. 127 00:06:53,420 --> 00:06:57,300 And so the thing to keep in mind is, for the most part, you don't attach to the spines. 128 00:06:57,300 --> 00:06:58,940 That's not always true. 129 00:06:58,940 --> 00:07:04,620 But you attach to the leaf, and you'll have things like services for leafs that you attach to. 130 00:07:04,860 --> 00:07:06,080 Is everybody with me so far? 131 00:07:06,080 --> 00:07:08,200 This is an example of what these switches look like. 132 00:07:08,200 --> 00:07:10,200 They are rather high-powered. 133 00:07:10,480 --> 00:07:15,520 The ones on the top actually do power over Ethernet, so you can attach things like phones and cameras to them. 134 00:07:15,780 --> 00:07:23,840 The one on the bottom, that has multiple 25 gigabit Ethernet connections, and it has, I believe, it's either 100 gig... 135 00:07:23,840 --> 00:07:26,400 Yeah, I think it's 100 gig uplinks that it has. 136 00:07:26,400 --> 00:07:28,400 So this is pretty high-powered stuff. 137 00:07:28,400 --> 00:07:32,180 Many, many different connections, like I was talking about earlier, up to a million endpoints. 138 00:07:33,160 --> 00:07:34,400 Okay, ACI, they have... 139 00:07:35,240 --> 00:07:36,480 So I'm a CCIE. 140 00:07:36,480 --> 00:07:38,860 I've been doing networking for about 25 years. 141 00:07:38,920 --> 00:07:45,440 And I had to completely unlearn networking to really understand how this thing worked, because it was just boggling the heck out of my mind. 142 00:07:45,440 --> 00:07:46,720 I just couldn't understand it. 143 00:07:46,740 --> 00:07:50,520 But at first, really, I had to unlearn it and then relearn it to really understand what's going on. 144 00:07:50,580 --> 00:07:53,100 When you have VLANs, they aren't really VLANs per se. 145 00:07:53,100 --> 00:07:54,480 I mean, they're not bridge domains. 146 00:07:54,480 --> 00:07:59,180 They represent what are called endpoint groups, EPGs, endpoint groups. 147 00:07:59,180 --> 00:08:04,260 And endpoint groups are a grouping of endpoints, and they are allowed to freely communicate inside of the endpoint group. 148 00:08:04,260 --> 00:08:10,580 So all of your endpoints that are inside of your endpoint group, they can talk to each other without any kind of policy, any kind of constraints. 149 00:08:10,720 --> 00:08:14,160 You can go from one endpoint group to the other without any problems. 150 00:08:14,200 --> 00:08:19,040 So the idea with this is that, you know, we're running out of IPv4 addresses, right? 151 00:08:19,040 --> 00:08:25,040 I mean, and people have to make these very large networks, and you have to be able to constrain your network so that... 152 00:08:25,720 --> 00:08:31,100 or you need to be able to design your network so that you don't have to be constrained by IP addresses and VLANs and all those things. 153 00:08:31,100 --> 00:08:33,040 And that's what EPGs are all about. 154 00:08:33,620 --> 00:08:34,100 Contracts. 155 00:08:34,140 --> 00:08:38,020 Contracts are what allow you to talk from one EPG to another. 156 00:08:38,020 --> 00:08:47,210 These are basically saying you have a provider and consumer relationship that says, I am providing TCP 443, HTTPS. 157 00:08:47,210 --> 00:08:49,830 I'm providing this to anybody that wants it. 158 00:08:49,910 --> 00:08:57,150 And then if I have a contract that comes along and it consumes that endpoint group, then that endpoint group can use that TCP 443. 159 00:08:57,250 --> 00:09:01,430 And if you're not part of that contract, then you don't get access to that port. 160 00:09:01,430 --> 00:09:02,910 It's the way it's supposed to work. 161 00:09:03,850 --> 00:09:07,490 Okay, inside of the fabric, the fabric is completely Layer 3. 162 00:09:07,490 --> 00:09:13,550 Even when you're doing Layer 2 connectivity, when I say Layer 3 and Layer 2, when I say Layer 3, you're actually going through a router. 163 00:09:14,390 --> 00:09:19,450 When you're going through from one endpoint group to another endpoint group, you're always going to be routing. 164 00:09:19,710 --> 00:09:22,070 And the way they do this is they use an overlay. 165 00:09:22,070 --> 00:09:24,770 You've probably heard of things like VXLAN. 166 00:09:24,810 --> 00:09:30,970 If you haven't learned VXLAN, you don't understand VXLAN, you really should, because everything is going that way. 167 00:09:30,970 --> 00:09:37,130 And they're starting to even use VXLAN in the edge of your network in your access layer. 168 00:09:37,130 --> 00:09:41,630 Cisco has software to find access, and I'm sure there's probably a lot of other ways out there. 169 00:09:41,710 --> 00:09:44,930 But as it turns out, it makes it really easy to be able to do policies. 170 00:09:44,930 --> 00:09:47,410 Please save your questions until the end of the presentation. 171 00:09:47,410 --> 00:09:48,190 Thank you. 172 00:09:49,150 --> 00:09:51,270 Okay, your links are IP unnumbered. 173 00:09:51,270 --> 00:09:53,310 We're using ISIS internally. 174 00:09:53,310 --> 00:09:54,790 That's the routing protocol that they use. 175 00:09:54,790 --> 00:10:00,490 And one of the things about ISIS that makes it really interesting is that it runs on link, and it runs at Layer 2. 176 00:10:00,530 --> 00:10:05,610 And it doesn't actually give you an opportunity to be able to inject things across broadcast domains. 177 00:10:05,610 --> 00:10:13,270 So if you're on a switch, what this means, if you're on a switch, you're not able to actually get access to that link to be able to inject things into ISIS. 178 00:10:13,270 --> 00:10:14,410 So it's a little better. 179 00:10:14,710 --> 00:10:21,650 But it's always Layer 3 routed, and they advertise what are called VXLAN tunnel endpoint IP addresses. 180 00:10:21,850 --> 00:10:25,670 So whenever you have a frame to send, it goes into the leaf switch. 181 00:10:25,670 --> 00:10:31,510 The leaf switch encapsulates it in VXLAN and routes it across the fabric to the destination leaf switch. 182 00:10:31,510 --> 00:10:40,830 The destination leaf switch then takes that encapsulated Ethernet packet frame, strips off the VXLAN stuff, and sends it on its way to where it needs to go. 183 00:10:42,090 --> 00:10:44,210 And they use ISIS. 184 00:10:44,210 --> 00:10:46,130 It's been tuned for a densely connected fabric. 185 00:10:46,130 --> 00:10:50,850 So of course you have many connections that are going all over the place, and it's been tuned so that it works. 186 00:10:50,850 --> 00:10:52,090 And they use IK multicast. 187 00:10:52,090 --> 00:10:55,610 If you don't know where things are going, they use anycast. 188 00:10:55,830 --> 00:11:00,610 So one of the things I'll talk about a little bit later on is that the spines are not dumb. 189 00:11:00,610 --> 00:11:02,790 The spines are actually really smart. 190 00:11:02,790 --> 00:11:05,850 They're the ones that do all of the tracking of who's connected where. 191 00:11:07,370 --> 00:11:10,450 We talk about tenants, VRFs, and bridge domains. 192 00:11:10,630 --> 00:11:19,910 VRFs, and they call this a context inside of ACI, but it's basically when you get boiled down to it, you've got a VRF, which is a routing table. 193 00:11:19,910 --> 00:11:29,190 You have a bridge domain, and the bridge domain contains subnets, and those subnets can be anywhere on any leaf switch that's in your fabric. 194 00:11:29,190 --> 00:11:32,750 And you have multiple of these since you have multiple tenants. 195 00:11:34,250 --> 00:11:35,510 So endpoint discovery. 196 00:11:35,510 --> 00:11:42,930 So when a device talks to the fabric for the first time, it will maybe send DHCP, send ARP, send something. 197 00:11:42,930 --> 00:11:45,470 It doesn't know who it is and who it's talking to. 198 00:11:45,470 --> 00:11:50,750 So what happens is the leaf switches are constantly listening on these things to do discovery. 199 00:11:50,750 --> 00:11:59,950 So when a VM, for instance, sends a packet for the first time, the leaf switch will pick it up, and it does a source lookup to see whether or not it knows where that leaf or that source is. 200 00:12:00,110 --> 00:12:04,090 And once the endpoint is discovered, it sends through a proprietary protocol called COOP. 201 00:12:04,090 --> 00:12:09,690 That's the Council of Oracle's protocol, and that's how it does location learning. 202 00:12:10,370 --> 00:12:17,830 So just in this example here, I'm showing something different where we have a VM that's running in vSphere. 203 00:12:17,830 --> 00:12:19,630 It's running VMware. 204 00:12:19,770 --> 00:12:21,030 It talks to the vSwitch. 205 00:12:21,030 --> 00:12:24,890 The vSwitch then sends it on to the vXLAN endpoint. 206 00:12:24,890 --> 00:12:27,530 So this is supposed to be agnostic. 207 00:12:27,530 --> 00:12:29,210 Pretty much vXLAN has won out. 208 00:12:29,210 --> 00:12:32,310 There's another encapsulation technology out there called Geneva. 209 00:12:33,170 --> 00:12:39,230 But there used to be NVGRE, and I think Microsoft has also kind of moved away from that. 210 00:12:39,250 --> 00:12:56,890 But once the ingress learns the MAC address and IP address of the arriving frame, it sends that along with the ingress port vLAN and vXLAN to the switch, and then the leaf forwards that endpoint address to the spines using the 0MQ protocol. 211 00:12:56,890 --> 00:12:58,050 That's what they use. 212 00:12:58,510 --> 00:13:03,350 And then that information is spread out, or it's distributed to all of the spines. 213 00:13:03,350 --> 00:13:06,970 So all of the spines know at any one time who's connected where. 214 00:13:06,970 --> 00:13:08,430 Hopefully that makes sense. 215 00:13:08,730 --> 00:13:10,590 This will come important later. 216 00:13:10,590 --> 00:13:23,170 And then when you send the information, when you send the frame to the egress leaf, the egress leaf then is able to learn the source address, MAC address, and all that other information when it gets to where it's going, unless you tell it not to. 217 00:13:23,170 --> 00:13:25,590 There's a flag in the frame that says don't learn this. 218 00:13:26,810 --> 00:13:27,950 So what is this for? 219 00:13:27,950 --> 00:13:29,250 What are we going with this? 220 00:13:29,250 --> 00:13:31,170 So just showing you, this is the life of the packet. 221 00:13:31,170 --> 00:13:32,270 This is how the packet works. 222 00:13:32,270 --> 00:13:35,030 It's sent from the vSwitch to the vTEP. 223 00:13:35,030 --> 00:13:43,950 The leaf switch then, if you're using vXLAN, it actually swaps out the vXLAN information for its own internal and semi-vXLAN protocol. 224 00:13:43,950 --> 00:13:46,850 It goes across the fabric. 225 00:13:47,230 --> 00:13:53,070 If it doesn't know the destination, it sends it to a spine using an anycast IP address. 226 00:13:53,070 --> 00:14:00,910 And it's just basically a range of IP addresses that are allocated to all of the spines, and all the spines are listening on that IP address all the time. 227 00:14:00,910 --> 00:14:05,390 Then in hardware, they're able to do that lookup to find out where that actual destination is. 228 00:14:05,390 --> 00:14:07,790 And then it gets sent to the destination leaf switch. 229 00:14:07,790 --> 00:14:10,770 The leaf switch then strips off that information and replaces it. 230 00:14:10,770 --> 00:14:14,510 If they're using VLANs for your endpoint groups, it can use VLANs. 231 00:14:14,510 --> 00:14:18,330 If you're using NVGRE, which isn't as popular anymore, they may use that. 232 00:14:18,750 --> 00:14:20,650 But that's basically how it all works. 233 00:14:22,690 --> 00:14:24,610 So then we get into VRFs. 234 00:14:24,610 --> 00:14:26,410 I'm going to just zip through this a little bit. 235 00:14:26,630 --> 00:14:32,850 But this just shows how tenants, VRFs, and bridge domains, and endpoint groups all work together. 236 00:14:32,850 --> 00:14:35,770 How the frame source information is kept. 237 00:14:35,770 --> 00:14:39,690 It's actually relayed from one leaf switch to the other through vXLAN. 238 00:14:39,690 --> 00:14:44,770 And the APIC controls the allocation of VNID labels across the fabric. 239 00:14:44,810 --> 00:14:53,010 By labels, I mean things like your actual VNIDS, that's your vXLAN network ID, and your source groups, and all those other things. 240 00:14:53,010 --> 00:14:57,330 And it does policy enforcement either at the source or the destination. 241 00:14:57,970 --> 00:15:04,110 And whether or not the policy has already been enforced is signaled through a flag in the label. 242 00:15:04,110 --> 00:15:05,870 And this will become important later. 243 00:15:06,890 --> 00:15:12,470 Central Management and ACI, they use a REST API that's load-shared through the APICs for everything. 244 00:15:12,470 --> 00:15:15,970 In other words, you can put a load balancer in front of this thing and it would work just fine. 245 00:15:15,970 --> 00:15:18,390 It doesn't matter which APIC it shows up on. 246 00:15:18,770 --> 00:15:23,210 It uses what's called sharding, which sounds really dirty to me. 247 00:15:26,030 --> 00:15:28,490 But everything is sharded. 248 00:15:30,010 --> 00:15:34,170 In other words, they have different instances that run on different APICs. 249 00:15:34,170 --> 00:15:36,910 I'm going to get into the security a little later on, I promise you. 250 00:15:37,710 --> 00:15:39,790 But they use this API for everything. 251 00:15:39,790 --> 00:15:43,550 They use it for the REST, they use it for the GUI, they even use it for the CLI. 252 00:15:43,710 --> 00:15:51,470 So when you're on the command line interface and you're SSH'd in, they actually run a chroot jail when you're SSH'd into the box. 253 00:15:52,110 --> 00:15:58,750 And even when you're talking to, even when you're configuring things through the CLI, that even gets translated up to the REST API. 254 00:15:58,750 --> 00:16:02,050 So they really have only one way in or out of this system. 255 00:16:02,050 --> 00:16:05,290 Which is good, because it only gives you one thing to secure. 256 00:16:06,530 --> 00:16:10,890 And they also have a Python SDK called Cobra that they use to manage. 257 00:16:10,890 --> 00:16:13,070 So let's actually get into the interior of this thing. 258 00:16:13,070 --> 00:16:14,850 This is how it all fits together. 259 00:16:14,930 --> 00:16:16,310 These are your switches. 260 00:16:16,310 --> 00:16:19,690 These could be either leafs, these could be spines, and then you have your APICs. 261 00:16:19,730 --> 00:16:25,790 And your APICs somehow magically can connect to and talk to the leaf switches or the spines. 262 00:16:25,790 --> 00:16:28,050 And the APICs run these processes inside them. 263 00:16:28,050 --> 00:16:30,910 These are called data management engines, or DMEs. 264 00:16:30,910 --> 00:16:36,130 And the DMEs have their own internal proprietary protocol called intrafabric messaging. 265 00:16:36,390 --> 00:16:40,190 And the primary front door through this whole thing is through NGINX. 266 00:16:40,750 --> 00:16:47,750 So the DMEs are responsible for a little part of something called the Management Information Tree, or MIT. 267 00:16:48,310 --> 00:16:51,770 And all communication happens through NGINX. 268 00:16:51,770 --> 00:16:54,590 So if you're going from the outside in, you're going through NGINX. 269 00:16:54,730 --> 00:17:00,430 And they communicate to each other from the switch, from the APICs, all through IFM. 270 00:17:00,430 --> 00:17:06,090 And it happens in between the VTAP IP addresses, and how they secure that I'll get into in a little bit. 271 00:17:07,030 --> 00:17:10,310 This is just a gee whiz diagram of how this all works. 272 00:17:10,310 --> 00:17:16,170 What's important here is that they have the intrafabric messaging that comes in over TCPIP. 273 00:17:16,170 --> 00:17:19,230 So internally, this is all proprietary the way this all works. 274 00:17:19,730 --> 00:17:21,730 They have the doer. 275 00:17:21,730 --> 00:17:26,270 They have this model that tells what they need to do in this Management Information Tree. 276 00:17:26,270 --> 00:17:29,930 And they have a replicator to replicate it to other DMEs if you're doing sharding. 277 00:17:29,930 --> 00:17:33,430 And then they have a persistifier which stores to an SQLite database. 278 00:17:33,610 --> 00:17:36,310 And each of these has its own database. 279 00:17:36,370 --> 00:17:41,310 And they also structured it so that if for sensitive data, they encrypt that data. 280 00:17:41,310 --> 00:17:44,610 If it needs to be encrypted, it will be encrypted on the box. 281 00:17:45,690 --> 00:17:47,130 It's actually not a bad design. 282 00:17:47,130 --> 00:17:49,170 I'm pretty impressed with it otherwise. 283 00:17:49,330 --> 00:17:55,230 Communication of policy and ACI, they use DME to DME communication through IFM. 284 00:17:55,270 --> 00:17:58,690 And they use TLS using mutual authentication. 285 00:17:58,690 --> 00:18:02,770 So there is authentication not only of the client but also of the server. 286 00:18:02,770 --> 00:18:07,030 And the certificates that they use are loaded on the switches in the APICs at the factory. 287 00:18:08,190 --> 00:18:13,510 So the certificates that are used, they have a very long expiration date. 288 00:18:13,750 --> 00:18:20,890 And the way they work is they use that certificate to authenticate the client and authenticate the server. 289 00:18:21,710 --> 00:18:24,030 I think you guys can see where this is going. 290 00:18:24,710 --> 00:18:34,530 The abstract policy on the APIC that they use, the endpoint groups, they actually take that and they make it concrete and they enforce it in the leaf switches using the DMEs. 291 00:18:35,570 --> 00:18:45,690 So for device discovery and ACI, if you were to plug an APIC into anything, the only protocol that it speaks at first is LLDP. 292 00:18:45,690 --> 00:18:47,750 That's Link Layer Discovery Protocol. 293 00:18:47,810 --> 00:18:52,770 If you were to plug into a switch, the only protocol that they use is LLDP. 294 00:18:52,770 --> 00:18:54,350 That's all we saw. 295 00:18:54,350 --> 00:18:57,270 So I was like, oh great, what's the attack surface going to be? 296 00:18:57,390 --> 00:18:58,350 Obviously , the LLDP. 297 00:18:58,350 --> 00:19:01,030 That's one of the main things that we're going to be using. 298 00:19:01,390 --> 00:19:11,910 One of the things that I'm really kicking myself in the butt for is that the folks that I was telling you about earlier that did the Black Hat talk, they found a buffer overflow in LLDP that we missed. 299 00:19:12,150 --> 00:19:16,830 And I feel really bad about it and I wish we had found it earlier, but hey, it's patched. 300 00:19:16,850 --> 00:19:22,310 And if you're listening to this video, please patch your fabric. 301 00:19:23,630 --> 00:19:32,270 Custom TLV, they have their own little proprietary TLV that they use for discovering the fabric so the fabric can discover the APICs. 302 00:19:32,570 --> 00:19:40,130 And when the switches see these custom TLV packets, they will open the underlay to the device that's connected to it. 303 00:19:40,130 --> 00:19:44,830 And one of the things about LLDP which makes it interesting is it doesn't travel over switches. 304 00:19:44,930 --> 00:19:48,510 It only travels inside of a broadcast domain, actually a collision domain. 305 00:19:48,510 --> 00:19:50,590 It's only from one point to the other point. 306 00:19:50,590 --> 00:19:55,510 There are multiple MAC addresses, but one of the MAC addresses that they actually use here will only travel one hop. 307 00:19:55,510 --> 00:19:57,190 It won't go any further than that. 308 00:19:57,530 --> 00:20:05,250 And what that also means is that unless you really screwed up with your hypervisor configuration, you have to be bare metal attached to be able to tinker with this. 309 00:20:05,250 --> 00:20:06,830 You can't do it from a VM. 310 00:20:07,310 --> 00:20:08,210 Make sense? 311 00:20:10,390 --> 00:20:12,330 So here's the real deal. 312 00:20:12,330 --> 00:20:13,530 Here's what we did. 313 00:20:13,530 --> 00:20:15,070 I've given you all the background. 314 00:20:15,070 --> 00:20:18,850 You know about DMEs, you know about LLDP and all those wonderful things. 315 00:20:18,850 --> 00:20:19,970 How are we going to do this? 316 00:20:19,970 --> 00:20:21,450 How are we going to actually own a datacenter? 317 00:20:21,450 --> 00:20:22,430 Here's what we're doing. 318 00:20:22,970 --> 00:20:24,670 Sure, let's own the datacenter. 319 00:20:24,670 --> 00:20:29,610 So in this case, in this situation, you have a device that maybe got owned. 320 00:20:29,610 --> 00:20:31,590 It's a bare metal device. 321 00:20:31,590 --> 00:20:33,010 Let's say it's not a hypervisor. 322 00:20:33,010 --> 00:20:38,130 Or maybe it could even be a hypervisor where somebody escalated privileges and got access to the hypervisor. 323 00:20:38,130 --> 00:20:46,110 Or maybe they were in a container and they escalated privileges and got access to the hypervisor so that they can send directly to that leaf switch and be able to talk LLDP. 324 00:20:47,490 --> 00:20:49,650 So that's the situation here. 325 00:20:49,650 --> 00:20:53,850 And what we want to do is we want to attack the APIC, which is more than one hop away. 326 00:20:53,850 --> 00:20:58,670 And remember, this is a Layer 3 switch fabric and it has overlays. 327 00:20:58,670 --> 00:21:02,710 And normally we can't even talk to the APIC because the APIC does not process packets. 328 00:21:02,810 --> 00:21:05,790 The packets flow from leaf to spine to leaf. 329 00:21:05,810 --> 00:21:06,850 They don't go through the APIC. 330 00:21:06,850 --> 00:21:09,330 We don't even have a way of talking to the APIC or touching the APIC. 331 00:21:09,330 --> 00:21:12,550 So we need something to be able to get us access to that. 332 00:21:12,550 --> 00:21:16,470 It's the central point of management for the entire ACI fabric. 333 00:21:16,910 --> 00:21:20,890 Anything that an admin can do, they can do from there and it makes it for a very tempting target. 334 00:21:20,890 --> 00:21:22,230 It's a sync target. 335 00:21:22,230 --> 00:21:24,210 It's the controller in your entire network. 336 00:21:24,370 --> 00:21:27,770 If you have a million endpoints, they're all being controlled from the APIC. 337 00:21:28,650 --> 00:21:33,270 So central management, we looked at the GUI and the GUI actually looks pretty good. 338 00:21:33,270 --> 00:21:36,090 They use an off-the-shelf framework. 339 00:21:36,090 --> 00:21:37,790 I forget which one it is right now. 340 00:21:37,790 --> 00:21:40,550 They probably have already changed it anyway because this is from... 341 00:21:40,550 --> 00:21:47,130 When we did this eval, it was on 1.1 or 1.2 was the version and I think they're up to 4 something now. 342 00:21:47,130 --> 00:21:49,030 So they've been around a long time. 343 00:21:49,170 --> 00:21:51,950 So they had cross-site request forgery protections. 344 00:21:51,950 --> 00:21:53,550 That's one of the first things we'll look for. 345 00:21:53,630 --> 00:21:58,050 They were very well protected from XSS but not for the reasons you would think. 346 00:21:58,710 --> 00:22:07,810 Anytime they took any kind of data from the user for any field, they would limit all of the fields to basically alphanumeric characters, spaces and things like that. 347 00:22:07,810 --> 00:22:08,630 And that's all you could do. 348 00:22:08,630 --> 00:22:10,590 You could never do anything like brackets. 349 00:22:11,550 --> 00:22:16,950 So we thought, well how can we do this by looking for some fields that may not be user input? 350 00:22:17,290 --> 00:22:22,030 And so we did XSS, actually cross-channel scripting on LLDP. 351 00:22:22,430 --> 00:22:26,230 So the idea is that you may do a social engineering attack. 352 00:22:26,510 --> 00:22:29,190 And you say, hey admin, I'm having a problem. 353 00:22:29,190 --> 00:22:30,090 I'm not getting connected. 354 00:22:30,090 --> 00:22:31,630 Can you make sure that I'm connected to something? 355 00:22:31,630 --> 00:22:36,830 Can you go look at my interface and look at LLDP for me and see what you see? 356 00:22:36,830 --> 00:22:42,470 Because I'm sending out LLDP and if you say that it's really attached to my machine, I'd really like to know. 357 00:22:42,470 --> 00:22:44,350 And so you get somebody to look at it. 358 00:22:44,350 --> 00:22:48,210 In the meantime, notice on the right hand side we have local users. 359 00:22:48,210 --> 00:22:52,190 We're going to run this script that just sends an LLDP frame, single frame. 360 00:22:52,190 --> 00:22:52,490 Boom. 361 00:22:52,490 --> 00:22:53,470 Did you see it? 362 00:22:54,890 --> 00:23:00,930 Just by taking advantage of the access that the browser had, we're able to create our own user. 363 00:23:00,930 --> 00:23:02,550 There's a user now called Hacker. 364 00:23:02,550 --> 00:23:04,190 And we'll just have this open at the same time. 365 00:23:04,190 --> 00:23:05,730 That happened in real time. 366 00:23:06,410 --> 00:23:11,950 So now if you look, we have access to pretty much everything on the APIC. 367 00:23:11,950 --> 00:23:13,030 Well, that's fun. 368 00:23:13,350 --> 00:23:14,990 So let's go a little bit further. 369 00:23:15,850 --> 00:23:17,090 We need a route. 370 00:23:17,090 --> 00:23:18,670 We need some way of getting to the APIC. 371 00:23:18,670 --> 00:23:21,810 Let's say the APIC's behind a firewall, which hopefully they are. 372 00:23:22,030 --> 00:23:26,430 We have no real way of getting to them, but we do have access to the fabric. 373 00:23:26,590 --> 00:23:28,590 So let's see if we can get access to that. 374 00:23:28,990 --> 00:23:32,050 So there is something called the infrastructure VLAN. 375 00:23:32,050 --> 00:23:38,610 If you've used ACI before, there's this little checkbox on the port that says give access to the infrastructure VLAN. 376 00:23:38,810 --> 00:23:42,570 That infrastructure VLAN is the crown jewels to your fabric. 377 00:23:42,570 --> 00:23:44,550 Don't give it to just anything. 378 00:23:45,310 --> 00:23:48,590 And the reason why is it gives you access to the underlay. 379 00:23:48,870 --> 00:23:55,650 Even though it's called an infrastructure VLAN, what they did is they set aside a VLAN for accessing the underlay. 380 00:23:56,630 --> 00:24:04,150 When we got into this, we knew that there was ISIS, we knew that things were routed, and we were like, how the hell am I ever going to get my IP address into ISIS? 381 00:24:04,450 --> 00:24:06,310 I was like, how is this going to work? 382 00:24:06,490 --> 00:24:09,670 Well, as it turned out, later on we found out that they do DHCP. 383 00:24:09,670 --> 00:24:12,410 When you have access to the infrastructure VLAN, that's one way. 384 00:24:13,050 --> 00:24:17,310 Another way is they actually learn your IP address, which I'll talk about. 385 00:24:18,070 --> 00:24:21,070 Enrollment of the APICs is automatic, so they do zero-touch provisioning. 386 00:24:21,070 --> 00:24:28,310 Anytime you ever attack a fabric or a network for the first time, look at how they do day zero configuration. 387 00:24:28,450 --> 00:24:30,570 Chances are you might find issues there. 388 00:24:32,390 --> 00:24:40,810 Communications at Layer 2, we saw LLDP, and we know that there are custom TLVs, so we wrote a Scapey plugin to generate these TLVs. 389 00:24:41,170 --> 00:24:44,710 And there's no authentication before them, so what happens if we tweak and replay? 390 00:24:44,710 --> 00:24:48,210 We find that it says, hey, you're a controller. 391 00:24:48,610 --> 00:24:52,390 You have access to the controller endpoint group, and you have infrastructure. 392 00:24:52,390 --> 00:24:53,690 So that's what we did. 393 00:24:54,050 --> 00:24:56,590 And this is what it looks like in the underlay. 394 00:24:56,830 --> 00:24:58,130 So you have the APICs. 395 00:24:58,130 --> 00:25:04,010 The APICs are usually dual-attached to two leaf switches, and then they have a set of subnets that are... 396 00:25:04,010 --> 00:25:15,010 or there's a subnet that's set aside on that leaf switch that is advertised out, and this whole thing is on the underlay IP address range that you'll specify when you first set this thing up. 397 00:25:15,470 --> 00:25:23,470 And you'll notice that it's all completely routed over ISIS, and if we're the attacker, we can do the same thing and represent ourselves up as an APIC. 398 00:25:23,470 --> 00:25:30,130 So we're spoofing ourself to the network and saying that, hey, we're an APIC, and it believes us and allows us onto the fabric. 399 00:25:31,410 --> 00:25:34,830 Once we're on the underlay, we have a much larger attack surface. 400 00:25:34,830 --> 00:25:37,090 We can get access to all of the different APICs. 401 00:25:37,090 --> 00:25:45,250 We can get access to the hypervisors that happen to be attached to the infrastructure VLAN, and all of the switch and APIC DME ports are accessible. 402 00:25:45,250 --> 00:25:48,390 We can get to them, but they're protected by TLS. 403 00:25:48,930 --> 00:25:51,210 They're using mutual authentication. 404 00:25:51,850 --> 00:25:52,790 We need access. 405 00:25:52,790 --> 00:25:56,990 We need some kind of way of getting access to that TLS connection. 406 00:25:57,070 --> 00:25:58,230 What do you think we did? 407 00:25:58,310 --> 00:25:59,430 Anybody guess? 408 00:26:00,490 --> 00:26:02,750 We need a cert and we need a private key. 409 00:26:02,750 --> 00:26:04,290 We could steal it from something. 410 00:26:04,290 --> 00:26:05,430 That's one way. 411 00:26:06,550 --> 00:26:07,630 What's that? 412 00:26:08,290 --> 00:26:08,970 Spoof it? 413 00:26:08,970 --> 00:26:12,650 Well, it has to be issued by Cisco because it's got a trust store. 414 00:26:13,410 --> 00:26:15,090 And, yeah, you steal it. 415 00:26:15,430 --> 00:26:18,690 The DMEs, they communicate policy throughout the fabric. 416 00:26:18,690 --> 00:26:22,050 That includes all of the users and credentials on the APICs. 417 00:26:22,550 --> 00:26:26,870 But we don't have access to the DMEs because we don't have access to TLS credentials. 418 00:26:26,870 --> 00:26:28,690 We don't have the certs and the private keys. 419 00:26:28,990 --> 00:26:37,570 So we looked at the certs, and the certs showed that they were issued by Cisco, and we know that they are issued by Cisco at manufacturing time. 420 00:26:37,950 --> 00:26:40,250 And they have an expiration date way, way, way out. 421 00:26:40,510 --> 00:26:43,230 And there's really nothing else that was really special about them. 422 00:26:43,470 --> 00:26:49,050 And so we tried another private key and certificate that was issued by a Cisco certificate authority. 423 00:26:49,790 --> 00:26:51,430 What do you think we used? 424 00:26:58,710 --> 00:27:05,310 If you're doing a tax against a PKI, keep a cache of certs and private keys available. 425 00:27:05,410 --> 00:27:07,170 You can extract them out of these things. 426 00:27:07,170 --> 00:27:08,130 It's not that hard. 427 00:27:08,130 --> 00:27:09,910 It's hard, but it's not that hard. 428 00:27:10,030 --> 00:27:11,850 It's just basically on flash. 429 00:27:11,870 --> 00:27:13,330 It's kept by Cisco. 430 00:27:13,330 --> 00:27:14,390 It's a certificate. 431 00:27:14,390 --> 00:27:16,230 It's a private key, and it's issued by Cisco. 432 00:27:16,230 --> 00:27:18,130 And it comes from a Cisco PKI. 433 00:27:18,470 --> 00:27:20,330 Not all things are that easy to get off. 434 00:27:20,330 --> 00:27:25,370 We actually have a module called the TAM, the Trust Anchor Module, which is tamper-resistant. 435 00:27:25,370 --> 00:27:29,730 And it's actually programmed somewhere else that's not in a contract manufacturer facility. 436 00:27:29,730 --> 00:27:33,910 And they ship those chips to be embedded on a device. 437 00:27:33,910 --> 00:27:35,590 Those are a little bit harder to get to. 438 00:27:35,590 --> 00:27:38,890 But if it's something that's on flash, you can get to it. 439 00:27:39,230 --> 00:27:40,430 So we use that. 440 00:27:40,710 --> 00:27:42,270 We get access to that key. 441 00:27:42,270 --> 00:27:46,910 And this is a video from soup to nuts of owning an APIC. 442 00:27:47,830 --> 00:27:49,690 And so we're going to get those credentials. 443 00:27:49,690 --> 00:27:53,390 We're going to stick those on the APIC so that we can get access to SSH. 444 00:27:53,390 --> 00:27:56,130 First thing we do is we're going to listen for LLDP. 445 00:27:56,630 --> 00:27:59,470 And you can see that we're now sending LLDP. 446 00:27:59,510 --> 00:28:01,310 And we have access to the endpoint group. 447 00:28:01,310 --> 00:28:03,850 And these are all of the VLANs that we have access to. 448 00:28:03,850 --> 00:28:10,610 Now from that point forward, then we can ping our default gateway that is on the infrastructure VLAN. 449 00:28:10,610 --> 00:28:12,750 And once we do that, we've been learned. 450 00:28:12,970 --> 00:28:15,170 And everybody now knows about us. 451 00:28:15,170 --> 00:28:18,910 The Spines, the Leafs, they all know about that IP address that we're reusing. 452 00:28:18,910 --> 00:28:26,570 Because they redistribute basically ARP into ISIS so that we're able to get discovered. 453 00:28:27,090 --> 00:28:28,950 And then from that point forward, then... 454 00:28:29,610 --> 00:28:31,810 So that's basically what I was telling you. 455 00:28:33,350 --> 00:28:37,030 And now we'll connect to the APIC. 456 00:28:37,130 --> 00:28:38,370 We'll do the same thing. 457 00:28:38,370 --> 00:28:41,750 We're going to create a user with our username and password. 458 00:28:41,930 --> 00:28:43,950 Then we're going to be able to SSH in. 459 00:28:43,950 --> 00:28:47,810 So when you have a username on the APIC, you can SSH in. 460 00:28:47,810 --> 00:28:50,310 You can get access as admin but not root. 461 00:28:50,450 --> 00:28:55,330 So we wanted root access to the APIC so that we could do something that I'll be showing you in a little bit. 462 00:28:55,330 --> 00:29:01,990 And the way we did that, there was a open internal service that you could only get to if you were logged in locally. 463 00:29:01,990 --> 00:29:03,850 It was not an external service. 464 00:29:03,970 --> 00:29:06,370 And it had a command injection vulnerability in it. 465 00:29:06,370 --> 00:29:10,530 And that service ran as root and that gave us access to the APIC as root. 466 00:29:10,910 --> 00:29:14,190 And then once we had that access, then we installed a root kit. 467 00:29:14,290 --> 00:29:15,370 I'll show you that. 468 00:29:18,050 --> 00:29:22,270 Now we've completely withdrawn our LLDP frame. 469 00:29:22,270 --> 00:29:26,550 So we no longer have access to the underlay because we don't want to attract attention to ourselves. 470 00:29:26,550 --> 00:29:28,330 But we want to get access to the APIC. 471 00:29:28,330 --> 00:29:32,930 And the APIC has a VLAN that it sets aside called in-band network. 472 00:29:32,930 --> 00:29:34,450 So that gives us access to the APIC. 473 00:29:34,450 --> 00:29:39,710 And we just netcad it directly in using our port, which is 1337. 474 00:29:39,710 --> 00:29:41,570 And we logged in and that gives us a bind shell. 475 00:29:41,570 --> 00:29:43,730 And that's something that we positioned ahead of time. 476 00:29:43,850 --> 00:29:49,090 And then we run script dev null and that gives us access to an actual sudo terminal so we can run anything we want. 477 00:29:49,090 --> 00:29:51,110 That's kind of a nice trick if you didn't know about that. 478 00:29:52,190 --> 00:29:54,290 Type ID, we see that we're root. 479 00:29:54,290 --> 00:29:57,810 And you'll notice that there's no processes that are listening on port 1337. 480 00:29:57,810 --> 00:29:58,710 They're hidden. 481 00:29:59,030 --> 00:30:03,210 There's also no directory there called rootkit. 482 00:30:03,210 --> 00:30:05,890 And we just log in and there's the subversive rootkit. 483 00:30:05,910 --> 00:30:09,210 The claim to fame with the subversive rootkit, which is really neat. 484 00:30:09,210 --> 00:30:11,690 If you haven't played with it, I strongly suggest you do. 485 00:30:11,690 --> 00:30:12,870 It runs on Linux. 486 00:30:13,030 --> 00:30:18,270 And it does its hooking through the debug registers of Intel. 487 00:30:18,690 --> 00:30:21,150 So you don't actually hook anything. 488 00:30:21,150 --> 00:30:24,050 You don't modify the kernel in any way. 489 00:30:24,050 --> 00:30:27,730 It uses the debug registers to be able to hook the different system calls. 490 00:30:27,730 --> 00:30:29,910 And one of the system calls they have, of course, is write. 491 00:30:29,910 --> 00:30:35,510 And you're hooking that and you're turning it into leetspeak by just turning lulz mode on and lulz mode off. 492 00:30:35,510 --> 00:30:37,010 And you can see the other things you can do. 493 00:30:37,010 --> 00:30:38,110 You can hide files. 494 00:30:38,110 --> 00:30:39,490 You can hide processes. 495 00:30:39,870 --> 00:30:45,870 But, of course, we didn't hide the kernel module even though we probably could have. 496 00:30:47,810 --> 00:30:49,050 With me so far? 497 00:30:50,850 --> 00:30:51,650 Okay. 498 00:30:51,690 --> 00:30:53,170 So after that... 499 00:30:53,170 --> 00:30:55,050 Oh, we're done. 500 00:30:55,130 --> 00:30:57,430 So this is how it worked in summary. 501 00:30:57,970 --> 00:31:02,190 So as a bare metal attacker, we spoofed the APIC VLLDP. 502 00:31:02,190 --> 00:31:04,430 We get access to the infrastructure VLAN. 503 00:31:04,490 --> 00:31:05,790 We use a static IP. 504 00:31:05,790 --> 00:31:07,550 You could have also used DHCP. 505 00:31:07,790 --> 00:31:10,290 And that gives us access to the local switch. 506 00:31:10,290 --> 00:31:12,210 Then we inject our IP into ISIS. 507 00:31:12,210 --> 00:31:12,910 That's automatic. 508 00:31:12,910 --> 00:31:14,870 That was something I was like, how the heck are we going to do this? 509 00:31:14,870 --> 00:31:17,110 Well, it turned out it was a lot easier to do than I thought. 510 00:31:17,470 --> 00:31:19,270 We gain access to overlay 1. 511 00:31:19,270 --> 00:31:21,190 That's the name of the infrastructure VLAN. 512 00:31:21,610 --> 00:31:26,190 We steal a cert from an existing switch or use the cert or key from a phone. 513 00:31:26,250 --> 00:31:28,030 We access the data management engine. 514 00:31:28,030 --> 00:31:31,250 The one that we're interested in is called the policy manager engine. 515 00:31:31,350 --> 00:31:33,490 And we connect to the shard leader for AAA. 516 00:31:33,490 --> 00:31:35,510 We create a local admin user. 517 00:31:35,630 --> 00:31:38,610 We then connect to the APIC over the overlay 1 via SSH. 518 00:31:38,610 --> 00:31:40,010 We SSH in. 519 00:31:40,130 --> 00:31:43,990 Skew the root user SSH keys, which we actually could have done. 520 00:31:43,990 --> 00:31:46,450 We did that through a command injection vulnerability. 521 00:31:46,590 --> 00:31:48,750 That gives us access to the APICs and the switches. 522 00:31:48,750 --> 00:31:51,670 We install a root kit, remove the admin user, and now they're owned. 523 00:31:57,330 --> 00:31:58,490 These are the kinds... 524 00:31:58,970 --> 00:32:00,350 Clap, if you like. 525 00:32:00,630 --> 00:32:01,550 Thank you. 526 00:32:03,450 --> 00:32:05,770 These are the kinds of things that you'll see. 527 00:32:06,390 --> 00:32:09,370 For our customers, you may be wondering, like, why am I doing this? 528 00:32:09,370 --> 00:32:11,610 Why am I talking about Cisco in this in-depth? 529 00:32:11,610 --> 00:32:13,990 I want you all to know that we work really hard. 530 00:32:14,390 --> 00:32:16,170 The ASIC team works really hard. 531 00:32:16,170 --> 00:32:19,650 I'm blessed every day that I get to work with such great people. 532 00:32:20,750 --> 00:32:22,110 It's absolutely amazing. 533 00:32:22,110 --> 00:32:25,370 Some of the smartest people on the earth are in ASIC. 534 00:32:25,370 --> 00:32:26,330 I just love it. 535 00:32:26,490 --> 00:32:27,410 I just go to work every day. 536 00:32:27,410 --> 00:32:28,350 I just love it. 537 00:32:29,830 --> 00:32:30,630 Owned. 538 00:32:32,470 --> 00:32:35,910 We have access to the APIC, but we want access to the endpoints. 539 00:32:36,430 --> 00:32:39,390 In CME, they have VXLAN. 540 00:32:39,390 --> 00:32:41,390 It is mostly standard. 541 00:32:41,390 --> 00:32:43,730 I think that they use a weird UDP port. 542 00:32:43,730 --> 00:32:48,090 But there are a couple of flags in there that says whether or not policy has been applied. 543 00:32:48,090 --> 00:32:49,930 The source policy applied flag. 544 00:32:50,030 --> 00:33:00,450 Once you have access to the infrastructure VLAN, you have direct access to be able to send NCME VXLAN encapsulated frames. 545 00:33:00,770 --> 00:33:05,350 They get routed through the leaf switches, and then they can get to their target. 546 00:33:05,350 --> 00:33:08,750 And you just say, hey, I've already done source policy. 547 00:33:08,750 --> 00:33:09,650 Don't worry about it. 548 00:33:09,650 --> 00:33:13,870 And then the destination leaf switch will forward it on to the destination. 549 00:33:15,210 --> 00:33:17,090 It's just as simple as that. 550 00:33:19,690 --> 00:33:24,870 Once you have that access, for instance, once you send something to it, you can spoof your IP address. 551 00:33:25,050 --> 00:33:28,610 Maybe you may respond somewhere off your network. 552 00:33:28,610 --> 00:33:32,170 Maybe you can get tumbled somewhere else, so then you can respond to it that way. 553 00:33:33,870 --> 00:33:35,510 That's basically all there is to it. 554 00:33:35,510 --> 00:33:36,830 It's quite easy. 555 00:33:37,290 --> 00:33:39,410 Here are the fixes that they did. 556 00:33:39,650 --> 00:33:42,170 XSS, obviously, is very easy. 557 00:33:42,170 --> 00:33:46,090 The XSS vulnerability was actually a DOM XSS vulnerability. 558 00:33:46,310 --> 00:33:47,550 It was not stored. 559 00:33:47,550 --> 00:33:50,350 It was not reflected or anything like that. 560 00:33:50,350 --> 00:33:51,230 It was in the DOM. 561 00:33:51,230 --> 00:33:53,310 So make sure you sanitize. 562 00:33:53,310 --> 00:33:57,670 Don't just rely on your back end to provide safe data to your web app. 563 00:33:57,670 --> 00:33:59,210 They used a single page web app. 564 00:33:59,210 --> 00:34:01,190 Everything was all done through single page. 565 00:34:01,570 --> 00:34:05,270 So sanitizing and escape anything you put into the DOM. 566 00:34:05,390 --> 00:34:07,810 Context, of course, matters, obviously. 567 00:34:08,590 --> 00:34:09,710 Strict mode. 568 00:34:09,710 --> 00:34:12,010 This is one of the mistakes that we made. 569 00:34:12,050 --> 00:34:17,530 They couldn't turn this on without breaking all the existing fabrics, so they had a flag. 570 00:34:17,650 --> 00:34:26,690 It was a nerd flag that we probably couldn't really talk about very much, even to our customers, because we didn't want them to know exactly how hard... 571 00:34:26,690 --> 00:34:28,070 We just said, turn it on. 572 00:34:28,070 --> 00:34:29,430 It's one of those things. 573 00:34:29,530 --> 00:34:36,790 Because if you don't have it turned on, then you're able to do the LLDB attack and then able to get to the underlay. 574 00:34:37,990 --> 00:34:44,870 So strict mode, when you have it turned on, it fixes the LLDP underlay access issue, and it wasn't, unfortunately, backwards compatible. 575 00:34:44,870 --> 00:34:47,090 And that's why it had to be a flag that you turned on. 576 00:34:47,090 --> 00:34:51,070 One of the things that just went out recently was they made it so that it was on by default. 577 00:34:51,070 --> 00:34:54,890 Because this has been three years now, and people probably should have had this on already. 578 00:34:54,890 --> 00:34:56,910 So they turned it on by default now. 579 00:34:57,650 --> 00:35:07,410 So when the host claims to be an APIC over LLDP, the switch will require a random bearer token to be inserted into LLDP TLV to open the underlay. 580 00:35:07,410 --> 00:35:11,430 And the way it learns that token is through connecting to a DME that's on the leaf. 581 00:35:11,430 --> 00:35:16,790 They have an ACL that they put on the port that says you can basically connect to the leaf, but no further. 582 00:35:17,850 --> 00:35:29,310 Once you connect to that, you'll have access to that one DME, and then that's authenticated using mutual TLS, using the certificates that have to be put in a whitelist ahead of time. 583 00:35:29,310 --> 00:35:34,470 Once you have that access, then you have access to the underlay, and only then. 584 00:35:35,350 --> 00:35:39,670 Another thing they did was they strengthened the subject distinguished name checking for certificates. 585 00:35:39,670 --> 00:35:45,470 This is unfortunately very common, guys, especially in embedded products. 586 00:35:45,470 --> 00:35:49,710 Just don't assume because they're using a PKI that they're not actually checking things. 587 00:35:49,710 --> 00:35:51,070 You'd be surprised. 588 00:35:51,070 --> 00:35:57,410 You can just go get a Let's Encrypt certificate, try to connect to something, and then it may say, well , hey, this is on my trust store. 589 00:35:57,410 --> 00:35:58,490 I'm going to allow it. 590 00:35:59,150 --> 00:36:01,270 They may not do the subject checking. 591 00:36:01,550 --> 00:36:08,590 Make sure you look for that because it's been in five products, I think now, so far. 592 00:36:09,370 --> 00:36:13,010 No reason an IP phone should be able to talk to the data management engines. 593 00:36:13,090 --> 00:36:15,410 The admin registers these APICs and switches. 594 00:36:15,410 --> 00:36:28,510 This is actually part of just what they do when they first set up the fabric, is they'll go in and you'll put in the serial number ahead of time, or you'll actually just say, accept this, and it puts that into a whitelist that's actually used for checking this. 595 00:36:29,070 --> 00:36:31,970 This check happens during the initial TLS exchange. 596 00:36:32,510 --> 00:36:41,190 And then IVXLAN spoofing, unfortunately, by design, it's part of the use cases that hypervisors be able to send directly to the leafs. 597 00:36:41,190 --> 00:36:42,830 That's the VLEAF use case. 598 00:36:42,930 --> 00:36:45,030 So, unfortunately, there's not really much you can do. 599 00:36:45,030 --> 00:36:48,530 It's just you really want to protect the infrastructure VLAN from untrusted hosts. 600 00:36:48,530 --> 00:36:49,870 Make sure you do this. 601 00:36:49,870 --> 00:36:57,790 There is a new feature called CloudSec that's on the newer switches that actually does encryption from VTEP to VTEP. 602 00:36:58,570 --> 00:37:07,130 And , anyway, it's something that I'm kind of excited about to see, but it uses something very similar to IPsec between the VTEPs. 603 00:37:09,190 --> 00:37:10,430 Okay, so lessons learned. 604 00:37:10,430 --> 00:37:11,990 Don't expect hardware to play nice. 605 00:37:11,990 --> 00:37:14,670 Someone else's box is plugged into your switch's user input. 606 00:37:14,670 --> 00:37:19,950 Don't ever trust unauthenticated information, regardless of where it's coming from. 607 00:37:19,950 --> 00:37:20,950 You'd be surprised. 608 00:37:20,950 --> 00:37:24,450 Even if you're doing LLDP, you can actually do XSS through LLDP. 609 00:37:24,450 --> 00:37:25,210 Who knew? 610 00:37:27,030 --> 00:37:30,130 Context-sensitive sanitization before inserting into the DOM. 611 00:37:30,370 --> 00:37:33,750 PKIs, public key infrastructures, especially in hardware, it's really hard. 612 00:37:33,750 --> 00:37:36,350 Because once you've done it, you've done it, and you're stuck. 613 00:37:37,130 --> 00:37:39,210 You can't revoke certificates. 614 00:37:39,810 --> 00:37:44,690 You don't have OCSP, the Open Certificate SAS protocol, or CRLs. 615 00:37:44,870 --> 00:37:47,110 Once you're stuck, you're stuck. 616 00:37:47,110 --> 00:37:49,970 You can't really check those kinds of things. 617 00:37:50,390 --> 00:37:51,350 Don't abuse protocols. 618 00:37:51,350 --> 00:37:53,310 LLDP is strictly for discovery. 619 00:37:53,310 --> 00:37:55,110 It's just like Cisco Discovery Protocol. 620 00:37:55,630 --> 00:37:57,650 Link-local discovery protocol. 621 00:37:58,910 --> 00:38:00,590 Any questions now? 622 00:38:00,650 --> 00:38:02,730 How am I doing on time? 623 00:38:05,570 --> 00:38:07,870 I actually got through that faster than I thought. 624 00:38:07,870 --> 00:38:08,550 Yes? 625 00:38:15,620 --> 00:38:20,200 The new Cisco certs that are in Encore, are they going to be taken into account? 626 00:38:20,200 --> 00:38:21,320 I don't know. 627 00:38:21,940 --> 00:38:23,940 You can send me, drop me an email. 628 00:38:24,660 --> 00:38:27,100 Or drop me a Twitter, and I'll see if I can find out. 629 00:38:34,460 --> 00:38:34,960 VXLAN? 630 00:38:37,380 --> 00:38:39,140 VXLAN is data plane. 631 00:38:39,440 --> 00:38:43,640 And the certificates that they do is for control plane or management plane. 632 00:38:43,640 --> 00:38:44,900 So they're kind of different. 633 00:38:44,900 --> 00:38:46,520 They're orthogonal, but they're different. 634 00:38:47,220 --> 00:38:48,340 Any other questions? 635 00:38:54,680 --> 00:39:00,260 The script, what the script does, is it connects, so when we... 636 00:39:00,260 --> 00:39:01,780 Yeah, it gives you a PTY. 637 00:39:02,440 --> 00:39:03,420 A pseudo-terminal. 638 00:39:03,680 --> 00:39:08,000 So normally, if you have a bind shell that's listening on a socket, it doesn't really give you a terminal. 639 00:39:08,000 --> 00:39:10,240 So if you try to run Vim or something like that, it won't work. 640 00:39:10,400 --> 00:39:14,920 So if you run script dev null, that just gives you a PTY, and it doesn't save it anymore, which is really nice. 641 00:39:14,920 --> 00:39:15,380 So... 642 00:39:17,540 --> 00:39:21,720 You'd be surprised how many little tricks that you learn, you know, just from watching other things. 643 00:39:24,420 --> 00:39:26,240 Yeah, I can't run anything. 644 00:39:26,240 --> 00:39:27,980 How do I just run... yeah, script dev null. 645 00:39:28,400 --> 00:39:28,960 Yes, sir? 646 00:39:31,460 --> 00:39:35,440 Are there any similarities between ACI and UCS? 647 00:39:35,880 --> 00:39:39,100 The APIC uses UCS server. 648 00:39:39,100 --> 00:39:47,240 It actually is a re-imaged UCS server that has its own certificate and ID for it. 649 00:39:47,240 --> 00:39:49,500 But other than that, it's just a UCS server. 650 00:39:50,960 --> 00:39:51,740 Good question. 651 00:39:51,740 --> 00:39:52,600 Any others? 652 00:40:02,750 --> 00:40:05,490 Oh, the question was, is where do we run this? 653 00:40:05,490 --> 00:40:07,110 We use testbeds. 654 00:40:07,110 --> 00:40:08,990 So we set testbeds up ahead of time. 655 00:40:08,990 --> 00:40:14,530 That's actually probably one of the most time-consuming parts that we're not actually doing work, is just getting testbeds to work. 656 00:40:14,530 --> 00:40:25,170 And for those of you who are doing, like, red teams or cloud pentests, it's the biggest... I hate doing cloud pentests, because you're always depending on somebody else to set up, like, a dev environment. 657 00:40:25,190 --> 00:40:29,550 And hopefully it's exactly the same as the production environment, and most of the time it isn't. 658 00:40:29,550 --> 00:40:32,070 But what we do is we go through and we try to set up where we can. 659 00:40:32,070 --> 00:40:37,430 We try to set up an on-prem environment that looks fairly complex, you know, and real. 660 00:40:44,110 --> 00:40:45,590 Any other questions? 661 00:40:47,130 --> 00:40:48,850 Any of this interest you? 662 00:40:50,670 --> 00:40:55,050 If you like this kind of work, please apply. 663 00:40:55,110 --> 00:40:57,950 Go to jobs.cisco.com and type in ASIG. 664 00:40:57,950 --> 00:41:01,690 I think there's only a couple jobs on there right now, but we're always trying to hire good people. 665 00:41:02,650 --> 00:41:07,070 Any other questions? 666 00:41:07,630 --> 00:41:14,630 No questions about inner fabric messaging, TLS, leaf switches, spine switches, connections, nothing like that? 667 00:41:16,390 --> 00:41:17,610 Thank you. 668 00:41:17,610 --> 00:41:18,790 Thanks for coming.