Hello everyone, welcome. I'm Tom Doinger from the Google TV Hacker. We're going to be talking about hacking the Google TV today. It should be interesting and a lot of fun, so let's get this started. First off, why do we do it? For science, as you can see. Moving on, so basically the Google TV Hacker team is consisted of six hackers. We kind of all met up on RAC and got together and started hacking the Google TV. Our primary goal was to bypass the hardware and the software to allow for unsigned kernels and give us more open to the system. To date, we have found multiple methods to accomplish this, so we're pretty happy with that. We're going to be dropping some of those today, so you guys should see some new stuff that you haven't seen yet from us. Our first accomplishment was on the Revu, which we got a $500 bounty to gain root. We're going to be working on that, and Amir is going to be talking about how we managed to do that. So just kind of basically going over our members today. We've got Agent HH, who's out in the audience up here in the front. He's not afraid to wear a pink shirt. We've got CJ, the destroyer of the words. Ginophage, a monster. He's, I don't know if he's here or not. There we go. That's our first time meeting him. It's kind of a mystery to us. We've got MBM, who couldn't be here today. Oh, he's on the cardboard over there. He's known for founding the open WRT and tossing 251 children in a well. Then we've got T-Dwang. That's me. I'm a software developer turned superhero. And then we have Amir, which is not very good at creating bios, so we don't know what he really does. And then we also have a special guest, Bliss, also known as Dan Rosenberg. He's a vulnerability researcher who takes on sick pleasure and exploiting anything with the CPU, and he once punched an android in the face. Moving on. So basically I'll go over just the basics of what the Google TV is. It's a system, a platform that bridges between the TV and the android device. It's a kind of creates an overlay instead of having to switch your source on your TV, so it's a direct input into your TV that you don't have to switch, which is kind of nice, because then you don't have to do that. It comes out of the box with, you know, Chrome, and then it also has an IR transmitter that talks to your TV so you can change channels and other fun stuff that you can do with a remote, but you can do with little keyboards and stuff that they give you. So it's a pretty good system. The system receives the over-the-air updates from the OEM manufacturer, so they're pretty slow about it, as we have found out. They say it's coming soon, and soon is six months. The platform contains Chrome, as I stated. It's basically a forked version of what you have on your computer. It works pretty well. It contains flash, but the plug-ins and extensions are disabled at the moment. So it's a pretty good system. It's a pretty good system. It's a pretty good system. We're currently looking into that, see if we can get it on there, which would be nice. So basically comparing the Android versus the Google TV, there's many differences. Google TV has a Chrome browser box right out of the box with it, so you can browse the web, and it's a nice Chrome browser, as most people probably prefer, like me. The Gen 1 devices all use x86 processors, so that was kind of different. It's kind of, you know, it's a little bit different than the first time I've seen anything with the Android that had x86, which causes all sorts of problems with Android market and games and stuff not being able to run. The initial release didn't have the Android market, which was a big letdown, because there was no apps that we could install or do anything when they first came out. Eventually that came out, and they're still lagging on apps, but we're hoping more and more come out in the next few months or so. Unlike most devices, the ADB is used over Ethernet instead of a USB, so basically there is only one whitelisted IP address that you can connect to the box at any given time. So if you have multiple computers like me, you have to use the same one to do any hacking or anything on it, which is kind of a pain, but most people probably only use one PC. Just kind of basically to go over the differences between the x86 and the ARM, most companies are using the x86, and most people are using the x86 on the TV. The most commonly deployed boxes that we have for the Google TV at the moment are x86. The newest devices are all ARM-based, and from our understanding, everything going forward is going to be ARM-based, so we expect to see a lot more apps and stuff that actually functions on these boxes, which would make it more useful. So the devices that we currently have out are the Sony boxes, which is a Blu-ray player and the TVs. We've got the LG TVs, the Vizio, which is coming soon, and the Logitech Revu. But we'll talk more on the ARM devices a little bit later in the talk here. I'll go over what's out there and let you guys know what's coming up. The big issue with the Google TV that we found is the content providers. So basically what they do is when you log into your open up Chrome and you go to content provider, they're checking the user agent and the flash version. So they're checking the content provider and they're checking the user agent and the flash version. They're basically looking in, see what you're on, so they're blocking all that to you, which is kind of the big downside at the moment. But we've bypassed that on numerous systems, so and future ones we plan on doing the same. So the content providers basically don't want us to do anything with that. So basically just to briefly go over the Gen 1 boxes, the x86 ones, they have the Intel CE4100. They have the Intel CE4100. They have the Intel 6400. They have the Intel 6400. They have the Intel 6410. They have the Intel 6419. They have the Intel 6419. They have the Intel 6420. The Intel 6420 is a high-end processor in it, which is an atom processor running at 1.2 gigahertz with an SOC on it. So basically they can create a chain of trust, which I'll be talking here shortly about, of how they lock down the boxes. The review is running a slightly slower processor, which is the CE4100. And the Sony TV and the Blu-ray player are running the 4150, which is slightly faster. Just kind of to go over the boot loader, we have a signed boot loader which was created using the Intel CFDK or also known as the Consumer Electronics Firmware Development Kit. The boot loader, as I mentioned before, it's signed with a signature and they use a chain of trust to prevent you from loading anything basically onto the device other than their signed software. Intel supplies a stage one and a stage two for their boot loader in the SDK that they have. Logitech utilizes both of these. The Sony, however, only uses the stage one and then uses their own prepared NBL for stage two. Just to go over the chain of trust here, we, this kind of breaks it down for you guys on how the chain of trust works on the Sony boxes and then Logitech uses their own Logitech box. So the first step of it is the SOC, which decrypts, verifies the signature of stage one of the CFDK, which then, once the CFDK boots, it moves on to check the signature and decrypts stage two. Once we reach stage two, that boots into the kernel and verifies the signature on that as well. So we, it's not as simple as rewriting that so we can run any new kernels. Once the kernel takes over, all of our files, at least on the Sony boxes, what it will do is it checks the SHA1 hash checks files and verifies all of them so we can't just go in and replace them to hack the boot order on that. And then after it does that, it checks the RSA verification on the niche.rc and then the niche.eagle.rc based on, which, I don't know if you've heard of it, but it checks the hash device you have. Just to briefly go over the kernel security, the kernel requires modules to be properly signed. So it's, we, so you can't just create a new module and insert into the kernel. So that's something that we've found a way to overcome and we'll be talking about that as well. All partitions, except for data and cache, are read only so that prevents us from changing anything in the system, which would be useful if we could. The ADB shell only allows you to read write to folders with the shell permission, which is your basic read write of pretty much nothing on the box. There's also an access dev slash mem, which is restricted to the normal shell user, so you can't just go into memory and mess with stuff either. And we also tried using all the current known Android vulnerabilities. So, you can't just go into the get the latest technologies on this bot, on the Sony and the logitech review with no avail. They're pretty good about patching everything and they're pretty quick once we release anything. So, hopefully, we release something here today that people can get on it before it gets patched in the next week or so, as we've seen. So, basically, I'm going to pass this off to Amir, who's going to talk about the current devices that we've got. All right. Hi, everyone. My name's Amir. I'm the head of the Logitech software and software development have. So, we're going to get started with the Logitech review. It was released in October 2010 and has a full-size keyboard with built-in touchpad. It was originally priced at about 249, was later reduced to 199, and was later discontinued and priced at around 99 to, I mean, I've seen it around 82. The big thing is that even though it's cheap and it's discontinued, it's probably one of our favorite devices. The full-size keyboard is really nice and it has all the same functionality as all the rest of the boxes. So, if you are looking to get into Google TV and you're looking for a cheap device to get you started, it's really nice. This is the Logitech review motherboard. We did our best to take a multimeter and label the pinouts the best we could. There are still a few that we didn't get, like the unused switch, NJ 24, which is an unknown header on the board. But it also has a UART pinout. It's a nice little thing. It doesn't have pins already soldered into it, but it's fairly easy to get to. It's not VIAs or whatnot. There's also an Intel XDP debug header, which requires some proprietary software to interface with. And there's an unpopulated SATA header, which we haven't had very much luck with. The review recovery is a standard Android 2e recovery. It gives you basically four things you can do. Reboot, apply update from USB, wipe data, factory reset, and wipe cache partition. All update files provided are RSA verified before the box even attempts an installation. So our first hack was UART on the review. We managed to get this done about two months after the box was released. And essentially it was just that you take a, well, first of all, the box does a mandatory update when you first plug it in. It makes you update to the latest version, and it basically kills this hack. So the reason we found it was we actually got lucky and plugged the box in before even trying an update and noticed that in recovery you get a console shell. So, you know, really easy to mistake. They pushed it out. They didn't think anyone was going to plug it in, plug a UART header into it and give it a shot. But they didn't know that we were going to buy, you know, five boxes at 250 bucks. So, yeah, we're not the brightest. So it required a virgin review. It still works on newly purchased reviews since it was pushed out from the main system. So, you know, it's a great manufacturer with this problem. And as mentioned earlier, it requires soldering to four pads on the board, which are really easy to do other than ground. And it allowed us to rewrite the file system, which was great because the kernel has some built in functionality that disables us to be able to write to, which we can talk about later. So this is essentially my recursive keyboard setup. As you can see, I have way too many keyboards plugged in. And that's in my kitchen. My wife is very, very patient. That was up there for, like, two months and she tolerated and didn't kick me out. So it's nice. What we did was we created a manual update process that didn't check any of the signatures. Since we had that old UART hack or the hack that we found, the downside was that it only worked on the unupdated version. So what we had to do is we wanted people to have the most recent version with the same vulnerability. So we created the manual update process, which didn't do any checks on signatures or anything along those lines. So, we created the manual update process, but still mirrored the exact same update process. We continued to release the modified updates until they started encrypting them, and then we had to jump through some hurdles. Plus, at one point, they jumped to 3.2, and we decided to start looking for other vulnerabilities. This was also our first content provider bypass because that's what people really wanted with this. They were tired of the Hulu and content provider battle with Google, and we really wanted a way to stream, you know, TV shows and stuff to get us away from work. So we created a content provider bypass. So the content provider bypass was extremely simple. What it was was essentially we take the flash version and we manipulate it by changing one byte. Literally we could change an A to an F or whatever, and they will just allow it because they strictly have a blacklist type setup. As you can see in the picture, we have GTV switched to ATV, and just doing that and changing the user agent in Chrome, which you can do just by going to settings, and you can change the text, and typing in anything you want will get you the content provider bypass. So with that, we released that, and we got a surprise message from Logitech. They essentially removed the recovery menu that I mentioned, the Android 2e recovery menu, and they put our names as the menu items and a rot 13 ciphered message. They removed all the functionality to install manual updates, and so they crippled the ability for users to recover their boxes unless they received the OTA update, which it was a really bad move because even on the forms, the Logitech forms, which we troll all the time, I assume they troll ours, there were multiple users who probably could have fixed their box if they still had access to this manual USB update mode. Each of the current GTV hackers members names at the time, which it's changed since then, but at the time were listed in there, which was a little eerie. You know they're watching you, but you don't want your name listed in the firmware. So yeah, if anyone's here, thanks, but we never got our message back, whatever. And this is essentially what it looks like. We had to do some jerry rigging to get this to show up like it did, but the message reads, A, at GTV hackers, congratulations, if you're reading this, please post a note on your form to let me know. Winky smiley face. So, I don't know, is this a good enough message? We posted it on the forums. If anyone here is from Logitech, please post a note on Logitech or Google or something. Please respond back. It's been a year and a half. So then we got started and we started working on hardware hacks, just different other things that we could do. We got to the flash sabotage. It's just a name we coined. I don't know if there's an actual real name for this, but what happened was since they removed the update functionality from manual updates, we still wanted a way so that we could update the box if we could get just any update zip file. So we found out that when a, you know, if you have a file, an update is done, an intent file is placed in slash cache slash recovery slash command. When the box is booting, it checks this intent file and it will know where the update is and what to do. But if only we had a way to write cache. That's where the flash sabotage comes in. Essentially, cache and Chrome are ext partitions stored on NAND flash and it's actually connected, the NAND flash is connected to a USB controller which essentially just makes it show up as a flash drive on the device. By simply cutting that line out and adding a USB header to it, we could input our own flash drive and take over cache and Chrome. So then we had our way to send updates. It allowed us to fix soft bricks and it, most of the time, if a brick happened and we were able to fix it with this, it was because they had corrupted the boot image. It also allowed us, like I said, to push OTA updates, but it didn't help us fix anything where we really screwed up. So we had to go and fix it. We had to go and fix it. We had to go another route and CJ was brave enough to solder a NAND programmer to his board. As you can see, you have to be really brave and have a lot of tape. We have some alternative points if anyone wants to give it a shot that we can pass out, but this was an early picture. It allowed us to essentially test all the stuff we wanted to, you know, to verify the bootloader was actually signed, flash a modified one to see if we could get it to boot. And just give anything a shot that we were really, really wanted to without a risk of having to go buy another expensive, crappy device. But yeah, so we had to add that picture. So we wanted a software route on honeycomb builds. No unpatched publicly known vulnerabilities worked, as Tom had mentioned. And there were no trivial symbolic links. Oh, shit. Okay. My bad. This goes to Bliss. Sorry. Hey, I'm Dan. He was trying to steal my thunder. So yeah. I'm Dan. I'm a software hack. Yeah. And then, as you were saying, we wanted a way of providing a software route for the honeycomb. These guys reached out to me. They had previously done the UART hack and gotten route that way. But that got fixed. And pretty much users were left without a way of having route access on their own devices. So they reached out to me because I like beating up Android. And I took a look. As we said before, they're pretty good about patching. They have this device had no unpatched publicly known vulnerabilities on it when I looked at it. And additionally, they had no unpapped vulnerabilities didn't have any of the sort of trivial vulnerabilities that tend to plague a lot of the OEMs that have to do with simple bugs with world writable directories and playing games with symbolic links to write files you shouldn't. None of that was there on inspection. But I looked a little bit deeper and found that there are some very suspicious looking world accessible character devices in slash dev. So just a little background. Traditionally Linux supports a file called slash dev slash mem that originally allowed users to map physical memory into a processes user address space. Since people realized this was fairly dangerous, you could make root kits this way, things like that, there's a configuration option called config strict dev mem that prevents even root from mapping most of RAM using this mechanism. So it's reserved for some, I think it's some IO related thing now. It's the X server, exactly. So, you know, this wasn't a viable vector for us, but I noticed that on the review there was a similar device that Intel was so kind to include called slash dev slash dev mem. And I was like, what the hell is this? So this device is world accessible, so we can interact with it, and on inspection it behaves the same as the original dev mem, but it doesn't allow mapping addresses lower than the last page frame of physical RAM. So what does that mean? So we are not allowed to map kernel memory as an unprivileged user using this device file. But on X86 Linux supports memory mapped IO, so accessing addresses higher than physical RAM actually results in interacting with hardware registers corresponding to device peripherals. So this means that this device is giving us the ability to poke and prod the hardware of the device directly, which is a brilliant idea. So this seems like something that we can use to somehow escalate our privileges. So there were several options available. You know, we have access to the PCI buses, we have access to the interrupt controllers, maybe we can reprogram them to do something crazy. We had access to the E1000 Ethernet controller, which, you know, maybe we could do things with DMA with that. But after weighing all these options, I ended up choosing the Intel CE NAND flash controller as the device that I would leverage. So, you know, it's a great device to gain root privileges. The first reason being it supports DMA, direct memory access, which is a mechanism by which hardware can write directly to physical RAM without intervention from the operating system. And secondly, because it had an open source driver, which really helps in that I didn't have to do any sort of hardware reverse engineering or any risky guess work where I basically just tried plugging things into random hardware registers and hope I didn't turn the device into a brick. So, you know, I thought, what can we do with this device now that we can play with it? So by using this dev dev mem file to map and write to flash controller hardware registers, we can actually cause this controller to DMA directly on top of kernel memory in a page length increments of 4096 bytes. So fortunately for us, the address of kernel memory that we can clobber doesn't have to be aligned to a page boundary, which could have been a restraint. But, you know, this device actually supports that. Unfortunately, the data that we're scribbling over using DMA isn't really controllable by us. Because it's just sort of raw NAND data that's living below the file system layer. You know, you don't even really have a hope of getting file fragments or anything like that because of where leveling and all that. So it's basically just garbage that we can, you know, clobber a page of kernel memory with. So the question becomes, what do we clobber? Like, how do we leverage this capability? So we need a target in kernel memory. So we need a target in kernel memory where it's okay to wipe out an entire full page with random garbage. So that, you know, what I would normally go after would be some sort of function pointer or an entry of the system call table where we can somehow trigger invocation of that and it would point into, you know, our payload and then we could run things with kernel privileges. But the problem was all of the targets that I'm aware of, we couldn't do it this way because clobbering an entire page of memory from that point on tended to break the kernel. So, you know, that was a big problem. And the device immediately crashed. Then I tried to be clever and go after something specific to Android, which is the Android properties page. So Android has this shared page of memory that represents sort of global system settings. And if you overwrite certain properties, the Android debugging daemon will actually run as root and give you a root shell. And I actually got this working and then I found out that on this particular device, they modified the ADB daemon to not be able to run a root shell. They never run as root, which really sucked. So I was a bit stuck for a little bit. And then I remembered that I actually had already solved this problem in a different context. So the technique that I'm using here, I actually talked about with John Oberheide like a year and a half ago. And it's a technique that we called stack jacking, which we thought was a really funny name. So in this case, a process's kernel stack is a great target. On Linux, by default, these kernel stacks are eight kilobytes big. So there's plenty of room. And most of it is generally unused. So you can wipe out a full page of memory there and it's not going to break anything. And the next thing is, at the base of a process's kernel stack on Linux, there's a structure called thread info. And this has stuff that's particularly useful for us to overwrite using this DMA. And in particular, there's one variable called the adder limit that I chose to go after. So the adder limit is basically, it represents the boundary between user and kernel memory. So on Linux, by default, the first three gigabytes of an address space are user memory. And the top one gigabyte is kernel memory. On the review, it's actually two gigabytes and two gigabytes. And I haven't figured out why they did that. And whenever the kernel is copying data from a supposed user land address to a kernel address, it checks, is this user land address actually below this limit? Otherwise, you know, you could read from a file descriptor right into a kernel buffer. So if we can overwrite this particular variable, it is at the base of the kernel stack with a high value, then that will allow our process to read and write to arbitrary kernel memory because all of these sort of access checks will pass. The way we actually find out where the process's kernel stack is is a little bit complicated. The gist of it is I leverage another vulnerability to leak some uninitialized bytes from the process's kernel stack and then do some fancy statistical hand waving and, you know, resolve the address. You can just believe me that it works and the code will be public. And this is all implemented in a library that I published like a year ago called libk stack. So here's that thread info structure which lives at the base of the kernel stack that we're going to clobber using DMA. You'll notice that, I don't know if you can, no, there's no mouse. Yeah, you can see that adder limit variable. And it clobbers, we're going to clobber everything from that point on. So we're also going to overwrite the restart block function pointer. We're also going to overwrite the return function pointer, which is, it actually gets invoked when system calls have to be restarted for certain reasons. And you can manually invoke it as well. And then we're also going to clobber this CIS enter return function pointer, which is a real pain in the ass. Because this is actually a pointer to a user land address where the kernel will return execution to the process when it is returning from a system call that was invoked using the CIS enter mechanism. The other CIS call mechanism being interrupt OX80. So we're going to do that. And then we're going to do a couple of things. So by clobbering this, we can no longer use like G lib C library functions, because they all use CIS enter by default and when those functions return, it will go to this random address that we've written there instead of where it's supposed to go. So we had to fix that up, too. So here's what the whole exploit looks like, just summarizing all that into one page. So we use this dev dev mem file to map the NAND flash controllers, hardware registers into our address space. We leverage this kernel info leak and do some magic to resolve the address of the current process's kernel stack. And now we know that there's that thread info structure at the base of it. We write to specific hardware registers that we sort of learned about by reading the Intel NAND driver to trigger this DMA on top of that offset corresponding to that outer limit variable from the base of the kernel stack. And then we pray that the random garbage that we wrote there happens to make this outer limit variable high, enough so that we can read and write to arbitrary kernel memory. And using that new capability, we fix up that CIS enter return thing. You know, we manually invoke all of our system calls using int 80 from then on. Fix the CIS enter return function pointer. Overwrite the restart block function pointer to point to our payload that will escalate privileges and then trigger it. Our payload gets executed. We escalate our privileges and we win. Some caveats about this exploit. It really sucks. We have a lot of problems with this exploit. We just don't have the tool that we need. So the jist of it is poking and prodding hardware registers like this is never a good idea. And in this particular case, it conflicts with what the driver's usage of this hardware. So when you trigger the DMA, the hardware sends off an IRQ saying, oh, I'm done doing DMA and the driver receives it and goes, why did you just tell me that I didn't ask you to do that? So and then on Linux, the default response to a spurious IRQ is that it's a is to ignore that from then on. So at that point your NAND flash controller can no longer perform DMA and your primary storage goes down and the box is totally useless until you reboot. So I have to that was a weird phone sound. So you have to I toggle an IRQ bit on the actual in the appropriate hardware register to prevent it from firing that off when the DMA is complete. But it's essentially a race condition and you know that really lowers the reliability of the exploit. The other problem is when we're doing our DMA we basically have to pray that the random data that overwrites this variable is something favorable to us. This only works like I don't know 20% of the time if that. But it's good enough for home brew and it will get people's devices rooted. So lastly as these guys mentioned the review, review, review, review. The review is a third thing. Unrestricted device would. So we just mapped the RSA verify function which I actually just guessed, it seemed like it was probably important and replaced the first bytes of that function with an XOR EAX EAX return which is just a return zero. So now the verification function will always return success and you can load arbitrary kernel modules. So next CJ is going to talk about Sony. So hello everyone. There we go. I'm CJ here. I'm going to talk to you about the Sony Google TV devices. My first question, anyone from Google or Sony around here? Audience? If so, I'm sorry about getting busy next week. So the generation one Sony Google TV devices include a Blu-ray player which is the GT one on the left. The other one is the Sony. And the televisions including a 24, 32, 40 and 46 inch GT one on the right. So that should be a GX one. The hardware is identical apart from the obvious differences of the fact that one is a TV, one is a Blu-ray player. You can tell by the GT one's motherboard that it is considerably bulkier than that of the Logitech review. But it is built like a Sony. I mean it's very heavy and it's populated with debug ports which is very great. There are at least three UARTs on board and it contains a CE4. So it's very heavy and it's populated with debug ports. So it's very heavy and it's populated with debug processor at 1.7 gigahertz. Now, our very first attempt was S8A sabotage. We noticed that the box had an internal SSD. It was connected over an S8A bus, used the TDK GB driver RS2. However, that featured AES encryption on the flash. So we couldn't just pull the flash, dump it, modify it, stick it back. Instead, we just tapped into the S8A bus. Our very first attempt was to tap into the bus, hook it into a computer, but we got nowhere since there was an ATA. So this is the S8A bus. It's a little bit sturdier than the S8A bus. The first attempt was to lock on the SSD. And since the cable was kind of I guess cheaply sorted in by myself, it wasn't very sturdy. So instead of doing that, I sort of new cable in, hooked it up to an external hard drive which allowed us to access the entire file system, read to it, write to it and also downgrade. Since the cache partition still had a flag on the box. That kept track of what version of the software should be at. So we used that to look for flaws. We initially downgraded to the very first version and started looking there. So the recovery system of the Google TV is far more interesting than that of the Logitech review. But like the review, it also has the update from USB features and it also has a few more other interesting features such as service mode that lets you set certain IDs for ACS and what not. However, the entire series of the recovery script is done through pretty much a large script. Runs a shell script, probably not the safest thing to do. We'll get to that in a moment. And it outputs logging to the UART, which we will use in a moment. And it's worth mentioning that Sony updates are RC4 encrypted. It's an RC4 and they are also RSA signed. So we saw this in the logs, the first line. Can anybody see the obvious problem? If nobody gets it, we're going to have to try and fix it. So we're going to go to the local command execution, which I'm sure some people do, but they're being quiet. The very first thing returns a wild card that's directly passed to another shell script. It's a big flaw. It was never validated. So using that, we could craft, yes, a package name. If as long as we had, we put some semicolons in, it matched the wild card, passed it to the SH, and we're able to get local command execution, which is pretty awesome since they never checked it. We initially started with a script called t.sh, which would pretty much spawn a shell over the UART and also telnet, and from there we were able to dump out the entire recovery file system and really examine it for more flaws. However, this exploit was patched in the 7-2011 update. We were checking around with it, patched. We still had the hardware exploit that we talked about, but to quote the tech blog Engadget, they stated about our review exploit, it's not exactly what we call an easy jailbreak, seeing as how it requires a soldering iron, an info procedure, and a logitech review that's never been powered on. So we're going to get into that in a minute. But it looks like it's possible to route a Google TV after a run. That was four rather large pads. The Sony would have to remove four surface mount capacitors and solder them in. I'm sure some of you could do it. Most people couldn't. So that was not a viable option to release to the public. Getting back to the UART, there was an active UART line, output only for logging, and after our initial hack with the replacement of the SSD, we were able to achieve a root console in Linux. And using that root console, we took a few steps to dump out the system memory, which showed the existence of NBL, which was Sony's second stage boot loader that Tom talked about earlier. And looking through it a bit, we saw that there was the existence of a shell, and after some memory reversing, we found out that if we hit the escape key, repeatedly when the box boots up, actually NBM did, but he's not here, it would bring us to a password prompt. And after more reversing on his part, the magic password to bring up a shell was console. And that's what we found out. And we found out that the NBL had options including loading files into memory and executing from internal flash or network via TFTP. That would be great but we couldn't just stick an unsigned kernel and have it boot. The kernels were, of course, signed. And the insecure booting features were disabled on production units. And since NBL used signature and hash checks, we couldn't do anything. But I do happen to remember that recovery version I spoke about that was patched in 7 2011, we could reload it. So this picture shows the initial boot up, shows us entering a password and then we boot over the network to a TFTP server, the exploitable recovery version and initial RAM disk. Takes a few minutes but then it will drop us to a root shell, which is perfect for what we needed. And it gets even better since the system, when you boot via TFTP, the system doesn't unlock the SSD on board, the kernel panics and drops to a shell. We don't even have to do anything past that, which is awesome. So in the exploitable recovery, the system boot binaries are stored not on the SSD but on a separate flash located at DevGlobe underscore Spectra A2. And since I mentioned the ATA was locked but the flash wasn't, we could write to it. So we replaced the new recovery version that was signed with our old exploitable but signed recovery version. Since now we have an exploitable recovery, there was no need to replace it with the old one. There was no need for UART and our thought was we could either wait until the rumored 3.2 release to release the exploit last September 2011. Google and Sony took until December, unfortunately. So come the 3.2 release in December, we didn't really want to give up our boot loader password being found. It was great fixing boxes and it was a pretty cool exploit. So we spent about two weeks looking for bugs. We found plenty of bugs in there, including leveraging sim links and zips and unzips and creating files and removing files but we could never get one to execute. But we really got to know the update process. So the next one shows the update process. Pretty much recovery mounts USB to temp mount disk B1. It looks for the package list wildcard. Then it passes it to package updated.sh which then copies the file to cache. And then the package update unzips the build.prop and displays it to the user. Before verification, mind you. And then we got to the update process. If the update's accepted, it's copied again to cache, then it's verified. But when they copied it to cache, they never checked if there was already an existing file in cache. So this is essentially what we did. Since the Sony recovery mounted EXT2 and EXT3 partitions with no mount parameters, we could use a block device on a USB drive to write to a device node as root. So we started with three flash drives. USB 1, USB 2, USB 3. USB 1 just had a build.prop. It didn't have to be signed. It just prompted the user 1 to switch. USB 2 contained the block device that we would write to the box. And USB 3 contained a full image of the flash stored on the system. So what we'd first do, we'd insert USB 1. It'd prompt us if we wanted to update. This was before the verification but after the initial copy. I'm sorry. I take that back. It was before the verification and before the initial copy. So we'd swap it out with USB 2 which held our block device that we labeled package-list-gtv-hacker.zip. We'd hit okay. It would copy package-list-gtv-hacker.zip as a block device to the cache partition. Then it would error out since it wasn't validated. But that's perfect. That's what we wanted. Then instead of rebooting or deleting the files, it would drop us back to the main menu. From the main menu, we repeat the process, insert USB 1, which would get us past that first prompt, and then we'd swap it out with USB 3, which contained our image of the flash file system. When we hit okay, it copied our new modified image with an exploitable recovery of the flash file system right over to the block device. And doing that, we were able to rewrite the internal flash only using software, which was great. Thank you. So now assuming all that went correctly, which every now and then if somebody copied a file or did something wrong, it could go poor, but then you could use the boot loader to fix it. Assuming that went correctly, we used the local executable. Not executable. Local code execution recovery exploit. In our exploit, we had a large script that when ran would repartition the internal SSD because we needed a little more room. It would copy boot to a new partition. It'd edit the initial boot to include K exec files and hijack the initial boot process to call K exec. Now, we're going to go back to the main menu and we're going to go going to go back to the main menu. And now, if anybody doesn't know, according to Wikipedia, K exec is a mechanism of a Linux kernel that allows live booting of a new kernel over the currently running kernel. Now, K exec can be built into the kernel, but most people don't, especially not if you don't want people running unsigned kernels. It wasn't, so we built it as a kernel module. Took a little bit, but we got it in there. K exec allowed us to boot the system, have it kick over in less than one second and load our new unsigned kernel. But as Tom mentioned, the Sony box, after checking the boot loader, checking the signing of the kernel, the kernel's, the kernel arguments also had a hash, an SHA1 hash on the init. And the init RSA verified the init scripts. So we had to find a place to jam something in there. The chain of trust needed to be broken. And we could break it a little further in the process, but the issue was the platform security firmware would kick in and panic the kernel. So we couldn't do that. So we looked for an attack vector and we found E2FSCK. Now, if anybody doesn't know, it does a file system check. It's one of the first things ran before anything is mounted. So we were able to attack that, and that was stored in E2FSCK, which is mounted from dev SD A1 on the SSD that we can now write to in our exploitable recovery. So we replaced E2FSCK with a script that mounted system, inserted our K exec modules, and K exec loaded our new kernel. Our new kernel, apart from having no hashes, no signatures, had a few other tweaks, including not signing the init.rc, the init.eagle or server.rc. It also modified the init.rc to read write everything, set our secure to zero, our debug to one, and we had a script that would mutate the flash plug-in totally randomly. So no two boxes would have the same flash plug-in and it also wouldn't randomly mutate it to GTV, which would defeat the point. Make sure to check for that. So you could watch Hulu or whatever else was blocked on the Sony Google TV. So now I'm going to pass it back off to Omeya to talk a little off topic about the Boxee. All right. So this is a little off topic portion, but what happened was that we were looking to port the Boxee to the Google TV devices. Now Boxee runs a C4100 just like the Google TV, but it's a little bit more expensive than the Google TV. So we thought it would be fairly easy and we actually did get it working. Downside was we were lacking certificates and what not to get Netflix working to get the box to where everyone would want it. We also discovered that we hate the Boxee because it is counterintuitive to everything you'd want it to do. If you have a Boxee, we have a route for it. We're about to drop, so enjoy. Yeah, and the Boxee hacking community wasn't very friendly to us, as it's mentioned at the bottom. So we decided to make this a little bit more complicated. So this is about Google TV, so we're going to make this pretty quick. Essentially, there's a software local command execution exploit that's as simple as dropping a semicolon into a certain field in the settings menu and throwing whatever command you want afterwards and owning the box. It's perfect. I don't know how it was missed. I don't know why there's still people looking for this route. They don't know how to use it. They don't know how to use it. We've been talking with them about it for like two or three months. But it was incredibly easy to find. I literally just went through and put semicolon reboot in every field. There's also a hardware exploit, which is a little more difficult, which involves there's two vials on the board that are kind of hidden. You scrape away at them a little bit but if you solder a UART adapter to it, it will just drop you into a route shell, which they also didn't fix. Between those two, you can route a Boxee very simply in two different methods. Essentially, at the bottom we have this example, which is semicolon SH, mount label custom.SH, so you can run more than one script. We're going to make this just real quick because we're running low on time. Essentially, we go to menu. Showing that it's up to date. I'm going to go back to the server. Go to network. SMB client, which is our service, which is the settings menu. And I, in this example, I entered in semicolon reboot in the share password, which is a required field. I just felt like throwing it in there. But the actual affected field is share work group, which there's semicolon reboot, semicolon. And then I'm going to go back to the server. So the sound works exactly as its樂hter went for.莉 S.F.: . When Sir para was first Todump the age when ever you got theke button on. So then you take a tick. Then they have to get it right if you click theFAQ show and go. But it's God gave me a perfect reason to boot buddy first. Unreleased is their Blu-ray player that's coming out we think in what October or something. We're not quite sure yet. They've got the Vizio that's on preorder. You guys can go get it if you want. It's only 99 bucks. We highly recommend that. It's pretty cheap. There's LG TV that we don't have. Too expensive for us. This slide just kind of goes over the basically the specs on all the new devices. This just tells you more about the Vizio specs and what's kind of out there. Supposed to be a Blu-ray player by them coming out in the future. This is kind of a brief overview of the LG TVs. Like I said, we don't have these. We don't have $1,200 lying around just to mess with the TV to break it. So Amir is going to talk about the timeline now. Actually, I'm going to skip the timeline because we're running low on time. So yeah, look at it. Everyone good? Cool. Good. Next one. Okay. So now we're going to talk about the Sony NSCGS7, which is the newest line of Google TV devices and the first released device. It was released this month. We have the tear down posted at GTV hacker and there's a CN2000 adapter on it which is the same that's in the NSCGT1. You can buy it at Micro RC cars websites. We'll have a link posted on our website before you can get it. It costs about $2 and it can help you have a solder-free solution to root the NSCGT1 but unfortunately not this device yet. Yeah. Timeline, we rooted it the next day. We were pretty proud of that because we got it from a few guys at Google IO. They went, they got the box. One guy met up with CJ here in Boston and sold it to him for $200, which was awesome. And another guy from roots wiki donated a box to myself. Unsigned kernel is still a work in progress and we're here so we didn't have a whole lot of time to try to finish that. Hopefully soon we'll have it. We're not going to release this one yet until we get it out of the market. We want the best for the community. Let's go to the demo. Essentially to not give away exactly what we did, this is just showing the fact that it is rooted and we have ADB set up right there. We dropped a sue binary on the system, gave it the correct permissions so we could just sue up and install super user.apk and this is what we have. We're going to show you the build number. Has his laptop open. He's going. Logs in through ADB. Types ID. So you can just see that we're still shell. You can see the super user APK just prompted the device to say that we had root and we're all done. So. . .