Give Rowan, a first-time speaker, a big round of applause. That's good. You get to keep one. Probably the one you used. Have a good time. Thanks. Hi. So my name is Rowan. I'm an undergrad at the University of Washington. And last time I was doing research into using Thin Sims to break mobile money applications. So first, what are mobile money applications? So if you've ever used Venmo, then you've probably used a mobile money application. The basic idea is you have a balance that you can load money into, and it's usually some form of app. Then you can transfer that money to other people and make payments through that way. Now, the ones you've probably seen all run on smart phones. But it's possible to run these things on the SIM card of a phone or other means. So they're actually very widely used. So there's almost 700 million accounts worldwide. 276 deployments in 90 countries. And transfers over a billion dollars a day. Now, a lot of these users don't transfer very much money, though. It's $188 a month. Which, on average. And that's because they live in places where they don't make much money. So these applications are very widely used in places like Africa and Southeast Asia for people who don't have much money. And the reason why they'd be using this over banks is that banks are a lot rarer. And so here you can see there's roughly 500,000 banks in developing countries. Whereas there's 2.2 million mobile money agents. So all you need to be a mobile money agent is just have a phone and have access to cash. So the infrastructure required is a lot lower. So it's a lot easier to get access to it. And so if you're a farmer and the nearest bank is a couple of villages away, you probably would not have a bank account with a bank. Because it's going to take too long to get there. And so the only way you could store your money is by trying to keep it safe somewhere. So maybe burying it at the ground. And that has its own issues, like maybe you lose it. It gets stolen. So mobile money is actually a really useful tool for these people to try and be more financially secure. And so it doesn't only run over smartphone apps. The most popular interface is USSD. I'll explain what that is later on. Then there's smartphone apps. Then there's some toolkit apps which run on a SIM card. I'll explain those as well. And then there's IVR. So this is the interfaces offered by these platforms. So most of them offer USSD. So this is the trade-offs between the different forms of applications. So you've got smartphone apps. Which everyone knows what a smartphone app is. It's got a very rich UI. It's very easy to develop for. There's existing development environments. It doesn't require any cooperation from the phone company. You can just load an app onto your phone. Start running it. It needs a data connection. Which can be a bit difficult to get in some areas. And also requires a smartphone, of course. Which comes with its own host of issues. Which means then you have to be able to charge it every day. They're fragile. If you break the screen, that's a big problem. So they're not so useful in these environments. Since most people also don't have smartphones. Because they cost money. So then you've got some toolkit apps. Now these run on any hardware. So that's good. They also don't require a data connection. They usually use SMS as a connection back to the servers. To make things happen. They've got a menu-based UI. So it's visual. It still requires a lot of cooperation from the phone company though. Because the application needs to be on the SIM card. So you also need a special SIM card that has the application preloaded. And this can be difficult if, for example, you are not the phone company. And trying to convince them to put the app on the phone. And then there's USSD. Which runs on any phone. Again, it's built into the GSM standards. Does not require any special SIM card. It's got a very standardized UI. Doesn't require data. Still requires carrier cooperation. Because the phone company has to set up the gateway to allow your application to actually run. And give you the number for people to call. However, it only provides a text-only interface. In experience though, people don't seem to care about this. It's perfectly fine. They don't mind using text-only. It's very fast. They've figured out how to use it in a very fast and efficient manner. So we all know what SIM cards are to some degree. But just to go over it. They identify users on the network. They can authenticate devices on the network. They can do call control. Which again, I'll explain later. And they can run the SIM toolkit applications. Among other things. So SIM toolkit applications run on the SIM card. They consist of menus and input prompts. They can also send SMS. Place calls. Get which cell tower you're talking to. Get the phone's IMEI. Which is its equipment identifier. And a few other things as well. It's defined by a GSM standard as well. So this is an example of what they look like. So on the left you have a SIM toolkit app running on a smart phone. So you can see you've got menus. You tap on a menu. And then it might pop up a prompt asking you for text. And then on the right you've got it running on a smartphone. Or on a feature phone. Or a basic phone. And so then it's still got very similar UI. Except you just navigate it with the keypad. So this is an example message flow from a mobile money application. It's a little modified. But the idea still stands. So what you can see is that IMEI is mobile equipment. So that's the user's phone. And the SIM card is the SIM card. So what you can see is that all messages always start from the phone. And then get sent to the SIM card. So here you can see. The phone is telling the SIM card. That someone entered into an application with this ID. The SIM card then says great. Select an item from this menu. The phone says here this is what they selected. The SIM card then asks for the user's PIN. The user provides a PIN. The SIM card will then go off and connect to the network. And make the payment go through. In this case. It's just hand wavy. But usually this is done through some form of encrypted SMS. And then the SIM card will then display the balance to the user. And the user will terminate the session. So this is what the messages look like. To TLV. So you've got the tag. The length of the body. And then the values. So SIM toolkit commands always start with the D0. And then the length. Then you've got the command details tag. So this will tell you what command you're trying. What command is being sent. Then you've got the device identity tag. Which I feel is a bit redundant. Because you can already figure that out from the command details tag. It basically just tells the phone where the message is coming from. And where it's going. And then you've got various tags associated with that type of message. So here you've got a text string tag. This is just saying. That they're trying. This is just displaying text on the screen basically. So then you've got USSD. Or unstructured supplementary services data. So it's dialed like a voice number. No records are stored on the device however. So while you would dial it with the same phone application. That you would use. You would usually use to say call someone. Usually there's a call log associated with that. So you can go back and see which numbers you've dialed before. USSD doesn't have that. So there's no way of going back and checking. Which USSD numbers someone has dialed. Provides text on the interface. And here you can see it running on a smart phone. This is an application we were using for testing. So this is the format that numbers are in. So it always starts with a star. And the numbers. And a pound. So this is the format that numbers are in. Then a pound sign. So the first one will just connect you straight to the service. Now if you know the service always pops up the same menu when you get there. And you know you want to enter in one. In the first screen. Then you can actually just append star one. To the number. And that means it will enter in one at the first menu prompt. And it will skip straight to the second one. Assuming one is a valid input for that. And you can chain this as many layers deep as you want. You'll get stuck though if you make a mistake. And then it will repeatedly try the subsequent numbers on the same screen. Which can lead to unexpected behavior. But you can chain it as many layers deep. So in theory you can do an entire transaction. Of going through many, many screens. Just in one command. And this is how most users end up using this service. So now for thin sims. Which is what we were actually using in this. To do these attacks. So you can see they're very thin devices. They go between the sim card and the phone. I have some. If people want to have a look at them later. But can't really hand them around. So they fit any size of device. So you can see we've got. The ones on the left. Are the ones that we were using for testing. They require cutting out the corner of the sim card. And as such they can only be used with mini sims. The ones on the right. You see they're much smaller. So they can work on both nano and micro sims. As well as mini sims. So they're field installable. This means anyone can install it. You don't need specialized equipment. It's kind of like a screen protector. In terms of installation process for some. Then they contain all the functionality of a sim card. I mean they're just running code. So you can write anything you want onto it. They're free from carrier restrictions. And therefore they allow third party applications. This is also useful. Because the phone company isn't the one putting it in. You can put any thin sim you want into your phone. And then they can read and modify all the communication. Because. Between the sim card and the phone. Because they're sitting on the interface. So the original use case for these. Was cell phone unlocking. So back when you had a GSM phone that was locked to a network. You could put a thin sim into it. And be able to use the phone on any network. Which was very useful. Then the other use case we've seen. Is distribution of apps. We'll talk about an example of that as well later on. If you've got. For example you're a company trying to put an application. Into a sim card. And the phone company doesn't want you to put it on. Then you can use a thin sim to get around that. And finally. There's the case of malicious installation. So this would be. Most of these attacks involve. Being able to steal money from mobile money applications. So say you're a shopkeeper. And you want to make a bit of money on the side. Or you run a phone repair business. And you're trying to make a bit more money. You could put a thin sim in. And be able to scrape a bit of money off the top. Not recommending this by the way. So let's look at M-Pesa. So M-Pesa was founded by Safaricom in 2007. The original way it was founded actually was. Users had these recharge codes. That would add balance. Into their accounts. And they would buy these codes. And then send them around. As a form of payment. So in exchange of services. You would then send someone. Say a $10 recharge code. They could then either apply it to their account. For $10 of air time. Or sell on to someone else. And eventually someone might sell it back to the storekeeper. To a shopkeeper who would sell it to another user. And so eventually Safaricom realized this was happening. And realized they could make M-Pesa. Which was a mobile money application. And cut all this out of the loop. And make it a lot more streamlined. And safe for the users. So today it transfers 24% of the Kenyan GDP. Each year. So it's very widely used. It's expanded to many other countries. And it definitely runs over. Simtoolkit application. It's not necessarily currently the primary way it runs. But it's definitely run over that in the past. And so. Then Equity Bank came along in 2015. So they wanted to run their own mobile money application. And so they. They came along. And because they wanted more people to be able to use it. They couldn't run it on a smartphone app. So they needed to use either USSD. Or Simtoolkit. And for whatever reason they decided to run it as a Simtoolkit application. Now unfortunately. Safaricom had 80 or 90% of the market share. And of course. They didn't want to put a competing application. On to their SIM cards. So as a result. They forced Equity Bank to try and distribute their app. As a thin SIM. So. There was a court case about this. With Safaricom trying to stop them from doing this. The court eventually allowed them to do it. But there was very little. No one really looked into the security implications of this. So. Here you can see a phone with a thin SIM installed. And an app running on the thin SIM. So you notice all the traffic goes from the phone to the thin SIM. It never touches the SIM card. This is all fine. No data is really at risk here. Then when you've got an application running on a SIM card however. This diagram makes it look like the data is traveling from. The phone to the SIM card. But really what's happening. Is it's being sent from the phone to the thin SIM. The thin SIM is then deciding to forward it on to the phone. And then the. On to the SIM card. And then the SIM card can process the data and send it back. But the thin SIM is processing all the data as it goes through. So. There's probably some fun things to be done here. So what if it's. What if the thin SIM is not friendly. What if there's some malicious code on it. So. There's a lot of things the thin SIM can do. Let's just look at the first three. For the first attack. So this is the ability to. Intercept, modify and create SIM toolkit commands. Then view the response to those commands. In plain text. And then. The ability to send SMS messages. Without notifying the user. So. This attack was primarily targeted at the M-Pacer SIM toolkit application. Because we needed a target platform. We also did some testing against Airtel. And some modifications. Just because it's got a different menu structure. It would work against that as well. And probably any other SIM toolkit based mobile money platform. So the attack takes place in two phases. You've got. First we steal the credentials. And then we actually make the fraudulent payments. So here you've got the phone. Thin SIM. And a SIM card. So initially there's a transparent. The user is using the SIM toolkit app. And it's completely. It's not clear at all that there's a thin SIM installed. They can't tell. So they're using the SIM toolkit app. On the SIM card. Everything's normal. Eventually the app will ask the user for a PIN. And at this point the thin SIM will start listening. Then the user will respond with the PIN. And the thin SIM stores the response. At this point the thin SIM has stored their credentials. For later use. And the user doesn't know anything about it. So. Then we have demo. Okay. So this is me. Entering into the. Mpacer app. So first I check to see if there's no. So let me just start this again. Okay. So what I'm going to do is. First check there's no. Verify there's no PIN stored. Then enter into the Mpacer app. Try and check my balance. And then view the PIN afterwards. To show that it's captured. Now unfortunately. Symfari com sims. If you don't use them for too long. They become. They're no longer active. And so. This one we didn't use for too long. And as a result. It can't actually send SMS messages. But the attacks. This still proves the first half of the attack. So here I go and. View the PIN that is stored. It says no PIN is captured. So then I go into the Mpacer app. Navigate through some menus. Check the balance. It then asks for the PIN. It says okay. And then it fails to send the SMS. Because it's not active on network. Exit out. View the PIN. And you have the PIN stored. So back to slides. That one. No. That one. Okay. So now for phase two. This is where we actually go and make the fraudulent payment. So again. You've got the phone. Thin SIM. And the SIM card. So first there's a status update. Now these status updates are sent roughly every 30 seconds. From the phone to the SIM card. They trigger the attack. Although it could be triggered through various other means. So once the Thin SIM decides it wants to start the attack. It then begins a transaction. It begins a SIM toolkit session. With the SIM card. In this session it goes and sends all the data required to initiate a transaction. The data sent is exactly the same data the SIM card would expect to see if a user was interacting with the SIM card. Eventually the SIM card will then try and contact the network. This is via sending an SMS. Now. The SIM card will then try and contact the network. Usually this would pop up a notification on the screen. However. That would tell the user something bad has happened. Something weird is happening. And they might be able to try and stop. Stop whatever is going on. So let's see if there's a way around that. So. Here you can see. This was one frame taken out of the previous video. Unfortunately if the SIM card was active. It would have been more obvious what was going on. But here you can see that there is a message at the bottom. Telling the user that the application is sending an SMS. Now. The application can specify the string. So here you've got the message that was actually sent. The SIM card sent to the phone. To make this SMS happen. So you've got all the stuff at the start. With the command details and the device identities. And then you've got this text string. And this is what is actually displayed to the user. And then that's followed by the SMS TPDU. Which is the body of the SMS. And where it's going. And all those boring things. So. How can we make this go away? Now you might think. Well. Unfortunately that leaves it up to the phone. To decide whether it wants to display something to the user. And most phones will display something to the user. Telling them that an SMS is being sent. But however. If you just give it a null string. So just tell it you've got a string of zero length. Nothing shows up. And so then you can send an SMS. Without the user seeing anything. So that's what we do. So if we go back. The SIM card is trying to send an SMS. The SIM takes a message. Removes the bytes. That would make something show up on the screen. And replace it with a zero length string. And then sends a silent SMS. That doesn't show up to the user. So what this looks like. . . . . . . . . . . . . . . . . . but the other message didn't pop up ahead of time. It's there in the logs. And the ability to send silent messages is shown in another demo as well. So that's the ‑‑ oh, no. Okay. So at this point we've successfully done the transaction. There's no indication to the user that the money has gone anywhere or anything has happened really at all. Okay. Cool. So let's go back to the list of capabilities that we have. So we've already used the first three. So let's look at the next two. So the ability to log and redirect calls, both for voice and USSD, and the ability to make USSD calls without notifying the user. So this is done by call control. So this is done by call control. So this is done by call control. So this is done by call control. So what call control is is whenever you dial a number to call on your phone, first the phone will actually ask the SIM card. So say you then ask ‑‑ the phone asks the SIM card, hey, can I call this number? And the SIM card will respond, yeah, sure, here you go, you can call the number. However, the SIM card can also say, no, you can't call that number and just deny it outright. Or it can modify the call and say, sure, you can call a number, but replace it with this one instead. Now, interestingly for voice calls, depending on the phone, this mail may not show up in the call log as being redirected. On the Android phone we had, it did show up as being redirected. However, on the feature phone we were testing on from 2005, it was running some Windows operating system, it didn't show up and it showed the original phone number. So this doesn't sound too bad, right? It's just messing with what people are calling. But there's lots of fun things to be done with this. So because USSD is not usually tracked, maybe you're using a USSD service that you wouldn't want other people to know that you're using it. You wouldn't want other people to know you're using it for whatever reason. So if you had a thin SIM installed that was looking at call control, it would then be able to see who you're calling, which can then be used for advertising, surveillance, blackmail, whatever you want. It could also be used for phishing attacks. If you're ever trying to set up a fake customer support line and trying to get someone to call it, this makes it a lot easier. You just make them call the original customer support number, it redirects to your own number, and then you can get away with whatever social engineering attacks you're trying to do. You could also route all their calls through some premium number and just make their phone bill go really high and charge them a lot of money that way. Of course, it would be a premium number you own, so you get the money for it. Or you could redirect USSD calls. Let's see what happens if we do that. So for the USSD attack, it takes place in two phases. Again, you've got stealing credentials and making transactions. However, this requires attackers to set up their own USSD service, which the other one didn't require the attackers to set anything up. And depending on the country, setting up a USSD service can be anywhere from easy to almost impossible. For example, in the US, no one really uses USSD. I've never seen any USSD sessions. The closest I've seen is, for example, AT&T, you dial star, data, pound, and then it will send you an SMS back with the data usage you've got for that month. So this is the set up we had. So we've got a laptop running the Osmocom network in a box, which is some cell software, cell tower software. Unfortunately, no out of the box cell phone software are going to be available. So we had to modify it a bit with various patches from various years, and it worked in the end. Then we've got a USRB B210, which is actually the radio we're using. Then you can see we've got a phone sitting there with a development module thin SIM plugged into the back of it, and then a debugger attached, so I can view the messages that are actually being sent between the phone and the SIM card for debugging purposes. So here you've got a phone, and then you've got a phone, the two services, so you've got the legitimate one that the user is trying to access, the attacker service that they've set up, and then you've got the thin SIM and SIM card as before. So the first thing the user is going to try and do is they're going to try and dial the number for the legitimate service. Now, this initiates call control, so it then tries to ask the SIM card, cannot dial this number. However, because there's a thin SIM installed, the thin SIM intercepts that and decides to redirect it somewhere else. So you've got the phone, the two services, the attacker service. So it then gets redirected to the attacker service. Now, the attacker service will mimic all the menus for the legitimate service perfectly. And so the user will go through all the menus they're expecting to go through and enter in all the payment details. However, right before the very end of the transaction that would actually send the money, the attacker service will return an error. This is because it can't actually make the transaction go through. The user should, it would likely interpret this as some kind of network, but it's not going to do that. So it's going to make a network connectivity issue and try again later, at which point it would go through with no issues. So we have a demo of that as well. Okay. So in this demo, I'm going to dial the number for our UST service and it will redirect it to the attacker service. So now I'm dialing for the legitimate service. It gets redirected without telling the user anything. So we go through and then enter in to check the balance. So we type one, press okay. So then it asks for the pin. Error code, try again later. So we exit out of this. So we exit out of this. We exit out of this. So we try again. I don't know why it takes so long to access the USST service. It really shouldn't, but it does. So we go through and we try to check the balance again. So enter in once, check balance. Then we go in, enter in the pin. Then we go in and it's okay. So I'm not going to do a actually get the balance. So notice this is 9,001. So over 9,000. All right. So let's go back to this. Okay. So that's the demo of phase one. So then in phase two we actually go and try and steal money. So again this is triggered through some means. In this case we just triggered it through a menu item in the sim toolkit application. However again it could be triggered through a status update or something of the like. So first the ThinSim will call the attacker service because it needs to get the pin back. So we'll call the attacker service and get the, retrieve the pin. Next it will, so then it gets the pin back and then it will actually make the transaction. So what it does here is it strings together the entire command it would need to do. So it'd be like star 1, 2, 3, star 2 for make transaction, star and then the destination phone number, another star, then the amount they're trying to send, star, 1 for confirm, star and then the pin and then pound. That's the string we need for this service in particular. So we have a demo of that. Okay. So going to the sim toolkit application. So we select send to SSD. It waits for a while because there's no, it doesn't display to the user anything that's happening. Usually it would but we've made it silent. So we're going to do a test. So now let's go and check the, let's check the balance to see that we've actually sent some money somewhere. So now we go through and actually go and check the balance. Entering the pin again. And now the balance is much lower. This is sending a bit over 600 current units of currency somewhere to another account. So now we're going to go and check the balance to see if we've got any more money. So at that point there's not really a lot the user could do. The money's disappeared. By the time they notice it's probably been shifted to another account or cached out of the network so that there's no, there's no method for recourse. And customer service in these places is often not so great. So there's very little chance of users getting their money back. So there are a couple more capabilities I didn't really talk about. There's the ability to track location updates. So this is what telltale the user is talking to. You can make a call to the user. You can make some like some snooping software to track users doing that. There's GSM authentication. This is not really so much an attack. But it's, you can use it if you know the IMSI of the device of another user and the key for the network. You can then pretend to be that user. And then you can read any data off the SIM card including the IMSI and the phone book if that's stored there. Also in the GSM standards it allows phones to store, you know, the data that's stored on the SIM card. And in the case where that message is being stored on the SIM card, the thin SIM would be able to read those as well as they went past. So let's look at some possible defenses now. So you can disable call control. This would get rid of all the call control based attacks as well as the USSD based attack because you simply, if you can't redirect the call, the attack is completely impossible. However, that requires modifying the phone standards and then updating all the phones. Which is, if you can't redirect the call, the attack is completely impossible. So this is not really going to happen because a lot of the users who would be affected by this don't have data. And if they have data, they want to use it for Facebook and WhatsApp. That's what they're going to use it for. And so they're not going to install apps, sorry, they're not going to install updates. It's probably not necessarily possible to install software updates over the air for these devices as well. Not all the companies that made the devices are even still around necessarily. So then there's the ability to disable silent outgoing calls and USSD. Well this wouldn't actually prevent the attacks. All it would do is prevent the notification, is make it clear to the user that something bad is happening. Now again, unfortunately this requires modifying the standard and has all the associated difficulties. You could discourage the use by encouraging phone companies to put third party apps on to their SIM cards. This would then require a lot of cooperation from phone companies who may not want to cooperate and may have financial incentives not to cooperate in the case of in the case of SafariCom. This would at least make ThinSIMs not normalized. So if someone saw a ThinSIM, at least then they'd be very suspicious of what's going on. You could use confirmation codes. So if the SIM took it in USSD, you could send the confirmation code after the transaction's gone through. Then the user would have to enter in that confirmation code in order to verify the transaction and make it go through. This works great for phones where the SMS message is not stored on the SIM card. But if it's stored on the SIM card, then ThinSIM has access to the SIM card. And so this is completely useless for those devices. I don't know how many devices out there have that functionality. So I don't know. If it's USSD, you could require the user to enter in confirmation value on the screen. So this doesn't work with ThinSIM toolkit because it would need to talk to the network, but the essential idea is once you start the USSD session, there's no indication, there's no helps, but they already have a chance of someone sending a phone. If the the SIM card can't interact with it anymore. So if the session completes and gets to the end without having to require any more input, the SIM card then does get the response, the final response that is sent back. If it needs more input, it will then ask the user for it and there's a prompt that shows up. So what this would mean is that the thin SIM would not be able to completely predict the message that it would need to send and something would show up on the user's screen that would allow them to then deny the payment, deny the transaction and stop anything bad from happening. So this would be quite effective. And finally, you know, it's a plain text interface. Why can't we just encrypt it? And, well, there is actually a standard for that. However, of course, no one implements this standard. That would be too sensible. Yeah, it's been around for many years, but there's no implementation of it. So there's a link to the paper that I used. There's a link to the paper that I used. There's a link that was written for this. Presented at a conference in June. And then there's a couple of standards that there are. Does anyone have any questions? Yep? If you buy your own SIM card? I mean, you would have to do a lot of work to get it to work. So as in for seeing those with the SIM installed? Yeah. If you look at your SIM card, it would be very clear if there's a thin SIM installed or not. It's very obvious. Yeah. Interesting note, it might be possible it can do all these attacks if you actually had software running on the SIM card itself. So if you had supply chain issues, for example, you might also not be safe. Yep? I don't believe it's possible to get the key off the SIM card. If it was possible, a thin SIM might be able to do it. Yeah. It's not really something we looked into. Anyone else? Cool. Thank you.