So, I'm, my name is Colin Mulliner, I'm a student of the Reliable Software Group at UC Santa Barbara and I'm doing some security research on Bluetooth and other stuff. And today I'm going to talk about advanced attacks against Pocket PC phones. But actually that's only half of the truth, since we're actually going to talk about MMS-based attacks against Pocket PC phones. So, we're going to talk about attacking and exploiting Pocket PC-based smartphones, about vulnerability analysis of smartphones and applying fuzzing to smartphones. In this particular case, we're looking at the MMS, at MMS, the Multimedia Messaging Service. And, of course, we are going to look at the client side, the user agent side. So, basically, we're going to look how to analyze and then how to attack the Pocket PC MMS user agent. So, first, a small overview about mobile phones, state-of-the-art attacks, a little bit about Pocket PC. The Multimedia Messaging Service, then vulnerability testing of the Multimedia Messaging Service. And then some nice exploits and how to own MMS user agents and some conclusions, of course. So, right now, the basic attacks against mobile phones are either Bluetooth-based attacks, where you just, like, take control over the phone using some logic errors, where you can, like, steal phone books or use it to do denial-of-service attacks, or you attack third-party applications, do some code injection, some denial-of-service. Or, if you go to SMS, MMS, we have these MMS worms for Symbian, which don't really utilize real vulnerabilities. It's more like, yeah, let's see if the user is actually dumb enough to run this Trojan. And some common examples are the Comwarrior, the Mubbier, Worms. And then we have the SMS-based attacks, some format string exploits, which basically can only be used to crash the device. Or the Siemens thing, some special characters. If you send an SMS with a special character, the phone just freezes. This is very, very stupid, not very advanced. So we are going to do advanced attacks. So Pocket PC was exploited about, like, three years ago. There was a first talk about DEF CON, I think, 11 or 12, I don't know. So the basic things are, okay, we can attack some third-party applications, preferably FTP servers, or we can do... some attacks against the Bluetooth stack. There's actually a nice, not really public, exploit, because Microsoft said, oh, we're not going to fix it, the next version is getting out. So Tim Herman of our group, he wrote this really nice exploit. Then we have some other Bluetooth OBEX-based attacks. Nothing... it's cool, but not that great. And then we have some denial of service, effective active sync, or... some local attacks, which are kind of stupid, against PDAs. But they're there. So, quick overview of what is Pocket PC. So Pocket PC is actually just the Windows CE versions used for PDAs and smartphones. Yeah, there are a bunch of architectures supported, but we are actually only interested in ARM. Also, we're not going to do any shell code or things today. Yeah. The current version is 5.0, but there are so many 4.2 devices out there, so we're going to look only at 4.2. So that's basically the phones where... the devices we are interested in. Just two examples, where we have, like, GSM, wireless LAN, Bluetooth, infrared in one device. Yeah. So these kind of phones are we going to attack. Some quick overview about Windows CE. So we have this... Windows CE only has, like, one virtual address space for the whole... for all applications, or all processes, which is divided into this really stupid slot structure. We have basically a 32 process limit, and yeah, there's some kind of memory protection. So, yeah, it's really stupid OS, but we are not going to look at the real details. We're actually only interested in... So, the security model is also really cool. There is actually... It's a single user device, and you can just lock your device, so any pro... And any process can access, like, everything, which is really cool, then, because once you're, like, execute code, you can just, like, oh, let's use Bluetooth. Oh, why not use GSM and call some numbers? Yeah. We can just do anything. So the reason why I'm not going to talk about shell code, and stuff, is because it's pretty well-covered by now. So if anybody's, like, into writing their own exploits, check out these talks, and use the stuff I present today to write some nice shell code. So there are some issues, like, on Linux or Windows, you have, like, a command shell, so you actually just want to do one thing. You just connect or exploit a box and run a shell, and you have access, but not on Pocket PC. So you actually have to write everything you want to do in your shell code. So it's going to be a little bit ugly. And then we have the stupid slot problem, where we actually have to, like, guess a specific part of the return address every time. You... So that's kind of annoying. There are some workarounds I'm going to show them later, but they're well-covered in the other talks. So that's the actual thing we're interested in, the multimedia messaging service. Many people, I guess, know it, either at MMS or as picture messaging in the U.S. Yeah, since I'm from Europe, we just call it MMS. It's basically just a multimedia messaging channel. It's an exchange system. It's basically built, like, really audio, video, pictures, text, of course. But you can actually send anything, you know, just some data exchange, like email. So like email, messages are sent, like, in a store-and-forward manner, so you actually have a big infrastructure in the back. And of course, you have to pay per message, which is kind of interesting if you try to analyze a system like that, because we don't actually want to spend money. So the architecture, even if it's, like, a phone thing, it's totally IP-based. So if you're, like, kind of skilled in all the IP stuff and HTTP, WAP, maybe, yeah, you know how to mess with MMS. The system is basically just, like, four components, the MMS server, a relay, a gateway, the push proxy, and the SMS service center. So... Yeah. The interesting thing. So when the message is sent, of course, the client generates the message, and then it's actually just first a WAP push to the WAP gateway, which just translated to HTTP. And so it just uploads some stupid file to some web server. That's basically how MMS works. The receiving side is a little bit more interesting, because the device somehow needs to know, oh, there's a new message waiting for you. So that's just going to happen via SMS. So as soon as a new message is waiting for you on the server, you just get an SMS. And then you just go to the server and the same way, just use WAP over the WAP gateway, do HTTP, and get the message. So the metrics is just, like, yeah, email. So we have some headers, some bodies. The bodies... So in MIME, a really nice format, especially if it's binary encoded. You can do a lot of nice and funny things with it. By the way, if there are any questions, just rave and get a mic. So they just do binary encoding, of course, to reduce message size, which is kind of interesting later. So we have a bunch of messages. There are message types. They are not too interesting, besides the notification message. So just for reference. So what is the user agent? Of course, it's like the MMS client application that sends and receives the stuff. It handles, of course, SMS, WAP push, all the IP crap. And of course, it has to render lots of formats. S-I-M-L, W-M-L. It's like HTML4. MMS. And of course, all the different audio, video, image formats. It has to do a lot of stuff. So the Pocket PC agent, they call it the inbox application. And the fun thing, it handles everything. Every communication, like SMS, MMS, POP3, IMAP. And yeah. I mean, I was working with these two. So maybe somebody has a device like that. Maybe he wants or she wants to switch the device off because maybe I'm going to do a demo later. The application binary is called TMA. So just if you want to look at your device, that's the application we're going to mess with. So now if you want to actually analyze and see and attack the agent, we first, of course, need to know, okay, what kind of inputs does this application have to handle? What are the possible attack vectors? And then we have to look at the infrastructure because all our methods we're sending to the device are going through the infrastructure. The infrastructure could just filter out, sanitize parts of the message, and maybe filter out bad stuff. We are sending. So we're going to have to look at that. And then since we don't want to pay for message delivery while testing, we're going to build our own infrastructure and use that for fuzzing. But yeah, more on this later. So basically there are two different messages which are sent to the device. The notification, this is the part that's sent over SMS, which has the information about the new message. And then we have the receive conf message. This message is basically the thing, the file you download from the web server with just normal HTTP web cache. And then we have on the receive conf, of course, we have like a header part and a body part. The body part is really nice, complex, binary encoded MIME multipart. If you ever looked at a MIME encoding and then just think about how it would look like in binary. Yeah. It's fun. So the infrastructure, so every time we send a message, the infrastructure or the MMS relay is going to look at the message and say, oh, what's about that header? That's maybe incorrect. So we're not accepting that for delivery. So in order to actually... Find the vulnerabilities or exploit them, we need to know what parts of the message we can actually modify to a certain extent before it gets rejected. So that's what we're gonna do. So I implemented a kind of fuzzing-like testing procedure where we just modify fields and just record the behavior of the MMS relay to see, okay, this is acceptable. This is not. So the message headers are basically sanitized heavily and it's mostly unusable. But the message body is more interesting anyway since there are many more possibilities there. And then I think they don't touch it. Yeah. So yeah. So if you look closer at the MMS delivery on the phone itself, we see that we get a... a WAP push, which is, you can do it over UDP, but they send basically the same message just encapsulated in an SMS. It's sent normally from port 9300 to port 2948. These are SMS ports, so in SMS you can also have the support identifiers. Then we have this nice thing on the device called a push router. The push router basically just gets all of our purchase and forwards it to the application. If you have this VND WAP MMS measure thing, the MMS client is going to get it. The real fun thing is the message, the URL, where to receive the actual message. That's just part of the notification. That's really just a URL string, like here's the message, get it from here. Now the real fun thing is the push router. Really bad, bad fuck up of Microsoft. The pocket PC device who have wireless LAN also accept the WAP push message on the wireless interface. As soon as you fire up your wireless interface, I can send you a lot of nice WAP pushes. That's how the notification looks like. You see at the end, the red part, this is just the URL where the message is waiting for you. Then you see the blue part is the WAP push. Just some information. You see some transaction, the subject, it's all in there. What you actually can do, you can just build your small WAP message generator and then just start sending WAP pushes over wireless to your device. Your device will think, oh, there's an MMS waiting for me. Your phone will try to dial up GPRS. The sound is also very, very annoying. If you send hundreds of messages, thousands of messages, your phone is all going to be very, very slow. You can do stuff like fill up the MMS inbox with the file system. You cannot do select all and just delete the junk message. You have to go through and delete one message by one by one. It's just really, really nice DOS attack. So, of course, we're going to publish a tool. Also the tool is not, yeah, I haven't put it on the website yet. So actually the trick is to, for the flooding, is to make the phone believe each message of course is a new message and the thing is we just have to have a unique transaction ID and content location. So if you look at the slides later with the notification printout, you can see what parts you have to modify in order to have a nice, small, unique notification message. So and yeah, if you, that could happen to you today if I put the tool online. Are you saying that the phone can actually go get messages when they're not there? No, that doesn't work. But because of some... Yeah. Of the web, since you have to go through the web gateway of your phone service provider, he is there of course blocking access or some of them block access to the servers which are not their MMS servers. But yeah, your phone will like try three times per message. So it will try to dial up GPS, try to do a connection, yeah. So but yeah, that's just like the small side effect, the small fun we had on the side by doing that because actually we're going to, yeah, use the UDP stuff for something else. So we want to find real exploitable bugs in the application. And since, yeah, we don't have the source or anything, we, yeah, we're going to use fuzzing. And fuzzing, probably most of you have heard of it, it's just you build like semi-valid input and send it to the device and see how it reacts. So the problem of course with MMS is, yeah, each message will cost you about like 25 cents maybe. So if you want to send like 5,000 messages to do some testing, you have to go pay a lot of money. So we are going to just build us our own MMS infrastructure. It's, yeah, since we only have a web server, we have a web gateway. So we can just get off the shelf stuff from the internet, set up an Apache web server, the web gateway, get the MMS message generator, which we're also going to release the custom, our customized library, but it will take some time. And we do the actual simulation of the MMS infrastructure. And we do the actual simulation of the MMS infrastructure by using the UDP part. So Microsoft actually gave us a really nice debugging tool with this UDP part. Because now we can 100% simulate the MMS delivery process. You just have to change some settings in the MMS client and say, okay, use this IP, like our Apache web server and our web gateway to get messages. So we can generate some messages, put them on the web server, yeah, put them on the web server. And send. And the notification. So we basically were just after basic buffer overflow, string links stuff. Just some basic testing. And so you just hook up the debugger to that email . Generate some message. Dump into, dump it into the web server directory. And send the message notification. So the phone will retrieve the message from the web server. Either it does nothing. and it just looks funny, or maybe it doesn't show anything, or maybe the TML exit will crash and you get some nice exception. So this is a printout of the actual receive conf. It's not complete, of course, because it's kind of big. So in the beginning, we see the phone numbers, and then we have the nice multi-part headers. In the middle, there is the text file, and then we have the XML file at the end. So it's just for your reference. Of course, the simulated infrastructure really, really helps, because the ISP infrastructures are really undeterministic. Sometimes the messages are not delivered promptly. So the simulated infrastructure really helps to do deterministic testing. Also, maybe we want to test the parts that are normally sanitized. So We can, with our infrastructure, we don't have this whole sanitization thing. We just generate files and feed them to the phone. And of course, GPS is kind of slow. Maybe if you have Edge, but still, the whole thing is kind of slow. And with our own infrastructure, we can really speed up the process. And of course, we don't have to pay our whatever, $0.25 a buck or however, how much the process is. The provider's going to charge us. So that's really nice, and makes the whole testing really relaxed, so you don't have to think about spending money for stupid messages. So then, yeah. The first box we found in the notification message. And there are just like three stupid buffer overflows. So if you just make the transaction ID like 264 bytes, . The MMS client just like dies. So and if you remember, you can send this message over UDP. So as soon as the wireless is up, you just go out, send a nicely modified notification message, and you can crash Team Alexa. Unfortunately, all these overflows are not really exploitable for code injection. You can just overwrite parts of the stack, and the application just goes away. So the bad thing is, OK, you see my, oh, yeah, when I want to write MMS, I don't need to be on the wireless. But since the application is also handling emails, so maybe you want to check your email. And at that point, we just fire. And so any time your wireless interface is up, you cannot read emails, SMS, MMS, a really nice one. And then we have some other bugs in the mretrieve config. That's, yeah, they're not so interesting. So in the body, this basically is the same bugs. But for some stuff, we cannot exploit it because we have the stupid sanitization. So what we could do, this is just what we could do. We actually haven't tried it. And because many mobile phone service providers actually run these stupid closed web gateways, which don't allow us to connect to our own rogue web MMS server. But if you find an ISP, which doesn't block access to other IPs, you can just run your own MMS server on their network. Or just on the internet. And send a nice SMS, which points to your servers. And whoops, you can exploit all the other bugs you just found, which were normally not exploitable. So maybe you want to try to test some other service providers. I just did like this, the big in the US and in Germany. And they're smart enough to deny this access to other MMS servers. But yeah, maybe you'll find something and whoops. So now it gets interesting. We have the SIML, this is XML-based presentation language, basically the HTML for MMS. And the really cool thing about that is this is, of course, transported in the message body. And everything we put in the message body, as I said before, is not sanitized. So whoa, that's a perfect attack vector. Maybe we find something there and really screw you. So that's basically how a file like this looks like. It just looks like HTML. The green and the red region is going to be interesting. Because yeah, there are some exploits. Actually, the implementation is that bad that for these. They just copy the stuff within the double quotes to the stack. So if you put like 600 bytes there, 800 bytes, whoops, just on the stack. We don't care about the size. It's probably the same parser, which just operates on different tags. So yeah, so maybe this is a nice exploit. But in order to actually send our own bad MMS, we first need to build our own MMS user agent. And since we know how MMS actually works, this is going to be quite easy. So we basically use an MMS lib to generate some MMS thing. I used a really stupid Java library to just handle the web stuff, since I didn't really care about re-implementing the shit. And then we, of course, have to use gprs.com. And then we have to use a lot of the in order to connect to your service provider. Because the MMS relay, of course, is not reachable from the internet. That would be so stupid. Or of course, sometimes the whole infrastructure is just in a private IP range. So it's not connectable by the internet anyway. So building an MMS user agent is actually quite easy. So yeah, the zero day. We can actually use this exploit from before. There's a lot of different ways to do this. There's a vulnerability to just do some remote code injection over MMS. And not like the other MMS things, where you just have to install. And yeah, it's OK that the application is not trusted. You just click on it, like on an email. And as soon as the viewer goes in action, bang, code executed. So yeah, there is some. So on the left side, of course, it's just the inbox. And yeah. If you click on that little message, whoops. Yeah. So maybe somebody wants to try this at home. Yeah. So as I said, I use these two devices. I really don't know how many devices are affected. But yeah. If you want to try this, there is a return addresses, the stack size. And so the slot problem I mentioned in the beginning, it's actually really, really stupid. So you actually have to guess on which memory slot the T-mail is going to be executed. And what I found is like 14, 16, 20, 24, of course, hex are the common slots. So basically what you do is just not send one malicious MMS. You just send four. And maybe the user is stupid enough to try to execute all four. And at some point, we will have him. So yeah. Have some fun with that. Oh, woo. I'm way too fast. So of course, I've talked to Microsoft and the company X, who doesn't want to have his name mentioned. But actually, the name is on the slides I submitted, because they responded like very slow in the beginning. So they really show that they took it. But seriously, because one of their VPs, of course, the marketing people, since they don't have one single security guy in the company, he was like, whoa, we can't do that. Can't really, you can't publish that. And in the end, they were actually very slow. It's very fast, sorry. So in about a week, they actually managed to bring out a fix. And the fix is now sitting at the OEMs, because they need to be tested and approved, before they can be released. So as far as I know, they haven't been released. So you have, I guess, maybe a week or two to exploit this. But yeah, do it with your own devices. Not with your owned devices. So yeah. So some defense stuff. I'm really, really fast. Of course, you could just run a packet filter on your pocket PC. I actually haven't tried that, because I was way too lazy. And for the MMS stuff itself, the ISP, of course, could run an IDS or some antivirus thing, which they already do. But yeah. OK. I didn't have a problem getting messages delivered over four different ISPs. So I guess they don't do any kind of detection until now. Of course, you can also run some IDS or antivirus on your phone. But yeah. I guess today is the first day they know about this. So yeah. So yeah. And yeah. What mobile phone providers actually should do is, they should actually filter. They should filter those SMS notifications over SMS, since actually nobody else besides them should be sending these notifications, because they also can crash the application over a real SMS. And yeah. Of course, install firmware updates when available, or soft updates. So the problem, yeah, security testing for smartphones is, like, really, really hard. It's really painful, because you have this infrastructure. You don't have source code. And in some cases, yeah, if you're like doing the security engineering side, then you're, oh, hmm, the MMS user agent is actually talking to everything, like to the GPS, mobile phone network, and to Wi-Fi. So you really have to be careful what you're doing. So we found about, like, 10 exploits. We actually stopped searching after we found stuff we could use for code execution. We will, of course, post a nice advisory on the list. Yeah. And yeah. We did the first code injection against mobile smartphones. And yeah. There will be a major, major problem in the future if the companies don't watch out about that. So. Let me see. Oh, yeah. So it was really too fast. Yeah. So in the future, of course, we have to look at other MMS implementations. And like, there is a Symbian, Palmer stuff, the new Linux phones. We haven't really looked at that stuff. And then, of course, all the other parts of the MMS message. We haven't looked at the audio, video, help parser. And the handlers. So, so many things to test. And then, of course, you could also attack the actual MMS infrastructure. There are so many different protocols in there. You can really, really mess it up. So, yeah. It was really too fast. So we have a lot of time for questions for anybody. Go ahead. Take the mic. And so, I guess, we can, I have time if, are people here with like pocket PC phones? So we can do some demo. If you have wireless on, I can do that. How off does the phone have to be? Is it on? How off does the phone have to be? Like, the, like, airplane mode and Wi-Fi off and Bluetooth off? Oh, for, for the Wi-Fi stuff, of course. You just turn off Wi-Fi and then you're secure against the Wi-Fi based stuff. But for the MMS stuff, yeah, you have to not read MMS. That's the only thing. So just leave it in airplane mode? Yeah, but then your phone is like off and not usable. So you should basically use a PDA maybe. When you were testing and you found that all the major carriers prevented the client from connecting to a rogue server, did you try running a server like on, on a device that's actually on their network, like a, you know, a cell phone or? Yeah, we, we tried, we tried that but not with all providers, with some. And yeah, I guess the, the European one, the US providers are really up to date with their MMS stuff. But I, I found online, in the, in the MMS, actually, developer forums online, they give you software. So much nice information and people are like, oh yeah, I think like in the former Eastern Bloc countries, I think some, some providers still just run totally open networks. But apparently the, the German and US stuff, they, was open I think until two years ago because I saw posts where people were just, oh, I want to play with MMS and people are just like reconfigure the MMS server. Just go ahead. So how about the future? What about FIBO? Is it super secure? Because I have a personal, this kind of hits me personally because I do have a FIBO phone but no, wireless is not on. So yeah, I only, yeah, so I also, I never actually had like a FIBO phone but a friend told me that apparently FIBO is completely compiled with stack protection. Yeah. I, I really don't know. Some, some people looked at it and they saw there is no way in so I, I haven't looked at it. I cannot say anything but you should be able to at least be able to crash the application over UDP since the. How is that possible? Because the exploit is based on MMS, I mean, does it, does FIBO somehow look at the headers well as the, the body? No. So if you're. Yeah, stack protection just like checks that if you overwrite the stack the function address doesn't, the function doesn't return so your code is not executed. So it basically just gets converted to a DOS attack which is kind of stupid over MMS since you actually have to pay for it. But the UDP attacks should still work, yeah, I, yeah, I really haven't tested anything about FIBO so maybe I can get a FIBO device and look at it. Preferably not mine. I appreciate it. The fuzzer you used, did you write that yourself or did you use another application? And if you wrote it will you be releasing it? What, what application? The fuz, the fuzzer you used. Yeah, we will, that will take some more time since it's actually a university project and we have like a scientific paper on it so we keep it until then but it's going to be released this year. The other application, the, the DOS tools, everyone can try it out. We'll be. Released later. As soon as I get off stage I will try to put it online together with updated slides. One other quick question. Are there other services that you're attacking or is it just MMS that you're interested in? We're just, just looking at MMS. Oh. Thanks. Anybody else? I guess I still have like 10 minutes or something. No. No, no, Dan. No, no, Dan. So, any volunteers for like putting up their, firing up their while, wireless? Did you say you want to test Windows mobile 5? No. Not on stage. So, no, no volunteers or I actually thought like people were like screaming to like volunteer for stuff. Normally people always want to volunteer and like oh yeah, I'm going to do the, the thing with the guy on stage, but I know that's your phone, huh? Please use a mic. OK. I guess I'm totally under time. Another question? Thanks. So I don't get in trouble with the DEF CON crew. I was just saying, could you expand a little bit more on the SMS ports thing? That's in standard SMS messages, there's like a port field or something? Yes, exactly. But the attacks over SMS itself, that's not as interesting because you actually have to pay for it. So the thing is, the SMS ports are the whole port thing for the web posts are just mirrored one-to-one between SMS and UDP. So it's basically, they just map it to the same port so you can send it over UDP. And according to the Microsoft security guy, we're just following the standards. I volunteer my phone for a demo. For two? Just hook it up to the DEF CON network and I will do this. I just have to hook up my laptop to the DEF CON network. And yeah, I don't need your IP since Microsoft accepts actually messages sent to the broadcast address. So you don't have to search stuff. So you actually don't have to search, you're just like, yeah. I have a question while you're thinking about that. Do you have any idea why Microsoft allowed the UDP notification messages? Like, do you have any thoughts about what their reasoning might have been? Because they're just following the standards. That's what I was told. I'm not going to. You have five hours. Let's see. . Make sure your sound's on. . . . . . . . . . Thank you. So, is your device on? You don't see anything on my laptop. Yeah, it's giving me the IP for now. Sure. Do you get anything? Still nothing? Bummer. Bummer. Anybody with a 4? 2 device? Okay. So, I guess I guess that's it. 5 minutes early, but Thank you.