1 00:00:00,083 --> 00:00:04,375 >> So, our next talk is gonna be super cool. I'm looking forward to this. We've got 2 00:00:04,375 --> 00:00:11,750 another live demo. We are going to learn about how to mess with your SmartTV system. Ism 3 00:00:11,750 --> 00:00:18,792 guessing make it do a few things it probably wasn't intended to originally. Is that right? 4 00:00:18,792 --> 00:00:23,917 Excellent. Hopefully, that is all that is intended for today? Yeah. All right ready to go in 5 00:00:23,917 --> 00:00:29,917 all right. Let's give a big party track welcome to Felix. Let's get this thing started. 6 00:00:36,667 --> 00:00:42,667 Have a good time. >> Thank you. >> Okay. Is it on the slides? We still have to get the video set 7 00:00:48,792 --> 00:00:56,250 up. I want to show you how it looks live. We need to switch the video projector in between. 8 00:00:56,250 --> 00:01:02,250 So, we are still working on this. (Pause) >> Is it up? Here we go. There is no sound. Starts 9 00:01:53,625 --> 00:01:59,625 very well. (Music playing) >> This is how my story begins. Sorry? TaTa was a German TV 10 00:02:34,042 --> 00:02:41,625 series. A crime series. It is almost as old as Colombo. The only thing is it is still 11 00:02:41,625 --> 00:02:47,625 producing shows and it is still running. In some German families after the weekend is over, you 12 00:02:51,333 --> 00:02:57,958 sit down, switch on the first TV channel that was ever there and is still there and watch the 13 00:02:57,958 --> 00:03:05,292 show, new episode. Since it is a tradition, it is also something my wife and I like to do we 14 00:03:05,292 --> 00:03:12,000 moved to a different country a few years back and were not able to see the show before. That was 15 00:03:12,000 --> 00:03:18,000 kind of sad. That is the beginning of the story. I am Felix Leder. My passion is to 16 00:03:20,167 --> 00:03:25,917 take things apart and put other things together that help to take things apart. Besides that 17 00:03:25,917 --> 00:03:31,917 I like to be out in the snow or in the water. To explain a bit more of what I mean by taking 18 00:03:34,333 --> 00:03:39,250 things apart, I like to have collect them. Research takeovers, count heavily 19 00:03:39,250 --> 00:03:45,250 involved in the project. During my day job I work around mobile research at a nice company 20 00:03:47,917 --> 00:03:53,917 called Bluecoat. The research I am presenting is not only my own work. Every research has 21 00:03:53,917 --> 00:04:00,458 supporters. In this case it is a group of people from a company called Ensigns [phonetic] and 22 00:04:00,458 --> 00:04:06,458 they helped me with this. We had the digital box TV I actually have one on stage here. It is a 23 00:04:11,667 --> 00:04:17,667 very kind piece of hardware, makes your dumb TV smart. If have you a smart TV, you get 24 00:04:17,667 --> 00:04:23,667 even more services and possibilities. You see HDMI out port. You can attach a keyboard 25 00:04:29,167 --> 00:04:35,542 and sufficient stuff like this. What is more interesting looks more like an Apple TV. It also 26 00:04:35,542 --> 00:04:41,542 has a one terabyte the hard drive. One device, don't need extra storage. So, that is very 27 00:04:46,458 --> 00:04:52,458 convenient. The processor is show. It is also not responsible for playing the video. Actually. 28 00:04:54,458 --> 00:05:00,458 Codex are on the system and they make sure you can play it fast enough. Back to the story. So, 29 00:05:04,250 --> 00:05:09,667 this box already has all kinds of services on their quite night, YouTube, Spotify. We did 30 00:05:09,667 --> 00:05:15,667 not have this TV sometime my wife actually said you know you are always breaks stuff the 31 00:05:19,458 --> 00:05:25,792 whole time. Why don't you for once do something useful with this and put my favorite show on 32 00:05:25,792 --> 00:05:30,542 this box. You know, when your wife asks for something like this, you better make sure you 33 00:05:30,542 --> 00:05:36,458 please her. Actually, I hope my wife is not here. She would probably come up and say, how 34 00:05:36,458 --> 00:05:42,458 you know about how to please me. That is a different story. Before we start, we are going to 35 00:05:48,583 --> 00:05:56,208 release the modifications we have done. This is for educational or research purposes 36 00:05:56,208 --> 00:06:03,000 only. If you do what we have done here and you break your box, it's not our fault and we 37 00:06:03,000 --> 00:06:08,917 will not help you or cannot help you. Also, if you lose any type of your keys and so on the box, 38 00:06:08,917 --> 00:06:14,917 it is not our fault. So much for the disclaimer. First attempt we did an off line he take it out, 39 00:06:17,042 --> 00:06:23,042 plug it into the computer, see what is on there. Started off lucky. We found a private 40 00:06:26,542 --> 00:06:33,167 partition on there. There was nothing of relevance on the partition. Just off line storage 41 00:06:33,167 --> 00:06:39,167 for Spotify and TV. The partition that holds the data, videos we upload. That was 42 00:06:42,500 --> 00:06:48,833 nothing. Unfortunately, bad attempt. Getting some pressure already from my wife for wasting 43 00:06:48,833 --> 00:06:56,750 time. Second step, this box has an update mechanism. It automatically reaches out to 44 00:06:56,750 --> 00:07:02,750 Western Digital to see if there is a new server if so asks if you want to install it. You can 45 00:07:04,833 --> 00:07:10,833 download the firmware manually going to the manual. We saw there was a zip file and in that 46 00:07:14,917 --> 00:07:22,542 is five different other files, two were interesting. One is bin and the other Bi 2. 150 47 00:07:22,542 --> 00:07:30,375 megabytes roughly. We wanted to see if we recognized something. We did. There is a squash 48 00:07:30,375 --> 00:07:37,292 [phonetic] file. It is an offset 32. So, I have some people drinking with me tonight. You 49 00:07:37,292 --> 00:07:43,292 can answer if you can guess what the first 32bite before the extra are? Signature! Very good. 50 00:07:52,625 --> 00:08:00,125 Who said it first? All right. Come back later to me. I will buy you a beer. Perfect. Turns 51 00:08:00,125 --> 00:08:06,125 out it is an MD 5 signature of the whole image. So we started researching this a little more 52 00:08:08,667 --> 00:08:15,167 closely, how the museums look. What you see is two different images that compose the whole 53 00:08:15,167 --> 00:08:21,542 operating system on the device. It is a Linux system. Which is the root file system? Everything 54 00:08:21,542 --> 00:08:27,167 from roots down wards? Has an N signature including the size and at the beginning like the 55 00:08:27,167 --> 00:08:34,708 gentleman just mentioned, the MB5 of the whole image. This MB5 appended to the second image 56 00:08:34,708 --> 00:08:39,958 which is usually mounted at slash up. This has another signature at the very front to 57 00:08:39,958 --> 00:08:46,917 make sure they fit together, nothing is broken. Those two together basically make up the 58 00:08:46,917 --> 00:08:52,875 image. Let's look into the contents. A little small. I will explain it. On the left side is 59 00:08:52,875 --> 00:08:58,875 the root image. Image process which initializes the whole device, a conflict file and 60 00:09:01,958 --> 00:09:07,500 another file with MD 5's. There will be lots of those in this presentation. Western Digital 61 00:09:07,500 --> 00:09:13,500 seems to like them. On the right side there is the up folder. There was one interesting folder 62 00:09:16,125 --> 00:09:22,583 Web Server, looked quite interesting. So, with this, there was enough information to 63 00:09:22,583 --> 00:09:28,583 actually modify the box. We were a bit hesitant about whether to modify the primary for the 64 00:09:31,458 --> 00:09:37,250 reason we were not sure whether they had more MD 5 checks. We could break the single device we 65 00:09:37,250 --> 00:09:43,250 had. The other option was let's hunt. Might take more time but also is more fun, right? 66 00:09:48,375 --> 00:09:54,375 Vulnerability finding. First was to look at the web server. This has a web server. So, we will 67 00:09:58,625 --> 00:10:04,625 quickly switch to Firefox. This is live now. You see. When you looking in the password is 68 00:10:13,167 --> 00:10:19,167 Edmund, by the way. Remote control. You can change the password. That looked promising. 69 00:10:21,500 --> 00:10:27,792 The PHP to change the configurations is not recorded, encrypted or anything. That is 70 00:10:27,792 --> 00:10:33,792 always a good start. STL injection. That was the first attempt. As you can see there is 71 00:10:38,083 --> 00:10:42,917 a nice SUS [phonetic] statement at the bottom. Request. Especially tri ID, language ID. 72 00:10:42,917 --> 00:10:48,917 Perfect! That is using S cue light you. Here is creating an S cue light [phonetic] and another 73 00:11:02,042 --> 00:11:08,042 PHP file. Anybody have experience with the PDO driver? Somebody over here? What's a 74 00:11:17,792 --> 00:11:23,792 problem? (Pause). PDO only allows one statement at a time. We wanted to inject five 75 00:11:29,875 --> 00:11:35,542 statements here. So unfortunately it did not work. Even if it had worked we found 76 00:11:35,542 --> 00:11:41,542 out this part of the process was Read Only. No chance at all. Bummer. Okay. Being on the web 77 00:11:44,333 --> 00:11:50,333 server track, next thing to try was remote file encode. There is a remote file inclusion or file 78 00:11:53,167 --> 00:12:00,208 inclusion possibility based on the language which is stored in the cookie. So, let me switch 79 00:12:00,208 --> 00:12:06,208 back to the web server. You can see there you have to enter a password. Down here, you have to 80 00:12:08,750 --> 00:12:14,750 select the language. Okay. I have a cookie I dropped here. Let's wait and refresh it. You 81 00:12:18,750 --> 00:12:24,750 can see there is a language ID of 3 in here. We are wondering: Okay, can we just modify this? A 82 00:12:27,333 --> 00:12:33,333 few slashes. Did I press the right button? It is a little far away. Yes I did. We get an error 83 00:12:43,750 --> 00:12:49,750 message saying it did not find the file hope not PHP. We said why not upload the file to a 84 00:12:56,333 --> 00:13:02,333 folder we can access. Then modify the cookie. To point to that and actually you can 85 00:13:05,958 --> 00:13:11,958 calculate the path looking at the firmware. I pressed the wrong button sorry. The cookie 86 00:13:28,833 --> 00:13:34,833 is really small. It is hard to see the screen, actually, from here. Okay, wow, nice. Now we 87 00:13:52,208 --> 00:13:58,208 have a PHP shell. Those of you who have worked with PHP shells know that they are a pain in the 88 00:14:01,583 --> 00:14:08,958 ass, right? The first thing you want to do is try to figure out what is on there. Tell it what 89 00:14:08,958 --> 00:14:14,958 should be on there. We want to activate it, get it into the box. I have to admit, my 90 00:14:17,125 --> 00:14:22,042 background is usually not too much the MP3 devices but the PC world. Next you think about 91 00:14:22,042 --> 00:14:28,042 privilege installation. The same thing here. Let's go and tell it to the box. In order to know 92 00:14:35,667 --> 00:14:41,667 like from which account or to get the privileges, first figure out which account you are and 93 00:14:45,125 --> 00:14:51,125 oops hey, we have the root already. This was significantly easier than I expected! You can 94 00:14:55,125 --> 00:15:01,125 also see my stupidity on the screen. PHP actually tells you that is your root. Okay. Nice! 95 00:15:07,417 --> 00:15:14,167 So, this was just the beginning. We were able to root. But, the lesson that I had to learn 96 00:15:14,167 --> 00:15:20,042 during the experience is: Don't start with SQ [phonetic] injection, remote file inclusion 97 00:15:20,042 --> 00:15:27,625 or privilege escalation stuff, like this. Look for the really low hanging fruit. Investigating 98 00:15:27,625 --> 00:15:34,250 the image a little further, I found the guys from western digital had a similar link from 99 00:15:34,250 --> 00:15:40,250 the root server's directory right to the disk. It was not necessary to even upload try to 100 00:15:42,500 --> 00:15:48,500 split the system. I am exploit the system. I am not sure whether they forgot or wanted to 101 00:15:52,750 --> 00:15:58,750 make it simpler for people. Because that is pre authentication. No 102 00:16:01,500 --> 00:16:07,625 authentication at this point, also get the shell; just a different directory. Ah, that's 103 00:16:07,625 --> 00:16:13,625 nice. If it is that easy, I figured we probably would find more stuff. If you saw the first 104 00:16:17,000 --> 00:16:23,375 this morning: Doing things in 45 minutes that was a fantastic talk. The guys took apart the 105 00:16:23,375 --> 00:16:29,375 Google TV in the past. We tried the same as they did. We looked on board, tried to see where our 106 00:16:33,917 --> 00:16:39,917 soldering points were. We found two pins that are candidates. See them in the picture. A 107 00:16:43,375 --> 00:16:49,042 little measuring, the one was closest Rx 2 H to ground and the 3.3volt pin. Here is the 108 00:16:49,042 --> 00:16:55,042 warning: At home, it is P.3 and your PC is 5volts. You can burn either your PC, the box or for 109 00:17:04,458 --> 00:17:12,250 example I have burned three. That was my lesson learned of not buying cheap stuff from 110 00:17:12,250 --> 00:17:18,250 Taiwan. So, what do you get after you a teach a serial console? You get all kinds of 111 00:17:22,625 --> 00:17:28,708 information about the system, where the images are stored, what else configurations, what 112 00:17:28,708 --> 00:17:34,250 is currently loaded, which drivers. Actually, when you have the system up and running and 113 00:17:34,250 --> 00:17:41,833 see the screen and push a button, remote control, tells you which buttons are pressed 114 00:17:41,833 --> 00:17:47,833 and which order to take. This is perfectly done button. When finished you see something like 115 00:17:51,208 --> 00:17:57,208 this. They like ND 5's. And you see the login. What's the password? That is a chance for 116 00:17:59,958 --> 00:18:05,958 winning another beer tonight. It is not that easy. It is not as easy as OEM root or something. 117 00:18:08,500 --> 00:18:14,500 These guys like MD 5's. Let's have a look. Sorry? MD 5? Close. Not quite. It is a little more 118 00:18:27,292 --> 00:18:32,250 sophisticated. I talked to another Gaia few minutes ago at least I did it right. Let's have 119 00:18:32,250 --> 00:18:38,250 a closer look. The shadow file exists in MP3 ETC exists in there. We wanted to find out 120 00:18:40,875 --> 00:18:46,875 what it is. That did not get us very far quickly. So we investigated a little closer. 121 00:18:51,875 --> 00:18:58,875 The serial line I told you is he very helpful for debugging. One line said: Password for root 122 00:18:58,875 --> 00:19:06,708 changed. From the screen shot you can see other information like which modules are started 123 00:19:06,708 --> 00:19:13,250 before, which modules load after. This was helpful to triage which module, which 124 00:19:13,250 --> 00:19:17,083 problem's actually responsible for this. There is a tool Gbus serial Nam [phonetic] and in a 125 00:19:17,083 --> 00:19:20,750 folder not inside the original. It is an encrypted to addition to the file system. Used a local 126 00:19:20,750 --> 00:19:27,542 S pin. Security by obscurity because it is located in slash home slash file. That is 127 00:19:27,542 --> 00:19:33,542 containing a lot of interesting information. Also put the information here, how you can 128 00:19:47,292 --> 00:19:52,875 get the AS key. I will not go into that. That is more nor reference. Here, visually, in 129 00:19:52,875 --> 00:19:58,875 the Home folder, a file called File, AST and after, stuff is put into folder local S bin. 130 00:20:03,333 --> 00:20:09,333 There is this program and another 30 megabytes AMOC. Since it is encrypted folder this is 131 00:20:15,792 --> 00:20:21,042 interesting. Let's have a closer look. Let's get back to what is the password. Once we had the 132 00:20:21,042 --> 00:20:25,208 problem we would reverse engineer. We found it is doing a system call. Subsystem function 133 00:20:25,208 --> 00:20:31,208 call of not a system call. Serial numbers used, MD 5 of that is actually reduced. It is 134 00:20:37,625 --> 00:20:43,625 the password. How do you get the serial number? Look at the box. Yeah. Actually an easier way. 135 00:20:50,250 --> 00:20:56,250 Have a look at the login screen. The serial number is the MD 5 right in front of the login. I 136 00:20:59,958 --> 00:21:03,833 didn't bring the serial cable. Should have but since I have blue screen, a few times with a 137 00:21:03,833 --> 00:21:09,917 serial cable I don't want to find out here. We can try it with LINUX that works better, we 138 00:21:09,917 --> 00:21:15,917 can try it later. I wanted to demo to you guys, see what it looks like. Log in. We want to 139 00:21:20,792 --> 00:21:26,792 log in as root. Need to copy and paste. On. Sorry, don't see that screen? That is calculating. And 140 00:21:47,833 --> 00:21:53,833 then over here, hey: Another root shell! This was the password, by the way. Okay. You 141 00:22:05,375 --> 00:22:11,375 probably know this yourself. At this point in time, you say yes! Right? Because your root always 142 00:22:13,708 --> 00:22:19,708 feels good to be root especially on systems you have not been on before. That's the point in time 143 00:22:21,917 --> 00:22:27,917 when my wife came back in: Sounds good. Are you done yet? I said Ahh, halfway. Next step was 144 00:22:30,125 --> 00:22:37,250 actually to find out where are the apps located. Looking on the root file system or the file 145 00:22:37,250 --> 00:22:44,917 system in general, you will find a lot of hints. You will find from DRM files but also some app 146 00:22:44,917 --> 00:22:50,917 v for which you find the one is AUL, some others. So, we were really wondering where are the 147 00:23:02,167 --> 00:23:08,167 apps especially for those. We had a closer look at this process. DMA. OSD. This is the 148 00:23:11,750 --> 00:23:17,750 last process that started. If this process dies, the whole box automatically reboots as a 149 00:23:21,667 --> 00:23:29,417 watchdog around it. It is okay in the encrypted partition, the AS before. This single process 150 00:23:29,417 --> 00:23:36,125 uses 150 megabytes of the 200 available on the box. So, it seems like this is an important 151 00:23:36,125 --> 00:23:43,500 piece. Looking more closely into this process we actually found some hardcoded URL's. HD western 152 00:23:43,500 --> 00:23:49,500 digital, HTML. And some others. Okay, when you go to these webpages now I have to check the 153 00:23:53,417 --> 00:23:59,417 resolution of. Projector here. Let's go to AOL. Hard to see on A.L. Let's try this Russian 154 00:24:08,750 --> 00:24:15,542 site. This is a Russian video site. Basically you can buy or stream videos from there. What 155 00:24:15,542 --> 00:24:22,167 you see is there is a white bar at the very bottom. That is not part of the design. If you go to 156 00:24:22,167 --> 00:24:29,042 these webpages with your browser, you will see they are 1280 times 624. Exactly for your 157 00:24:29,042 --> 00:24:35,042 TV. These are made so this box can access them and you see what you are supposed to see. That 158 00:24:44,333 --> 00:24:51,583 gives us some pointers some information about this is VMA or V executable. Browsers, 30 159 00:24:51,583 --> 00:24:57,583 megabytes. That is huge, especially for these devices. Big for small one like this, it 160 00:24:59,667 --> 00:25:05,667 is huge. Everything is linked esthetically. There is a QT web browser in there. H D MI, for 161 00:25:09,625 --> 00:25:15,625 accessing the corrodex. Check for firmware, automatically sync with the hard drive. On screen 162 00:25:23,250 --> 00:25:31,167 menus. On Start, all pictures, it finds in some specific folders on the disks, all into 163 00:25:31,167 --> 00:25:37,167 memory. This is actually a piece where you want to dig deeper. You really want to modify the on 164 00:25:39,542 --> 00:25:46,500 screen and TV sayings stations. The next step to understand the logic, create a server, put it 165 00:25:46,500 --> 00:25:52,167 on the box, attach a debug err on the box where it is running, control it from another machine. 166 00:25:52,167 --> 00:25:57,667 The next slide is for your reference if you want to try to. This is a compilation change. 167 00:26:00,750 --> 00:26:06,750 The nice thing if you are reversing an Upro you can use that to debug this process. 168 00:26:13,458 --> 00:26:20,583 Unfortunately, it breaks sometimes. Don't fully rely on this. This cost actually a few 169 00:26:20,583 --> 00:26:26,583 evenings. My wife at this point came back, looked over my shoulder and said: You are again 170 00:26:29,167 --> 00:26:35,167 looking at assembly. What's the status? The programs starting. Now I want to see it. I said: I 171 00:26:38,250 --> 00:26:44,250 am making progress. But let's see. So now we know there is a web server on the box, right? 172 00:26:48,000 --> 00:26:53,917 There is one nice thing. The broadcast err, they have a live stream. They have a live stream 173 00:26:53,917 --> 00:26:59,917 on the Internet. Let's see. There is no running at the moment. See if we can get a live 174 00:27:09,833 --> 00:27:15,917 stream. They blocked some content to other sites. Unfortunately, not. At the 175 00:27:15,917 --> 00:27:22,042 moment I was hoping it would be in use. They are not. We will show you how this stuff works. 176 00:27:22,042 --> 00:27:28,167 At this time, I was dedicated to go for the low hanging fruits. In this case it is going through 177 00:27:28,167 --> 00:27:34,167 the process, search around, where are the URL's the hardcore ones and catch one or two, to 178 00:27:37,375 --> 00:27:43,375 get the TV station we want. Switching back to the box. >> This is the process ID we want 179 00:28:07,375 --> 00:28:13,375 to patch, 2006. And we want to dash let's take, for example the Red Bull [phonetic] entry. MTV 180 00:28:26,167 --> 00:28:32,167 entry. And we redirect it to Germany. So, what this little tool does is it searches E 181 00:28:45,333 --> 00:28:52,208 choice and searches the memory or sequence we have given it here. In this case, connect the 182 00:28:52,208 --> 00:28:58,208 dot Red Bull MTV and once it finds it overrides it with what we the address never changed, no 183 00:29:01,917 --> 00:29:07,917 randomization. To keep the tool flexibility for future versions this way there we go, we have 184 00:29:10,625 --> 00:29:16,625 found it. Now, the dangerous switch. (Pause). Now you see the box in action. See all of the 185 00:29:30,833 --> 00:29:36,833 services on the box and also you see Red Bull TV. In the background it basically prepares 186 00:29:39,375 --> 00:29:45,375 everything for the browser to start up. Once it starts up, is running, the box reaches out to 187 00:29:48,917 --> 00:29:54,917 Google.TV page. Went down a few times this morning actually. Okay, perfect. (Applause). >> We 188 00:29:59,458 --> 00:30:05,458 are able to redirect the TV to whatever webpage you want it to. This was the point where we did 189 00:30:09,083 --> 00:30:15,083 the biggest mistake in the overall process. So, because I knew there was a page when there 190 00:30:18,958 --> 00:30:25,625 was live stream and was able to patch the browser, I told my wife: I have it! I will be done 191 00:30:25,625 --> 00:30:31,625 in five minutes. Have you ever told your wife you are done in five minutes? Then you know 192 00:30:36,333 --> 00:30:42,333 Murphy's law it usually takes five hours or more. Same here so, quickly changing to the new 193 00:30:44,750 --> 00:30:50,750 URL, got something which looked like this. The point was the codex that they returned to the 194 00:30:58,958 --> 00:31:05,625 browser of the box did not match any of the hardware codex that were actually on the box. Oh, 195 00:31:05,625 --> 00:31:11,625 man. So, not quite there yet. So, fortunately, the serial console actually was providing 196 00:31:15,333 --> 00:31:19,958 more information. Once the browser starts it tells you which codex it loads and 197 00:31:19,958 --> 00:31:26,250 supports. Then it was only a matter of finding out are there other stream that is we can 198 00:31:26,250 --> 00:31:32,958 leverage that we can use from this broadcaster. After looking around, matching, trying out 199 00:31:32,958 --> 00:31:39,042 other things, finally, we were able to create a small webpage that selected a specific codec 200 00:31:39,042 --> 00:31:45,042 and also made it work. So, let's try this. So, we want to go. (Pause) and we want to take it 201 00:32:03,875 --> 00:32:10,875 dash just a second. I have to go back to another slide where I have the original URL. Don't 202 00:32:10,875 --> 00:32:16,958 want to mistype anything. If I mess up with the bok at this point in time it takes at least 203 00:32:16,958 --> 00:32:22,958 three minutes to reboot. So, I try to avoid this as much as possible. Okay. (Pause). >> 204 00:32:27,167 --> 00:32:33,167 Process ID it wants. 1206. Okay! Looks good. Again, attach pre trace. Serve the memory. We want 205 00:32:38,958 --> 00:32:44,958 to Google.TV what we put on the overdrive. You can see the URL slash user. Gets you down to the 206 00:32:52,125 --> 00:32:58,125 page that you can upload. That takes a few seconds. Here we go switch back. Unfortunately we 207 00:33:06,750 --> 00:33:12,750 have to restart Red Bull. Not the whole box unfortunately. The page is up a little quicker now. 208 00:33:18,500 --> 00:33:21,750 Now it's trying to get the stream. At least we should get the stream that is saying: You 209 00:33:21,750 --> 00:33:27,750 are not supposed to see this program. Takes time to buffer. They are streaming the message. 210 00:33:30,000 --> 00:33:36,000 You are not supposed to see this. Hm. (Pause). >> Maybe today Ah. Actually, wow. We have 211 00:33:48,958 --> 00:33:54,958 progressed a bit further. That is called that is the weather. Perfect. Ah, nice. (Applause) >> 212 00:34:00,833 --> 00:34:06,833 You know? Finally, we were able to watch the program. It feels good to please your wife after 213 00:34:17,083 --> 00:34:23,083 you have put so much effort into it. So, I have told you that actually the show was quite old, 214 00:34:25,375 --> 00:34:28,667 from the '70's. They changed actors. This is one of the famous German actors, plays in 215 00:34:28,667 --> 00:34:34,667 some American movies. Someone recognize him? Who is it? Kil Schveiger. He played the Nazi 216 00:34:45,792 --> 00:34:51,792 killer in Inglorious Basterds, Quentin Tarantino. The talk this morning was quite good about 217 00:35:02,792 --> 00:35:09,542 this: You want to own the software in the system, not just the hardware. The stuff that I 218 00:35:09,542 --> 00:35:14,125 have shown you is not really owning the software, because nothing of what has been done so 219 00:35:14,125 --> 00:35:20,583 far is persistent. Everything was just done in memory or running system. It actually is 220 00:35:20,583 --> 00:35:27,917 not even though your root you cannot modify the file system, for example. Everything is 221 00:35:27,917 --> 00:35:35,542 stored in Read Only memory. When the system is rebooted, everything that needs to be 222 00:35:35,542 --> 00:35:41,208 changed, shutoff file, host file, everything gets copied to slashtp and you use it from 223 00:35:41,208 --> 00:35:48,917 there. The reason is quite simple: If you pull out the power or have a power outage, 224 00:35:48,917 --> 00:35:54,917 you never can break the box. You always can get a clean copy from ROM and everything volume a tile 225 00:35:57,708 --> 00:36:03,083 is basically done. The configuration is stored in a specific region in the ROM or 226 00:36:03,083 --> 00:36:07,500 flash memory. You have to make sure that you do not have a power outage during reflashing 227 00:36:07,500 --> 00:36:15,208 or changing configuration settings. This wasn't tricky. We wanted to be persistent. Most of 228 00:36:15,208 --> 00:36:21,208 the stuff you see, I marked in red. The only thing that is really persistent and liveses 229 00:36:26,542 --> 00:36:32,542 long is the hard drive. We want it to be persistent. Some more requirements. We wanted to 230 00:36:35,833 --> 00:36:41,375 actually keep this clean reset scheme. At any point in time, you unplug the system, it still 231 00:36:41,375 --> 00:36:48,042 works. It should be persistent and writable. It should be possible and based on the 232 00:36:48,042 --> 00:36:54,042 information we have, to actually flash the drive, every time we wanted to have it changed. Or, 233 00:36:56,542 --> 00:37:01,958 somehow use the hard drive. If you flash a drive often enough especially when experimenting 234 00:37:01,958 --> 00:37:06,167 with firmware, I promise at one point you will break it. I only had one device and my wife 235 00:37:06,167 --> 00:37:12,167 didn't want to lose this feature. So I had to make sure this device staying up and 236 00:37:15,792 --> 00:37:20,708 running. So, another requirement or thing that we were a bit scared to do was we did not want 237 00:37:20,708 --> 00:37:26,708 to catch the main but the second image. The main was full of MD 5 sounds and integrity checks. 238 00:37:29,667 --> 00:37:36,000 Investigating the blue process, we found something interesting. There is the inner process which 239 00:37:36,000 --> 00:37:42,000 starts runall, runs a tool which is later on starting the main executable. But this script is 240 00:37:45,083 --> 00:37:52,458 looking for another script called off T P run T P in the off partition. This script 241 00:37:52,458 --> 00:37:59,792 wasn't there. If this file is present, there, it is executing it. If not it doesn't do 242 00:37:59,792 --> 00:38:05,208 anything. That is perfect. We have taken out a file and have left the suitable in the boot 243 00:38:05,208 --> 00:38:11,208 process for us to just place it there. Very kind of them. Only a little challenge with this. The 244 00:38:14,083 --> 00:38:19,583 challenge is this script is run first and only after it returns the main process, the main 245 00:38:19,583 --> 00:38:26,958 executable startup. The main statutable is actually responsible for mounting the 246 00:38:26,958 --> 00:38:34,792 hard drive. So we cannot modify anything to load additional stuff from the hard drive until 247 00:38:34,792 --> 00:38:42,750 this final processor started. That is not an overly challenge, I admit that. So, what we did is 248 00:38:42,750 --> 00:38:48,000 basically returning from run T T and started a background process which is monitoring for the hard 249 00:38:48,000 --> 00:38:53,208 drive to come just in the background. Is the hard drive up yet? No. Let's wait five 250 00:38:53,208 --> 00:38:55,250 seconds. No. Wait 52nd. At one point, the hard drive is there and we basically can continue to 251 00:38:55,250 --> 00:39:01,250 note stuff from there and execute it. This way, we have secrete created a second stage 252 00:39:06,750 --> 00:39:12,750 LINUX Start. If you look at SMB you will see it here. There we have a script, you upload it to 253 00:39:17,833 --> 00:39:23,833 the root folder at SMB and you have your own new process, Second Stage obviously. On the 254 00:39:26,167 --> 00:39:33,042 device itself, it is a different part. That is okay. Now you can start to modify via SMD, the 255 00:39:33,042 --> 00:39:40,792 firmware as much as you like. Any change you do there are some limitations to that, you only 256 00:39:40,792 --> 00:39:46,208 can do things outside the root FS or you have to remount it. All of the processes are already 257 00:39:46,208 --> 00:39:52,208 running so you cannot modify them really except patching them like we did. So, the nice thing 258 00:39:57,208 --> 00:40:05,083 about this extension is you can undo everything by SMB. Just go there, SMB, change the files to 259 00:40:05,083 --> 00:40:09,208 what they were before. Can completely mess up the systems, remove all of the files and good 260 00:40:09,208 --> 00:40:16,625 to go as it was originally. If you mess up SMB you still have the option to take out the hard 261 00:40:16,625 --> 00:40:24,000 drive, put it in normal PC, undo all of the changes. Very good way to experiment without any 262 00:40:24,000 --> 00:40:30,000 risk of breaking the box. (Applause). >> So, this was the techie part. Usually it is not a 263 00:40:38,667 --> 00:40:46,167 good party without lawyers. Do we have some lawyers in the room? (Pause). >> Come on. There 264 00:40:46,167 --> 00:40:52,917 must be some lawyer in the room. At least somebody who will say you are talking about LINUX: 265 00:40:52,917 --> 00:40:58,917 What about GVL violations actually western digital has been thinking about that? They 266 00:41:02,167 --> 00:41:09,792 are making their firmware available as a GPL variant. You might say why the heck did you 267 00:41:09,792 --> 00:41:15,625 spend all that time on changing the original if you can just download the original and upload 268 00:41:15,625 --> 00:41:23,375 that? There is actually a reason for that. If you go to the webpage, there is a warning. Let 269 00:41:23,375 --> 00:41:28,708 me read the last sentence to you. Once you install third party or user modified firmware 270 00:41:28,708 --> 00:41:36,458 even if the product goes back to its original, access to certain features will be disabled. What 271 00:41:36,458 --> 00:41:40,125 does that mean? That means they delete all a of their MP's if they find out. So, no more 272 00:41:40,125 --> 00:41:47,167 Spotify. No Netflix, for example anymore. Unfortunately, this does not give you the full 273 00:41:47,167 --> 00:41:53,167 feature set. With the firmware we are going to release, we have not seen any of the we do not 274 00:41:59,250 --> 00:42:04,792 want to give any guarantee. But since we have slid past the original firmware, we do not 275 00:42:04,792 --> 00:42:10,792 expect it to go out. Disclosure: Next political topic: I looked up on Showdown over 500 box only 276 00:42:17,917 --> 00:42:23,917 were available on the Internet. 500 only. A lot more in houses and closed networks. I heard 277 00:42:29,375 --> 00:42:36,292 some estimations there between 10,000 and 100,000 boxes out there. So, 500 open there. Not 278 00:42:36,292 --> 00:42:44,167 password protected. You can upload stuff via SMP in most cases. You may say Felix, there 279 00:42:44,167 --> 00:42:50,167 are two remote ways to get into the system with this. You should talk to the vendor. I tell you: 280 00:42:52,583 --> 00:42:59,750 I have tried to. I have tried so hard. I filed an official support case. I contacted their 281 00:42:59,750 --> 00:43:04,000 press because they are the ones most interested in saying I want to present this at DEF CON. 282 00:43:04,000 --> 00:43:11,000 Fixed it first. I talked to product marketing, tried to reach out to western digital. 283 00:43:11,000 --> 00:43:16,792 Unfortunately the answer was thanks for contacting western digital. We will forward your 284 00:43:16,792 --> 00:43:23,708 request to and it feels like there is null. Even pinging them asking what is the status. 285 00:43:23,708 --> 00:43:29,708 Quiet. Do we have anything anybody from western digital here tonight? (Pause). >> If you 286 00:43:32,625 --> 00:43:37,250 know anybody Western Digital, I am interested in getting some of the stuff fixed because it is 287 00:43:37,250 --> 00:43:43,250 just too open. So, if you know somebody, let me know and we can make some progress. The playing 288 00:43:46,250 --> 00:43:52,250 field I know some of you like conspiracy. Theories. I have a theory too. If you think about 289 00:43:56,792 --> 00:44:02,792 it, they have serious bucks. Intentionally. Roots on the web server pointing to world 290 00:44:04,875 --> 00:44:10,875 writable [phonetic] folder. On the other hand you have some stakeholders like providers of 291 00:44:18,250 --> 00:44:24,167 end based services, Netflix, Qualify and so on. They don't want their services to be 292 00:44:24,167 --> 00:44:30,167 switched to the open. So, why don't you leave some backdoors in there, easy to find, satisfy 293 00:44:32,917 --> 00:44:39,250 the community and at the same time satisfy the other stakeholders? Okay. That is just 294 00:44:39,250 --> 00:44:45,250 my conspiracy theory. Another topic for some beers tonight. What is the outlook? Let me 295 00:44:48,042 --> 00:44:54,042 explain my situation. Two months after we were able to watch the cable TV provider. Guess what? 296 00:45:05,667 --> 00:45:11,667 In their standard portfolio was the broadcast. I was able to please my wife two months. Now 297 00:45:15,417 --> 00:45:21,417 it is another entity that is doing it every Sunday evening. (Laughter) >> Maybe life is 298 00:45:30,750 --> 00:45:37,167 better for you. First, again, a disclaimer in case you use your end piece or break your box: It 299 00:45:37,167 --> 00:45:42,500 is not our problem. This firmware is just for educational purposes. But if you are 300 00:45:42,500 --> 00:45:48,500 interested in actually getting it. The last slide it is on Wdtv put up zero point com. You can 301 00:45:52,208 --> 00:45:58,750 download there and also our version of second be stage. In case you want to create your 302 00:45:58,750 --> 00:46:06,125 own, you can modify it from there. Now you can go and based on the techniques that were 303 00:46:06,125 --> 00:46:12,667 presented here, patch the system to add your own TV channels or if you want for example to have 304 00:46:12,667 --> 00:46:19,208 Torrent on your box, low power consumption, you can add Bit Torrent on there. Or if you have 305 00:46:19,208 --> 00:46:25,208 problems not seeing other country's streams because you are IP limited you can change 306 00:46:29,250 --> 00:46:36,042 this. If you are really craze you can find a version of Bitcoin. You won't get rich. You 307 00:46:36,042 --> 00:46:42,042 can use squeeze and simply upload the executables and most work right away. We have not 308 00:46:53,958 --> 00:46:59,625 been the first ones to research this. B Red [phonetic] is an awesome guy. He did fantastic 309 00:46:59,625 --> 00:47:05,625 work with western digital, most without storage. You should check out his pages to get more 310 00:47:08,708 --> 00:47:14,708 inspiration. That leaves us with three minutes left for questions. (Applause). >> Let's 311 00:47:19,333 --> 00:47:25,333 give him a hand one more time. (Applause) Now I don't know if you have been noticing but a lot 312 00:47:35,708 --> 00:47:41,708 of our speakers have earned their merits have been given these patches. How many people 313 00:47:48,000 --> 00:47:54,000 think Felix should get a patch too? [Cheers and applause] >> Thanks. And yeah there is 314 00:48:01,083 --> 00:48:07,083 somebody named Charlie Miller speaking next. You are going to want to get together. We will 315 00:48:14,208 --> 00:48:20,208 probably be really crowded for the next talk.