00:00:00.100-->00:00:04.938 >>Let's give Rowan, a first time speaker a big round of applause. [Audience cheers] [applause] 00:00:04.938-->00:00:09.943 Wooh! Best guy. Cheers! [applause] [banging] >>Hey, you get to keep one. Shot Glasses. 00:00:12.546-->00:00:17.551 >>Probably only gonna use two. [laughter] >>Have a good time. >>Thanks. Hi. So my name's 00:00:19.953-->00:00:24.358 Rowan. I'm an undergrad at the University of Washington and the last time I was doing research 00:00:24.358-->00:00:29.429 into using thin sims to break mobile money applications. So first what are mobile money 00:00:29.429-->00:00:35.636 applications? So, ahh sorry. If you've ever used Venmo than you've probably used a mobile 00:00:35.636-->00:00:40.974 money applications the g-basic idea is you have a balance you can load money into, uh whether 00:00:40.974-->00:00:45.646 and it's usually some form of app. Then you can transfer that money to other people, and make 00:00:45.646-->00:00:50.984 payments that, through that way. Now, the ones you've probably seen, all run on smartphones but 00:00:50.984-->00:00:57.658 it's possible to run these things on uh the sim card of a phone or over other means. So, 00:00:57.658-->00:01:02.296 their actually very widely used. So there's 700, almost 700 million accounts world wide. 00:01:02.296-->00:01:07.301 200, 200 and uh 76 deployments in 90 countries uh and transfers over a billion dollars a day. 00:01:11.238-->00:01:16.577 Now a lot of these users don't transfer very much money though. It's 188 dollars a month which 00:01:16.577-->00:01:20.647 on average and that's because they live in places but they don't make much money so these 00:01:20.647-->00:01:26.320 applications are very widely used in places like Africa and Southeast Asia. Uh good for 00:01:26.320-->00:01:29.589 people that don't have access to banks. And the reason why'd they'd be using this type of 00:01:29.589-->00:01:35.929 banks is that banks are a lot rarer and so here you can see this uh roughly 5, 500-->000 banks 00:01:35.929-->00:01:41.134 in developing countries. Where it says 2 point 2 million mobile money agents. So, and so all you 00:01:41.134-->00:01:45.472 need to be a mobile money agent is to have a phone and have access to cash. So this the 00:01:45.472-->00:01:50.644 infrastructure required is a lot lower uh so it's a lot alot easier to get access to it and 00:01:50.644-->00:01:55.248 so if you're if you're a farmer and the nearest bank is a couple of villages a-away, you probably 00:01:55.248-->00:01:59.219 would not have a bank account with a bank because it's gonna take too long to get there and 00:01:59.219-->00:02:03.390 so the only way you could store your money is by u-uh trying to keep it safe somewhere so maybe 00:02:03.390-->00:02:07.561 burying it in the ground and that has it's own issues like maybe you lose it. Um gets 00:02:07.561-->00:02:14.101 stolen. So, mo-mobile money is actually a really useful tool for these people to try and uh 00:02:14.101-->00:02:20.707 be more financially secure. And so it doesn't only run over app over smartphone apps, The most 00:02:20.707-->00:02:25.712 cop popular interface is USSD. I'll explain what that is later on. Uh then there's smartphone 00:02:25.712-->00:02:30.317 apps. Then there's some token apps which run on sim card. I'll explain those as well. And then 00:02:30.317-->00:02:35.789 there's IVR. So this is uh th-the interface offered by these platforms. So most of them 00:02:35.789-->00:02:41.828 offer a USSD. So this is the tradeoffs between the different app between the different uh uh 00:02:41.828-->00:02:45.632 forms of applications. So you've heard of smartphone apps which everyone knows what a smartphone 00:02:45.632-->00:02:50.103 app is. It's got a very rich UI, there's it's very easy to develop for, there's existing 00:02:50.103-->00:02:54.307 development environments, uh it does not require any cooperations from the phone 00:02:54.307-->00:02:58.578 company you can just load an app onto your phone, start running it. It needs a data connection 00:02:58.578-->00:03:03.750 which can be difficult to get in some areas um and also requires a smart phone of course, which 00:03:03.750-->00:03:07.687 comes with it's own host of issues. Which means you know, than you have to have uh be able 00:03:07.687-->00:03:11.324 to charge it every day, they're fragile, you can break the screen. That's a big problem. 00:03:11.324-->00:03:16.296 Um, so they're not so useful in these environments uh since most people also don't have 00:03:16.296-->00:03:20.934 smartphones cause the cost money. So then you've got some token apps. Now these run on any 00:03:20.934-->00:03:26.873 hardware uh so that's good. They also don't require a data connection. They usually use uh 00:03:26.873-->00:03:32.312 SMS as a back hole to or as a connection back to the service to make things happen. Uh 00:03:32.312-->00:03:38.051 they've got a menu based UI so it's visual. Um it's does not. It still requires some quo, it 00:03:38.051-->00:03:40.987 requires a lot of cooperation with the phone company though because the application needs to 00:03:40.987-->00:03:45.425 be on the sim card so you also need a special sim card that has the application pre loaded uh 00:03:45.425-->00:03:50.530 and this can be difficult. Uh, if for example you are not the phone company and trying to 00:03:50.530-->00:03:56.203 convince them to put the app on the phone. And then there's USSD which runs on any phone, again. 00:03:56.203-->00:04:00.207 It's built into the GSM standards, uh it does not require any special sim cards, 00:04:00.207-->00:04:05.812 gotta very standardized UI, doesn't require data, uh still requires carrier cooperation 00:04:05.812-->00:04:10.283 because the phone company's has to set up the gateway to allow you application to actually run 00:04:10.283-->00:04:14.421 and give you the number of people to call. Um, it does pr-however it only provides a 00:04:14.421-->00:04:19.759 text only interface. In in experience though, people don't seem to care about this, it's 00:04:19.759-->00:04:24.931 perfectly fine. They don't mind using text only uh it's very fast they've figured out how to 00:04:24.931-->00:04:30.170 use it in a very fast and efficient manner. So, we all know what sim cards are to some 00:04:30.170-->00:04:34.608 degree but just to go over it. They identify users on the network. They can authenticate 00:04:34.608-->00:04:39.246 devices on the network uh they can do call control which again i'll explain later and they can 00:04:39.246-->00:04:43.250 run the sim tool kit applications, [distant laughing] among other things. So sim 00:04:43.250-->00:04:48.221 toolki sim toolkit applications run the sim card, they consist of menus and input prompts, uh 00:04:48.221-->00:04:54.127 they can not they can al-also send SMS, place calls, uh get which cell tower you're talking 00:04:54.127-->00:05:00.834 to, get the phone's IMEI, uh which it's uh equipment identifier um and a few other 00:05:00.834-->00:05:07.207 things as well. Uh, it's defined by a GSM standard as well. So this is an example of what they 00:05:07.207-->00:05:11.912 look like. So on the left you have a sim toolkit app running on a smartphone. So you can see 00:05:11.912-->00:05:15.982 we've got menus. You tap on a menu and then it might pop up a prompt asking you for text. And 00:05:15.982-->00:05:20.287 then on the right you've got it running on f-feature phone, or a basic phone and so then it's 00:05:20.287-->00:05:25.292 still got a very similar UI except you just navigate it with uh the keypad. [inaudible 00:05:27.627-->00:05:31.364 talking] [coughing] So, this is an example message flow from uh s-uh mobile money application. 00:05:31.364-->00:05:34.434 It's a little modified but the idea's still what stands. So what can you see is that uh ME 00:05:34.434-->00:05:36.436 is mobile equipment, so that's the user's phone and the sim card is the sim card. So what 00:05:36.436-->00:05:41.441 you can see is that all messages are always start from the phone and then get sent to the sim 00:05:43.910-->00:05:50.650 card. So here you can see the phone is telling the sim card that someone entered into an 00:05:50.650-->00:05:55.422 application with this ID. The sim card then says, "great. Select an item from this menu." 00:05:55.422-->00:06:00.627 Uh the phone says, "here, this is what they selected." Uh, the sim card then asks for the 00:06:00.627-->00:06:06.132 user's pin, user provides a pin. Sim card will then go off and uh connect to the network and make 00:06:06.132-->00:06:11.938 the payment go through. Uh in this case, I, it's just hand wavy but usually this is done 00:06:11.938-->00:06:17.344 through some form of encrypted SMS. Uh, and then the sim card will then display the balance to 00:06:17.344-->00:06:22.115 the user and the user will terminate the session. [distant cough] So this is what the 00:06:22.115-->00:06:27.120 messages look like. Uh, to TLV uh to go tag, length of the uh body, and then the values. So it 00:06:29.256-->00:06:33.593 will sim talk it commands always start with the D 0 and then the length. Then you've got the 00:06:33.593-->00:06:40.100 command details tag so this will tell you what command you're tryin, the uh what command is 00:06:40.100-->00:06:44.404 being sent. Then you've got the device identity tag which I feel is a bit redundant because you 00:06:44.404-->00:06:50.043 can already figure that out from the command details tag but it basically just tells uh the 00:06:50.043-->00:06:54.814 phone w-uh where the message is coming from and where it's going and then you've got various tags 00:06:54.814-->00:06:58.952 associated with that type of message. So, here you've got a text string tag. [coughing] This 00:06:58.952-->00:07:03.890 is just saying uh that they're trying, this is just plain text on the screen basically. So then 00:07:06.860-->00:07:10.764 we've got uh USSD or unstructured supplementary services data. So, it's dialed 00:07:10.764-->00:07:15.201 like a voice number um it's no record that's stored on the device however. So while you 00:07:15.201-->00:07:19.606 would dial it with the same phone application that you would usually use to say call someone 00:07:19.606-->00:07:24.377 uh usually there's a call log associated with that so you can go back and see which numbers 00:07:24.377-->00:07:29.816 you've dialed before. Uh USSD doesn't have that so, there's no way of going back and checking 00:07:29.816-->00:07:34.487 which d-which USSD numbers someone has dialed. Um, provides text on the interface and here 00:07:34.487-->00:07:38.892 you can see it running on a smartphone. Uh this is an application we were using for 00:07:38.892-->00:07:43.897 testing uh so this uh the format that numbers are in. So it always starts with a star, and 00:07:46.433-->00:07:50.270 then the numbers, and a pound. Then pound sign. So the first one will just connect you 00:07:50.270-->00:07:54.507 straight to the service. Now, if that all if you know the service always pops up the same menu 00:07:54.507-->00:07:59.212 when you get there, and you know you want to enter in 1 uh in the first screen, then you can 00:07:59.212-->00:08:03.983 actually just u-uh pin star 1 uh to the number and then that means it'll enter in one of the 00:08:03.983-->00:08:07.721 first menu prompt and it'll skip straight to the second one assuming one is a valid input 00:08:07.721-->00:08:12.192 for that. And you can chain this as many layers deep as you want. Uh you'll get stuck though if 00:08:12.192-->00:08:17.263 you uh make a mistake and then it will uh repeatedly try the uh subsequent numbers on the same 00:08:17.263-->00:08:22.168 screen which can lead to unexpected behavior um, but you can chain as many layers deep. 00:08:22.168-->00:08:26.406 So in theory you can do an entire transaction of going through many many screens just 00:08:26.406-->00:08:32.846 in one command and this how most users end up using this service. So now for the thin sims which 00:08:32.846-->00:08:37.717 is what we were actually using in this uh to do these texts. So here you can see they're very 00:08:37.717-->00:08:42.055 thin devices. They go between the sim card and the phone. Uh I have some if people wanna have a 00:08:42.055-->00:08:46.860 look at them later uh but I can't really hand them around. [speaker laughs] Uh so they've 00:08:46.860-->00:08:51.765 they fit any size sim card so you can see we've got uh the ones on the left are the ones 00:08:51.765-->00:08:55.402 that we were using for testing. They will require cutting out a corner of the sim card and as 00:08:55.402-->00:08:59.939 such they can only be used with mini sims. Uh, the ones on the right, you see they've got 00:08:59.939-->00:09:04.043 different, they're much smaller and so they can work on both nano and micro sims as well as 00:09:04.043-->00:09:09.449 mini sims. So they're field installable. This means anyone can install it. You don't need 00:09:09.449-->00:09:13.386 specialized equipment. uh, It's kind of like a screen protector thin, uh in terms of the 00:09:13.386-->00:09:18.491 installation process for some. Uh then they contain all the functionality of a sim card I-I 00:09:18.491-->00:09:21.795 mean they're just running code so you can write anything you want on to it. Uh they're free 00:09:21.795-->00:09:26.332 from carrier restrictions and therefore they allow third party applications. Uh this is also 00:09:26.332-->00:09:30.670 useful um because the phone companies won't putting it in, you can put any thin sim you 00:09:30.670-->00:09:35.408 want into your phone and then they can read and modify all the communication because between 00:09:35.408-->00:09:40.513 the sim card and the phone because they're sitting on the interface. So the original use 00:09:40.513-->00:09:44.784 case for these was cell phone unlocking. So back when you had a lock uh GSM phone that was 00:09:44.784-->00:09:49.622 locked to a network, you could put a thin sim into it and be able to use the thin and you'd 00:09:49.622-->00:09:54.861 be able to use the sim the phone on any network uh which was very useful. Uh then they could, the 00:09:54.861-->00:09:59.165 other use case we've seen is distribution of apps. Uh, I'll talk about an example of that as 00:09:59.165-->00:10:04.103 well later on. Uh if you've got if for example you're a company trying to put an application on 00:10:04.103-->00:10:09.576 the sim card and the phone company doesn't want you to put it on, then you can use a thin 00:10:09.576-->00:10:13.379 sim to get around that. And finally there's the case of malicious installation. So this 00:10:13.379-->00:10:17.717 would be uh most of these attacks involved still are being able to steal money from mobile 00:10:17.717-->00:10:21.955 money applications. So say you're a shopkeeper and you want to make a bit of money on the 00:10:21.955-->00:10:25.859 side, you run a phone repair business, and you're trying to make a bit more money. You could 00:10:25.859-->00:10:30.897 put a thin sim in and be able to s-uh scrape a bit of money off the top. Not recommending this 00:10:30.897-->00:10:36.436 by the way. [speaker laughs] [ audience laughs] So let's at M-Pesa. So M-Pesa was founded by 00:10:36.436-->00:10:42.008 Safaricom in 2000 and 7. The original way it was founded actually was uh users had these 00:10:42.008-->00:10:46.179 uh recharge codes. It would add balance into their accou into their accounts and they would 00:10:46.179-->00:10:51.417 buy these codes and then send them around as uh as a form of payment. So an exchange of 00:10:51.417-->00:10:55.955 services you would then send someone say a 10 dollar recharge code. That would, they could 00:10:55.955-->00:10:59.726 then either apply it at their account for a 10 for 10 dollars of air time or sell on to 00:10:59.726-->00:11:03.663 someone else. And eventually someone might sell it back to the store keeper, to a who would 00:11:03.663-->00:11:09.235 sell it to another user. And so eventually Safaricom realized this was happening and realized 00:11:09.235-->00:11:15.108 they could make M-Pesa and which was a mobile money application uh and cut all this outta the 00:11:15.108-->00:11:20.713 loop uh and make it a lot more streamlined and safe for the users. So, uh today it transfers 00:11:20.713-->00:11:27.186 24 percent of the Kenyan GDP each year. So it's very widely used uh it's expanded to many 00:11:27.186-->00:11:31.858 other countries and at a cert, it's definitely runs over sim toolkit application. It's not 00:11:31.858-->00:11:36.896 totally currently the primary way it's runs but it had definitely run over that in the 00:11:36.896-->00:11:41.467 past. [distant cough] And so in then equity bank came along in 20 15. So they wanted to run 00:11:41.467-->00:11:45.939 their own mobile money application and so they because they came along and they because 00:11:45.939-->00:11:50.710 they wanted more, more people to have to use it, they couldn't run it on a smartphone app. So 00:11:50.710-->00:11:55.648 they needed to use either USSD or sim toolkit and for whatever reason they decided to run it on 00:11:55.648-->00:12:01.754 as a s-sim toolkit application. Now, unfortunately safaricom had 80 or 90 percent of the market 00:12:01.754-->00:12:05.258 share and of course they didn't want to put a competing application on to their sim 00:12:05.258-->00:12:11.798 cards. So, as a result that forced equity bank to try and distribute their app as um a 00:12:11.798-->00:12:16.536 thin sim. So there's a court case about this with Safaricom trying to stop them from doing 00:12:16.536-->00:12:22.041 this. The court eventually allowed them to do it uh but there's very little, no one 00:12:22.041-->00:12:28.047 really looked into the security implications of this. So here you can see a phone with a thin 00:12:28.047-->00:12:31.150 sim installed and an app running on the thin sim. So you notice that all the traffic goes from 00:12:31.150-->00:12:35.955 the phone to the thin sim, it never touches the sim card. This is all fine, no data is really 00:12:35.955-->00:12:40.126 at risk here. Then when you've got an application running on a sim card however, this diagram 00:12:40.126-->00:12:44.731 makes it look like the data is traveling from the phone to the sim card, but really what's 00:12:44.731-->00:12:49.235 happening is it's being sent from the phone to the thin sim. The thin sim is then deciding to 00:12:49.235-->00:12:51.237 forward it on to the phone uh and then the o-on to the sim card and then it can then the 00:12:51.237-->00:12:53.239 sim card can process the data and send it back. But the thin sim is processing all the data 00:12:53.239-->00:12:55.241 that goes through so there's probably some fun things to be done here. So what if it's, what 00:12:55.241-->00:12:57.243 if the sim is not friendly? Uh what if there's some malicious code on it? So, there's a lot of 00:12:57.243-->00:13:02.181 things that can be, the thin sim can do. Uh, [distant coughing] let's look at the first 3 uh for 00:13:13.026-->00:13:18.097 the first attack. So this is the ability to intercept, modify, and create sim toolkit commands, 00:13:18.097-->00:13:24.203 then view the response to those commands. Uh in plain text uh and then th-the ability to send 00:13:24.203-->00:13:30.810 SMS messages without notifying the user. So, this attack was primarily targeted at the M-Pesa 00:13:30.810-->00:13:35.815 sim toolkit application cause we needed a t-target platform. Uh we also did some testing into 00:13:35.815-->00:13:38.951 Airtel and then some modifications just because it's got a different menu structure. 00:13:38.951-->00:13:42.855 It would work against that as well and probably any other sim toolkit based mobile money 00:13:42.855-->00:13:47.894 platform. So the attacks takes place in 2 phases. You've got a first we steal the credentials 00:13:47.894-->00:13:53.132 and then we actually make the fraudulent payments. So, here you've got the phone, thin sim, 00:13:53.132-->00:13:58.137 and a sim card. So, initially the there's a transparent uh the user is using the sim toolkit 00:14:00.440-->00:14:05.178 app and it's completely there's it's not clear at all there's a th-sim card a thin sim 00:14:05.178-->00:14:10.683 installed. They can't tell. They're just using the s-the sim toolkit app on the sim card, 00:14:10.683-->00:14:15.054 everything's normal. Eventually the sim talk the eventually the app will ask the user for a pin 00:14:15.054-->00:14:19.158 and at this point the thin sim will start listening. Then the user will respond with a pin, 00:14:19.158-->00:14:23.930 and the thin sim stores a response. At this point the thin sim has stored their credentials 00:14:23.930-->00:14:28.935 uh for later use and the user doesn't know anything about it. So, then we have a demo uh.. 00:14:39.312-->00:14:44.617 [clicking] Okay so this is me uh entering into the uh uh M-Pesa app. Also so first I checked to 00:14:44.617-->00:14:50.389 see there's no so just let me start the scan. Okay. So what I'm going to do is uh first 00:14:50.389-->00:14:55.762 check there's no verify there's no pin stored then enter in to the M-Pesa app, try and check my 00:14:55.762-->00:14:59.999 balance, and then view the pin afterwards to show that it's captured. Now unfortunately uh 00:14:59.999-->00:15:04.937 Simfaricom sims if you don't use them for too long they become d-uh uh they're no longer active 00:15:07.173-->00:15:12.178 uh and so this one we didn't use so for too long and as a result it can't actually send SMS 00:15:14.213-->00:15:19.218 messages it uh but the attack this still proves the first half of the attack. So here I go and 00:15:22.021-->00:15:28.628 view the pin that is stored. It says no pin is captured. So then I go into the M-Pesa app uh 00:15:28.628-->00:15:33.633 navigate through some menus check the balance it then asks for the pin. Uh, it says okay 00:15:49.248-->00:15:54.253 and then it fails to send the SMS because it's not active on network. Exit out, view the pin 00:15:57.790-->00:16:02.728 and now we have the pin stored. So back to the slides. Uh, [inaudible words] Okay so now 00:16:14.140-->00:16:17.743 for phase 2. This is where we actually go and make the fraudulent payment. So again 00:16:17.743-->00:16:22.582 you've got the phone thin sim and the sim card. So first there's a status update, now 00:16:22.582-->00:16:27.386 these status updates are sent roughly every 30 seconds from the phone to the sim card. We're 00:16:27.386-->00:16:30.389 just using this as a way to trigger the attack uh although it could be triggered through 00:16:30.389-->00:16:36.062 various other means. So once the thin sim decides it wants to start the attack, it then begins 00:16:36.062-->00:16:42.835 a s-a transaction it b-begins as a sim toolkit session with the sim card. Uh in this session it 00:16:42.835-->00:16:47.340 goes and sends all the data required to initiate a transaction. The data sent is 00:16:47.340-->00:16:51.711 exactly the same data the the sim card would expect to see if the use was interacting with the 00:16:51.711-->00:16:56.449 sim card. Eventually the sim card will then try and contact their network. This is by 00:16:56.449-->00:17:01.554 sending an SMS. Now usually this would pop up a notification on the screen. Um however that 00:17:01.554-->00:17:05.658 would tell the user something bad has happened, something weird has happening and they 00:17:05.658-->00:17:10.329 might be able to try and uh stop stop whatever's going on. So let's see if there's a way 00:17:10.329-->00:17:15.334 around that. So, here you can see uh this was taken one from taken out of the previous video. 00:17:17.503-->00:17:21.874 Unfortunately if the sim card was active it would've been more obvious what was going on. But 00:17:21.874-->00:17:26.379 here you can see that there is a message at the bottom telling the user that the application is 00:17:26.379-->00:17:31.217 sending an SMS. Now the f-the application can specify the string. So here you've got the 00:17:31.217-->00:17:36.188 message that was actually sent uh the the f-sim card sent to the phone to make this SMS 00:17:36.188-->00:17:40.493 happen. So you've got all the stuff to start with. The command details, and the device head and 00:17:40.493-->00:17:44.797 these. Um and then you've got this text string uh and this is what is actually displayed to 00:17:44.797-->00:17:50.102 the user and then that's followed by the SMS uh TPDU which is the body of this mess 00:17:50.102-->00:17:54.874 and where it's going and all those boring things. So, how can we make this go away? Now you 00:17:54.874-->00:17:59.045 might think oh let's just remove the text string and maybe it will disappear. Well 00:17:59.045-->00:18:03.115 unfortunately that leaves it up to the phone to decide whether it wants to send display 00:18:03.115-->00:18:06.586 something to the user and most phones will display something to the user telling them that the 00:18:06.586-->00:18:11.590 an SMS is being sent. Uh but however if you just give it a null string, so just tell it 00:18:11.590-->00:18:16.596 you've got a string of 0 length uh nothing shows up and so then you can send an SMS without the 00:18:16.596-->00:18:22.835 user seeing anything. So that's what we do. So the if we go right back the sim card is uh 00:18:22.835-->00:18:28.274 trying to send an SMS. The thin sim takes the message, removes the bites that would uh make 00:18:28.274-->00:18:32.345 something sharp on the screen and just uh replace it with a 0 length string and then sends a 00:18:32.345-->00:18:37.350 silent SMS uh that doesn't show up to the user. So, what this looks like uh. [inaudible word] 00:18:42.421-->00:18:47.426 okay oh [speaker laughs] Okay. So let's start again. Alright so what this looks like to the user 00:19:00.406-->00:19:05.411 so we can just verify we've got the pin stored. Um, and then we uh start the attack. Then the 00:19:09.281-->00:19:13.653 user won't see anything. Unfortunately because the sim card is disac is not active, it 00:19:13.653-->00:19:18.057 will still show the failed send SMS but the other messages didn't pop up and uh [inaudible 00:19:18.057-->00:19:23.329 word] our time. It's there in the uh it's there in the logs um and the abil the ability to send 00:19:23.329-->00:19:28.334 silent messages is shown in another demo as well. So that's that's the uh oh no okay. So the 00:19:32.938-->00:19:38.177 at this point we've successfully st-uh tran done the transaction and there's no indication to the 00:19:38.177-->00:19:43.182 user that the money has gone anywhere or anything's happened really at all. Ohh. [inaudible 00:19:49.021-->00:19:54.226 background noise] Okay cool. [distant cough] So let's go back to the list of capabilities we 00:19:54.226-->00:19:58.264 have. So we've already used the first 3, so let's look at the next 2. So the ability to login 00:19:58.264-->00:20:03.402 and redirect calls uh both with voice and USSD. And the ability to make USSD calls without 00:20:03.402-->00:20:10.209 notifying the user. So this is done via call control. So what call control is is whenever you 00:20:10.209-->00:20:14.580 dial a number to call on your phone, first the phone will actually ask the sim card. So 00:20:14.580-->00:20:18.984 say you then ask the phone asks the sim card, "hey, can I call this number?" And the sim card 00:20:18.984-->00:20:23.489 will respond, "yeah sure here ya go, you can call the number." However the phone req the thin 00:20:23.489-->00:20:28.994 the sim card can also say, "no, you can't call that number." And just deny it outright. Or, it 00:20:28.994-->00:20:32.398 can modify the call and say, "sure you can call a number but, replace it with this one 00:20:32.398-->00:20:37.603 instead." Now instantly for voice calls uh depending on the phone, this may or may not show 00:20:37.603-->00:20:42.875 up in the call log as being redirected uh on the uh android phone we had it was shown it did 00:20:42.875-->00:20:47.947 show up as being redirected. However, on the s- feature phone we were testing on from 2005 was 00:20:47.947-->00:20:52.718 running some Windows operating system, uh it didn't show up and it's showed the original phone 00:20:52.718-->00:20:58.290 number. So, this doesn't sound too bad right? We can just, it's just messing with what people 00:20:58.290-->00:21:03.596 are calling. But there's lots fun things to be done with this. So because uh USSD is not 00:21:03.596-->00:21:08.234 usually tracked, maybe you're using a USSD service that uh you wouldn't want other people to 00:21:08.234-->00:21:12.505 know you were using for whatever reason. So if you had a thin sim installed that was looking at 00:21:12.505-->00:21:17.042 call control it would then be able to see uh who you're calling which can be used for 00:21:17.042-->00:21:21.213 advertising, surveillance, blackmail, whatever you want. Um it could also be used with 00:21:21.213-->00:21:25.451 phishing attacks. If you ever trying to set up a fake uh customer support line and trying 00:21:25.451-->00:21:28.921 to get someone to call it, this makes it a lot easier. you know you just make them call the 00:21:28.921-->00:21:32.158 original customer support number. It redirects to your own number and then you can get away 00:21:32.158-->00:21:36.595 with whatever social engineering attacks you're trying to do. Um, you could also route all their 00:21:36.595-->00:21:41.133 calls through some premium f-uh number and just charge make their phone bill go really high, 00:21:41.133-->00:21:45.237 and charge them a lot of money that way of course it'd be a premium number you own so you 00:21:45.237-->00:21:49.742 get the money for it. Um or you could redirect USSD calls. Let's see what happens if we do that. 00:21:49.742-->00:21:55.080 So for the USSD attack, uh it takes place in 2 phases. Again you've got stealing credentials 00:21:55.080-->00:21:59.118 and making transactions. However, this requires attackers to set up their own USSD 00:21:59.118-->00:22:03.889 service. Uh which the other one didn't require the attackers to set anything up and depending on 00:22:03.889-->00:22:10.796 the country attack, setting up a USSD service can be anywhere from easy, to almost impossible. 00:22:10.796-->00:22:15.201 Uh for example in the US no one really uses USSD. I've never seen any s-uh USSD sessions. The 00:22:15.201-->00:22:20.105 closest I've seen is for example, AT and T you'd dial star data pound uh and then it 00:22:20.105-->00:22:25.811 will send you an SMS back with the data and high usage you've got for that month. So this is 00:22:25.811-->00:22:30.849 the set up we had. So I've got laptop running the osmocom uh network in a box. Which is a 00:22:30.849-->00:22:35.721 cell sim cell software, it's a cell tower software. Unfortunately, noth no out of 00:22:35.721-->00:22:41.927 the box uh cell phone software I could find as an open source had functioning USSD capabilities so 00:22:41.927-->00:22:46.532 we had to modify it a bit with various patches from various years and it worked in the end. 00:22:46.532-->00:22:51.537 Then we've got a US US side B um uh B 2 10 which is actually the radio we're using. Then you can 00:22:54.974-->00:22:58.811 see we've got a phone sitting there with a development module thin sim plugged into the back 00:22:58.811-->00:23:02.681 of it and then a debugger attached so I can view the the messages that are actually being 00:23:02.681-->00:23:08.354 sent between the phone and the sim card uh for debugging purposes. So, here you've got uh 00:23:08.354-->00:23:14.560 a phone, the 2 services. You got legitimate one, that the user is trying to access. The attacker's 00:23:14.560-->00:23:18.497 service that they've set up. And then you've got the thin the thin sim and the sim card as 00:23:18.497-->00:23:22.668 before. So the first thing the users going to try and do is they're going to try and dial 00:23:22.668-->00:23:28.374 the number for the legitimate service. Now this initiates call control so it then asks the the 00:23:28.374-->00:23:32.945 tries to ask the sim card, can it dial this number. However, because there's a thin sim 00:23:32.945-->00:23:37.850 installed the thin sim intercepts that and decides to uh redirect it somewhere else. 00:23:37.850-->00:23:43.055 So, the f-everything gets redirected to the attacker's service. Now the attacker's 00:23:43.055-->00:23:48.961 service will mimi-mimic all the menus for a legitimate service perfectly. And so the user will 00:23:48.961-->00:23:52.364 go through all the menus they're expecting to go through and entering all the payment 00:23:52.364-->00:23:57.403 details. Uh however right before the very end that would actu uh of the message right before the 00:23:57.403-->00:24:00.873 very end of the transaction that would actually send the money, the attacker's service will 00:24:00.873-->00:24:05.611 return an error. This is because it can't actually make the transaction go through. Um, the 00:24:05.611-->00:24:09.682 user's sh-it will likely interpret this as some kind of network connectivity issue and 00:24:09.682-->00:24:16.021 try again later at which point it would go through, uh with no issues. So we have a demo of 00:24:16.021-->00:24:21.026 that as well. [computer chime] okay. So and this time I'm gonna dial the dial the number for our 00:24:29.368-->00:24:34.373 uh USSD service and it will redirect it uh to the attacker's service. So now I'm dialing for 00:24:37.943-->00:24:43.682 the legitimate service. It gets redirected without [cell phone chimes] telling the user 00:24:43.682-->00:24:49.521 anything. So we go through and then enter in to check the balance. So we tap 1, press 00:24:49.521-->00:24:54.526 okay. [cell phone chimes] So then it asks for the pin. [tapping] Error code, try again 00:25:05.003-->00:25:10.009 later. So, we exit outta this. Kay, just mute that. So we try again. Uh, I don't know why it 00:25:15.981-->00:25:20.886 takes so long to access a USSD service. Uh, It really shouldn't but it does. [speaker laughs] 00:25:20.886-->00:25:23.956 [distant coughing] So I'm gonna go through and re-try and check the balance again. So we enter 00:25:23.956-->00:25:28.961 1's check balance. Again we go and enter in the pin. [distant voices] [coughing] [tap] And now 00:25:40.439-->00:25:45.444 we actually get the balance. So notice this is uh 9000 ones over 9000. Alright so let's go back 00:25:49.681-->00:25:56.288 and do this. Okay so that's the demo of phase 1. So then in phase 2 we actually go on and 00:25:56.288-->00:26:00.325 try s-uh, steal the money. So again this triggered through some means uh in this case we 00:26:00.325-->00:26:05.364 just triggered it through uh uh a menu item in the sim toolkit application uh however again, it 00:26:05.364-->00:26:11.170 could be triggered through uh uh through a status update or something of the like. So first 00:26:11.170-->00:26:15.174 the thin sim will call the attacker's service because it needs to get the pin back. So it 00:26:15.174-->00:26:20.479 will call the attacker's service and get the retrieve the pin. Next it will so then it gets the 00:26:20.479-->00:26:25.050 pin back and then it'll actually make the transaction. So what it does here is it strings together 00:26:25.050-->00:26:30.856 the entire command it would need to do. So it'd be like star 1 2 3, star 2 for make transactions, 00:26:30.856-->00:26:34.893 star and then the destination phone number another star then the amount they're trying to 00:26:34.893-->00:26:40.499 send star, 1 for confirm star, and then the pin uh and then pound. [coughing] That's that's 00:26:40.499-->00:26:45.504 the string w-we need for this service um to go on. So we have a demo of that. [speaker talking 00:26:54.413-->00:27:00.252 inaudibly] Okay. So we go into the sim toolkit application. So we select send USSD. It waits 00:27:00.252-->00:27:03.989 for awhile because there's no it doesn't display to the user anything is happening. Usually 00:27:03.989-->00:27:09.495 it would but we've made it silent. [coughing] So now let's go and check the bal let's check 00:27:09.495-->00:27:13.866 the balance to see that we've actually uh sent some money somewhere. [distant coughing] 00:27:13.866-->00:27:18.604 So, now we go through and actually go and check the balance. Enter in the pin again. 00:27:25.377-->00:27:29.081 [coughing] [distant talking] And now the balance is much lower. Uh this is sending a bit of a 00:27:29.081-->00:27:34.086 600 uh current units of currency. Something like that. Do another account. [distant 00:27:37.656-->00:27:40.959 talking] So that point there's not really a lot the user could do. The moneys disappeared. By 00:27:40.959-->00:27:44.897 the time they notice uh it's probably been shifted to another account or cashed out of the 00:27:44.897-->00:27:50.068 network so that there's no, there's no method for recourse. And customer service in these 00:27:50.068-->00:27:55.007 places are often not so great so there's very little chance of user's getting their money back. 00:27:55.007-->00:27:58.844 So there are a-a couple more capabilities I didn't really talk about. Uh there's the 00:27:58.844-->00:28:03.916 ability to track location uh updates. So this is what cell tower the user is talking to. 00:28:03.916-->00:28:08.921 You could make some uh like some snooping software that to track users. Uh you doing that. 00:28:11.323-->00:28:17.062 There's GSM authentication. Uh this is not really so much an attack uh but it's you can use 00:28:17.062-->00:28:23.835 it if you know the uh IMSI of the device of another user and the key for the network you can 00:28:23.835-->00:28:28.774 then get pretend to be that user. Um, and then you can read any data off the sim card 00:28:28.774-->00:28:33.145 including the IMSI and the phonebook it that's stored there. Uh also in the GSM 00:28:33.145-->00:28:39.384 standards it allows phones to store uh SMS messages on the sim card and in the case where their 00:28:39.384-->00:28:43.722 messages are being stored on the sim card, the thin sim would be able to read those as well as 00:28:43.722-->00:28:50.262 they went passed. So let's look at some possible defenses now. So you could disable call 00:28:50.262-->00:28:54.700 control. This would get rid of all the call control based attacks as well as the USSD 00:28:54.700-->00:28:58.403 based attack because you simply if you can't redirect the call the attack is completely 00:28:58.403-->00:29:03.508 impossible. Uh, however that requires modifying the ph-the phone standards uh and then 00:29:03.508-->00:29:08.146 updating all the phones which is not really going to happen because these user a lot of the 00:29:08.146-->00:29:13.719 users who would be affected by this uh don't have data and if they have data they wanna use it 00:29:13.719-->00:29:17.522 for Facebook and Whatsapp. That's what they're gonna use it for. And so they're not gonna 00:29:17.522-->00:29:21.627 install apps, I'm sorry they're not gonna install updates. It's not probably not pos necessarily 00:29:21.627-->00:29:26.465 possible to install a software updates over the uh over the air for these devices. Well not all 00:29:26.465-->00:29:32.037 the company's that made the devices are even still around necessarily. Um so then there's 00:29:32.037-->00:29:36.842 the ability to just then disabling silent, silent outgoing SMS and USSD. Well this 00:29:36.842-->00:29:40.078 wouldn't actually prevent the attacks all it would do is prevent the notification 00:29:40.078-->00:29:44.249 [inaudible word] uh make it clear to the user that something bad is happening. Uh now again 00:29:44.249-->00:29:48.787 unfortunately this requires modifying the standard and has all the associated difficulties. 00:29:48.787-->00:29:53.792 Uh you could discourage the use by encouraging uh phone companies to put third party 00:29:53.792-->00:29:59.665 apps on to their sim cards. Uh this would then require a lot of cooperation from phone companies 00:29:59.665-->00:30:03.435 who may not want to cooperate and may have financial incentives not to cooperate in 00:30:03.435-->00:30:09.875 the case of m pay in the case it's Firecom. Uh this would at least make sim uh thin sims not 00:30:09.875-->00:30:14.279 normalized so if someone saw a thin sim at least then that'd be very suspicious of what's going 00:30:14.279-->00:30:19.084 on. Um you could use confirmation codes. So if there's sim toolkit USSD you 00:30:19.084-->00:30:23.722 could send the confirmation code sep uh after the transaction has gone through, then the user 00:30:23.722-->00:30:27.125 would have to enter in that confirmation code in order to verify the transaction and make 00:30:27.125-->00:30:32.631 it go through. Uh this works great for phones where the SMS message is not stored on the sim 00:30:32.631-->00:30:36.635 card but if it's stored on the sim card then the thin sim has access to it and so this is 00:30:36.635-->00:30:41.707 completely useless and for those devices. I don't know how many d-devices out there uh have that 00:30:41.707-->00:30:46.945 functionality. So I don't know. Alright and then for USSD you could require the user to enter 00:30:46.945-->00:30:51.950 in confirmation value on the screen. So this does this doesn't work with sim toolkit 00:30:51.950-->00:30:56.955 because it would need to talk to the network. Um, but the essential idea is that um once 00:30:59.357-->00:31:04.296 the once you start the USSD session there's no indication the the sim card interact with 00:31:06.865-->00:31:13.171 it anymore. So if the session uh completes and gets to the end uh without having to require 00:31:13.171-->00:31:18.043 anymore input the the sim card then get does get the response uh th-the final response that is 00:31:18.043-->00:31:22.247 sent back. If it needs more input it will then uh ask the user for it and there's a prompt 00:31:22.247-->00:31:27.252 that shows up. Uh, So what this would mean is that the thin sim would not be able to 00:31:27.252-->00:31:31.857 com-completely predict the message that it would need to send and something would show up 00:31:31.857-->00:31:36.027 on the user's screen uh that would allow them to then deny the payment, deny the 00:31:36.027-->00:31:40.732 transaction and stop anything bad from happening. So this would be quite effective. And 00:31:40.732-->00:31:45.137 finally you know it's a it's a plain text interface. Why can't we just encrypt it? And well 00:31:45.137-->00:31:50.308 there is actually a standard for that uh however of course no one implements this standard that 00:31:50.308-->00:31:55.514 would be too sensible, um. [speaker laughs] Uh yeah it's been around for man-many years. 00:31:55.514-->00:32:01.586 But no one there's no indentation of it. So, there's a link to the paper uh that I used 00:32:01.586-->00:32:07.726 uh that was written for this uh presented a conference uh in June and then there's a couple 00:32:07.726-->00:32:14.599 standards that there are. Uh does anyone have any questions? Yep? >>[inaudible question] >>Uh 00:32:14.599-->00:32:19.604 sorry what was that? >>[inaudible talking] >>Uh if you buy your own sim card? 00:32:28.780-->00:32:33.785 >>yeah >>Uh I mean you'd [speaker sighs] so as in for noti for seeing those as the sim 00:32:37.489-->00:32:41.927 card? >>yeah >>yeah um so the thin look at your sim card it'd be very clear if there's a thin 00:32:41.927-->00:32:46.932 sim installed on it or not. Um it's be very obvious. Uh yeah um however the interesting note uh 00:32:50.101-->00:32:53.905 it might be possible it can do all these attacks if you actually had software running on 00:32:53.905-->00:32:59.411 the sim card itself. Uh so if you had supply chaining issues for example, you might also not 00:32:59.411-->00:33:04.349 be safe. Yup? >>[inaudible questions] >>Uh >>[inaudible talker] >>The the I don't 00:33:08.820-->00:33:13.992 believe it's possible to get the key off the sim card. if it was a possible a thin sim might be 00:33:13.992-->00:33:18.997 able to do it. Um yeah I it's not really something we looked into. [distant talking] Anyone 00:33:30.308-->00:33:31.576 else? [distant talking] Cool. Thank you. [applause]