Okay, and now, we're at the top of the hour, 3 p.m. here in beautiful Las Vegas, Nevada. How's everyone enjoying their day? So, you don't know how lucky you are right now. Because at this time, I would like to, this man needs no introduction. He has given workshops here. He has given a workshop at many, many places for many years here. He will talk about Android apps and their security. It is my honor, no introduction. Tim Mohn, everyone. How about that? Oh, okay. Technology is so baffling. All right. So, I'm Sam Bowne. I teach at City College, San Francisco. And I got interested in mobile apps because they're very important these days. And I came across the enormous difference between Android and iOS. Android is much more popular because it's cheaper. And also, Google doesn't control it. They have a philosophy that it should be open source like Linux. So, they let everybody use their operating system and modify it however they like and make devices. And so, there are thousands of different devices out there, widely varying in quality at every level. And a lot of them are appallingly insecure. And the operating system itself does almost nothing to protect you, which is completely the opposite of iOS. Where you have to install, unless you jailbreak your phone, you have to install everything from the Apple Store. And Apple. It very vigorously limits what goes into that store. So, you're like a kid playing in a backyard behind a fence with parents that only let trustworthy people in there. So, the app doesn't really have to worry much about security and neither does the user. But Android is like playing in the street with traffic. You can download apps from everywhere. It's very strange. They require apps to be signed, but they don't need valid public signatures. You can just install a self-signed app right on top of a commercial app with a commercial signature. And the phone does not complain. Which is mighty strange. And this has led to quite a few entertaining disasters. So, your main tool, if you want to work with Android devices, is Android Debug Bridge. It lets you control them from the command line or from GUI tools that feed through it. Either a real device through USB cable or an emulated device through TCP. You can push files to the device. You can pull files from the device. View the log. Install apps. And you can get a shell. So, you can see how this works. I've got the Jenny Motion Emulator here. This is the best free emulator I've ever found. It's very nice. Emulating a phone. And the only trick is each operating system puts the software development kit in a different directory. This is where it goes on iOS. So, if I go here and run ADB shell, right now I'm in the Macintosh host. But when I do this, this pound sign is root on the Android device itself. And I can just go to the root of it and examine what's here. And you'll see I've got dev and etch and so on and mount and proc. This is a standard Android file system. And if I go to this place, data, data, you'll see... All right. I've got a bunch of folders here. And each directory belongs to a different user account. And if I go... These are the Android operating system files that Google put there for the Android operating system. And if I go down further, I'm going to hit the apps that have been installed. Like here's the Capital One app from Kony Labs. It has its own user account. Each app you install gets a newly created user account. And it only has the privileges to read and write in that folder. And other apps don't. This is the primary sandbox to protect apps from stealing each other's data. Each app only has Unix permissions to go in one folder. So in order for one app to steal data from another app, it would have to have a root kernel exploit to elevate to root and then go over. Or the app would have to make the mistake of storing the data somewhere foolish, like sending it all over network in plain text or putting it on the SD card. Now, you can watch processes on your phone. And I'll run this through more. There's a lot of system processes. And let me launch an app. Like here's TD Ameritrade, a financial app. So I'll run that thing. And go back. We'll be back to that later. All right. And let's find it here. I'm just going to use grep. All right. And there you see the TD Ameritrade app running with user account 40. So each process runs just like you'd expect it to on Linux. There's data subfolders where it stores it. And you can put apps on the phone and pull them back off the phone. And we'll do more of that a little bit later. So one very, very strange thing about Android is that the apps are not really compiled down to machine code like C++ or Objective C apps. They're compiled down to Dalvik bytecode, which is still very readable. So you can every app you install on your phone is in a single APK file, which is like a zip file. And when you pull it off the phone, you can take it apart. So you can read the source code. You can see the names of the variables, the names of the methods. You basically have the source code with every app. And this stuff is not that hard to read. All you have to do is use a Java APK tool, which will unzip it and show you all the things contained inside that app. And here's what's inside that TD Ameritrade app. It has a folder above this with a couple of XML files with global permissions. Things like this app is allowed to access the network code. You can see the password and your contacts and things like that. Then it has a series of Smully files in folders. All these Smully files have different purposes. And as you can see here, it is plainly readable. This is nothing like what you'll see if you take a Windows executable and run it through IDA Pro. You'll find no variable names, no method names. You just get a mess that's very hard to read. But here I can see cache manager, consumer API, market API, and so on in entirely readable form. Now, there is an obfuscator to try to protect your app from people doing this, reading the source code and understanding what you've done or modifying it. ProGuard that comes built inside Android Studio. And it is completely worthless. It's like a guard that locks the front door and leaves the back door open and goes home. I don't know why they bother at all. Here's what ProGuard does. Some of the names are reduced to A and B and C. And a lot of them aren't. So I've never been slowed down a bit by ProGuard. It's free. And it's worth just as much as you pay for it. So here's the difference between Java and Smalley. This is what the app developer actually saw. It was a Java function to perform a login. Put in two parameters called username and password. And this is what I find by decoding that app after it's been put into an APK file is Smalley. Perform login is still here. Here's parameter three and parameter four, username and password. Really not much harder to read and not much harder to modify than original Java. So you can then build the app. And re-sign it with your own self-signed key. And put it on a phone and run it. And you can do anything you like here. So let me just... This is what started me on this. Was the ability to change things in Android. Because of this Dancing with Dalvik talk I saw at various conventions about a year ago. Where this guy took Android games and modified them for his child. So it would be easier or something. And I noticed how very readable and easy it was to mess with the Dalvik. Then... So I started testing apps to see how many of them are vulnerable to this. And the answer is essentially all of them. So I put the summary of it here. These are the code modification vulnerabilities. And this is how I first got involved. So I decided to try big name apps. I'd say the top ten banks and the top ten stockbrokers and the top ten insurance companies. And the vulnerable... All the ones that are not green are vulnerable. And I've contacted them all in February. And the responses are different. Now the one thing I've learned largely from coming to these conventions. The banks that would not talk to me. Several of their security officers have come to me at BSides and DEFCON quietly, privately to tell me what's going on. And what's going on is when I tell a bank in the first place none of these have any vulnerability disclosure policy at all. There is no one to tell vulnerability results to. There is no official form. There is no e-mail address. So I'm often just hunting around trying to figure out how to tell anybody. Charles Schwab, for example, had a whole series of vulnerabilities here. And when I tried to contact them to tell them this, this is what happened. So let's go through this one. So you can use an ADB command to list the packages on the phone. So here's the Charles Schwab package. You can then find the complete path to it here. And you can pull it down from the phone. So it's a single file which is, what, six megabytes. That's the Charles Schwab app. Then you take it apart with APK tool. And that creates a bunch of Smalley. And I was easily able to find something called perform login with user name and password. And this was my Trojan. I'm making a poison Trojan app as a proof of concept to try to convince the executives at Charles Schwab that they should do something about this. Anybody could do this. So what this does is the simplest thing I could do. It puts the user name and password in the error log, like syslog. Now, that is not too dramatic. I originally wanted to send it up to Pastebin. But that's too hard to write in Smalley. But putting it in the syslog demonstrates that it's very vulnerable because any other app could steal it from the syslog. That's available to every app on the phone. And you can rebuild it and sign it and then run it. And then the user name and password appear in the log. So I wrote this page up. And then I tried to notify Charles Schwab. They have an e-mail form. But if you try to use it, an error occurs. It doesn't work. So then I sent an e-mail to security at Schwab.com. Because this is something Dan Kaminski said in his talk. Almost everybody has security at domain.com. This has never worked for me anywhere. I have not found any company where this e-mail gets anywhere. I always get this. It just bounces back. So then I found the U.K. office with another contact form, which I was able to send in with my security report. But I wasn't convinced I really reached anybody. Oh, this one failed, too. So then I found an international e-mail address and sent that. And it didn't bounce. But when I researched this at a site called Get Human, they said, never e-mail to Charles Schwab for any reason. They don't monitor or answer any of these addresses. Which was my impression. So at this point I was still not convinced I had in fact successfully notified them of this problem. So I went to what has never failed me, but I don't like doing it, which is you tweet the CEO. This guy is the CEO of Charles Schwab. And I didn't know until I tried this. But if you send a message saying please follow me so I can send you a private message to the CEO of a major company, they will do it. The problem is everyone else by standing know exactly what's going on by now. So it's almost a public disclosure. But they didn't put me in contact with the security manager who told me he called me up after that and he said, in the first place, if you find something else, don't do this again. And in the second place, we'll fix that. It will be coming out pretty soon, which it never did. But anyway, this is what I found at all these companies. It seems to me that these companies have a little responsibility, considering all the money they're handling. But they don't feel any responsibility to have a bug bounty or even a vulnerability disclosure email or anything. And three of these banks have privately approached me here at the con and at B-Sides to explain this. And what they've said is there are lawyers and compliance requirements and PR departments that all prevent them from talking to anybody. Only very carefully prepared statements can come out. That's why I thought no one was listening to me. I never got anything from Bank of America. Until a guy came to yell at me at B-Sides to say, why are you putting us down? He'd be reading all my stuff and looking at my web page. But they can't talk to me. They can't get clearance to communicate back to me. So I think it appears to me that they are still pretending that they have no security problems. And they think their customers imagine they have no security problems. Or at the very least, they want to be very, very careful in what they release about security problems. They don't appear to have a problem and don't think they've been hacked or something. So anyway, he told me they're absolutely not going to fix this at Bank of America. They don't think this matters. They think it's perfectly fine that people can alter their app. But they do care at Chase and they care at Wells Fargo. And they actually fixed this problem. And so did M&T. All right. And here's one. TD Ameritrade gets a special prize. I wrote a Trojan in their app to log the password. I notified them. So they changed their own program so that it now logs the password in addition. So I don't have Trojan anymore. I've heard a completely misunderstood thing. So let me just start with that one. That's probably a good thing to be a demo. So here. Let's look at the log. There's the log of this Android phone. And here's this TD Ameritrade app. So if I log in with DEFCON user and complete idiot. I log in. This is the unmodified TD Ameritrade app. Um. And so I found out because they updated it. I got the update. I tried to Trojan it. And when I did, there were two copies of the password in the log. And I said, what? So anyway, the latest version, they took this out again. But for about a month this was the current version about two months back. And that earned them a special place in my classes. See, I have a policy like this. When I find stuff, I notify the developer. If they don't talk to me for a month, I figure it's open season to use them for homework. So when I taught this class at City College, I found some app that someone wrote like a fake bank app to make every possible mistake. And my students worked on that. But now I don't do that anymore. Now we use real apps. Because there's so many apps out there on the Google Play Store making every possible mistake that you don't need to use fake ones. So let's play with a few more of these. Here's one that really is entertaining. Stitcher. We can crowd source this one. Stitcher is some kind of music app. And I don't really know what they do. But it's entertaining how they do it. Let me first run this through a proxy. So that's source code modification vulnerabilities. There's another category of vulnerability, which is how your network traffic goes. And so for that, I would like to send that through burp. Burp is, of course, the popular proxy used by pretty much everybody. You have to put that address in as a proxy server. I'll fill that in here in my Android phone. A manual proxy. And all I need is the address. 10.104.170.72. Okay. So now this is interesting. What happened here is Carnegie Mellon wanted to see if apps break SSL security by not checking their certificate. So they wrote, first they built a special router with Raspberry Pi, which was a device which would catch the network traffic and forge HTTPS certificates that would be wrong. They needed to be from an untrusted authority or outside the date range or for the wrong domain name. And then they connected a phone emulator to it. And they wrote an emulated program that would click the buttons on the app to just make it do something and create some traffic. Then they would automatically detect if HTTPS had been ‑‑ connections had been made through the man in the middle attack, which should not be possible. And if they were, they would automatically e‑mail the developer of the app and say your app is not secure. They tested the entire Google Play store. I think it was 100,000 apps at that time. And they found 33,000 of them vulnerable. And notified them. And I thought they found them all. But I've been finding a lot that Carnegie Mellon missed. And I don't understand why. Because they don't have a human smart enough to fill out the form and log in and stuff. They just have some automated process trying to press buttons in the app. And the other thing that occurred to me is this is ‑‑ I'm abusing this product. The correct way to use Burke. You export the certificate from Burke and import it onto the phone so it becomes a trusted certificate authority. And then you can audit HTTPS packets as they go by because your phone will trust Burke. But I did not install the certificate. And yet I'm running traffic through here. So now I'm using Burke as a man in the middle attack tool. Any secure connections that pass through the Burke will be given a forged certificate. So if I open up a browser, and let me just cancel this one. Go up and just load AOL in the first place. In fact, XQCD is one someone told me about. Good. Okay. If I ever get this thing to knock it off. All right. Let me try this. Because we're going to get there. I can't find it. All right. I'll just settle for what I've got here rather than struggle. The point is you'll see these security warnings whenever it tries to make a secure connection. And it's going to tell you this partner shareaholic.com, which is some ad on the AOL page, is actually signed by port swigger, not by a trusted certificate authority like VeriSign. So this is a secure app. The browser is secure. If you try to perform man in the middle attack over HTTP, the browser will catch it. Now, let's try Stitcher. Now, Stitcher has a login page somewhere. Let me just nuke all my old data. I'll just say here. Stitcher. Clear data. All right. And for stop, there we go. Now it will start from the beginning the way I want it to. I'm going to clear this old stuff. Now, this one has a different network security problem. This one sends everything in plain text. Doesn't even bother to try to use ACTP S. So I'm going to put in here test at AOL.com. And down here a password, a password. And a login. And I'm not seeing it here. Pardon me while I try to debug my problem. Did you people spot it out there? Did I type in the wrong address here? The user name? Wrong user name? Okay. Thank you. Good. I appreciate your help. It's much easier to spot errors from down there than up here. What's wrong? It doesn't like the user name. Okay. Thank you. I probably have a space at the start of it or something. Test. Oh, I remember this. I think it has to be lower case. Which is another clue that you're not dealing with geniuses here. All right. So there we go. Okay. So here it is sending my user name and password up to the Internet. Now, the first thing is it's sending it over HTTP, which means there's no encryption at all. But the second thing is, notice, if I try to steal the user name and password, the e-mail is here, but the password appears to be encrypted. It's this long jumble of random characters. It's kind of weird. It doesn't look quite like an MD5 hash. But they've done something. So this is a clue that they've probably done something foolish because they didn't use HTTPS. They made up their own custom encryption, and that's one of the cardinal rules. Never roll your own encryption. But let's see a few people. How many people can deduce their encryption here? That looks like a long ‑‑ I tried just a short password. If I use a password of A and send that up, then it sends up SN. Okay. So let's make a little chart here and see if you can deduce the pattern. So A goes to SN. Okay. And B. Okay. Here we go. N to S, O. Goes to S, O. Perhaps you are beginning to have a hypothesis about their encryption routine here. C goes to SP. So evidently they're using a Caesar cipher and shifting every letter forward so somebody faces in the alphabet, but it's a little more than that. You can't pick on that. If you use AA, it's now SN5K, and AB will complete this pattern. AB is SN5L. So the way it works is every other letter is just fixed. It's always an S. This is always a 5. That's moved forward something like 12 letters. That's moved forward something like four letters, and that's it. That's their glorious encryption. So don't do that. Anyway, but the point is they're all relying on the fact that both the developers and the customers aren't looking at all at what's going on here. Now, GenieMD actually breaks HTTPS, so let me show you that. This is some kind of medical app. And it seemed to me like a medical app ought to pay attention to security, but they did not agree. They told me that they are not subject to HIPAA compliance law because the patient installs the app and the patient is not covered, and therefore they can do any damn thing they want, no matter how stupid it is. I'm afraid they might be right about that, but they might be wrong. So if I log in here with tester at AOL.com and a password of secret password and sign in, and sign in, and sign in, it's going to send it in a post. And the post, okay. Come on, that's what this would be. I should see it, but I'm not going to struggle too much. How did it? Let's see. Let me try it again. Let's just add another letter. A couple of letters at the end. Okay. There we are. Now I think I've got the packet I need. All right. Perhaps I've got kicks off the Internet or something. I'll stick with my pictures of this. The point is you will see the HTTPS data. I think I've got that coming up here. All right. So I told you already how I Trojaned these apps, and I did quite a few of these. Let me go on to that. I'm not good. My demo has failed on me. But rather than... I don't want to worry about it. I want to show you something else. The point is you will see this. HTTPS. Now let me point out right now Carnegie Mellon would already warn them because they made an HTTPS connection through the proxy and that shouldn't have been possible. Now what they actually sent through it in this case doesn't appear to contain the username and password in this packet, but they are sent in another packet which for some reason I failed to capture here. And it is, in fact, important. This is where I differ with Carnegie Mellon. Carnegie Mellon warned them if they had made a technical failure. I only notify them if there's a real business cost, like I see a password pass through. Anyway, let me move on to types of Trojans. So I Trojaned a lot of these apps. And I found four different types of places to put a Trojan. The simplest one is Schwab. Schwab just has a username and password sitting in a parameter. So I put it in a parameter here. And if you log in... Yeah, yeah, that's fine. Let Schwab stop. Okay. So if I go here... Oh. Let me get rid of the proxy. I'm still going through burp and that will slow down or perhaps even stop some of those apps from launching. There we go. So Schwab, I can log in here. If I log in with A and B, then you see the username and password are in the log. Now that's not because Schwab was stupid enough to put it there. That's because I was able to modify their app to put it there. But otherwise it works and looks normal, and that's a dangerous thing. Now, that's one type of Trojan. Citibank is another. For this one, I was not able to find a place where the username and password were just sitting there in variables with those names. So this one, if I give it, say, C, C, C, C, C, C, C, and D, then you sign into here. You see a whole lot of data go by. And if you scroll up, what these are are all the parameters in the HTTPS message. What I did was Trojan the HTTP routine that creates parameters. So these are all the name value pairs for every parameter that was sent, including log in ID value and log in input item value, which is the password. So it's another place to Trojan that if you can't find the password handled by itself. And another one, there were four cases that I thought were kind of interesting, was Capital One. Capital One has something called the secure user input. And this is left over from last time. Let me just get rid of this stuff. Okay. They have a secure user input form, which does not put the password in a variable, and it doesn't put it in a very clear way in a parameter. But it does capture the key presses, and you can get the key code. So if I type A, B, C, D, you see these numbers, 29, 30, 31. Those are Google Android physical key codes. They're not ASCII, but they're close to it. You have to go to the Google website to find them. There's a key. Every key has a number. So I can key log the password letter by letter here. P, A, S, S, W, O, R, D. You just have to translate them back. And the last type that I found was the Bancorp. Let me back this up. Bancorp also does not ever store the password in a single variable. But what it does, that did it backwards. I'm going to do it forwards. You can type in your user ID here. And see, it's slowly accumulating characters into a variable, which it doesn't store in a way I can steal it, but you can steal the characters one by one, and you get this accumulation here. So it's easy enough to approach in any of them. And let me show you the workshop I just taught here, because it shows the things that are easily done. Let me go back to this one. And this one. All right. So this is what I gave my students. Look at the log like you did. And then we looked at broken SSLs. Then modify some apps. You can try these. I wrote a program that is nothing more than a Python script that does two search and replaces. But what it does is add a Trojan to every single module in the entire app. So if you do that, then the app, the log is just screaming by. Because if you can't find something like password or user name with grep, you can do that and then run the app, and when you press log in, see which method was called. So that's one way to find things if you're not having luck finding it the other way. And none of this should be possible. This is all ridiculous. There are plenty of products available to prevent it, and these guys just don't bother to use them. They don't take it seriously. So let me point out for orientation the OWASP top ten. Here's the Momo top ten. OWASP is the Bible of this stuff. So these are the things you should not do. Now the one I've been talking about is lack of binary protections. That's when you let somebody see your source code and mess with your source code. It's generally not a good idea, and there are products out there to prevent it. ProGuard is trying to prevent it very badly. There's a product called Dash O that does a much better job of obfuscating code. And there's another product called Arxan, which is very expensive, and they won't even talk to me or give me a free trial, so I can't test it. But they claim that they cover your app in layers of protection. To prevent app modification and have internal checks to see, have you used it? You look like you're able to bypass it. But you think so. Okay. Well, I see some doubt out there. It may be true. I wish I could have it and play with it and see. Anyway, all these things are technically security through obscurity, but they're trying to get you down to where you'd be with a binary compiled code. So the only thing to look here is lack of binary protections, and insufficient transport layer protection, either plain text or some broken SSL or some nonsense like a Caesar cipher. That's what I would call insufficient. But also insufficient secure data storage. They often store your password in plain text on the device, which is a bad idea because someone could steal your device, root it, and get the password. All right. So let me go down here. We talked about them. All right. Now, people have sometimes told me, like the Bank of America security officer, that this does not matter. It's not under active attack. Nothing bad is going to happen. And they say it may not be under active attack right now, but it was in 2011, is when Droid Dream infected a bunch of apps and they went right into Google Play Store. Now, Google has been trying to supervise the junk in their store better. And they're improving, but they're nowhere near where Apple is. And even if they were to clean out their store, people can load apps that are not from the store. So it's kind of strange. But anyway, Google has been gradually improving their ability to screen malware out of the store. But even now, here's antivirus products for Android. Here's how effective they are. Here's the Google Play Store scanner. And the same thing, of course, is true of Microsoft's antivirus. It's just garbage. It's not even compared to the others. And even Microsoft admits it. I don't know why. The people that write the OS can't write the defense. But it seems to still be the case that they can't. So you can prevent these things. You cannot store secrets on the client side, so they can't be stolen. You can opposite your source code with a variety of products. Dash O does this. It changes all the variables to these long garbled messes. And that would stop me. But I'm a very weak attacker. If I can't search for password, you can still get in with some kind of automated process that prints out every variable and then hunt through it for the password you typed in. But it would be a lot more work. That's 2,000 bucks for that one. So the broken SSL, the first thing I did, this was the Carnegie Mellon project. They found 23,000 vulnerable apps. And I went to look to see how many of those apps are still vulnerable seven months later. Because they published a spreadsheet of these 23,000 vulnerable apps. And the thing about me is I don't want to bring infamy on my college by just dumping apps, phones without notifying people first. So I want, this time, Carnegie Mellon notified them seven months ago so I don't have to go through responsible disclosure. I've just tested. So I tested to see how many of them are still vulnerable. And a lot of them were. Like PixArt with 100 million downloads was still vulnerable. And one thing that's really kind of fun is the is apps that do harm to services you wouldn't expect. Like Foxit. Foxit was the mobile PDF reader for Android. And their Android Foxit reader, this is the page I sent to Foxit. Or I didn't. In this case, I did not have to notify them because they had already been notified. But if I run Burp, they have HTTPS and you see the password, any email address, going to an untrusted man in the middle attack over HTTPS. Because if I run Burp, they just don't bother to check the certificate. But then Foxit has the feature not only to view PDFs but to share them with other services. And instead of using the default operations of the Android to log in, they use their own broken implementation for all those logins too. I found several apps that do this. So Foxit loses not only its own credentials, it loses your Dropbox credentials, your Box credentials, your Microsoft credentials, and your Google credentials. Which I think is pretty damn thick when Google will put something in the Google Play Store that leaks out your Google password. It seems to me like they should at least care about that. Anyway, after this hit the press, Foxit did in fact fix it and so did SnapSecure that makes a security device you put on your Android phone and it also broke HTTPS. And that's pretty embarrassing when your security product does a dumb thing like that. And when you log in, it sends it over broken HTTPS so anybody can see the name and password passing by. You could just do a man in the middle attacking a coffee house and steal it. Instachat. OkCupid actually fixed it. Safeway didn't. Then it occurred to me that some of those apps are medical. Some of those 23,000 apps found by search are medical. It seemed to me like they were required to protect your data for HIPAA compliance. So I found 265 vulnerable ones including this one here, Lowest Med Corporate Rx. And I published a page saying I think these people are violating HIPAA. Now I'm not a lawyer, but it seems to me like it says here that information should be protected with reasonable technical safeguards to ensure its confidentiality, integrity and availability. And it seems to me that sending them over the internet in plain text is a constitutional opinion on the matter. So I published a page saying I think these people are violating HIPAA. And that got some attention. The people at this company, Lowest Med, immediately phoned the chancellor of the college and demanded that page be taken down and they're going to sue the college and I should be fired. And then they said they had to phone my chancellor because they couldn't find me. Now some of you might have tried Googling me. It's not that hard to find me. But anyway, so they get a phone call threatening to sue the college. And they can't take it down. I put up that page and if you want it down you've got to talk to me. Number two, I'm not going to talk to you on the phone. Send me an email in writing and I will then forward that to my attorney and we will draft an appropriate response. And somehow, when they heard that, there's no more threats. Then they just sent me a plight letter saying we think we're not covered by HIPAA and so it doesn't matter. And I said, well okay, I can put that up on the page as a comment, but suddenly they don't need me fired and they don't need to sue me when they realize they're not going to sue me. Anyway, so a lot of them are out here. GDMD is one of them, lowest med and so on. And none of these, this is the dark side of compliance. I was generally in favor of HIPAA for a few years ago because it meant there was someone to talk to. I found a college that had a HIPAA compliance problem and there is a HIPAA compliance office. There is an official form to use to report it and when you report it, they actually do things. So I thought compliance is pretty cool. But now I hit the dark side of compliance. So when I call GDMD and I tell them, look, you're attending confidential information about patient symptoms and medical appointments and stuff over the internet in plain text. What are you, nuts? They say, we are not covered by HIPAA, therefore it doesn't matter. And so, anyway, it is perhaps useful to observe that they're using broken HDP here, but let me point out one thing, which I think I didn't mention in this talk yet, which is that this activity is probably illegal in America. And that's here. A student told me about this. This is when I give this talk at layer one. Fandango and Credit Karma were sanctioned by the Federal Trade Commission last year for doing exactly this. They broke HTTPS. And then, in their privacy policy, they said something like this. We will take reasonable efforts to keep your information private. And the FTC swooped in. Now, I used to work under contract with the FTC and I know how they operate. They love this. If you promise $10 and you charge $20, they say, aha, you didn't do your promise. And they punish you. They were not fined, but they were forced to stop doing it and forced to be audited for the next 20 years to make sure they don't do it again. And so, it appears to be illegal, or close to it, to do this in America. And that may help convince some people to care. And it may not. Anyway, let me go down here. That was Louis Med, yeah, trying to get me fired. So then I started to test new apps. My first thought is that Carnegie Mellon must have found them all. But when I started just testing random apps, I found a lot of apps. And I learned something. Blue Cross and Blue Shield are not a unified organization. There's a separate Blue Cross Blue Shield app for every little township and district and zone. And they don't have any uniformity. They don't all go to the same server. They don't all look the same. So everybody gets whoever they want to write their app. And some of them are good and some of them are bad. So Blue Cross Blue Shield of North Carolina, this is a really good web developer. It leaks Blue Cross credentials. And by the way, it was one of these that would also leak Facebook, Twitter, and YouTube credentials because when you click these links it would send them through the same buggy app. And I notified him and he fixed it in two days. Which I thought was very impressive. And that meant I could talk about it at cons and I don't have to wait for a longer disclosure. The one thing that kind of puzzles me is isn't there a higher level of management that has to do like HIPAA reporting on these violations and make an official statement there isn't any? Okay. I thought management might have to do something. But anyway, that's the game there. I was testing all the insurance companies and there's a big insurance company called AIG and they don't have an app. But there is an app with their name on it which is the app they use if you insure your phone itself. To insure your phone, you put on their app to keep your phone safe called AIG Mobile Guard. And AIG Mobile Guard is made by a company that makes mobile superhero and it causes you to make a pin and then it stores the pin in plain text in the log and on the phone. And on the phone it stores your security answer, your mother's maiden name, security question, your pin, all in plain text locally. So I contacted them. By the way, this is a fun thing. You should try this. It's very easy to find your own phones with these simple tests. I went through the other products from the same company and they all have the same problem. Mobile superhero, Virgin Mobile, they all have the same problem and most of them have been removed. So when you find one bad app, go find the other apps from the same developer. I found seven families of apps so far. Probably the most important one was the one that makes the college apps for all the big colleges including the US Air Force Academy, West Point Academy, and I think one of the other military academies, the Marine Academy I think. They all got an app from a company called Stratton and many other colleges and all of them broke SSL the same way. So after I notified about eight or ten of them, I contacted the developer and they totally agreed that I was right, updated their libraries and fixed it in about a month. Their whole product line. I've got seven vulnerable product lines I know of. Some of them haven't yet been noticed because of the political problems of teaching this class. So I taught this class in Texas about three weeks ago. It was a week-long class for college teachers to learn something new in the summer. So all these college security teachers had a whole bunch of projects like these here playing with these apps and seeing how to test them for simple security problems. And then they started testing their own apps after that. And they found 20 new vulnerabilities. I put them here. I like to brag about students that do good things. So they found 20 new vulnerabilities. Here's a student who found maybe six and so on. And as I said, go notify these people and they give them example notification. But then one of them tested an app at one of the colleges infected. One of the colleges involved in this. When the administrator of the conference found out about that, they said you're a terrible person. We're going to fire you. We're going to never invite you back. You can never teach here again for being such a rotten person. And the students all said if you throw Sam out, I'm going to quit too. So they relented. But it is the lesson that they got from that which is unfortunately true. Which is if you are a college professor, you find a vulnerability and responsibly report it, you can get fired. And that's 40% in my opinion that some administrator will decide to fire you for doing that because they are complete flaming morons. And the only thing they care about is that you shouldn't make any waves. And the original complaint said I understand what you're doing but someone stupid might misunderstand it and you should never do anything that someone stupid might misunderstand. Now, I used to be married. I heard a lot of that to where I got immune to it. At the time I was not grateful. Because people tried to throw the same crap at me that I dealt with them and now I don't care. But anyway, that's total nonsense. You're supposed to do something that no moron, no matter how stupid, could possibly misunderstand. But the point of this is that money is controlled by complete morons. And they're afraid they'll be defunded. So anyway, what happened is half of these students gave the information back to me and I'm going to have to report them. They do not want credit for their discoveries and I'm not going to be able to get them fired. So I'm objecting about the political structure of the world. The colleges are all screwed up in case that's news to anybody. And all the big companies are all screwed up. They don't even let you report vulnerabilities at all. So I'd really like to see them have bug bounties. And anyway, by the way, this is all very simple stuff. There are Android security auditing products you can get. The free versions are even lamer than the stuff I'm doing. But as far as I can tell, most developers are just writing apps and throwing them out there and not doing them at all. So you would be doing a much better job if you would just try these very simple tests on your app before putting it out in the market. Just see if it breaks HTTPS or uses plain text. And by the way, one last thing that I want to tell you. I was going to demonstrate it live but I can't get a wired ethernet connection up here on short notice. But you can ignore all this software I've been using and do this with a real device. If you have a Mac, I have exact instructions to do this, too. You take internet on Wi-Fi and you share it out the Bluetooth. Now you take any real mobile device you like and connect to the internet through Bluetooth. Now all the traffic is passing through the Mac. Now you run Burp on the Mac and you use the PF firewall. The PF firewall is not IP tables but it's a similar kind of firewall in the Mac. And it is baffling in its complexity but to do this simple task, you need to make one file that says redirect all traffic on the bridge 100 network which is the internet connection sharing network through Burp which is 127 001 port 8080 and another config file tells it to use that rules file and then you start it with that command. So about three command line commands cause all the traffic that's coming through the shared connection to pass through Burp and now you can audit real devices. Hey there. Oh good, just on time anyway. So I was gonna do this one live and test your apps on your real phones but I can't do it due to lack of a wired connection here but you can do it and I highly encourage you to test your mobile apps. And if you want to test random apps out there, an incredible number of them are vulnerable. Something like 5 to 10% of all the apps in the Google Play Store appear to be vulnerable. I have found hundreds and my students in like two days of testing found 20 more and these are big names. Major TV networks, major newspapers just, it's awful. Now only one of the top 10 banks, insurance companies and stock broker apps broke SSL. They seem to have figured out that breaking SSL is bad up there. But if you're not in the stratosphere people just seem to comment out the SSL verification all the time and leave it that way. The developers do not seem to understand the consequences of what they're doing. And there does not seem to be any security auditing process in there. Anyway, I think that's all I've got. Any questions out there? Yeah? What's that? You want to get the slides you say? Yeah, everything is all on my web page. And what'll happen is you go to samsclassstudyinfo and right now everything's right on the front and in a week or so it'll move to old classes. And it's all public domain so you can totally use this stuff. You can put it in a book, put your name on it, sell it and keep the money. You can do any bloody thing you want. Except the only thing you can't do is if you do something rotten with it it'll get you out of jail. Yeah? You talked a lot about people leaking passwords. Have you seen other sorts of information? Oh yes, yeah. I see other things besides passwords and yes, if they leak passwords they'll leak everything else too. That's just the main thing I test for just because it's easy to think about. But to medical apps in particular there's forms where you have your symptoms and your appointments Anything else? What's that? Yeah. No, to put the trojans in every module all you have to do is two search and replaces. Every place there is a locals of zero you have to make locals one so there's room for one variable and before the first line of the app before the prologue statement you put an entry in the log. That's all. Well, you know, if you see my code you'll just laugh at it. It's just two search and replaces. That's all it is. So it is that easy. That's why I'm just amazed. I don't do anything difficult because anything I do has to boil down to a one hour homework assignment eventually and it is far, far too easy to mess with Android apps. Anything else? Alright, well I guess I better get out of here for the next speaker. Thank you. Thank you.