Alright, I'll hand it over to these wonderful people. Give them a big round of applause. Alright, ah, okay. So, you guys are all here. I'm sure you know what this talk is. You should pat yourself on the back because this is the right choice for talk to attend right now. It is the best talk. You made the right decision. Your life is already done. You're good. You're good for life because, uh, we're talking about Cisco routers and secure boot, uh, and the title of this talk is 100 seconds of solitude. Uh, my name is Antwe. Is that on? Is this thing on? Uh. Hey, uh, my name is Jatin Gutaria. Very good. Okay. And what is primary main objective? Primary main objective is not ChimpocoCamp. It is Cisco Trust Anchor. Uh, and, you know, so this talk is about the work that we've done over the last three years, uh, around reverse engineering, not just the Cisco router, uh, in front of you, but, uh, a fundamental piece of hardware that underpins a lot of the, the secure boot process of, uh, dozens of types of Cisco devices ranging from, you know, small switches all the way up to the very large enterprise level, you know, core routers. So, uh, the Trust Anchor is something that we had no idea existed when we started this project and we'll take you through all of that story. But, um, ultimately what this revolved around was the work that we developed, techniques that we developed, uh, to manipulate FPGA bitstreams in order for it to do something useful. Uh, so, uh, you know, even though we're gonna talk about the security implications of, uh, our techniques on this router, uh, we're really here to talk—well, okay. So, the deeper primary main objective is, uh, FPGA bitstream manipulation. And the reason why this is is because, you know, yes, uh, Cisco routers and switches, you know, all use—or a lot of them use this type of, uh, you know, Spartan Xilinx FPGA, but so do a whole lot of other things in the world, like, you know, uh, advanced driver assist in cars, uh, I'm sure legacy weapon systems, missiles, and all sorts of things. And the, uh, you know, the techniques that we're gonna talk about here are going to affect those devices, too. So, even though this might seem like a fairly large impact vulnerability disclosure, uh, the real impact of using these techniques, uh, in devices we haven't even started to look at, uh, I think is much larger. So, uh, you know, like I said, you know, we did this for three years, uh, and there's a long story which I'm gonna take you through over the next 235 slides. And yes, I have exactly those. Uh, and—but before we start, you know, this is kind of an epic story. You know, there's love and loss and betrayal, more love and friendship and defeat and, you know, redemption and—and more friendship. Uh, so we're gonna go through the cast. Uh, Jaden over here, right? That's him. Uh, Rick is actually in the front row. That's Rick. Right here. I think he's at a wedding. Uh, this is me. I'm wearing sandals just like the photo shows. James, uh, right there. Okay. And, um, well, over the last three years, uh, at Rebel Insecurity, we've invested a ton of our resources in creating this massively complicated, highly intelligent, automated testing framework, uh, abbreviated to Brian. You know, it's so complicated that some might even say that he is borderline sentient, which I think is ridiculous. But, you know, we'll—we'll get to that. All right. So, as with, uh, all great epic tales, uh, we start in mid-story. Okay? So, you know, we started this work in 2016. Uh, in 2015, Jaden and I worked on this little thing where we got code execution inside the on-screen display controllers of all sorts of, you know, probably over a billion monitors. Uh, and then in 2017, you know, Rick and I worked on this thing where we built an EMP, uh, electromagnetic pulse generator in order to defeat Secure Boot in Trust Zone on a Cisco phone. So, you know, those projects are pretty simple, straightforward. You know, there's really no thinking involved. I mean, very easy to do. Uh, so, in the middle of all of that, you know, I say, hey, guys, like, our lives are so easy. You know, like, it's going too well. Uh, let's punish ourselves for, like, no reason. And then Jaden says— What the F, man? Why? He said, do what? All right. So, ultimately, you know, fast forward to 2019, here we are talking about all of that work. Uh, and, you know, it resulted in this thing called ThrangryCat, right? And technically, you can't pronounce it like ThrangryCat because it is the first vulnerability named after three unpronounceable emojis. So, you can only come close to pronouncing it, but not really. You can't really say it out loud. Uh, ThrangryFact one, uh, the domain name for this vulnerability is emojis, okay? And for uncool kids, you can type it out as ThrangryCat. It's fine. Uh, ThrangryFact two, we, you know, have all sorts of information about the nature of the vulnerability, you know, how we, you know, how we did it. And actually, I will tempt fate and try to tab out of this thing to show you our website. So, if you go to our website, uh, just a few hours ago, you know, we put the slides up, finally, and then we also have all of the libraries that we'll be talking about and the tools that we built. Uh, it's all in GitHub. It's right there on our website. So, if you like any of this stuff and you're interested, check it out. The tools are actually super cool. Okay. So, we wrote about, you know, we had this, like, four, uh, resurrection of, you know, four series, a set of four reasons why we decided to name, uh, our vulnerability after emojis. Uh, and I'll just give you one. Rule, uh, reason number two is that emojis are indexical to the digital age, right? And, uh, that's just one of four reasons. And ThrangryFact 2.1, and this made my heart sing when I read it, right? I found it interesting that the section that explains the name of this vulnerability is way more thought out and verbose than any other sections. It's almost they had, like, the linguists on the team, and the emoji name was just prideful, kind of, you know, I don't know, I don't know, I don't know, I don't know, I don't know. So, it's a great, great contribution. True fact. True fact. Uh, thank you. If you're out there, you're good. Um, alright. So, just the immediate impact of, uh, this vulnerability, uh, it affected, like I said, probably, I think something like 180, uh, types of... 133. 133 Cisco devices, and here's a list of some of them. You know, it goes, like, this page, and more on this page, and this page, and this page, and this page, and this page, and this page. I think there's one more. Nope. Two more. One more. Right? Alright. Cool. So, it affects a whole lot of Cisco routers. Alright, let's talk about how we did it. Uh, yeah. So? It all started when we wanted to, um, hack ASR 1001. But it was end of life. And, uh, Cisco started, uh, you know, sending 1001X in 2013. Right? Yeah. So, right? Judd was like, let's look at the 1001. And I was like, oh, can't really buy this thing anymore. So, whatever. I see this thing called 1001X. Uh, whatever. It's probably the same. You know? Yeah. But, uh, what, um, doesn't matter. We don't care about documentation. Who cares about the X? You know, X is for chumps. It's probably fine. Right? So, we looked at it. We, you know, signed ourselves up to do this work. And, you know, to be fair, look. The left is the 1001. The right is the 1001X. Looks exactly the same. Uh, you know, the 1001X, uh, was kind of expensive. It's like $11,000 per router. But we bought it anyway. To, uh, help everyone visualize what exactly that is. It's on sale, though. Huh? It was on sale. Oh, that's right. It's on sale. So, you can get it for a little bit cheaper. Uh, anyway. So, what is that? Let's talk about what that means. So, $1 is, uh, 6.14 inches by 2.61 inches. That's approximately 1 gram. So, the cost of that 1001X is approximately 3.58 feet or 22 pounds. Which, uh, to put in a unit that you guys can understand, it's basically two healthy three-month-old babies stacked on top of each other. Like, that's the right height and weight. That's exactly what it is. Okay? So, the, uh, 1001X. The X, uh, has this thing called Trust Anchor and Secure Boot. Which, again, at the time, we had no idea what it is. Uh, so we thought, hey, maybe this is just like a new bootloader. Whatever. Let's, we can do it. All right. So, goal is, uh, what do we want to do? The goal is to modify the RAM on. Like, we just wanted to run our own firmware, our own stack on the ASR 1001. And it was, uh, it was that's what we wanted. So, uh, we have done, you know, previous work. And we thought, you know, like, it would be easy. It was just, like, change the root key, change the firmware. It doesn't matter. Let's just do that. All right. So, and, uh, this is kind of like Iron Chef. The secret ingredient is, okay, we actually have one of these things in front of you. And if I don't knock it over the table, we'll see what's inside. All right. If we don't keep the lid on, uh, it'll, the thermals are horrible. So, it's not great. But, anyway, so, when you open this box, uh, you see this thing over here. Uh, it might look a little weird, but a lot of this is basically a standard, you know, Intel-based computer. Right? So, the things that we care about is, um, you know, obviously there's the Intel Xeon processor. So, probably a lot of that code runs there. Uh, and, uh, there is a Xilinx FPGA. So, who knows? Maybe that's doing something interesting. And this thing has a number of different little SPI flash chips that, uh, we thought might actually be, you know, useful to look at. Uh, and the rest of it is a whole lot of complicated hardware that actually makes, you know, the routing and switching stuff work. But, you know, we opened this box and we said, okay, you know, we probably understand something about this, uh, piece of hardware. You know, this is somewhat like a normal pro- a computer, but it certainly has a whole lot of weird stuff that we haven't seen before. Okay. So, let's look at the software analysis. Um, so, if you guys have worked with Cisco, they used to have, uh, this, uh, proprietary boot console called RAMON. So, which allows you to boot through TFTP, you know, change images. Uh, so, what they did was, uh, they, uh, they, uh, they, uh, what they did was they changed to UEFI in 2013. And, uh, but they still wanted to work with their RAMON. So, they implemented a pre-RAMON as a pre-EFI module. What it does is that it manages RAMON. It also, with those two SPI flashes as you saw, as you can see, it also handles the updates. So, in the Linux kernel, if they want to apply a patch to the bootloader, the Linux kernel will update one of the SPI flashes and then the pre-RAMON will validate, uh, that whether it is right or not. And if it is not, then copy the code and copy again. Uh, pretty common stuff. Uh, then they had, uh, then they had RAMON. And, uh, basically this is implemented as a DXE module. Uh, again, it does the exact same thing. It can allow you to boot, uh, Cisco images, um, through TFTP. Also allows, also validates the next operating system it's gonna boot in the bootloader, um, the OS stage. And, uh, it also has a privilege mode which allows you to, uh, introspect what is happening in the DXE. Oh, by the way, so RAM, does RAMON doesn't stand, uh, for what you think it does. It's not actually read-only memory. It stands for romantic monitor. True fact. True fact. So, uh, then comes the Linux kernel. Uh, so they ported, uh, they started using, uh, you know, uh, um, off-the-shelf Linux kernel on which they ported their own Cisco stack running, uh, as a privilege process. They also wrote a process manager which, uh, manages this process. So anything, any kind of crash happens in the IOS, it reboots the whole, uh, system. And once you combine that, uh, you can, uh, you can, uh, combine this, this becomes your IOS XE stack. And if you go to their website, this is the most secure stack. Uh, so we, while doing this analysis, looking at everything, we saw no hashes on the UEFI, no certs on the UEFI, so it should be, like, a really easy mod because our goal is to just run our own stack. And, uh, we also disabled, uh, some of the checks, um, which were in the pre-RAMON and we, uh, booted the modified firmware. And everything worked. And I was, this is pretty simple. Uh, so, but, wait. Uh, so, uh, so, uh, so, uh, so, uh, so, uh, okay. Then router reset. Then we saw, like, wow, it reset after every hundred seconds, which doesn't make sense. And uh, we spend a lot of time, and then at... Well, so first it was, uh, you know, u-u-you know, it resets, well, he was able to get code execution on the Xeon processor and it allowed us to do it. And then you would eventually kind of reboot, and then, uh, at first, you know, he was like, well... one, once in a while, maybe a minute, right. And then he was like, u-uh, it's kind of like a hundred seconds. And I said, well, how many seconds, is it exactly like a hundred seconds? And then, uh, you basically just roommates because computers don't like to count in decimal, you know, it's not like they have 10 fingers and 10 toes. So 100 exact seconds was kind of a hint to us that there's something else that's kind of like a piece of code that some engineer wrote that enforces that 100 second thing. So this is signified by a loud fan noise. These fans, as you can see, four fans, make a very loud noise and this was crucial in doing all of the reverse engineering. This is probably the key, the fan noise. So we came up with the hypothesis of like what is this 100 second reset causing. You know, there are multiple x86, because there are processors in x86 code, so maybe there are multiple mitigations, like the one is, you know, maybe it is doing some kind of virtual machine introspection. Uh, but we analyzed the code, it was already disabled. Uh, x86 has dozens of watchdog timers, so we disabled all of them because we had 100 seconds to run whatever code we want. And uh, that also did not help. Uh, then we went to SMM and we saw, like, SMM was enabled. Uh, SMM was enabled. Uh, SMM was enabled. Uh, SMM was enabled. Uh, SMM was disabled. Uh, so we disabled that. Uh, but it was still rebooting. So I was like, um, I don't know, man. Yeah, so we, we hypothesized, like, is there like a magical deity in this processor that somehow, despite the fact that we control every instruction that executes on the processor, still is watching us and tempting us, right? It allows us to execute, like, our hopes are coming true, right? And it waits for 100 seconds before it takes our dream away. Right? Like, what kind of thing is this? Uh! All right, so, you know, this is, you know, normally, every time we ask this question, we're like, how do we mind read the computer we don't understand? Uh, we typically like to default back to electromagnetic emanation. And if you look at some of the past research we, we've done, this is a really useful tool. Uh, and a way to kind of figure out, you know, what the computer is kind of doing without really understanding a lot. So, you know, basic stuff, like, when you push an electron through a wire, right, it likes to induce a magnetic field, then an electric field, so it kind of emanates, right, EM. So when you take a near-field probe to the thing, right, you should be able to, you know, measure out the, you know, activity around certain parts of the, the machine in order to kind of come out with a timeline of what is probably executing. So, you know, we have a CNC machine that we like to hook up to a near-field probe, right, that to do this type of, you know, analysis automatically. Uh, I think the zip tie broke, so we're just holding it by hand. But usually it's automated. Uh, we, we swear. Right? So, uh, after gathering some data, here's what we have. Okay? So, uh, on this one, on the, on the way, way on the right, we have, uh, the emanation coming out of the, the CPU power supply. Okay? So, there is a tiny little dot, uh, where's my mouse? Up here, right? So this is, uh, you know, time, right? Uh, so, you know, as we go downwards, that's later in time. So little dots come up, right, and a whole lot of, uh, noise coming out of the power supply, you know, in like a quarter second or something like that. Now, uh, there's nothing coming out of the, uh, the CPU, the Xeon processor, until basically the bottom of, of, of this graph. So the processor is sitting idle, doing nothing, but the FPGA, the Xeon Spartan 6 FPGA has this, uh, emanation profile. So, you know, slightly after the initial power turn on, right, you see two little blips, and then it waits there for a while, thinks about its life, and then, uh, later it starts doing a bunch of stuff. Right? And then, the SPI chip, one of the SPI chips, which is actually connected to the FPGA, right, has similar, uh, electromagnetic emanation profile, uh, in the beginning, and then, you know, it, it gets red, and then basically nothing happens. So, you know, if you put, like, this is like Blue's Clues, right, you put all these clues together, I wonder what's happening. So, power turns on, right, the FPGA reads from the SPI, uh, flash, uh, its bitstream, right, it actually reads two bitstreams, and then it loads that configuration into the FPGA, and then the FPGA does some magical thing, right, and then basically at the very bottom of this, this is where the, uh, the, the Xeon processor is starts to do stuff. So, uh, you know, we start hypothesizing that this is basically the mean little deity that's hiding in the machine that's taking our dreams away after 100 seconds. You took my joke. All right. But, uh, there is a slide. So, uh, there were unknown bits coming out of this SPI, uh, and, uh, we saw, you know, like, it was not available in the bootloader, and it turned out, uh, we had 100 seconds, so we can dump this code. Uh, and, uh, these were interrupt handlers, uh, and, uh, and, uh, and, uh, and, uh, for the real mode, uh, basically the BIOS, ROM, VBIOS, which is present in that range. Uh, then we also, you know, analyzed, we saw some, uh, address ranges, which was, like, uh, 0xFED4, as you can see. This is usually used for external devices, uh, which are mapped, uh, uh, you know, memory mapped as, uh, I.O. devices, uh, for SQI's, you know, bus, which is basically a serial quad interface. And, uh, once you, once, this also gives us, like, kind of an idea, like, some other I.O. device is mapped in, and x86 is, uh, uh, breeding its state. So, just to validate, we also hijacked the first x86 instruction, wrote the whole serial driver, literally validated, and there was an external entity which was doing it, and that was a joke. But... Well, hold on. So this is where, you know, he put it in the slide, and I said, well, you know, let's not be culturally insensitive. So I added, we do have a cat god in the rest of this presentation, so cat Buddha, cat Buddha, cat Buddha. So there is a deity. It is a vengeful one. So, uh, we wanted to, uh, you know, we knew that FPGA is doing the reset. Um, so this was our assumption at this point, like FPGA is booting, uh, it's validating the UEFI, so any bit change in the UEFI, uh, address space, you know, it causes the whole thing to, uh, reset. And also, pre-Raman checks Raman, Raman checks Linux OS, uh, it's kind of a, you know, secure boot flow. So then we wanted to find the reset pin. And, uh, uh, it was the first $10,000 demise, which we did, because it was a BGA chip. Well, so, and this is a large part of the difficulty of doing this work, because, I mean, seriously, who can afford to just blow away $10,000 by, like, touching a pin wrong? You know, that was, for all of us, uh, and we've destroyed many more than just one of these, uh, so this was, uh, for all of us, probably the most expensive soldering mistake we've made in life until this point. So in, in honor of those mistakes, we've built a fail fort, right? So the, the fort grows over time, and there's a whole history and mythology about the rise and fall of fail fort. But anyway, fail fort version one, $10,000, uh, humble beginnings. This is the start of the civilization. Um, then, uh, we wanted to test this theory, right? Uh, and RTL reconstruction is really hard, and we'll come back to article, uh, RTL, what is RTL? And then, uh, but we still wanted it. And, uh, uh, I want to just, like, to pull the reset pin high. And I'm a systems guy, so I go to either Angad or Rick for my hardware problems, and, uh, Rick said, you know, this, this guy over there, like, I'm going to take a 10K ohm resistor, I'm going to just, you know, keep it high always. And then it again costed, it basically costed $1 per 1 ohm. And it was total cost was $20,000. All right, so now router sitting there doing, like, completely unfazed, except, you know, the ones that have died, uh, and us, we're negative $20,000, uh, in a, in a hole. So version two, you know, we started racing recklessly towards fail sky. This is, this is where we, uh, you know, took over the template. Uh, we, uh, we, uh, we, uh, we, uh, we, uh, we, uh, we, uh, we, uh, we, all right. So, you know, at this time, another, another one of our colleagues, you know, uh, Joey was sitting and saying, well, man, why are you guys, like, breaking all this equipment? You guys suck. Like, why don't you try to Google this, you know? And he said, like, I'm a level nine Googler. So, look, I typed into the computer thing, and I found this patent. So here is a patent, uh, awarded to Cisco in 2012 that talked about a lot of the things that we were kind of seeing, right? So it is a patent of secure boot through an external device and it specifically said, you know, you can implement this using FPGA and it actually has a very similar diagram to the thing that we came up with. So anyway, this document is super useful and one key thing that the document said is you must implement the trust anchor, which is I think what they called it in this patent, with an immutable thing, right? Because if the attacker can, like, change it, then the whole premise of it goes away. Uh, and they also said that you can implement it with an FPGA. But, you know, we'll get back to that. Uh, wait, so it is also, if you see, it is connected through LPC bus, so the way it is actually doing it is like it turns off the South Bridge, so the code has to just reset. Alright, so at this point, you know, we're kind of getting somewhere, but, you know, for us and I think for a whole lot of other folks out there, you know, we're firmware people, you know, maybe software people, maybe some hardware people, but all of us found FPGAs to be scary. You know, it is a mystery thing that's really hard. A lot of smart people are working on it and, you know, they don't know what they're doing. And, you know, they're like, they haven't done the thing that we needed. So, you know, we kind of, you know, said, ugh, this is so hard. And we said, well, you know what, like, why don't we stop, let's give up, but say we didn't. And then, like, a year goes by, right, because, you know, we have actual work and, you know, we already defeated twice, like, $20,000 in the hole. Um, and then, you know, one night Jaden was like... Yeah, I basically went too long and I said, like, give me $20,000 more. Let's do it. So... I can, I can hack FPGA. Yeah, and I said, okay, fine, let's go do it. So, uh, he read a ton of docs and he's gonna talk about... Yeah. So, uh, again, as I said, like, I'm a systems guy, so, you know, how do you understand FPGAs? And, uh... Wait, actually, we never, what is an FPGA? What does it stand for? Yeah. So, what is an FPGA, right? Like, it looks like a lot of blocks, a lot of registers, a lot of flip-flops. No idea. Field Programmable Gate Array. Oh, I see. I still don't know that. Okay. So, uh, how does the FPGA design flow works, right? Like, uh, the coder basically provides the hardware circuit in an SGA hardware description language. Uh, the vendor toolchain synthesizes it, places it, maps it, all this information about the truth tables, about what is the memory initialization, routing, and so forth, uh, gets encoded into a bitstream, which gets encoded into a binary, which we call it a configuration bitstream. So, any time FPGA gets configured, how the, uh, you know, because it is an IC which has, uh, benefits of both hardware and software. Uh, so it has hardware logic block to, uh, you know, uh, you know, uh, uh, uh, uh, uh, to implement, to do computations and, um, it can be reconfigured as software. And there are different types of FPGAs. There is SRAM-based FPGA, which is basically boots its configuration bitstream from an external static memory. Uh, so any time it reboots, it has to reload itself. And that's what we are talking about here, uh, for Cisco ASR. And then the other one is the flash-based, in which the flash is automatic, uh, is already present on the die. It's less power consumption. It, uh, boots really quickly. And then the other one is the anti-fuse, which is, doesn't allow you to configure again. So it's not kind of an FPGA. So, but still, what is FPGA? Now we learn about advanced FPGA because that's how smart we are. Yeah. And beginning FPGA. And I just learned field program obligator. Okay. And actually, you still didn't know what FPGA stands for. So, FPGA can be thought of, think of as like a combination of blocks. You know, each block does something and they basically correlate with each other. But again, what is FPGA for systems people? It's Y is equal to FX. So, this is very important. It's not just a simple thing. It's very important because what matters is, like, if we can control the Y and the X with, irrespective of the logic F, then we win. Doesn't matter how complex it is. So, let's go inside, like, what are the basic blocks of the FPGA? IOB is a group of basic elements which drives, uh, the output and the input functions of the FPGA. And the value could be 0, 1, or Z. But really, what is it? It is just a thing which is connected to IOB. And it gives 0 or 1. That's all you care about. The second thing is IO interface. This is how the pin gets the, uh, uh, the value from the rest of the logic and provides value to the, uh, to the other part of the logic. And the third is BRAM, which is just memory. It can be of different data width. Uh, you know, it could be 1 bit, uh, 1 width or 2 or 32 or it could be, uh, for Spartan 6, it's like 18 kilobyte, 9 kilobyte blocks. You can configure it. You can make it, uh, single or dual port. The other, uh, which does, uh, so complex logic block is something which implements the Boolean function of the FPGA. It has two slices, a switch matrix. Switch matrix allows it to, uh, you know, like, communicate with the rest of the FPGA or also allows it to communicate it to other parts of the IO. Uh, and, uh, the slice contains flip flops that lead you, again, doesn't matter for system scrap. Uh, and then there is, you know, slices can be of multiple types. Slice X, Boolean function, slice L with the carry logic Boolean function. And slice M also allows, gives you some memory. Uh, but this is the complexity of the FPGA. It's so complicated. I'm, I'm bored just listening to this. I know. Do we? Right? Because there's so many, you know, like, little nuances, a piece of, like, all of the stuff and all of the innards of this is almost always in commercial FPGAs kept as a secret. This is a proprietary thing. You know, they allow you to, they give you a tool chain that generates, you know, from the, the hardware description language, the bit stream that configures their specific vendor, specific, you know, FPGA and it will work. But they don't actually, they, well, just, you know, they don't, you know, they don't, you know, they don't, you know, generally never tell you the, any of the internals of how that bit stream is read and what it, what that bit actually does. But, you know, you have to know all of the stuff about the components and you kind of, just depend on the fact that the magical tool chain will give you the bit stream that will magically configure this hardware thing to do what you kind of told it to do through, you know, VHDL or Verilog. So other resources doesn't really matter, David. So what is a developer domain? Right? The developer domain is, like, you specify the source code and the attacker domain is the bit stream. So how do you reverse a bit stream? Well, before that, let's go back. Right. So as an attacker, you know, you don't have access to any of the information about the hardware description language. You don't actually even know how the various blocks are routed. All you have is this, you know, end of the result bit stream, like literally a stream of bits that is fed through the FPGA and magically, like I said, you know, that bit stream makes the FPGA do what you think it should do. But as an attacker, all you have is the bit stream. So you have to reverse engineer the bit stream, you know, like you would reverse engineer a piece of binary with machine instructions and then figure out, you know, what the logical constructs is in that massive bit stream without any documentation from the vendor. And again, you know, each vendor will have a different format, right? Each type of class of FPGA from the same vendor will have a different format. So the rules are literally changing on you underneath your feet. And that's what we have. Okay. So we wanted to reverse the FPGA, right? And there is some people have tried it. JBits was one thing which Xilinx released in 1999. It allowed you to, like, change logic. But then they stopped supporting it. Then Build, which it requires a netlist. It was released in 2012. And the guy did say that it's very, it's, like, impossible to reverse engineer. And then 2017 Bitmare. It also allows you to, like, move logic, relocate logic. So by reversing, you know, we mean you take the bit stream and then the goal, for the most part, is to... To be able to recover the hardware description language and underlying logic that went into generating that bit stream. And once you have that, and if you did that 100% correctly, you might be able to modify that logic to have it do something different than its original design. And then you have to run the whole synthesis tool, right? And regenerate the bit stream. Well, you know, redo the optimization routing and then regenerate a bit stream. And if you did that 100% correctly, again, without knowing any of the rules about how to run FPGA, then you might have a hope of, you know, taking something like the bit stream that we found in the FPGA that we think is implementing the trust anchor and then altering its behavior in a way that it might allow us to bypass, you know, the trust anchor capability. But the chances, you know, people doing this on anything but a very simple FPGA is very low. In fact, I'm not actually aware of anyone who has successfully done that entire path on something like a commercial, you know, like a, you know, a real world commercial application of an FPGA on some commercial, you know, bit stream. So the chances of that working, very low. Yeah, let's talk about the bi—all right. So like I had mentioned, you know, on the FPGA, you have complex logic blocks, right? So this is where, you know, your hardware description language with the logic gets configured. Then you have pins, right? Pins are literally those little metal things that stick out from the chip, right, that you wire to other metal things on other chips. So, you know, we're humans. We like to design things on, you know, whatever you want to call it. So, you know, a few layers of a PCB, right? So the number of pins, we want to keep reasonable. And the largest, you know, Spartan 6 FPGA has something like 560, 76 pins, right? So, you know, that's a lot, but that's a very small finite number compared to the logic blocks, which go up to about 200,000. And in each block, you have a whole lot of, you know, like smaller logic blocks. So, you know, we have about no more than 600 pins, and we have 200,000. So, you know, standard sort of approach to FPGA reversing was to, you know, recover all of the logic from all the CLBs. And we looked at that and we said, well, you know, we're not FPGA people. Like, we're, you know, this is too complicated, right? Like this probably won't work. A lot of smart people have tried and haven't really gotten far. But why don't we look at this? You know, there are not that many pins. So if we can figure out a way to deterministically and reliably manipulate these pins, you know, we're going to be able to do a lot of things. If we can manipulate the pin, who cares about what the logic is doing? You know, if we can disconnect the pin, right, and hook it up to something else that we supply, then it's one of those things that, like, if the FPGA falls in the forest, like, did it really happen if no one hears it? No, right? Because, you know, if we take a pin, disconnect it from its logic, and that pin is still connected to the rest of the circuit board, and then we've bypassed that logic, right? So, and this is an actual plot of the Spartan 6 family. The largest, the most dense chip has, yeah, 576 cores. So, you know, we're going to be able to do 56 pins and 150,000 logic blocks, right? So if you put that, you know, actually in scale, the graph actually looks like something like this, right? So, and this is not even to scale. That curve grows really fast. So one of our intuitions at the beginning is forget about reconstruction, you know, reconstructing logic. It's too hard. Let's look at, you know, a way for us to reliably manipulate the pin itself and see if we can do that. So, also, you know, Bistrom does optimizations, and there are no optimizations in Bistrom. This is one of the logic complexity we are looking at. So this is a SHA-256 we wrote, and this is a very small part of that logic. It has, like, thousands of CLVs. But what is interesting is this thing, right? Like, this is the binary representation of the Bistrom. The top part represents the complex logic block, which is implementing the Boolean functions, and the seven, yeah, six of those are basically the IOB blocks. Each IOB block is eight bytes in Spartan 6. And if you can control, if you change the, if you change the, if you change the, if you change the, if you change a little bit in this, you know, like a byte here, you can change the value of the logic of the IOB from zero to one or one to zero. And you can also change, these eight bytes represents the characteristics of this IOB. So you can convert it from, you know, like input to output. By just changing one parameter, the number of rounds in the SHA-256, look at the logic changing, but the IOB remains the same. And this is the diff. So the only diff was actually in the complex logic block. It was not there in the IOB. And this is very important. So as I said... Well, actually, let's back. So the thing that you look at is an actual graphical rendering of the actual Bistrom generated from this little mock example that we created. And if you can go back one more slide, right? Yeah. So the IOB doesn't change at all. It's in very predictable places. We know where the pins are because they're numbered, you know, one after another, right? They are designed on the PC board and they don't get to change because the PC board is, you know, in hardware. And if we figured out, like, which 8-byte construct describes which pin, then we should be able to very predictably and reliably, you know, change the behavior of that pin. And we have much more hope of doing that than trying to do RTL reconstruction on the logic block. Okay. So as we said, like, we can change the output from, you know, we can assign the value zero without depending on the function F. Then similarly, output to one. Change output to zero. Then similarly, output to one. Change output to input. And the same thing goes with the input. So what we want to say here is that, like, you know, the vendor is not ‑‑ vendor should not be dependent on the obscurity of the FPGA. Because as we saw, RTL reconstruction is hard, but not changing IO. So how do you reverse a bitstream, right? We see a bitstream as a firmware and it can go with unpack, analyze, modify, repack. And it has ‑‑ you can talk about, like, it has encryption, but you can probably do, you know, like, site ‑‑ you know, like, you know, like, you know, like, you know, like, you know, like, you know, like, you know, like, you can do type‑channel analysis to figure out the AES keys, you can do fault injection to change to basically skip this check. And then you can also do important emotion analysis. So our development board, which we chose to do all this research was Spartan 6, LX45D. It's the model of the Spartan. And how do you do the unpack? If you read the documentation, you can do the unpack. Which is basically, like, find the sync word, figure out which ‑‑ what kind of Spartan it is, downloads it's registration student description language, parse it, and find the registered FDRI, which specifies the hardware circuit for Boolean functions. So then we move to analyze. There are multiple types of logic. Type 0 frames. The first one is the complex logic block frame, which, and also it contains IOI, you know, like how to configure a BRAM and all that. Type 1 is BRAM, the actual memory, what it contains. And the type 2 is the IOB itself. And all of these, which is very important, is all of these are serially laid out. So if you figure out the range of each of those, then you can do analysis and reversing to figure out which pin is represented by which bits. And, you know, the main important thing here is like if you figure out the device layout, you can exactly pinpoint which CLB is used, which BRAM is used, and which IOB is used. And each, you know, these are details which you can find in our GitHub. And, you know, I think it's really cool. So, uh, major represents, so it is a 2, SRAM is basically a 2D, uh, array. And, uh, each row has multiple columns. Each column represent one resource. So, you know, like a CLB, a memory, uh, slice MCLB will be one column. Slice LCLB will be second column. BRAM will be third column. And like that. And similarly, each column has its own array of rows, uh, which defines which flip-flop is used, uh, uh, which MUX was actually, uh, encoded. So, uh, we, we actually analyzed the bitstream and created this really cool, uh, uh, visualization. My team has really worked hard on this, uh, tool. Uh, as you can see, it specifies the resource utilization, uh, which column is used. You can see this is for, uh, the Mojo board, uh, which uses LX9. It's a really cool dev board. And this represents the ASR bitstream. So, you, you can see, like, which, uh, uh, block, which resource represents the PCIe, which resource represents the LCLB, and so forth and so on. So, this tool, can you go back, is, is Unkit help writing this? Uh, yeah. Uh, uh, right now, it's amazingly cool. You should totally check it out. Because, uh, you know, you can, all that stuff that Jaden said, you can read maybe 2,000 pages of Xilinx documentation and try to figure it out. Great. Or you can use this tool, which has already done that. And not only that, it will show you, like, every, you can pinpoint any piece of the binary, and it will show you what that binary, what, what that chunk of binary represents. Is it an IO pin? If so, which pin is it? Right? Is it, like, a CLB? If so, like, what is the raw data in that CLB? Uh, and for us, you know, we, after reading the, the patent, knew that, okay, the trust anchor does a whole lot of magical DAD stuff, right? And then if it doesn't like what's happening after 100 seconds, it will literally assert the reset pin on the Xeon processor and physically reset the processor. So, that is how the mechanism, we think, works. So, if we can find out exactly which pin, uh, the FPGA is using, uh, for that, we can do our thing and disable that pin and make sure the trust anchor literally cannot reset that reset pin. Uh, and, uh, we can, uh, reset pin and then we win. And, uh, the next thing is, okay, so, because the pins are set in, in serial, in serial order, uh, we know exactly what part of that binary it ought to be. So, the only thing that we need to know now is which pin, uh, actually is used on that FPGA, which basically involves tracing, you know, the, the PCB on this router from the CPU reset pin to the FPGA, which is very simple. Um, we have only five minutes left, so I guess we're going to go to the demo. But, uh, this is a, this is a, this is a, this is a, this is a, this is a, this is a, this is how the encoding works if you know the range, figure out how, which pin represent, which bit represent which pin. And, uh, you know, all this code you can easily read. Um. Yeah. We have a paper coming out in Woot. We have a lot of documentation in GitHub. All the details are there. And, um, one thing I would want to say is that modification is really easy. Uh, they have, like, implemented this 22-bit CRC for single event upset, you know, uh, and, uh, that is also reverse engineered. You guys can just check out the GitHub. You probably have to go. But, uh, you can also disable the CRC. I haven't tried that. But, uh, you can just disable using this register. Uh, and then I want to, uh, the demo basically contains, uh, we have a bit stream which enables those four pins and we're going to just turn this pin off, uh, using the tool which is currently present again. And, uh, as Aang said, we basically figure out which is the reset, uh, which pin is controlling the reset pin and you disable that. And really cool thing part about this is, like, uh, there is no patch available. Once it is allowed, we disable the emulation of the FPGA so that the Linux code actually cannot the FPGA anymore. So that's pretty awesome. Uh, and, uh, but I also want to talk about, uh, Rick, uh, found a really cool way as Aang was saying, like, there are 600 pins. In this case there were 296 and, you know, our, uh, automated extraction bit stream tool who is not here right now. Uh, so he came up with a cool idea of JTAG scan chain. Uh, as soon as the fan comes up, uh, he checks the state of all of those 296 pins using JTAG and we found 10 pins. And one of them was the one. And do you want? Sure. Okay. So this is where Brian comes in. You know, after years of investing in this, uh, we just couldn't make it work. So we got an intern. His name is Brian. And I said, Brian, you touch all the pins, you find out where this thing connects. And he did it. He's great. Thank you, Brian. I mean, without him, this work would have not been possible. Because, you know, we need to trace through, like, the six, uh, layers of the PCB in order to find, you know, which pin goes from the reset pin to the FPGA. Uh, and then, well, you know, he touched the wrong pin. Uh, so, uh, so, uh, so, uh, so, uh, so, uh, so, uh, so, uh, so, uh, so, uh. And he had three wrong pins, so he'd add it all together and they're gross, right? Which is fine. I mean, it was a very hard job, so... Uh, but then, you know, we were able to make some progress, uh, and we were able to find that pin, right? Uh, and the last question is, well, this is cool, but how are we gonna do this remotely? You know, if it's not remote, it's not really interesting, uh, if because, if someone already has root, uh, on the router, then, okay, you can change all sorts of stuff. So we say, well, you know, this is 2019. Finding a remote, you know, codec, uh,unciation while haven't permissioned this and privilege escalation, it's got to be really hard. People have been looking at Cisco routers for quite a long time. So, man, can we even do it? Yeah, so they have a driver basically. That's how they use it. And we also did a lot of fuzzing on all these protocols. While this was going on, James come in. Well, you know, so we're like, man, this is going to be really hard. Who knows if we're ever going to get this to work. And then James was sitting over there and said, okay, guys, I got root. It was great. And then, you know. It was easy. You know, like he found command injection vulnerability CSRF vulnerability on the Cisco routers, which are patched now. So let's just point that out. You know, he found this KCAS remotely exploitable, you know, command injection in 2019 on a Cisco IOS. So, you know, for those who say the command injections are gone, it's like, you know, it's not true. And this was a very simple vulnerability to exploit. So, man, this is going to be really hard. So, you know, it's going to be really hard. But this was great. So if you couple any kind of code injection on any part of the tag surface of any Cisco IOS, you know, platform or device that's affected by this, you can immediately use that escalate privilege and then update the firmware. And, well, update the bit stream and then disable the FPGA, right, the trust anchor. So you can take a remote exploit, couple it with this, and make permanent modification of the hardware that is impossible to undo using software again. So with that, let's ‑‑ and we broke some more. And then final cost, $50,000. The fort is very large. But as a result, we figured ‑‑ finally figured this out. So I'm going to let John show the two demos. We're going to exploit the Cisco router and then show how this is done. And then we're going to also show the Mojo board demo. Okay. So ‑‑ yeah. Okay. So we're going to show the Mojo board demo. Okay. So this is what I want to show right now. This is booted. It takes, like, 10 minutes to boot. So I have to boot it. So this is the output of this ASR1001X right here, right? It's running the latest firmware. Well, one minus the latest firmware because Cisco did patch this. So what I want to talk about here is that, uh, look at this message. As soon as it boots, it says initializing hardware. And, uh, that says system integrated status. This status is coming from the FPGA. And the pre‑ROM on, which we talked about a little bit earlier, this is the status and printing it out. So now we're going to go ahead and exploit it. Did we connect the wire? We did. Yeah, we did. We connected to the wrong port. Uh, one second. Oh, really? Yeah. Okay. So we're going to go ahead and exploit this. We're going to do this. Yeah. Anyhow, never mind. Uh, damn it. We meant to do this. This is part of the demo. Okay. Well. Yay. Okay. It's going on. So what it is doing right now is that it is doing James Hack, uh, getting the root. And then we, uh, took a driver which was cracked. It's not a start KO. I don't know why they wanted to crack it. But, uh, so we took, we hijacked the driver. We understood this reverse engine of the CPLD driver. Understood how to emulate, uh, how the FPGA emulates the SPI, uh, flash for the, uh, Linux, uh, OS. And then, uh, basically applied the patch. You only require around 15 bytes of patch to disable the complete, uh, update and also disable the reset. This is going to take some time. I'm going to go ahead and, like, do the Mojo demo. So, just so you, we're, what we're watching is a full remote exploit of CPLD driver. And, uh, the next step is, uh, we're gonna run it on the cross-disk этого. So, this has been a way of, of, you know, uh, reducing the future, uh, of the BI- uh, of the display, and then, for you're, you're going to have to, uh, like, uh, push those, uh, buttons. So, uh, you don't, uh, you don't, uh, you don't have a break. You don't, this, this, uh, you don't have a break. You don't, uh, you don't have, uh, you don't have to, uh, uh, you don't have to, uh, you don't have has affected your router but is persistent to the point where in order for you to get rid of it, you probably will literally have to desolder a chip, right, from your router or your switch in order to test, even to see if you've been exploited or not. Okay. So as you can see, this is a Mojo board. And yeah, can you put the light on it? Yeah. So this is a Mojo board. You will Google it. And what matters is like those four lights, right? And those four lights are representing one on those pins. And we're going to go ahead, run our tool, which I'm going to run again. So right now, you know, the lights indicate, you know, the pieces of logic that we've put in. Very simple to understand, you know, like one thing says, okay, you know, pull, like connect this to logic that always makes the pin zero or LED zero high. So what it's doing right now here is that we took the tool, we disabled the pin, and I'm uploading it right now, the re-peg binary, which our tool did, to the GitHub link. And it's going to go ahead and we want to go, can you reboot the router? Yeah. So let's look at what was the integrated status. Again, this is on pre-Raman. We have full access now. FPGA cannot do anything. And here it is. We have updated the FPGA. It's still booted. You cannot apply any more patch. I have 20 SPI flashes right now on my, so I have to like literally take it out, update it. Ta-da! Like this is where you have the, that's very good. Come on guys, like this is really cool though. So now we've left the output, right, of this thing saying that something is wrong, right, in Raman so we can demonstrate, prove that, okay, so the FPGA is doing its job. It just physically can't reset that processor. And now we can actually patch Raman and pre-Raman to make this little message go away. Right? So, but for the purpose of the demo, you know, we're showing that this thing is trying to cry out for help, but no one is coming. And we're going to wait a hundred seconds also while they show the other demo. Uh, so as, uh, you can see, uh, there were four lights before and we have disabled the one light which was on the, uh, at the end. So, again, try it out, play with it. And, uh, what we want to... Yeah, and the reason why we used the Mojo is that, you know, this is a very inexpensive piece of hardware that has, you know, the, the Spartan FPGA inside. So, uh, if you like take a look at our tool, right, you should be able to, you know, modify this yourself and play with all of the different options of taking, you know, pin high, pin low, input to output and all of that good stuff. So, you know, I think we're about out of time. Yeah, this is the impact. Well, right. Cisco routers are used a lot in a lot of places. Um, but, so, we do make a lot of recommendations, uh, and a lot more detail on the technical side of all of this and the implications of other things that's not just a Cisco router, right, in our, in our paper, which is coming out in, in a day, I think, or two days, uh, at use next boot. So, you know, we don't have time to talk about all of our recommendations that we have for, uh, you know, improving FPGA security, right, uh, making it as, as good as possible. Because, fundamentally, this is something that is stuck in hardware, and I don't believe that this is something that can actually be fixed via a software patch. So, please check out our website, uh, our code on GitHub, read our paper, read the fucking paper, right? And, um, there are 20 more slides. You guys can look at it later. Uh, I don't know. I think we're getting kicked out. Oh, in order to reward you guys for, for coming to the right talk, I'm going to throw out some t-shirts. I mean, who else is doing that? Right? There you go. You guys made the right decision in life. And you get awarded for that. So, thank you so much. Uh, thank you so much. Go for it. Yay! So, alright. Well, anyway, thank you very much. Uh, that's our talk.