All right, I guess we're going to start. Good morning, I guess, everyone. Thanks for being able to stay up for the whole three days of DEF CON. We really appreciate it. We know some of you have flights to catch. We're going to talk about widgets and gadgets, which is cool by itself. And our PR guys came up with an even cooler title for the presentation. So, thanks, PR. Who are we, and what the hell are we doing here on stage? My name is Iftach Ian Amit. Don't try to pronounce Iftach. It's in Hebrew. Ian is fine. I'm Director of Security Research in Finjan. And with me is Aviv Ruff, Security Research with the Melissa's Code Research Center in Finjan Research. And... As I mentioned before, we're going to talk about widgets and gadgets, so we're going to start with going through a couple of slides just to make sure everyone understands what's a widget and what's a gadget. I'm going to use widgets and gadgets just freely. Sorry, vendors. It's all the same. Basically, a widget is a small application. I don't know if you've noticed. It's not just pretty stuff, but it's an actual application. It provides visual information to some useful stuff. Sometimes, sometimes not. Provides access to frequently used functions. You can get your RSS feeds. You can get a calculator. Wow. And what differentiates them from normal applications is that they're hosted in an environment called a widget engine. And that's basically how we classify them into three types of widgets and gadgets. We have web widgets. You can see that stuff on iGoogle. And any portal that respects itself. You can get them integrated into the operating system by default. Or if you don't have a cool operating system or a new one, you can get a third-party application widget and play it like you have Vista. Really cool. So what's the problem with widgets? I mean, what's the problem with widgets? I mean, why are we here? Well, basically, as I mentioned before, they're applications. So any of you guys, just like us, can write a malicious application, which is nice. And the applications can include, as I said, malicious code. So widgets can be malicious. How they get to the user, that's another question, which we'll cover in a few seconds. The second problem with widgets, and the more acute problem, as far as I can tell, is that they're vulnerable widgets. As I said at the beginning, widgets are pretty. But apparently, the guys who program widgets are guys that do pretty stuff and not really smart or secure stuff. So widgets are small applications. Widget programmers, I don't think you should have Photoshop qualifications before programming. But that seems to be the way widgets are developed. They're often considered just too small to play a security threat. And as we're going to see in a few minutes, they're not. And really, the guys that program these stuff is like first-rated webmasters or whatever it is. And it's pretty nasty. And probably most of you guys here use them at some point of time. The guy with the Mac in the front row. Oh, there we go. The kind of stuff that I should see. Google Gears. That's like two and a half, whatever. So widgets probably have security vulnerabilities. Well, strikeout probably, as we will step on stage in a couple of minutes. Attack vector. How do we get malicious or vulnerable widgets to be accessible? Exploited at the user. Well, first, you can download them. So if you write a widget, you just post it into like a widget repository. And no one gives a shit. If it looks nice and it does cool stuff, we're probably going to get hits for it. And if it's got malicious stuff in it, then wow. You can email them. Again, I'm not talking to you. I'm talking to the person next to you at work that will actually open an email and install something from it. And yeah. Okay. That's bad. And as I mentioned before, you can get vulnerable widgets. So if you're using Vista, Mac, iGoogle, live.com, Yahoo, and the list goes on, there's probably a vulnerable widget in your neighborhood. And what we can see, there is anything from command injection through manual attacks that can push stuff into the widget that looks nice but connects to like a gazillion sources to get its information from. And do nifty things. And bottom line, they can exploit browser vulnerabilities because that's usually where they live, especially on the web. And obviously, they can like be used for cross-site scripting, cross-site request forgery, and all the cool stuff that all the web apps like guys are talking about. Impact, again, anything from session hijacking. So I own your Google account. And I own your email, or your MySpace, or your blog, or whatever it is through remote and out servers. I'm just going to screw up your machine. Information leakage. And obviously, pwnage, remote code execution, execute to browser vulnerabilities, download code, Trojans, all the nice crap that you can get. So I'm going to hand it over to Aviv that's going to show you some of the real stuff. That we've found. And he's going to start with the web widgets and do demos. I don't know if it's smart but it's cool. Hi, everyone. So web widgets. Web widgets are actually inside of websites. Some of the websites that we know are iGoogle, Microsoft Live, several blog systems like WordPress and TypeOut. That allows you to add... All right. web widgets, and of course social networks like MySpace, you can share your widgets with your friends, etc. Especially iGoogle. iGoogle, as I said, is a personalized portal. It allows you to add your own widgets, arrange them the way you want, save your settings. And if you actually want to save your settings, you must have a Google account. And again, if you want to have a Google account, then when you download a malicious widget, it can hijack your account like that. And if you're a developer, a widget developer, they are based on HTML and JavaScript, so it can be rendered as any other stuff on the website. Google actually gives for the developers a JavaScript API. So the widgets that you can access can interact with each other. But if they want to interact with each other, they must be in line. So you'll get some kind of a warning. But again, if any one of you actually listened to warnings, you should, but other people won't. Iftach will later talk about the mobile support in iGoogle. iGoogle is not the only one that supports mobile. Live.com is also available. So let's get straight to the demo. Okay. I hope you guys see this. Okay. This is the victim machine. This is Windows XP. I'll just go to iGoogle. Sorry, iGoogle. Let's see if we can find it. And as you can see, this is the basic stuff. I can move around the widgets. But if I want to save the settings, I must log in to my Google account. I'll just do that, defconvictim, okay, nice cool stuff, but eventually if I want to add an external widget, I'll go to add stuff, and add my own widget, there is actually a gallery, but I haven't added my malicious proof of concept to the gallery, so just don't look for them there, you can try to see what I'm running right here, let's see, okay, yeah, okay, as you can see, it gives you a warning, but again, no one listens to warning, and this is here, my widget, well, actually, you get another warning, because this is an inline widget, so if I click okay, and this is what happens, what I'm going to do, I get the auto-price finder widget, which eventually is useless right now, because everyone is going home, but now that I'm, now that I've added my widgets, the cross-site scripting issue just occurred, why I'm saying that, because now I'm going to the attacker page, and when I refresh the attacker page, and I'll see the user that's just logged in to my Trojan, and I can do whatever I want on his page, for example, I'll just send hello DEF CON, oh, DEF CON alert to the user, and if I go to the victim, you'll see, hello DEF CON, okay, well, that's pretty, but how about, as you can see, it has some GML information, how about just get information from GML, just created some predefined commands here, let's get the GML information, okay, if we go back to the victim, nothing happens, but if we go to our log, let's see, ah, okay, I'm going to try, okay, better? Yeah, there's the email. Okay, so basically that's quite enough for the malicious demo, as you can see, you can do whatever you want. Let's go to the vulnerable widget demo. The vulnerability was found in live.com RSS reader, and it was fixed by Microsoft like two days before DEF CON, so I actually can't show you the video. There was more people, so I was actually going to do it with the whole IDO.com, I could have done it on time. Of course. I could have done it later, but I don't know. Let's play that. If there was a single process for vulnerability on iGoogle. If there was a single cross-site scripting vulnerability on iGoogle.com, would that have been enough? Answer is, yeah, just the whole thing is owned. That's it, game over. Okay. Any Microsoft guys in the crowd? No. Thanks for fixing that. Okay, so this is the live.com demo. Okay, pretty much it's done. I'll go add my RSS feed. Don't write down the address, please. Okay, so as you can see, the lower links are regular links, but the first one is a JavaScript link. And this is not sanitized by Microsoft? No. Yeah. So when the user clicks... Yeah. ...we are now on. So let's go to the attacker. And again, we go to the ProSite version application. And again, send some kind of a load just to see that we are here. Okay, so this is the live.com demo. And again, send some kind of a load just to see that we are here. Okay, so as an attacker, I actually don't know what the victim has. So before that, I'll try to get his cookie. So maybe just try to hijack his session. You can actually get real cool stuff done with this. Let's try to get the widgets from the user. Okay, so this is the list of the victim's widgets. And when we click on this... One of them is the mail, as you've seen in the iGoogle, I can do the same stuff on live.com. Just for closing, let's try to get the weather cities, let's try to figure out where the guy comes from. OK. So, he came to Vegas and he's from Israel, so it's probably me. OK. So, this is the Web Widgets. Now, what about a third-party application widget? Well, you want to have, you don't own Windows Vista, you don't own Apple OS X, but you want to have some cool gadgets on your desktop. So you go to a website and download a widget engine, you have your widgets, you have Google Desktop, you have Desktop X, which is one of the first widget engines on the market. And even if you have the Opera Browser, actually the web extensions of Opera Browser are widgets, we'll talk about it later. But specifically about YOWidgets, YOWidgets is previously known as Confabulator, they bought it. They recently released version 4.0. The latest version they added some cool. The sidebar, very similar to the Windows Vista. And again, it's based on some kind of Markov language, very similar to HTML, and you can use JavaScript in it. And if you are using the pre-installed widgets, you must, in some of them, you must have a YOW account. And again, this might allow the attacker to hijack your YOW account too. And as a developer, if you... If you develop widgets for YOWidgets, you can develop for both Windows and MacOS, because it works on both, and it provides you a multi-platform API. So again, let's go to the demo. Okay. Well, actually, when I come to Vegas, I like to gamble. And for that, I go to some kind of casino websites. And on one of my favorite casino websites, I had a YOWidget for slot machine. So I go and download the widget. I open it. I get some kind of warning, because it wasn't really... It was written by Yahoo. And I get the DEF CON 15 slot machine. Okay. So I can play whatever I want, but what I don't know is... Yeah, thank you. Is that right behind the slot machine created folder on my root directory. And if you don't believe me, I'll just delete that and run it again. Let's call the widget. Can you see it? I'm just trying to come here. This widget and slot machine. Okay. So here's the hack it's created. Okay. Okay. So you're just going to play, and someone already owns you. Am I a sucker? No. Now he knows what to do with his comp money. Okay. So this is the demo for the malicious widget. Well, let's go to the vulnerable widget. The vulnerable widget is in the YOW context. This, again, was fixed by YOW several days before DEF CON. Actually, they were pretty quick, less than a week to fix it, but what the heck, it was like one line of code. I'll show you that later. So I'll just close this stuff and go to the YOW context. One back. Ah, okay. Up there. Sorry. Okay, so, again, if you want to use a YOW context, you must sign in to your YOW account. So I also have a YOW ID for DEF CON victim. I can have a trademark for this. And I sign in, and I get the list of contacts. One of them is Mimi. And when I click on Mimi, actually, nothing happens. Why is that? Because YOW first fixed the vulnerability on their server side. What they did, they escaped the contact information, and the vulnerability won't work. But what they didn't fix was the widget itself. The problem is the widget does not use, secured communication between the widget and the server, so what we are going to do is use a man-in-the-middle attack. I have a water. Sorry. Okay. And for that, I'll use Fiddler. Oh. I have an update. Really? Oh. Mm-hmm. Okay. So Fiddler is a proxy, and it emulates a man-in-the-middle attack. I can temper the data that comes and goes between the widget and the server. So if I close the contacts, run it again, you'll see that it tries to log in. This alert, is because it tries to contact via SSL and have a certificate warnings. Okay. So as you can see, I can just monitor anything that goes between the widget and the server. What's interesting here is the addresses URL. And as you can see, can you see it here, or I need to zoom in? No. Okay. As you can see, this contact is trying to conduct some kind of cross-scripting attack against the widget. And then try to run a command. Just run a calculator. That's it. Well, it doesn't work because they escaped it. And you can see it actually double escaping here because it's XML format. So the first escaping is, for the XML, the second one is the yellow fix. And what we are going to do is just temper with the data and remove one escape. So let me set a breakpoint. Okay. Let's try it again. I'll close the widget. Okay. Okay. So we set a breakpoint at the address. And let's break on response. And now we can change the information. And what I'm going to do here is just remove the double escaping. Remove the AMP call. Semi-call, sorry. Again. That's about that. And let's run to computer. And let's see if it's going to be complete. And now when I click on the email address, I get the calculator running like I want it. So basically, all the attacker has to do is get in the middle of the communication and just change the data. That's it. So let's see what was the vulnerable code. It was actually very simple. Whenever you click on an email address, it's going to show up as an email address. It's going to show up as an item. It has onMouseUp event, which tries to open a URL. And this URL is not sanitized. So I can just inject whatever I want. And here's the fixed code. So they just used a function and no string concatenation. And they also mark up the, and add their own how of shame. OK. So that's it for the third party application widget. And let's go back to the presentation. OK. So what about OS widgets? If you have your cool operating system, you probably have it out of the box. If you have Apple OS 10, if you have Windows Vista, some Linux distribution already have them installed by default. You already have your widget engine installed. So probably you're vulnerable by default. Let's talk about Vista sidebar. Actually, the Vista sidebar is installed by default on all the Vista editions. If you have basic, if you have premium, or if you have ultimate, you have it. It also allows you to install external widgets. So you can download the widget, like any other third party application, and have it on your machine. Well, it's not that smart. It actually uses Internet Explorer 7 for rendering. So you actually built your own HTML page and display it on the sidebar. Vista has a cool feature called protected mode. The problem here is that the sidebar does not utilize this feature. So, no sandbox here, guys. Please try. So, and again, Microsoft provides some kind of API for the developers, but this is Internet Explorer 7. So you can just run any ActiveX you want, and it will run it as if you're running it in a default browser. So, let's go for a malicious demo. Ah, crap. I forgot to run the Vista machine. Oh, yeah. I'll do that. Let me see. Yeah. Sorry for the waiting. I just forgot to run the machine. What we're going to show here is actually a malicious widget that we wrote, that Aviv wrote himself. And we're going to focus on the vulnerable widgets in Vista shortly after. Okay. Yeah, yeah. Go on. Oh. Cool. Come on. A lot of demos. Yeah. Well, yeah. That's the purpose, isn't it? It's blazingly fast. Yeah. Yeah. Yeah. Well, yeah. Yeah. Yeah. Okay. Yeah. Yeah. Yeah. Okay. As I said, there's a lot that. Let's see here. I've got the opponent here. I've got him. I know he's a little bit . Let's see. Okay, here we go. So I don't know how many of you guys are werewolves around here, but I am. And like any other werewolves, I like to know when it's full moon. So I go to the gallery and when it's going to work, okay. I'm going to download a full moon gadget and open it. Okay. But just before I open it, I want to show you that we are clean here and the startup folder here is empty. So it's going to be filled after I run the Vista. What you see here is the protected mode warning. This is actually the I7 warning. This is not the sidebar. What it says is that... You're going to open the gadget in Windows sidebar, but that was your intention in the first place. So this basically happens whenever you try to move the mouse. So it's probably disabled. Okay. So it says that it's on publisher, but I want... Hopefully. Yeah. Okay. Okay. So I get the machine and hopefully we got infected and I can know... Oh, on the 30th, it's going to be full moon. I got fire on my startup folder. Okay. So, as you can see, you can do whatever you want. If you install... Okay. So, let's try the gadget. Let's try now the vulnerable widget. Actually, this vulnerability was not patched, so I've created a video for that. We've notified Microsoft. Yeah. We've noticed Microsoft on this for like... Eight months? No, no. On March. So, five months. It's enough for them to fix one code liner. Okay. Thank you. Bye. Bye. Bye. Microsoft said that it would fix this on April. And then... When? June? And then Black Hat and DEF CON came awfully close. So, they said... July? lie it doesn't work come on shut down a lot of demos let's try so this is still unpatched and again by default installed in all of vistas yeah the demos is playing with me one moment okay come on okay let's try do some processes everything is done the live demos work and the videos doesn't yeah I mean pretty stuff Murphy where are you get out of the room what are you doing trying to get the task manager breaking stuff again yeah I'm usual as usual it's a really cool video hopefully we like pretty pictures so we love Vista okay so probably we have Windows multiplayer somewhere here and this is why it doesn't work yeah I knew that okay you now you how many we got you and we Habitое Go, go, Vista. No. Okay. It just doesn't feel itself. Nothing. Okay, so let's skip that. Skip it? No. All right, we're going to move on while Aviv is going to try to set up my laptop with the video. We really want to show it. It's cool. Yeah, the patch is out August 14th. So. No, we're under responsible disclosure. Don't worry, guys. I am the responsible adult here. All right, so mobile devices. We saw that widgets work everywhere, and they really do work everywhere. I mean, we've seen operating systems. We've seen third-party applications when we've seen the web. But you get web on your office. You get your iPhone, and your Nokias, and your Crackberries, and all the other cool shit. So, iGoogleLive.com actually have mobile interfaces for their widgets. And different widgets can be displayed on the PC as well as on mobile devices. They just have a different profile. But if you're a widget developer, you can definitely type and talk at the same time. You can definitely create a profile. You can create a custom version for mobile. Only some of them are allowed to be added, but, hey, we can bypass that. Attack Vectors basically concentrate on session hijacking and breaking your phone. So, we love phones that are connected to the internet. We mentioned briefly browser extensions. And they're actually not a lot different from widgets. Because they provide, again, all sorts of cool stuff. You can add some cool stuff to the browser and enhance it and put pretty pictures on it. The problem is that browser extensions are really close to the operating system of the browser itself. So, for Firefox, the extensions run in Chrome in elevated privileges. And who doesn't use Firebug in Firefox? Oh, you've got to try this out, dude. It rocks. It's cool. So, PDP from GNU Citizen has actually found a vulnerability for one of the previous versions of Firebug. And it's like total control. So, watch out. And Internet Explorer, well, duh. BHOs, ActiveXs from the OS, everything is accessible through the browser. So, it's kind of cool to be integrated into it. So, how are we going to fix the problem? I mean, we've seen that it's like everywhere, even in my pocket. Oh, that sounds bad. And so, what do we do about it? Well, basically, you can start with the simple stuff. Start signing it. Kudos to Yahoo, who actually signed their widgets. Everyone else, not. Bad. Trust no one. Well, yeah. You're the right crowd. If you're actually working and getting paid for what you do here, then you can control this. You can block this at the gateway. Just don't let those things inside. .widgets, .gadgets, .whatevers. And surprisingly, there's actually a widget implementation solution. It's a standard by, it's actually a recommendation. It's a recommendation by the W3C. The last draft was from November 2006. It's available there. It's actually pretty cool and pretty smart. It recommends using the object model based on Apple's dashboard. So, Mac user, you're safe, kind of. It's implemented in Opera. Go Opera. And it basically defines a really strict security model. So, no access to user file system. Finally. And if you want to use the network, you have to explicitly say what protocols are you going to use and what ports are you going to use. So, it can be administratively enforced across a corporation. Start using it, guys. This is not that difficult. You can build like Vista and it's pretty. So, an OS 10. Cool stuff. So, use it. And obviously, you can't, no matter what, access any intranet IP ranges. Do we have this ready? Yeah. All right. We're going to try and do like a really quick and dirty switch. Because I really want to show you the Vista stuff. You need the sound. I don't need that. Sound. Sound. Yeah. Like that. Does that work? Yeah. All right. Bear with me. This is hacking at its best. Work. No. Going to try tracking. You getting there? Okay. All right. Looks like. So this is like R-rated This is Vista, pretty I'm gonna take you down, yeah Love music too Strongpeople.com Guys? Oh, yeah We forgot that we're under like responsible disclosure, so we can't really show you exactly what widget it is but it's vulnerable and you can like own a Vista in two seconds, so Microsoft are doing a pretty good job on responding and fixing stuff, so it will be out in like six days, ten days Don't run Vistas until then Alright Alright, so we managed to run through all the pretty stuff We talked about what's the solution, well there isn't really one out there right now and kind of everyone is vulnerable so you have a lot of work on your hands right now, because it's everywhere and it's like exploitable explodable like hell and it's got access to operating systems, so go Questions? Yeah Is there, the question was is there a place where where you can see security analysis on widgets? I don't think so, I mean this is pretty new to the security world, I mean this is our first presentation ever talking about this and we haven't really seen anyone talk about it before, so no, I don't think so The vendors are aware of it, because we kind of sent emails and stuff like that, but and they're fixing stuff, but I don't think it's started to come to the attention of like the general crowd and that's why we're here There's a lot of stuff out there, yeah, go ahead I'm going to go ahead and I'll start with the the the the the the the the the the Well, yeah, definitely, I mean obviously you're right, I mean it's it shouldn't be so like all over the place, the problem is is that most operating systems today have everything with everything and like there is no real object security model enforced so what you're saying is that the URL should be a URL and it shouldn't be like playable or whatever it is Yeah, well data data and code and executable code are awfully closed these days so, yeah, you can take data and turn it into code, we've actually seen it in the wild so you can take like a text portion of an HTML page and make it runnable in a browser with like three lines of JavaScript data, code run, execute, it's it's all there, that's the problem, so we need to develop, I don't know if you've seen Bruce's presentation, really cool we need to really start thinking about the software we write and maintain More questions More questions That's it, alright guys, go to work, thank you very much