1 00:00:00,000 --> 00:00:06,100 Okay, and now, we're at the top of the hour, 3 p.m. here in beautiful Las Vegas, Nevada. 2 00:00:06,980 --> 00:00:08,780 How's everyone enjoying their day? 3 00:00:12,780 --> 00:00:18,160 So, you don't know how lucky you are right now. 4 00:00:18,540 --> 00:00:23,940 Because at this time, I would like to, this man needs no introduction. 5 00:00:24,740 --> 00:00:26,500 He has given workshops here. 6 00:00:26,500 --> 00:00:31,000 He has given a workshop at many, many places for many years here. 7 00:00:31,700 --> 00:00:35,000 He will talk about Android apps and their security. 8 00:00:35,220 --> 00:00:37,180 It is my honor, no introduction. 9 00:00:37,820 --> 00:00:38,940 Tim Mohn, everyone. 10 00:01:01,120 --> 00:01:01,960 How about that? 11 00:01:02,100 --> 00:01:02,820 Oh, okay. 12 00:01:04,400 --> 00:01:05,960 Technology is so baffling. 13 00:01:06,160 --> 00:01:06,480 All right. 14 00:01:08,840 --> 00:01:10,220 So, I'm Sam Bowne. 15 00:01:10,260 --> 00:01:11,700 I teach at City College, San Francisco. 16 00:01:13,140 --> 00:01:17,920 And I got interested in mobile apps because they're very important these days. 17 00:01:18,000 --> 00:01:22,040 And I came across the enormous difference between Android and iOS. 18 00:01:23,280 --> 00:01:26,280 Android is much more popular because it's cheaper. 19 00:01:26,500 --> 00:01:28,400 And also, Google doesn't control it. 20 00:01:28,440 --> 00:01:30,860 They have a philosophy that it should be open source like Linux. 21 00:01:30,960 --> 00:01:36,500 So, they let everybody use their operating system and modify it however they like and make devices. 22 00:01:36,720 --> 00:01:41,480 And so, there are thousands of different devices out there, widely varying in quality at every level. 23 00:01:42,020 --> 00:01:43,940 And a lot of them are appallingly insecure. 24 00:01:44,660 --> 00:01:50,240 And the operating system itself does almost nothing to protect you, which is completely the opposite of iOS. 25 00:01:50,780 --> 00:01:55,260 Where you have to install, unless you jailbreak your phone, you have to install everything from the Apple Store. 26 00:01:55,460 --> 00:01:56,100 And Apple. 27 00:01:56,500 --> 00:01:58,740 It very vigorously limits what goes into that store. 28 00:01:58,960 --> 00:02:04,860 So, you're like a kid playing in a backyard behind a fence with parents that only let trustworthy people in there. 29 00:02:05,080 --> 00:02:08,800 So, the app doesn't really have to worry much about security and neither does the user. 30 00:02:09,020 --> 00:02:11,520 But Android is like playing in the street with traffic. 31 00:02:11,860 --> 00:02:13,200 You can download apps from everywhere. 32 00:02:13,880 --> 00:02:15,060 It's very strange. 33 00:02:15,340 --> 00:02:19,100 They require apps to be signed, but they don't need valid public signatures. 34 00:02:19,280 --> 00:02:23,240 You can just install a self-signed app right on top of a commercial app with a commercial signature. 35 00:02:23,580 --> 00:02:25,280 And the phone does not complain. 36 00:02:25,620 --> 00:02:26,480 Which is mighty strange. 37 00:02:26,480 --> 00:02:30,420 And this has led to quite a few entertaining disasters. 38 00:02:31,840 --> 00:02:35,920 So, your main tool, if you want to work with Android devices, is Android Debug Bridge. 39 00:02:36,280 --> 00:02:39,540 It lets you control them from the command line or from GUI tools that feed through it. 40 00:02:39,620 --> 00:02:44,000 Either a real device through USB cable or an emulated device through TCP. 41 00:02:44,560 --> 00:02:46,340 You can push files to the device. 42 00:02:46,460 --> 00:02:48,080 You can pull files from the device. 43 00:02:48,440 --> 00:02:49,280 View the log. 44 00:02:49,520 --> 00:02:50,300 Install apps. 45 00:02:50,720 --> 00:02:51,860 And you can get a shell. 46 00:02:52,640 --> 00:02:54,100 So, you can see how this works. 47 00:02:54,220 --> 00:02:55,760 I've got the Jenny Motion Emulator here. 48 00:02:55,760 --> 00:02:58,060 This is the best free emulator I've ever found. 49 00:02:58,320 --> 00:02:59,360 It's very nice. 50 00:02:59,460 --> 00:03:00,300 Emulating a phone. 51 00:03:00,960 --> 00:03:11,220 And the only trick is each operating system puts the software development kit in a different directory. 52 00:03:11,480 --> 00:03:12,900 This is where it goes on iOS. 53 00:03:15,140 --> 00:03:23,300 So, if I go here and run ADB shell, right now I'm in the Macintosh host. 54 00:03:23,300 --> 00:03:27,640 But when I do this, this pound sign is root on the Android device itself. 55 00:03:28,120 --> 00:03:33,100 And I can just go to the root of it and examine what's here. 56 00:03:35,660 --> 00:03:39,460 And you'll see I've got dev and etch and so on and mount and proc. 57 00:03:39,620 --> 00:03:41,520 This is a standard Android file system. 58 00:03:42,740 --> 00:03:49,160 And if I go to this place, data, data, you'll see... 59 00:03:53,380 --> 00:03:54,060 All right. 60 00:03:54,120 --> 00:03:55,880 I've got a bunch of folders here. 61 00:03:56,260 --> 00:03:59,160 And each directory belongs to a different user account. 62 00:03:59,880 --> 00:04:01,100 And if I go... 63 00:04:01,100 --> 00:04:06,740 These are the Android operating system files that Google put there for the Android operating system. 64 00:04:06,960 --> 00:04:09,820 And if I go down further, I'm going to hit the apps that have been installed. 65 00:04:10,020 --> 00:04:12,800 Like here's the Capital One app from Kony Labs. 66 00:04:13,080 --> 00:04:14,460 It has its own user account. 67 00:04:14,720 --> 00:04:17,740 Each app you install gets a newly created user account. 68 00:04:18,000 --> 00:04:20,940 And it only has the privileges to read and write in that folder. 69 00:04:21,080 --> 00:04:22,140 And other apps don't. 70 00:04:22,140 --> 00:04:26,360 This is the primary sandbox to protect apps from stealing each other's data. 71 00:04:26,560 --> 00:04:29,100 Each app only has Unix permissions to go in one folder. 72 00:04:29,440 --> 00:04:36,760 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. 73 00:04:37,020 --> 00:04:44,940 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. 74 00:04:46,020 --> 00:04:48,180 Now, you can watch processes on your phone. 75 00:04:49,680 --> 00:04:51,200 And I'll run this through more. 76 00:04:52,240 --> 00:04:53,660 There's a lot of system processes. 77 00:04:53,980 --> 00:04:55,240 And let me launch an app. 78 00:04:55,340 --> 00:04:57,960 Like here's TD Ameritrade, a financial app. 79 00:04:58,520 --> 00:04:59,580 So I'll run that thing. 80 00:05:00,440 --> 00:05:01,460 And go back. 81 00:05:01,520 --> 00:05:02,500 We'll be back to that later. 82 00:05:02,740 --> 00:05:03,040 All right. 83 00:05:03,080 --> 00:05:04,260 And let's find it here. 84 00:05:04,440 --> 00:05:06,260 I'm just going to use grep. 85 00:05:10,460 --> 00:05:11,100 All right. 86 00:05:11,120 --> 00:05:15,340 And there you see the TD Ameritrade app running with user account 40. 87 00:05:16,320 --> 00:05:19,800 So each process runs just like you'd expect it to on Linux. 88 00:05:19,900 --> 00:05:22,040 There's data subfolders where it stores it. 89 00:05:22,140 --> 00:05:26,060 And you can put apps on the phone and pull them back off the phone. 90 00:05:26,320 --> 00:05:27,860 And we'll do more of that a little bit later. 91 00:05:29,800 --> 00:05:39,260 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. 92 00:05:39,460 --> 00:05:43,300 They're compiled down to Dalvik bytecode, which is still very readable. 93 00:05:44,020 --> 00:05:49,560 So you can every app you install on your phone is in a single APK file, which is like a zip file. 94 00:05:49,560 --> 00:05:52,580 And when you pull it off the phone, you can take it apart. 95 00:05:52,880 --> 00:05:54,400 So you can read the source code. 96 00:05:54,620 --> 00:05:56,980 You can see the names of the variables, the names of the methods. 97 00:05:57,400 --> 00:05:59,860 You basically have the source code with every app. 98 00:06:01,660 --> 00:06:03,660 And this stuff is not that hard to read. 99 00:06:03,820 --> 00:06:10,620 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. 100 00:06:10,800 --> 00:06:13,060 And here's what's inside that TD Ameritrade app. 101 00:06:13,280 --> 00:06:16,920 It has a folder above this with a couple of XML files with global permissions. 102 00:06:17,060 --> 00:06:19,540 Things like this app is allowed to access the network code. 103 00:06:19,560 --> 00:06:21,960 You can see the password and your contacts and things like that. 104 00:06:22,220 --> 00:06:25,400 Then it has a series of Smully files in folders. 105 00:06:25,620 --> 00:06:29,420 All these Smully files have different purposes. 106 00:06:29,760 --> 00:06:32,240 And as you can see here, it is plainly readable. 107 00:06:32,480 --> 00:06:36,040 This is nothing like what you'll see if you take a Windows executable and run it through IDA Pro. 108 00:06:36,440 --> 00:06:39,000 You'll find no variable names, no method names. 109 00:06:39,180 --> 00:06:40,980 You just get a mess that's very hard to read. 110 00:06:41,240 --> 00:06:48,220 But here I can see cache manager, consumer API, market API, and so on in entirely readable form. 111 00:06:48,220 --> 00:06:55,760 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. 112 00:06:56,320 --> 00:06:58,880 ProGuard that comes built inside Android Studio. 113 00:06:59,240 --> 00:07:00,580 And it is completely worthless. 114 00:07:00,840 --> 00:07:04,260 It's like a guard that locks the front door and leaves the back door open and goes home. 115 00:07:04,640 --> 00:07:05,980 I don't know why they bother at all. 116 00:07:06,280 --> 00:07:07,480 Here's what ProGuard does. 117 00:07:07,560 --> 00:07:09,900 Some of the names are reduced to A and B and C. 118 00:07:09,960 --> 00:07:11,060 And a lot of them aren't. 119 00:07:11,380 --> 00:07:13,680 So I've never been slowed down a bit by ProGuard. 120 00:07:14,020 --> 00:07:14,640 It's free. 121 00:07:14,780 --> 00:07:16,620 And it's worth just as much as you pay for it. 122 00:07:18,220 --> 00:07:20,200 So here's the difference between Java and Smalley. 123 00:07:20,400 --> 00:07:22,780 This is what the app developer actually saw. 124 00:07:22,980 --> 00:07:24,980 It was a Java function to perform a login. 125 00:07:25,400 --> 00:07:28,020 Put in two parameters called username and password. 126 00:07:28,280 --> 00:07:35,300 And this is what I find by decoding that app after it's been put into an APK file is Smalley. 127 00:07:35,600 --> 00:07:37,300 Perform login is still here. 128 00:07:37,700 --> 00:07:40,560 Here's parameter three and parameter four, username and password. 129 00:07:40,980 --> 00:07:45,580 Really not much harder to read and not much harder to modify than original Java. 130 00:07:46,400 --> 00:07:48,200 So you can then build the app. 131 00:07:48,220 --> 00:07:50,740 And re-sign it with your own self-signed key. 132 00:07:51,140 --> 00:07:52,740 And put it on a phone and run it. 133 00:07:53,300 --> 00:07:54,820 And you can do anything you like here. 134 00:07:56,580 --> 00:07:58,020 So let me just... 135 00:07:59,960 --> 00:08:01,400 This is what started me on this. 136 00:08:01,460 --> 00:08:02,760 Was the ability to change things in Android. 137 00:08:02,940 --> 00:08:06,740 Because of this Dancing with Dalvik talk I saw at various conventions about a year ago. 138 00:08:06,940 --> 00:08:10,480 Where this guy took Android games and modified them for his child. 139 00:08:11,040 --> 00:08:12,260 So it would be easier or something. 140 00:08:12,440 --> 00:08:15,280 And I noticed how very readable and easy it was to mess with the Dalvik. 141 00:08:16,000 --> 00:08:16,400 Then... 142 00:08:16,400 --> 00:08:19,680 So I started testing apps to see how many of them are vulnerable to this. 143 00:08:19,840 --> 00:08:22,100 And the answer is essentially all of them. 144 00:08:23,600 --> 00:08:25,840 So I put the summary of it here. 145 00:08:26,440 --> 00:08:28,260 These are the code modification vulnerabilities. 146 00:08:28,600 --> 00:08:29,880 And this is how I first got involved. 147 00:08:30,280 --> 00:08:32,680 So I decided to try big name apps. 148 00:08:32,860 --> 00:08:38,720 I'd say the top ten banks and the top ten stockbrokers and the top ten insurance companies. 149 00:08:39,220 --> 00:08:41,180 And the vulnerable... 150 00:08:42,340 --> 00:08:44,600 All the ones that are not green are vulnerable. 151 00:08:44,600 --> 00:08:46,560 And I've contacted them all in February. 152 00:08:46,900 --> 00:08:48,460 And the responses are different. 153 00:08:48,600 --> 00:08:51,700 Now the one thing I've learned largely from coming to these conventions. 154 00:08:52,020 --> 00:08:53,680 The banks that would not talk to me. 155 00:08:53,800 --> 00:09:00,500 Several of their security officers have come to me at BSides and DEFCON quietly, privately to tell me what's going on. 156 00:09:00,660 --> 00:09:08,460 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. 157 00:09:08,720 --> 00:09:11,880 There is no one to tell vulnerability results to. 158 00:09:12,060 --> 00:09:13,960 There is no official form. 159 00:09:13,960 --> 00:09:15,260 There is no e-mail address. 160 00:09:15,600 --> 00:09:19,180 So I'm often just hunting around trying to figure out how to tell anybody. 161 00:09:19,640 --> 00:09:22,480 Charles Schwab, for example, had a whole series of vulnerabilities here. 162 00:09:23,020 --> 00:09:26,800 And when I tried to contact them to tell them this, this is what happened. 163 00:09:26,940 --> 00:09:28,160 So let's go through this one. 164 00:09:28,240 --> 00:09:31,780 So you can use an ADB command to list the packages on the phone. 165 00:09:31,980 --> 00:09:34,200 So here's the Charles Schwab package. 166 00:09:34,520 --> 00:09:36,960 You can then find the complete path to it here. 167 00:09:37,100 --> 00:09:38,480 And you can pull it down from the phone. 168 00:09:38,800 --> 00:09:41,820 So it's a single file which is, what, six megabytes. 169 00:09:42,040 --> 00:09:43,480 That's the Charles Schwab app. 170 00:09:43,960 --> 00:09:46,020 Then you take it apart with APK tool. 171 00:09:46,680 --> 00:09:49,120 And that creates a bunch of Smalley. 172 00:09:49,220 --> 00:09:53,020 And I was easily able to find something called perform login with user name and password. 173 00:09:53,460 --> 00:09:54,860 And this was my Trojan. 174 00:09:54,980 --> 00:10:01,400 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. 175 00:10:01,460 --> 00:10:02,300 Anybody could do this. 176 00:10:02,560 --> 00:10:05,080 So what this does is the simplest thing I could do. 177 00:10:05,140 --> 00:10:08,500 It puts the user name and password in the error log, like syslog. 178 00:10:08,780 --> 00:10:10,280 Now, that is not too dramatic. 179 00:10:10,600 --> 00:10:12,340 I originally wanted to send it up to Pastebin. 180 00:10:12,420 --> 00:10:13,780 But that's too hard to write in Smalley. 181 00:10:14,180 --> 00:10:19,280 But putting it in the syslog demonstrates that it's very vulnerable because any other app could steal it from the syslog. 182 00:10:19,400 --> 00:10:22,400 That's available to every app on the phone. 183 00:10:24,080 --> 00:10:26,420 And you can rebuild it and sign it and then run it. 184 00:10:26,520 --> 00:10:28,500 And then the user name and password appear in the log. 185 00:10:28,640 --> 00:10:29,980 So I wrote this page up. 186 00:10:30,100 --> 00:10:32,220 And then I tried to notify Charles Schwab. 187 00:10:32,480 --> 00:10:33,940 They have an e-mail form. 188 00:10:34,300 --> 00:10:36,740 But if you try to use it, an error occurs. 189 00:10:36,800 --> 00:10:37,340 It doesn't work. 190 00:10:37,960 --> 00:10:41,420 So then I sent an e-mail to security at Schwab.com. 191 00:10:41,560 --> 00:10:43,560 Because this is something Dan Kaminski said in his talk. 192 00:10:43,960 --> 00:10:46,520 Almost everybody has security at domain.com. 193 00:10:46,740 --> 00:10:48,780 This has never worked for me anywhere. 194 00:10:49,520 --> 00:10:52,200 I have not found any company where this e-mail gets anywhere. 195 00:10:52,440 --> 00:10:53,260 I always get this. 196 00:10:53,340 --> 00:10:54,220 It just bounces back. 197 00:10:54,860 --> 00:11:01,640 So then I found the U.K. office with another contact form, which I was able to send in with my security report. 198 00:11:01,940 --> 00:11:04,060 But I wasn't convinced I really reached anybody. 199 00:11:04,260 --> 00:11:05,100 Oh, this one failed, too. 200 00:11:05,380 --> 00:11:08,380 So then I found an international e-mail address and sent that. 201 00:11:08,520 --> 00:11:09,340 And it didn't bounce. 202 00:11:09,640 --> 00:11:12,660 But when I researched this at a site called Get Human, they said, 203 00:11:12,660 --> 00:11:15,160 never e-mail to Charles Schwab for any reason. 204 00:11:15,260 --> 00:11:17,300 They don't monitor or answer any of these addresses. 205 00:11:17,840 --> 00:11:18,700 Which was my impression. 206 00:11:18,860 --> 00:11:22,980 So at this point I was still not convinced I had in fact successfully notified them of this problem. 207 00:11:23,600 --> 00:11:28,100 So I went to what has never failed me, but I don't like doing it, which is you tweet the CEO. 208 00:11:29,280 --> 00:11:31,160 This guy is the CEO of Charles Schwab. 209 00:11:31,440 --> 00:11:33,620 And I didn't know until I tried this. 210 00:11:33,740 --> 00:11:39,240 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, 211 00:11:39,380 --> 00:11:40,280 they will do it. 212 00:11:42,100 --> 00:11:46,380 The problem is everyone else by standing know exactly what's going on by now. 213 00:11:46,900 --> 00:11:48,440 So it's almost a public disclosure. 214 00:11:48,800 --> 00:11:53,820 But they didn't put me in contact with the security manager who told me he called me up after that and he said, 215 00:11:53,900 --> 00:11:56,700 in the first place, if you find something else, don't do this again. 216 00:11:57,320 --> 00:12:00,080 And in the second place, we'll fix that. 217 00:12:00,180 --> 00:12:02,000 It will be coming out pretty soon, which it never did. 218 00:12:02,840 --> 00:12:06,340 But anyway, this is what I found at all these companies. 219 00:12:06,500 --> 00:12:09,440 It seems to me that these companies have a little responsibility, 220 00:12:09,440 --> 00:12:10,960 considering all the money they're handling. 221 00:12:11,220 --> 00:12:18,140 But they don't feel any responsibility to have a bug bounty or even a vulnerability disclosure email or anything. 222 00:12:18,520 --> 00:12:23,800 And three of these banks have privately approached me here at the con and at B-Sides to explain this. 223 00:12:24,020 --> 00:12:28,900 And what they've said is there are lawyers and compliance requirements and PR departments 224 00:12:29,360 --> 00:12:32,520 that all prevent them from talking to anybody. 225 00:12:32,820 --> 00:12:35,420 Only very carefully prepared statements can come out. 226 00:12:35,540 --> 00:12:37,620 That's why I thought no one was listening to me. 227 00:12:37,680 --> 00:12:39,200 I never got anything from Bank of America. 228 00:12:39,440 --> 00:12:42,660 Until a guy came to yell at me at B-Sides to say, why are you putting us down? 229 00:12:42,780 --> 00:12:44,680 He'd be reading all my stuff and looking at my web page. 230 00:12:44,840 --> 00:12:45,980 But they can't talk to me. 231 00:12:46,100 --> 00:12:48,560 They can't get clearance to communicate back to me. 232 00:12:48,880 --> 00:12:53,280 So I think it appears to me that they are still pretending that they have no security problems. 233 00:12:53,640 --> 00:12:56,300 And they think their customers imagine they have no security problems. 234 00:12:56,880 --> 00:13:01,400 Or at the very least, they want to be very, very careful in what they release about security problems. 235 00:13:01,500 --> 00:13:04,740 They don't appear to have a problem and don't think they've been hacked or something. 236 00:13:04,980 --> 00:13:07,780 So anyway, he told me they're absolutely not going to fix this at Bank of America. 237 00:13:07,920 --> 00:13:08,760 They don't think this matters. 238 00:13:08,760 --> 00:13:11,180 They think it's perfectly fine that people can alter their app. 239 00:13:11,340 --> 00:13:14,240 But they do care at Chase and they care at Wells Fargo. 240 00:13:14,340 --> 00:13:15,640 And they actually fixed this problem. 241 00:13:15,780 --> 00:13:16,460 And so did M&T. 242 00:13:18,760 --> 00:13:19,400 All right. 243 00:13:21,180 --> 00:13:22,120 And here's one. 244 00:13:22,780 --> 00:13:24,900 TD Ameritrade gets a special prize. 245 00:13:25,340 --> 00:13:28,880 I wrote a Trojan in their app to log the password. 246 00:13:29,040 --> 00:13:29,840 I notified them. 247 00:13:29,920 --> 00:13:34,880 So they changed their own program so that it now logs the password in addition. 248 00:13:35,360 --> 00:13:36,720 So I don't have Trojan anymore. 249 00:13:37,040 --> 00:13:38,740 I've heard a completely misunderstood thing. 250 00:13:38,760 --> 00:13:40,400 So let me just start with that one. 251 00:13:40,500 --> 00:13:41,740 That's probably a good thing to be a demo. 252 00:13:42,140 --> 00:13:42,780 So here. 253 00:13:43,260 --> 00:13:44,220 Let's look at the log. 254 00:13:45,920 --> 00:13:47,900 There's the log of this Android phone. 255 00:13:50,120 --> 00:13:52,240 And here's this TD Ameritrade app. 256 00:13:52,660 --> 00:13:59,540 So if I log in with DEFCON user and complete idiot. 257 00:14:01,500 --> 00:14:02,420 I log in. 258 00:14:02,740 --> 00:14:05,640 This is the unmodified TD Ameritrade app. 259 00:14:06,300 --> 00:14:06,780 Um. 260 00:14:08,460 --> 00:14:11,700 And so I found out because they updated it. 261 00:14:11,760 --> 00:14:12,720 I got the update. 262 00:14:12,860 --> 00:14:13,720 I tried to Trojan it. 263 00:14:13,800 --> 00:14:15,760 And when I did, there were two copies of the password in the log. 264 00:14:15,840 --> 00:14:16,300 And I said, what? 265 00:14:16,640 --> 00:14:20,840 So anyway, the latest version, they took this out again. 266 00:14:21,020 --> 00:14:23,460 But for about a month this was the current version about two months back. 267 00:14:23,640 --> 00:14:26,240 And that earned them a special place in my classes. 268 00:14:26,360 --> 00:14:27,960 See, I have a policy like this. 269 00:14:28,040 --> 00:14:30,040 When I find stuff, I notify the developer. 270 00:14:30,220 --> 00:14:34,300 If they don't talk to me for a month, I figure it's open season to use them for homework. 271 00:14:34,300 --> 00:14:40,280 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. 272 00:14:40,620 --> 00:14:41,860 And my students worked on that. 273 00:14:42,060 --> 00:14:43,360 But now I don't do that anymore. 274 00:14:43,480 --> 00:14:44,560 Now we use real apps. 275 00:14:44,820 --> 00:14:51,100 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. 276 00:14:51,480 --> 00:14:52,840 So let's play with a few more of these. 277 00:14:53,240 --> 00:14:54,560 Here's one that really is entertaining. 278 00:14:56,640 --> 00:14:57,040 Stitcher. 279 00:14:57,420 --> 00:14:58,860 We can crowd source this one. 280 00:14:58,960 --> 00:15:00,320 Stitcher is some kind of music app. 281 00:15:01,120 --> 00:15:02,440 And I don't really know what they do. 282 00:15:02,940 --> 00:15:04,280 But it's entertaining how they do it. 283 00:15:04,280 --> 00:15:07,140 Let me first run this through a proxy. 284 00:15:07,560 --> 00:15:10,160 So that's source code modification vulnerabilities. 285 00:15:10,660 --> 00:15:13,900 There's another category of vulnerability, which is how your network traffic goes. 286 00:15:14,500 --> 00:15:16,940 And so for that, I would like to send that through burp. 287 00:15:17,080 --> 00:15:20,480 Burp is, of course, the popular proxy used by pretty much everybody. 288 00:15:21,500 --> 00:15:24,320 You have to put that address in as a proxy server. 289 00:15:25,960 --> 00:15:28,440 I'll fill that in here in my Android phone. 290 00:15:34,620 --> 00:15:36,080 A manual proxy. 291 00:15:36,680 --> 00:15:38,240 And all I need is the address. 292 00:15:40,140 --> 00:15:45,200 10.104.170.72. 293 00:15:47,420 --> 00:15:48,020 Okay. 294 00:15:48,220 --> 00:15:50,560 So now this is interesting. 295 00:15:50,740 --> 00:15:58,460 What happened here is Carnegie Mellon wanted to see if apps break SSL security by not checking their certificate. 296 00:15:58,760 --> 00:16:02,340 So they wrote, first they built a special router with Raspberry Pi, 297 00:16:02,340 --> 00:16:07,960 which was a device which would catch the network traffic and forge HTTPS certificates that would be wrong. 298 00:16:08,260 --> 00:16:13,000 They needed to be from an untrusted authority or outside the date range or for the wrong domain name. 299 00:16:13,160 --> 00:16:15,540 And then they connected a phone emulator to it. 300 00:16:15,600 --> 00:16:21,360 And they wrote an emulated program that would click the buttons on the app to just make it do something and create some traffic. 301 00:16:21,560 --> 00:16:27,100 Then they would automatically detect if HTTPS had been ‑‑ connections had been made through the man in the middle attack, 302 00:16:27,300 --> 00:16:28,480 which should not be possible. 303 00:16:28,680 --> 00:16:31,900 And if they were, they would automatically e‑mail the developer of the app 304 00:16:32,340 --> 00:16:33,200 and say your app is not secure. 305 00:16:33,520 --> 00:16:35,440 They tested the entire Google Play store. 306 00:16:35,720 --> 00:16:37,580 I think it was 100,000 apps at that time. 307 00:16:37,720 --> 00:16:39,620 And they found 33,000 of them vulnerable. 308 00:16:39,800 --> 00:16:40,780 And notified them. 309 00:16:41,220 --> 00:16:43,280 And I thought they found them all. 310 00:16:43,400 --> 00:16:46,100 But I've been finding a lot that Carnegie Mellon missed. 311 00:16:46,280 --> 00:16:47,320 And I don't understand why. 312 00:16:47,440 --> 00:16:50,820 Because they don't have a human smart enough to fill out the form and log in and stuff. 313 00:16:50,920 --> 00:16:54,020 They just have some automated process trying to press buttons in the app. 314 00:16:54,720 --> 00:16:59,280 And the other thing that occurred to me is this is ‑‑ I'm abusing this product. 315 00:16:59,720 --> 00:17:01,300 The correct way to use Burke. 316 00:17:02,340 --> 00:17:07,620 You export the certificate from Burke and import it onto the phone so it becomes a trusted certificate authority. 317 00:17:08,080 --> 00:17:13,660 And then you can audit HTTPS packets as they go by because your phone will trust Burke. 318 00:17:13,940 --> 00:17:15,720 But I did not install the certificate. 319 00:17:16,180 --> 00:17:17,920 And yet I'm running traffic through here. 320 00:17:18,040 --> 00:17:20,460 So now I'm using Burke as a man in the middle attack tool. 321 00:17:20,780 --> 00:17:24,820 Any secure connections that pass through the Burke will be given a forged certificate. 322 00:17:25,240 --> 00:17:29,940 So if I open up a browser, and let me just cancel this one. 323 00:17:29,940 --> 00:17:32,320 Go up and just load AOL in the first place. 324 00:17:32,560 --> 00:17:34,460 In fact, XQCD is one someone told me about. 325 00:17:34,680 --> 00:17:34,840 Good. 326 00:17:34,860 --> 00:17:35,080 Okay. 327 00:17:35,800 --> 00:17:37,360 If I ever get this thing to knock it off. 328 00:17:38,340 --> 00:17:38,960 All right. 329 00:17:39,300 --> 00:17:40,160 Let me try this. 330 00:17:41,380 --> 00:17:42,420 Because we're going to get there. 331 00:17:48,980 --> 00:17:49,940 I can't find it. 332 00:17:49,980 --> 00:17:50,140 All right. 333 00:17:50,140 --> 00:17:51,780 I'll just settle for what I've got here rather than struggle. 334 00:17:53,260 --> 00:17:57,340 The point is you'll see these security warnings whenever it tries to make a secure connection. 335 00:17:57,340 --> 00:18:07,040 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. 336 00:18:07,200 --> 00:18:08,820 So this is a secure app. 337 00:18:09,040 --> 00:18:10,420 The browser is secure. 338 00:18:10,660 --> 00:18:14,560 If you try to perform man in the middle attack over HTTP, the browser will catch it. 339 00:18:15,060 --> 00:18:17,060 Now, let's try Stitcher. 340 00:18:18,380 --> 00:18:22,840 Now, Stitcher has a login page somewhere. 341 00:18:24,920 --> 00:18:27,240 Let me just nuke all my old data. 342 00:18:27,340 --> 00:18:27,440 I'll just say here. 343 00:18:31,640 --> 00:18:32,080 Stitcher. 344 00:18:32,220 --> 00:18:32,840 Clear data. 345 00:18:33,080 --> 00:18:33,360 All right. 346 00:18:34,340 --> 00:18:36,100 And for stop, there we go. 347 00:18:36,220 --> 00:18:38,180 Now it will start from the beginning the way I want it to. 348 00:18:38,640 --> 00:18:40,040 I'm going to clear this old stuff. 349 00:18:40,300 --> 00:18:43,760 Now, this one has a different network security problem. 350 00:18:44,960 --> 00:18:46,980 This one sends everything in plain text. 351 00:18:47,560 --> 00:18:51,040 Doesn't even bother to try to use ACTP S. 352 00:18:51,420 --> 00:18:55,280 So I'm going to put in here test at AOL.com. 353 00:18:55,280 --> 00:18:57,680 And down here a password, a password. 354 00:18:58,840 --> 00:18:59,700 And a login. 355 00:19:07,460 --> 00:19:09,060 And I'm not seeing it here. 356 00:19:09,240 --> 00:19:10,840 Pardon me while I try to debug my problem. 357 00:19:11,000 --> 00:19:12,300 Did you people spot it out there? 358 00:19:13,100 --> 00:19:14,560 Did I type in the wrong address here? 359 00:19:17,240 --> 00:19:18,260 The user name? 360 00:19:19,860 --> 00:19:20,700 Wrong user name? 361 00:19:20,800 --> 00:19:21,000 Okay. 362 00:19:21,040 --> 00:19:21,340 Thank you. 363 00:19:21,360 --> 00:19:21,500 Good. 364 00:19:21,560 --> 00:19:22,600 I appreciate your help. 365 00:19:22,820 --> 00:19:25,160 It's much easier to spot errors from down there than up here. 366 00:19:25,420 --> 00:19:25,860 What's wrong? 367 00:19:26,000 --> 00:19:26,880 It doesn't like the user name. 368 00:19:27,280 --> 00:19:27,640 Okay. 369 00:19:27,880 --> 00:19:28,240 Thank you. 370 00:19:28,460 --> 00:19:30,260 I probably have a space at the start of it or something. 371 00:19:31,100 --> 00:19:31,460 Test. 372 00:19:33,320 --> 00:19:34,320 Oh, I remember this. 373 00:19:34,520 --> 00:19:35,720 I think it has to be lower case. 374 00:19:36,200 --> 00:19:38,900 Which is another clue that you're not dealing with geniuses here. 375 00:19:39,080 --> 00:19:39,300 All right. 376 00:19:39,400 --> 00:19:43,360 So there we go. 377 00:19:43,800 --> 00:19:44,160 Okay. 378 00:19:44,260 --> 00:19:51,400 So here it is sending my user name and password up to the 379 00:19:51,500 --> 00:19:51,620 Internet. 380 00:19:51,980 --> 00:19:56,260 Now, the first thing is it's sending it over HTTP, which means there's no encryption at 381 00:19:56,260 --> 00:19:56,380 all. 382 00:19:56,840 --> 00:20:01,460 But the second thing is, notice, if I try to steal the user name and password, the e-mail 383 00:20:01,460 --> 00:20:04,160 is here, but the password appears to be encrypted. 384 00:20:04,580 --> 00:20:06,500 It's this long jumble of random characters. 385 00:20:06,580 --> 00:20:07,520 It's kind of weird. 386 00:20:07,660 --> 00:20:09,260 It doesn't look quite like an MD5 hash. 387 00:20:09,620 --> 00:20:10,720 But they've done something. 388 00:20:10,880 --> 00:20:14,460 So this is a clue that they've probably done something foolish because they didn't use 389 00:20:14,460 --> 00:20:15,260 HTTPS. 390 00:20:15,480 --> 00:20:18,480 They made up their own custom encryption, and that's one of the cardinal rules. 391 00:20:18,640 --> 00:20:19,700 Never roll your own encryption. 392 00:20:20,180 --> 00:20:21,400 But let's see a few people. 393 00:20:21,400 --> 00:20:22,820 How many people can deduce their encryption here? 394 00:20:23,080 --> 00:20:25,760 That looks like a long ‑‑ I tried just a short password. 395 00:20:26,080 --> 00:20:32,800 If I use a password of A and send that up, then it sends up SN. 396 00:20:34,340 --> 00:20:34,840 Okay. 397 00:20:34,900 --> 00:20:38,900 So let's make a little chart here and see if you can deduce the pattern. 398 00:20:41,300 --> 00:20:43,300 So A goes to SN. 399 00:20:45,440 --> 00:20:45,940 Okay. 400 00:20:46,000 --> 00:20:48,900 And B. 401 00:20:49,900 --> 00:20:50,400 Okay. 402 00:20:51,960 --> 00:20:52,740 Here we go. 403 00:20:54,340 --> 00:20:54,960 N to S, O. 404 00:20:54,960 --> 00:20:57,140 Goes to S, O. 405 00:20:59,400 --> 00:21:02,800 Perhaps you are beginning to have a hypothesis about their encryption 406 00:21:02,800 --> 00:21:03,540 routine here. 407 00:21:06,740 --> 00:21:12,720 C goes to SP. 408 00:21:16,180 --> 00:21:20,260 So evidently they're using a Caesar cipher and shifting every letter forward so 409 00:21:20,260 --> 00:21:22,620 somebody faces in the alphabet, but it's a little more than that. 410 00:21:22,760 --> 00:21:23,620 You can't pick on that. 411 00:21:23,700 --> 00:21:39,420 If you use AA, it's now SN5K, and AB will complete this pattern. 412 00:21:43,500 --> 00:21:45,640 AB is SN5L. 413 00:21:47,520 --> 00:21:51,220 So the way it works is every other letter is just fixed. 414 00:21:52,220 --> 00:21:53,260 It's always an S. 415 00:21:53,320 --> 00:21:54,020 This is always a 5. 416 00:21:54,220 --> 00:21:55,840 That's moved forward something like 12 letters. 417 00:21:55,940 --> 00:21:58,160 That's moved forward something like four letters, and that's it. 418 00:21:58,200 --> 00:21:59,160 That's their glorious encryption. 419 00:22:00,040 --> 00:22:01,060 So don't do that. 420 00:22:01,340 --> 00:22:06,240 Anyway, but the point is they're all relying on the fact that both the developers 421 00:22:06,240 --> 00:22:09,120 and the customers aren't looking at all at what's going on here. 422 00:22:09,500 --> 00:22:13,420 Now, GenieMD actually breaks HTTPS, so let me show you that. 423 00:22:13,540 --> 00:22:15,100 This is some kind of medical app. 424 00:22:15,640 --> 00:22:18,380 And it seemed to me like a medical app ought to pay attention to security, 425 00:22:18,620 --> 00:22:19,400 but they did not agree. 426 00:22:19,560 --> 00:22:22,320 They told me that they are not subject to HIPAA compliance law 427 00:22:22,320 --> 00:22:25,540 because the patient installs the app and the patient is not covered, 428 00:22:25,640 --> 00:22:28,620 and therefore they can do any damn thing they want, no matter how stupid it is. 429 00:22:30,440 --> 00:22:33,000 I'm afraid they might be right about that, but they might be wrong. 430 00:22:33,160 --> 00:22:36,820 So if I log in here with tester at AOL.com 431 00:22:37,500 --> 00:22:40,840 and a password of secret password 432 00:22:43,240 --> 00:22:44,280 and sign in, 433 00:22:44,300 --> 00:22:44,800 and sign in, 434 00:22:45,220 --> 00:22:45,620 and sign in, 435 00:22:45,620 --> 00:22:46,880 it's going to send it in a post. 436 00:22:47,980 --> 00:22:49,540 And the post, okay. 437 00:22:52,600 --> 00:22:54,160 Come on, that's what this would be. 438 00:23:01,580 --> 00:23:04,920 I should see it, but I'm not going to struggle too much. 439 00:23:05,380 --> 00:23:05,900 How did it? 440 00:23:06,440 --> 00:23:06,980 Let's see. 441 00:23:08,180 --> 00:23:09,280 Let me try it again. 442 00:23:09,500 --> 00:23:10,540 Let's just add another letter. 443 00:23:11,340 --> 00:23:12,800 A couple of letters at the end. 444 00:23:14,360 --> 00:23:14,800 Okay. 445 00:23:15,860 --> 00:23:16,540 There we are. 446 00:23:16,620 --> 00:23:17,880 Now I think I've got the packet I need. 447 00:23:23,020 --> 00:23:23,540 All right. 448 00:23:23,580 --> 00:23:25,240 Perhaps I've got kicks off the Internet or something. 449 00:23:25,280 --> 00:23:26,640 I'll stick with my pictures of this. 450 00:23:26,920 --> 00:23:30,860 The point is you will see the HTTPS data. 451 00:23:31,260 --> 00:23:32,500 I think I've got that coming up here. 452 00:23:32,520 --> 00:23:32,780 All right. 453 00:23:34,240 --> 00:23:36,340 So I told you already how I Trojaned these apps, 454 00:23:36,440 --> 00:23:37,500 and I did quite a few of these. 455 00:23:38,440 --> 00:23:39,340 Let me go on to that. 456 00:23:40,080 --> 00:23:40,700 I'm not good. 457 00:23:41,460 --> 00:23:43,680 My demo has failed on me. 458 00:23:44,040 --> 00:23:44,960 But rather than... 459 00:23:45,620 --> 00:23:46,000 I don't want to worry about it. 460 00:23:46,040 --> 00:23:46,940 I want to show you something else. 461 00:23:48,500 --> 00:23:50,520 The point is you will see this. 462 00:23:50,740 --> 00:23:51,180 HTTPS. 463 00:23:51,400 --> 00:23:56,440 Now let me point out right now Carnegie Mellon would already warn them because they made 464 00:23:56,440 --> 00:23:59,680 an HTTPS connection through the proxy and that shouldn't have been possible. 465 00:24:00,060 --> 00:24:03,740 Now what they actually sent through it in this case doesn't appear to contain the username 466 00:24:03,740 --> 00:24:07,520 and password in this packet, but they are sent in another packet which for some reason 467 00:24:07,520 --> 00:24:08,560 I failed to capture here. 468 00:24:08,800 --> 00:24:10,560 And it is, in fact, important. 469 00:24:10,860 --> 00:24:13,000 This is where I differ with Carnegie Mellon. 470 00:24:13,040 --> 00:24:15,180 Carnegie Mellon warned them if they had made a technical failure. 471 00:24:15,180 --> 00:24:20,060 I only notify them if there's a real business cost, like I see a password pass through. 472 00:24:20,380 --> 00:24:25,340 Anyway, let me move on to types of Trojans. 473 00:24:25,780 --> 00:24:27,380 So I Trojaned a lot of these apps. 474 00:24:27,580 --> 00:24:30,780 And I found four different types of places to put a Trojan. 475 00:24:31,720 --> 00:24:33,480 The simplest one is Schwab. 476 00:24:33,740 --> 00:24:36,680 Schwab just has a username and password sitting in a parameter. 477 00:24:37,140 --> 00:24:38,860 So I put it in a parameter here. 478 00:24:39,240 --> 00:24:40,600 And if you log in... 479 00:24:41,180 --> 00:24:42,180 Yeah, yeah, that's fine. 480 00:24:42,260 --> 00:24:42,980 Let Schwab stop. 481 00:24:43,540 --> 00:24:43,980 Okay. 482 00:24:45,520 --> 00:24:47,540 So if I go here... 483 00:24:47,540 --> 00:24:47,920 Oh. 484 00:24:48,740 --> 00:24:49,940 Let me get rid of the proxy. 485 00:24:50,260 --> 00:24:54,260 I'm still going through burp and that will slow down or perhaps even stop some of those 486 00:24:55,140 --> 00:24:56,180 apps from launching. 487 00:24:57,400 --> 00:24:58,060 There we go. 488 00:24:58,240 --> 00:25:02,100 So Schwab, I can log in here. 489 00:25:02,840 --> 00:25:12,580 If I log in with A and B, then you see the username and password are in the log. 490 00:25:12,700 --> 00:25:15,100 Now that's not because Schwab was stupid enough to put it there. 491 00:25:15,100 --> 00:25:17,980 That's because I was able to modify their app to put it there. 492 00:25:18,120 --> 00:25:21,700 But otherwise it works and looks normal, and that's a dangerous thing. 493 00:25:23,140 --> 00:25:24,700 Now, that's one type of Trojan. 494 00:25:25,100 --> 00:25:25,840 Citibank is another. 495 00:25:26,260 --> 00:25:32,680 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. 496 00:25:32,940 --> 00:25:40,540 So this one, if I give it, say, C, C, C, C, C, C, C, and D, then you sign into here. 497 00:25:40,740 --> 00:25:42,440 You see a whole lot of data go by. 498 00:25:42,440 --> 00:25:47,780 And if you scroll up, what these are are all the parameters in the HTTPS message. 499 00:25:48,260 --> 00:25:53,140 What I did was Trojan the HTTP routine that creates parameters. 500 00:25:53,440 --> 00:26:01,060 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. 501 00:26:01,500 --> 00:26:06,080 So it's another place to Trojan that if you can't find the password handled by itself. 502 00:26:06,540 --> 00:26:11,240 And another one, there were four cases that I thought were kind of interesting, was Capital One. 503 00:26:11,240 --> 00:26:14,580 Capital One has something called the secure user input. 504 00:26:15,380 --> 00:26:16,940 And this is left over from last time. 505 00:26:17,000 --> 00:26:17,980 Let me just get rid of this stuff. 506 00:26:18,740 --> 00:26:19,140 Okay. 507 00:26:19,960 --> 00:26:27,100 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. 508 00:26:27,360 --> 00:26:30,720 But it does capture the key presses, and you can get the key code. 509 00:26:31,100 --> 00:26:35,960 So if I type A, B, C, D, you see these numbers, 29, 30, 31. 510 00:26:36,140 --> 00:26:40,800 Those are Google Android physical key codes. 511 00:26:41,240 --> 00:26:43,120 They're not ASCII, but they're close to it. 512 00:26:43,160 --> 00:26:44,920 You have to go to the Google website to find them. 513 00:26:45,080 --> 00:26:45,780 There's a key. 514 00:26:45,980 --> 00:26:46,980 Every key has a number. 515 00:26:47,060 --> 00:26:50,080 So I can key log the password letter by letter here. 516 00:26:50,240 --> 00:26:52,960 P, A, S, S, W, O, R, D. 517 00:26:53,080 --> 00:26:54,960 You just have to translate them back. 518 00:26:55,800 --> 00:26:58,780 And the last type that I found was the Bancorp. 519 00:26:59,760 --> 00:27:00,860 Let me back this up. 520 00:27:02,340 --> 00:27:05,340 Bancorp also does not ever store the password in a single variable. 521 00:27:05,760 --> 00:27:07,760 But what it does, that did it backwards. 522 00:27:07,900 --> 00:27:08,460 I'm going to do it forwards. 523 00:27:08,580 --> 00:27:09,900 You can type in your user ID here. 524 00:27:11,120 --> 00:27:15,720 And see, it's slowly accumulating characters into a variable, 525 00:27:16,420 --> 00:27:18,540 which it doesn't store in a way I can steal it, 526 00:27:18,540 --> 00:27:20,920 but you can steal the characters one by one, 527 00:27:21,040 --> 00:27:22,500 and you get this accumulation here. 528 00:27:22,640 --> 00:27:24,660 So it's easy enough to approach in any of them. 529 00:27:25,180 --> 00:27:29,040 And let me show you the workshop I just taught here, 530 00:27:29,140 --> 00:27:33,320 because it shows the things that are easily done. 531 00:27:33,760 --> 00:27:35,140 Let me go back to this one. 532 00:27:36,240 --> 00:27:37,740 And this one. 533 00:27:39,140 --> 00:27:40,100 All right. 534 00:27:40,120 --> 00:27:43,440 So this is what I gave my students. 535 00:27:43,600 --> 00:27:45,520 Look at the log like you did. 536 00:27:46,420 --> 00:27:48,740 And then we looked at broken SSLs. 537 00:27:49,400 --> 00:27:50,480 Then modify some apps. 538 00:27:50,880 --> 00:27:51,520 You can try these. 539 00:27:52,120 --> 00:27:57,360 I wrote a program that is nothing more than a Python script that does two search and replaces. 540 00:27:57,760 --> 00:28:02,120 But what it does is add a Trojan to every single module in the entire app. 541 00:28:02,360 --> 00:28:05,940 So if you do that, then the app, the log is just screaming by. 542 00:28:05,940 --> 00:28:09,700 Because if you can't find something like password or user name with grep, 543 00:28:09,840 --> 00:28:11,740 you can do that and then run the app, 544 00:28:11,940 --> 00:28:14,680 and when you press log in, see which method was called. 545 00:28:15,520 --> 00:28:18,800 So that's one way to find things if you're not having luck finding it the other way. 546 00:28:19,000 --> 00:28:20,880 And none of this should be possible. 547 00:28:21,140 --> 00:28:22,020 This is all ridiculous. 548 00:28:22,440 --> 00:28:24,320 There are plenty of products available to prevent it, 549 00:28:24,340 --> 00:28:25,860 and these guys just don't bother to use them. 550 00:28:26,120 --> 00:28:27,280 They don't take it seriously. 551 00:28:27,640 --> 00:28:31,220 So let me point out for orientation the OWASP top ten. 552 00:28:31,440 --> 00:28:32,440 Here's the Momo top ten. 553 00:28:32,520 --> 00:28:34,040 OWASP is the Bible of this stuff. 554 00:28:34,040 --> 00:28:36,220 So these are the things you should not do. 555 00:28:36,340 --> 00:28:38,800 Now the one I've been talking about is lack of binary protections. 556 00:28:39,300 --> 00:28:42,800 That's when you let somebody see your source code and mess with your source code. 557 00:28:43,220 --> 00:28:46,460 It's generally not a good idea, and there are products out there to prevent it. 558 00:28:47,380 --> 00:28:49,200 ProGuard is trying to prevent it very badly. 559 00:28:49,420 --> 00:28:53,400 There's a product called Dash O that does a much better job of obfuscating code. 560 00:28:53,640 --> 00:28:57,040 And there's another product called Arxan, which is very expensive, 561 00:28:57,140 --> 00:29:00,220 and they won't even talk to me or give me a free trial, so I can't test it. 562 00:29:00,300 --> 00:29:04,020 But they claim that they cover your app in layers of protection. 563 00:29:04,040 --> 00:29:07,820 To prevent app modification and have internal checks to see, 564 00:29:07,940 --> 00:29:08,580 have you used it? 565 00:29:08,660 --> 00:29:12,220 You look like you're able to bypass it. 566 00:29:13,400 --> 00:29:14,140 But you think so. 567 00:29:15,560 --> 00:29:15,920 Okay. 568 00:29:16,000 --> 00:29:17,200 Well, I see some doubt out there. 569 00:29:17,360 --> 00:29:18,000 It may be true. 570 00:29:18,040 --> 00:29:19,780 I wish I could have it and play with it and see. 571 00:29:20,200 --> 00:29:22,780 Anyway, all these things are technically security through obscurity, 572 00:29:22,880 --> 00:29:26,060 but they're trying to get you down to where you'd be with a binary compiled code. 573 00:29:26,460 --> 00:29:28,960 So the only thing to look here is lack of binary protections, 574 00:29:29,340 --> 00:29:31,080 and insufficient transport layer protection, 575 00:29:31,360 --> 00:29:33,080 either plain text or some broken SSL 576 00:29:33,080 --> 00:29:35,200 or some nonsense like a Caesar cipher. 577 00:29:35,360 --> 00:29:36,420 That's what I would call insufficient. 578 00:29:36,840 --> 00:29:39,060 But also insufficient secure data storage. 579 00:29:39,500 --> 00:29:42,180 They often store your password in plain text on the device, 580 00:29:42,420 --> 00:29:44,800 which is a bad idea because someone could steal your device, 581 00:29:45,060 --> 00:29:46,120 root it, and get the password. 582 00:29:47,860 --> 00:29:48,500 All right. 583 00:29:49,580 --> 00:29:50,700 So let me go down here. 584 00:29:50,960 --> 00:29:52,020 We talked about them. 585 00:29:53,400 --> 00:29:54,080 All right. 586 00:29:54,540 --> 00:29:56,980 Now, people have sometimes told me, 587 00:29:57,040 --> 00:29:59,100 like the Bank of America security officer, 588 00:29:59,260 --> 00:30:00,360 that this does not matter. 589 00:30:00,420 --> 00:30:01,600 It's not under active attack. 590 00:30:01,780 --> 00:30:02,860 Nothing bad is going to happen. 591 00:30:02,860 --> 00:30:04,800 And they say it may not be under active attack right now, 592 00:30:04,960 --> 00:30:06,300 but it was in 2011, 593 00:30:07,000 --> 00:30:09,460 is when Droid Dream infected a bunch of apps 594 00:30:09,460 --> 00:30:10,920 and they went right into Google Play Store. 595 00:30:11,240 --> 00:30:15,560 Now, Google has been trying to supervise the junk in their store better. 596 00:30:15,760 --> 00:30:18,160 And they're improving, but they're nowhere near where Apple is. 597 00:30:18,560 --> 00:30:22,180 And even if they were to clean out their store, 598 00:30:22,640 --> 00:30:24,800 people can load apps that are not from the store. 599 00:30:25,300 --> 00:30:26,340 So it's kind of strange. 600 00:30:26,600 --> 00:30:28,160 But anyway, Google has been gradually improving 601 00:30:28,800 --> 00:30:31,240 their ability to screen malware out of the store. 602 00:30:31,380 --> 00:30:32,460 But even now, 603 00:30:32,860 --> 00:30:34,400 here's antivirus products for Android. 604 00:30:34,540 --> 00:30:35,660 Here's how effective they are. 605 00:30:35,780 --> 00:30:37,840 Here's the Google Play Store scanner. 606 00:30:38,180 --> 00:30:40,680 And the same thing, of course, is true of Microsoft's antivirus. 607 00:30:40,880 --> 00:30:41,760 It's just garbage. 608 00:30:41,860 --> 00:30:43,120 It's not even compared to the others. 609 00:30:43,260 --> 00:30:44,500 And even Microsoft admits it. 610 00:30:44,960 --> 00:30:45,820 I don't know why. 611 00:30:45,940 --> 00:30:47,580 The people that write the OS can't write the defense. 612 00:30:47,780 --> 00:30:49,620 But it seems to still be the case that they can't. 613 00:30:51,500 --> 00:30:53,000 So you can prevent these things. 614 00:30:53,240 --> 00:30:56,100 You cannot store secrets on the client side, 615 00:30:56,280 --> 00:30:57,040 so they can't be stolen. 616 00:30:57,200 --> 00:30:59,200 You can opposite your source code with a variety of products. 617 00:30:59,600 --> 00:31:00,760 Dash O does this. 618 00:31:00,920 --> 00:31:02,000 It changes all the variables 619 00:31:02,000 --> 00:31:03,740 to these long garbled messes. 620 00:31:03,820 --> 00:31:04,800 And that would stop me. 621 00:31:04,940 --> 00:31:05,940 But I'm a very weak attacker. 622 00:31:06,320 --> 00:31:07,740 If I can't search for password, 623 00:31:07,880 --> 00:31:09,980 you can still get in with some kind of automated process 624 00:31:09,980 --> 00:31:11,580 that prints out every variable 625 00:31:11,580 --> 00:31:13,420 and then hunt through it for the password you typed in. 626 00:31:13,620 --> 00:31:14,920 But it would be a lot more work. 627 00:31:16,000 --> 00:31:17,480 That's 2,000 bucks for that one. 628 00:31:18,960 --> 00:31:20,140 So the broken SSL, 629 00:31:20,660 --> 00:31:21,520 the first thing I did, 630 00:31:21,600 --> 00:31:24,180 this was the Carnegie Mellon project. 631 00:31:24,420 --> 00:31:26,160 They found 23,000 vulnerable apps. 632 00:31:26,320 --> 00:31:28,240 And I went to look to see how many of those apps 633 00:31:28,240 --> 00:31:29,940 are still vulnerable seven months later. 634 00:31:30,300 --> 00:31:31,560 Because they published a spreadsheet 635 00:31:32,000 --> 00:31:33,260 of these 23,000 vulnerable apps. 636 00:31:33,440 --> 00:31:35,420 And the thing about me is I don't want to bring 637 00:31:35,420 --> 00:31:37,920 infamy on my college by just dumping apps, 638 00:31:38,040 --> 00:31:39,860 phones without notifying people first. 639 00:31:40,320 --> 00:31:42,180 So I want, this time, 640 00:31:42,240 --> 00:31:44,120 Carnegie Mellon notified them seven months ago 641 00:31:44,120 --> 00:31:46,100 so I don't have to go through responsible disclosure. 642 00:31:46,640 --> 00:31:47,460 I've just tested. 643 00:31:47,520 --> 00:31:49,140 So I tested to see how many of them are still vulnerable. 644 00:31:49,360 --> 00:31:50,360 And a lot of them were. 645 00:31:50,480 --> 00:31:53,100 Like PixArt with 100 million downloads was still vulnerable. 646 00:31:53,720 --> 00:31:55,600 And one thing that's really kind of fun 647 00:31:56,080 --> 00:31:56,640 is the 648 00:32:00,380 --> 00:32:03,920 is apps that do harm to services you wouldn't expect. 649 00:32:05,560 --> 00:32:06,520 Like Foxit. 650 00:32:07,020 --> 00:32:09,300 Foxit was the mobile PDF reader for Android. 651 00:32:09,680 --> 00:32:11,460 And their Android Foxit reader, 652 00:32:11,680 --> 00:32:13,640 this is the page I sent to Foxit. 653 00:32:13,740 --> 00:32:14,420 Or I didn't. 654 00:32:14,460 --> 00:32:16,040 In this case, I did not have to notify them 655 00:32:16,040 --> 00:32:17,080 because they had already been notified. 656 00:32:17,420 --> 00:32:18,420 But if I run Burp, 657 00:32:18,460 --> 00:32:20,360 they have HTTPS and you see the password, 658 00:32:20,600 --> 00:32:21,560 any email address, 659 00:32:22,420 --> 00:32:24,740 going to an untrusted man in the middle attack 660 00:32:24,740 --> 00:32:26,300 over HTTPS. 661 00:32:26,300 --> 00:32:26,620 Because if I run Burp, 662 00:32:26,640 --> 00:32:28,540 they just don't bother to check the certificate. 663 00:32:29,300 --> 00:32:31,660 But then Foxit has the feature 664 00:32:31,660 --> 00:32:32,860 not only to view PDFs 665 00:32:33,620 --> 00:32:35,060 but to share them with other services. 666 00:32:35,500 --> 00:32:37,140 And instead of using the default 667 00:32:37,740 --> 00:32:39,000 operations of the Android 668 00:32:39,000 --> 00:32:39,780 to log in, 669 00:32:39,880 --> 00:32:41,660 they use their own broken implementation 670 00:32:41,660 --> 00:32:43,360 for all those logins too. 671 00:32:43,880 --> 00:32:45,540 I found several apps that do this. 672 00:32:45,800 --> 00:32:48,660 So Foxit loses not only its own credentials, 673 00:32:48,860 --> 00:32:50,680 it loses your Dropbox credentials, 674 00:32:51,080 --> 00:32:52,220 your Box credentials, 675 00:32:52,800 --> 00:32:54,320 your Microsoft credentials, 676 00:32:54,960 --> 00:32:56,620 and your Google credentials. 677 00:32:56,640 --> 00:32:58,920 Which I think is pretty damn thick 678 00:32:58,920 --> 00:33:00,400 when Google will put something 679 00:33:00,400 --> 00:33:01,800 in the Google Play Store 680 00:33:01,800 --> 00:33:03,140 that leaks out your Google password. 681 00:33:03,420 --> 00:33:04,640 It seems to me like they should 682 00:33:04,640 --> 00:33:05,560 at least care about that. 683 00:33:07,100 --> 00:33:09,080 Anyway, after this hit the press, 684 00:33:09,580 --> 00:33:10,860 Foxit did in fact fix it 685 00:33:10,860 --> 00:33:12,260 and so did SnapSecure 686 00:33:12,260 --> 00:33:13,380 that makes a security device 687 00:33:13,380 --> 00:33:14,480 you put on your Android phone 688 00:33:14,480 --> 00:33:16,180 and it also broke HTTPS. 689 00:33:16,280 --> 00:33:17,220 And that's pretty embarrassing 690 00:33:17,220 --> 00:33:18,060 when your security product 691 00:33:18,060 --> 00:33:19,440 does a dumb thing like that. 692 00:33:26,640 --> 00:33:27,340 And when you log in, 693 00:33:27,420 --> 00:33:29,160 it sends it over broken HTTPS 694 00:33:29,160 --> 00:33:30,720 so anybody can see the name 695 00:33:30,720 --> 00:33:32,360 and password passing by. 696 00:33:32,760 --> 00:33:34,140 You could just do a man in the middle 697 00:33:34,140 --> 00:33:35,620 attacking a coffee house and steal it. 698 00:33:36,040 --> 00:33:36,440 Instachat. 699 00:33:37,060 --> 00:33:38,300 OkCupid actually fixed it. 700 00:33:38,780 --> 00:33:39,580 Safeway didn't. 701 00:33:43,220 --> 00:33:44,780 Then it occurred to me 702 00:33:44,780 --> 00:33:46,540 that some of those apps are medical. 703 00:33:47,020 --> 00:33:48,680 Some of those 23,000 apps 704 00:33:48,680 --> 00:33:49,720 found by search are medical. 705 00:33:49,820 --> 00:33:51,260 It seemed to me like they were required 706 00:33:51,260 --> 00:33:52,560 to protect your data 707 00:33:52,560 --> 00:33:54,320 for HIPAA compliance. 708 00:33:54,700 --> 00:33:56,840 So I found 265 vulnerable ones 709 00:33:56,840 --> 00:33:58,100 including this one here, 710 00:33:58,180 --> 00:33:59,680 Lowest Med Corporate Rx. 711 00:34:00,000 --> 00:34:02,000 And I published a page saying 712 00:34:02,000 --> 00:34:03,540 I think these people are violating HIPAA. 713 00:34:03,640 --> 00:34:04,700 Now I'm not a lawyer, 714 00:34:04,840 --> 00:34:07,180 but it seems to me like it says here 715 00:34:07,180 --> 00:34:10,040 that information should be protected 716 00:34:10,040 --> 00:34:12,440 with reasonable technical safeguards 717 00:34:12,440 --> 00:34:14,200 to ensure its confidentiality, 718 00:34:14,200 --> 00:34:14,980 integrity and availability. 719 00:34:15,440 --> 00:34:17,020 And it seems to me that sending them 720 00:34:17,020 --> 00:34:18,200 over the internet in plain text 721 00:34:21,260 --> 00:34:22,200 is a constitutional opinion on the matter. 722 00:34:22,400 --> 00:34:23,700 So I published a page saying 723 00:34:23,700 --> 00:34:25,260 I think these people are violating HIPAA. 724 00:34:25,400 --> 00:34:26,620 And that got some attention. 725 00:34:26,840 --> 00:34:28,860 The people at this company, Lowest Med, 726 00:34:29,020 --> 00:34:30,920 immediately phoned the chancellor of the college 727 00:34:30,920 --> 00:34:32,320 and demanded that page be taken down 728 00:34:32,320 --> 00:34:33,540 and they're going to sue the college 729 00:34:33,540 --> 00:34:34,280 and I should be fired. 730 00:34:34,760 --> 00:34:36,920 And then they said they had to phone my chancellor 731 00:34:36,920 --> 00:34:38,440 because they couldn't find me. 732 00:34:39,060 --> 00:34:41,020 Now some of you might have tried Googling me. 733 00:34:41,100 --> 00:34:42,360 It's not that hard to find me. 734 00:34:42,480 --> 00:34:45,160 But anyway, so they get a phone call 735 00:34:45,160 --> 00:34:46,880 threatening to sue the college. 736 00:34:51,560 --> 00:34:53,200 And they can't take it down. 737 00:34:53,400 --> 00:34:55,220 I put up that page and if you want it down 738 00:34:55,220 --> 00:34:56,120 you've got to talk to me. 739 00:34:56,400 --> 00:34:58,500 Number two, I'm not going to talk to you on the phone. 740 00:34:58,640 --> 00:35:00,120 Send me an email in writing 741 00:35:00,120 --> 00:35:02,860 and I will then forward that to my attorney 742 00:35:02,860 --> 00:35:04,640 and we will draft an appropriate response. 743 00:35:05,180 --> 00:35:06,920 And somehow, when they heard that, 744 00:35:07,120 --> 00:35:08,120 there's no more threats. 745 00:35:08,460 --> 00:35:09,880 Then they just sent me a plight letter saying 746 00:35:09,880 --> 00:35:11,340 we think we're not covered by HIPAA 747 00:35:11,340 --> 00:35:12,200 and so it doesn't matter. 748 00:35:12,680 --> 00:35:14,300 And I said, well okay, I can put that up on the page 749 00:35:14,300 --> 00:35:16,140 as a comment, but suddenly they don't need me fired 750 00:35:16,140 --> 00:35:18,560 and they don't need to sue me when they realize 751 00:35:21,420 --> 00:35:21,800 they're not going to sue me. 752 00:35:21,800 --> 00:35:23,920 Anyway, so a lot of them are out here. 753 00:35:24,020 --> 00:35:26,020 GDMD is one of them, lowest med and so on. 754 00:35:26,180 --> 00:35:28,500 And none of these, this is the dark side of compliance. 755 00:35:28,920 --> 00:35:30,700 I was generally in favor of HIPAA 756 00:35:30,700 --> 00:35:32,520 for a few years ago because it meant 757 00:35:32,520 --> 00:35:33,560 there was someone to talk to. 758 00:35:34,680 --> 00:35:37,240 I found a college that had a HIPAA compliance problem 759 00:35:37,240 --> 00:35:39,460 and there is a HIPAA compliance office. 760 00:35:39,600 --> 00:35:41,540 There is an official form to use to report it 761 00:35:41,540 --> 00:35:43,060 and when you report it, they actually do things. 762 00:35:43,300 --> 00:35:45,160 So I thought compliance is pretty cool. 763 00:35:45,520 --> 00:35:47,460 But now I hit the dark side of compliance. 764 00:35:47,800 --> 00:35:49,340 So when I call GDMD 765 00:35:49,340 --> 00:35:51,040 and I tell them, look, you're attending 766 00:35:51,260 --> 00:35:53,520 confidential information about patient symptoms 767 00:35:53,520 --> 00:35:54,780 and medical appointments and stuff 768 00:35:54,780 --> 00:35:56,640 over the internet in plain text. 769 00:35:56,880 --> 00:35:57,800 What are you, nuts? 770 00:35:58,000 --> 00:36:00,280 They say, we are not covered by HIPAA, 771 00:36:00,360 --> 00:36:01,780 therefore it doesn't matter. 772 00:36:02,420 --> 00:36:04,040 And so, anyway, 773 00:36:04,840 --> 00:36:07,420 it is perhaps useful to observe 774 00:36:07,420 --> 00:36:08,880 that they're using broken 775 00:36:08,880 --> 00:36:11,280 HDP here, but let me point out 776 00:36:11,280 --> 00:36:13,280 one thing, which I think I didn't mention 777 00:36:13,280 --> 00:36:14,920 in this talk yet, which is that this 778 00:36:14,920 --> 00:36:17,280 activity is probably illegal in America. 779 00:36:17,620 --> 00:36:19,220 And that's here. A student told me 780 00:36:19,220 --> 00:36:19,720 about this. 781 00:36:21,260 --> 00:36:22,820 This is when I give this talk at layer one. 782 00:36:23,640 --> 00:36:25,100 Fandango and Credit Karma 783 00:36:25,100 --> 00:36:26,900 were sanctioned by the Federal Trade Commission 784 00:36:26,900 --> 00:36:29,140 last year for doing exactly this. 785 00:36:29,440 --> 00:36:31,080 They broke HTTPS. 786 00:36:31,420 --> 00:36:33,320 And then, in their privacy 787 00:36:33,320 --> 00:36:34,880 policy, they said something like this. 788 00:36:34,960 --> 00:36:37,160 We will take reasonable efforts to keep your information private. 789 00:36:37,360 --> 00:36:38,680 And the FTC swooped in. 790 00:36:38,760 --> 00:36:40,440 Now, I used to work under contract with the FTC 791 00:36:40,440 --> 00:36:42,180 and I know how they operate. They love this. 792 00:36:42,320 --> 00:36:44,200 If you promise $10 and you charge $20, 793 00:36:44,260 --> 00:36:46,240 they say, aha, you didn't do your promise. 794 00:36:46,460 --> 00:36:47,380 And they punish you. 795 00:36:47,780 --> 00:36:50,840 They were not fined, but they were forced 796 00:36:51,260 --> 00:36:52,540 to stop doing it and forced to be audited 797 00:36:52,540 --> 00:36:54,580 for the next 20 years to make sure they don't do it again. 798 00:36:55,020 --> 00:36:56,480 And so, it appears to be 799 00:36:56,480 --> 00:36:59,000 illegal, or close to it, to do this in America. 800 00:36:59,280 --> 00:37:00,900 And that may help convince 801 00:37:00,900 --> 00:37:03,180 some people to care. And it may not. 802 00:37:04,540 --> 00:37:04,940 Anyway, 803 00:37:05,100 --> 00:37:05,920 let me go down here. 804 00:37:07,480 --> 00:37:09,080 That was Louis Med, yeah, trying 805 00:37:09,080 --> 00:37:09,700 to get me fired. 806 00:37:10,360 --> 00:37:12,220 So then I started to test new apps. 807 00:37:13,140 --> 00:37:14,380 My first thought is that 808 00:37:15,120 --> 00:37:16,740 Carnegie Mellon must have found them all. 809 00:37:17,080 --> 00:37:19,060 But when I started just testing random apps, 810 00:37:19,220 --> 00:37:20,420 I found a lot of apps. 811 00:37:21,400 --> 00:37:22,380 And I learned something. 812 00:37:22,500 --> 00:37:25,120 Blue Cross and Blue Shield are not a unified organization. 813 00:37:25,600 --> 00:37:27,060 There's a separate Blue Cross 814 00:37:27,060 --> 00:37:29,480 Blue Shield app for every little township 815 00:37:29,480 --> 00:37:30,480 and district and zone. 816 00:37:30,740 --> 00:37:32,440 And they don't have any uniformity. 817 00:37:32,440 --> 00:37:33,540 They don't all go to the same server. 818 00:37:33,640 --> 00:37:34,620 They don't all look the same. 819 00:37:34,740 --> 00:37:37,540 So everybody gets whoever they want to write their app. 820 00:37:37,920 --> 00:37:40,080 And some of them are good and some of them are bad. 821 00:37:40,240 --> 00:37:41,980 So Blue Cross Blue Shield of North Carolina, 822 00:37:42,180 --> 00:37:44,160 this is a really good web developer. 823 00:37:45,080 --> 00:37:46,460 It leaks Blue Cross credentials. 824 00:37:46,760 --> 00:37:48,480 And by the way, it was one of these 825 00:37:48,480 --> 00:37:50,200 that would also leak Facebook, Twitter, 826 00:37:50,240 --> 00:37:52,320 and YouTube credentials because when you click these links 827 00:37:52,320 --> 00:37:53,800 it would send them through the same buggy app. 828 00:37:54,140 --> 00:37:56,300 And I notified him and he fixed it 829 00:37:56,300 --> 00:37:57,040 in two days. 830 00:37:58,480 --> 00:37:59,920 Which I thought was very impressive. 831 00:38:00,200 --> 00:38:02,080 And that meant I could talk about it at cons 832 00:38:02,080 --> 00:38:03,480 and I don't have to wait for a longer disclosure. 833 00:38:03,620 --> 00:38:06,020 The one thing that kind of puzzles me is 834 00:38:06,760 --> 00:38:08,240 isn't there a higher level of management 835 00:38:08,240 --> 00:38:09,940 that has to do like HIPAA 836 00:38:10,740 --> 00:38:12,060 reporting on these violations 837 00:38:12,060 --> 00:38:14,540 and make an official statement there isn't any? 838 00:38:14,620 --> 00:38:16,620 Okay. I thought management might have to do something. 839 00:38:16,860 --> 00:38:17,460 But anyway, 840 00:38:18,480 --> 00:38:19,140 that's the game there. 841 00:38:19,160 --> 00:38:22,480 I was testing all the insurance companies 842 00:38:22,480 --> 00:38:24,680 and there's a big insurance company called AIG 843 00:38:24,680 --> 00:38:26,100 and they don't have an app. 844 00:38:26,260 --> 00:38:28,880 But there is an app with their name on it 845 00:38:28,880 --> 00:38:30,220 which is the app they use 846 00:38:30,220 --> 00:38:32,180 if you insure your phone itself. 847 00:38:32,740 --> 00:38:33,940 To insure your phone, 848 00:38:34,060 --> 00:38:36,140 you put on their app to keep your phone safe 849 00:38:36,140 --> 00:38:38,140 called AIG Mobile Guard. 850 00:38:39,720 --> 00:38:41,100 And AIG Mobile Guard 851 00:38:41,100 --> 00:38:42,500 is made by a company 852 00:38:42,500 --> 00:38:44,260 that makes mobile superhero 853 00:38:44,260 --> 00:38:46,080 and it causes you to make a pin 854 00:38:46,080 --> 00:38:47,900 and then it stores the pin in plain text 855 00:38:48,480 --> 00:38:50,660 in the log and on the phone. 856 00:38:51,680 --> 00:38:52,740 And on the phone 857 00:38:52,740 --> 00:38:54,500 it stores your security answer, 858 00:38:54,680 --> 00:38:55,680 your mother's maiden name, 859 00:38:56,140 --> 00:38:57,980 security question, your pin, 860 00:38:58,160 --> 00:38:59,260 all in plain text locally. 861 00:38:59,860 --> 00:39:01,260 So I contacted them. 862 00:39:01,340 --> 00:39:02,800 By the way, this is a fun thing. 863 00:39:02,880 --> 00:39:03,500 You should try this. 864 00:39:03,680 --> 00:39:08,480 It's very easy to find your own phones 865 00:39:09,140 --> 00:39:10,300 with these simple tests. 866 00:39:10,780 --> 00:39:11,960 I went through the other products 867 00:39:11,960 --> 00:39:12,660 from the same company 868 00:39:12,660 --> 00:39:13,720 and they all have the same problem. 869 00:39:13,840 --> 00:39:15,220 Mobile superhero, Virgin Mobile, 870 00:39:18,480 --> 00:39:19,020 they all have the same problem 871 00:39:19,020 --> 00:39:20,620 and most of them have been removed. 872 00:39:21,120 --> 00:39:22,760 So when you find one bad app, 873 00:39:22,920 --> 00:39:24,620 go find the other apps from the same developer. 874 00:39:24,840 --> 00:39:26,820 I found seven families of apps so far. 875 00:39:27,100 --> 00:39:28,500 Probably the most important one 876 00:39:28,500 --> 00:39:30,780 was the one that makes the college apps 877 00:39:30,780 --> 00:39:32,380 for all the big colleges 878 00:39:32,380 --> 00:39:33,820 including the US Air Force Academy, 879 00:39:34,300 --> 00:39:35,160 West Point Academy, 880 00:39:35,620 --> 00:39:39,820 and I think one of the other military academies, 881 00:39:39,840 --> 00:39:40,780 the Marine Academy I think. 882 00:39:40,880 --> 00:39:43,580 They all got an app from a company called Stratton 883 00:39:43,580 --> 00:39:45,020 and many other colleges 884 00:39:45,020 --> 00:39:46,940 and all of them broke SSL the same way. 885 00:39:47,160 --> 00:39:48,820 So after I notified about eight or ten of them, 886 00:39:48,900 --> 00:39:50,080 I contacted the developer 887 00:39:50,080 --> 00:39:52,620 and they totally agreed that I was right, 888 00:39:52,700 --> 00:39:54,820 updated their libraries and fixed it in about a month. 889 00:39:54,940 --> 00:39:55,920 Their whole product line. 890 00:39:56,140 --> 00:39:58,020 I've got seven vulnerable product lines I know of. 891 00:39:58,260 --> 00:39:59,820 Some of them haven't yet been noticed 892 00:39:59,820 --> 00:40:02,240 because of the political problems 893 00:40:02,240 --> 00:40:03,580 of teaching this class. 894 00:40:03,940 --> 00:40:05,920 So I taught this class in Texas 895 00:40:05,920 --> 00:40:07,460 about three weeks ago. 896 00:40:08,140 --> 00:40:11,160 It was a week-long class for college teachers 897 00:40:11,160 --> 00:40:12,440 to learn something new in the summer. 898 00:40:12,600 --> 00:40:14,120 So all these college security teachers 899 00:40:15,020 --> 00:40:16,320 had a whole bunch of projects like these here 900 00:40:16,320 --> 00:40:18,520 playing with these apps and seeing how to test them 901 00:40:18,520 --> 00:40:19,660 for simple security problems. 902 00:40:19,860 --> 00:40:22,340 And then they started testing their own apps after that. 903 00:40:23,780 --> 00:40:25,020 And they found 904 00:40:25,020 --> 00:40:26,220 20 new vulnerabilities. 905 00:40:26,580 --> 00:40:27,120 I put them here. 906 00:40:27,300 --> 00:40:29,760 I like to brag about students that do good things. 907 00:40:30,320 --> 00:40:32,040 So they found 20 new vulnerabilities. 908 00:40:32,240 --> 00:40:34,620 Here's a student who found maybe six and so on. 909 00:40:34,800 --> 00:40:37,000 And as I said, go notify these people 910 00:40:37,000 --> 00:40:37,980 and they give them example notification. 911 00:40:38,480 --> 00:40:40,400 But then one of them tested 912 00:40:40,860 --> 00:40:42,660 an app at one of the colleges infected. 913 00:40:42,900 --> 00:40:44,200 One of the colleges involved in this. 914 00:40:45,100 --> 00:40:47,260 When the administrator of the conference 915 00:40:47,260 --> 00:40:48,040 found out about that, 916 00:40:48,100 --> 00:40:49,280 they said you're a terrible person. 917 00:40:49,380 --> 00:40:50,920 We're going to fire you. 918 00:40:50,980 --> 00:40:52,120 We're going to never invite you back. 919 00:40:52,240 --> 00:40:53,160 You can never teach here again 920 00:40:53,160 --> 00:40:54,420 for being such a rotten person. 921 00:40:55,100 --> 00:40:57,400 And the students all said if you throw Sam out, 922 00:40:57,500 --> 00:40:58,600 I'm going to quit too. 923 00:40:59,060 --> 00:41:00,060 So they relented. 924 00:41:00,880 --> 00:41:03,600 But it is the lesson that they got from that 925 00:41:03,600 --> 00:41:05,000 which is unfortunately true. 926 00:41:05,240 --> 00:41:06,740 Which is if you are a college professor, 927 00:41:07,060 --> 00:41:09,480 you find a vulnerability and responsibly report it, 928 00:41:09,500 --> 00:41:10,560 you can get fired. 929 00:41:15,020 --> 00:41:16,140 And that's 40% in my opinion 930 00:41:16,140 --> 00:41:17,840 that some administrator will decide 931 00:41:17,840 --> 00:41:18,880 to fire you for doing that 932 00:41:18,880 --> 00:41:21,020 because they are complete flaming morons. 933 00:41:21,280 --> 00:41:22,880 And the only thing they care about 934 00:41:22,880 --> 00:41:24,160 is that you shouldn't make any waves. 935 00:41:24,580 --> 00:41:27,220 And the original complaint said 936 00:41:27,220 --> 00:41:28,780 I understand what you're doing 937 00:41:28,780 --> 00:41:31,260 but someone stupid might misunderstand it 938 00:41:31,260 --> 00:41:32,560 and you should never do anything 939 00:41:32,560 --> 00:41:34,000 that someone stupid might misunderstand. 940 00:41:35,820 --> 00:41:37,880 Now, I used to be married. 941 00:41:38,100 --> 00:41:39,340 I heard a lot of that 942 00:41:39,340 --> 00:41:40,320 to where I got immune to it. 943 00:41:40,520 --> 00:41:42,000 At the time I was not grateful. 944 00:41:45,020 --> 00:41:47,280 Because people tried to throw the same crap at me 945 00:41:47,280 --> 00:41:49,200 that I dealt with them and now I don't care. 946 00:41:49,580 --> 00:41:50,600 But anyway, 947 00:41:50,820 --> 00:41:51,820 that's total nonsense. 948 00:41:52,100 --> 00:41:53,640 You're supposed to do something that no moron, 949 00:41:53,640 --> 00:41:55,180 no matter how stupid, could possibly misunderstand. 950 00:41:55,680 --> 00:41:57,260 But the point of this is 951 00:41:57,260 --> 00:42:00,820 that money is controlled by complete morons. 952 00:42:01,440 --> 00:42:01,840 And 953 00:42:03,100 --> 00:42:04,480 they're afraid they'll be defunded. 954 00:42:04,600 --> 00:42:05,020 So anyway, 955 00:42:05,840 --> 00:42:07,420 what happened is half of these students 956 00:42:07,420 --> 00:42:09,680 gave the information back to me 957 00:42:09,680 --> 00:42:11,060 and I'm going to have to report them. 958 00:42:11,120 --> 00:42:12,800 They do not want credit for their discoveries 959 00:42:15,020 --> 00:42:15,780 and I'm not going to be able to get them fired. 960 00:42:16,920 --> 00:42:18,760 So I'm objecting about 961 00:42:18,760 --> 00:42:19,900 the political structure of the world. 962 00:42:20,000 --> 00:42:21,160 The colleges are all screwed up 963 00:42:21,160 --> 00:42:22,620 in case that's news to anybody. 964 00:42:22,900 --> 00:42:25,160 And all the big companies are all screwed up. 965 00:42:25,280 --> 00:42:27,580 They don't even let you report vulnerabilities at all. 966 00:42:28,260 --> 00:42:30,260 So I'd really like to see them have bug bounties. 967 00:42:30,980 --> 00:42:31,580 And anyway, 968 00:42:31,780 --> 00:42:33,840 by the way, this is all very simple stuff. 969 00:42:34,060 --> 00:42:36,480 There are Android security auditing products you can get. 970 00:42:36,600 --> 00:42:39,060 The free versions are even lamer than the stuff I'm doing. 971 00:42:39,420 --> 00:42:40,840 But as far as I can tell, 972 00:42:40,960 --> 00:42:42,540 most developers are just writing apps 973 00:42:42,540 --> 00:42:43,340 and throwing them out there 974 00:42:45,020 --> 00:42:45,200 and not doing them at all. 975 00:42:45,420 --> 00:42:48,520 So you would be doing a much better job 976 00:42:48,520 --> 00:42:50,880 if you would just try these very simple tests 977 00:42:50,880 --> 00:42:52,680 on your app before putting it out in the market. 978 00:42:53,080 --> 00:42:54,680 Just see if it breaks HTTPS 979 00:42:54,680 --> 00:42:55,720 or uses plain text. 980 00:42:57,180 --> 00:42:58,140 And by the way, 981 00:42:58,240 --> 00:43:00,500 one last thing that I want to tell you. 982 00:43:00,600 --> 00:43:01,720 I was going to demonstrate it live 983 00:43:01,720 --> 00:43:04,180 but I can't get a wired ethernet connection up here 984 00:43:04,180 --> 00:43:05,060 on short notice. 985 00:43:05,320 --> 00:43:07,960 But you can ignore all this software I've been using 986 00:43:07,960 --> 00:43:09,560 and do this with a real device. 987 00:43:10,220 --> 00:43:11,320 If you have a Mac, 988 00:43:11,540 --> 00:43:13,220 I have exact instructions to do this, 989 00:43:15,020 --> 00:43:15,120 too. 990 00:43:15,380 --> 00:43:17,520 You take internet on Wi-Fi 991 00:43:17,520 --> 00:43:19,520 and you share it out the Bluetooth. 992 00:43:19,980 --> 00:43:22,760 Now you take any real mobile device you like 993 00:43:22,760 --> 00:43:24,400 and connect to the internet 994 00:43:24,400 --> 00:43:25,040 through Bluetooth. 995 00:43:25,460 --> 00:43:27,640 Now all the traffic is passing through the Mac. 996 00:43:28,100 --> 00:43:29,760 Now you run Burp on the Mac 997 00:43:29,760 --> 00:43:32,480 and you use the PF firewall. 998 00:43:33,140 --> 00:43:34,420 The PF firewall 999 00:43:34,420 --> 00:43:37,160 is not IP tables 1000 00:43:37,160 --> 00:43:38,480 but it's a similar kind of firewall 1001 00:43:38,480 --> 00:43:39,160 in the Mac. 1002 00:43:39,340 --> 00:43:41,320 And it is baffling in its complexity 1003 00:43:41,320 --> 00:43:43,420 but to do this simple task, 1004 00:43:45,560 --> 00:43:47,500 you need to make one file 1005 00:43:47,500 --> 00:43:49,260 that says redirect all traffic 1006 00:43:49,260 --> 00:43:50,640 on the bridge 100 network 1007 00:43:50,640 --> 00:43:52,480 which is the internet connection sharing network 1008 00:43:52,960 --> 00:43:53,800 through Burp 1009 00:43:53,800 --> 00:43:56,320 which is 127 001 port 8080 1010 00:43:56,320 --> 00:43:57,940 and another config file 1011 00:43:57,940 --> 00:43:59,480 tells it to use that rules file 1012 00:43:59,480 --> 00:44:01,660 and then you start it with that command. 1013 00:44:02,780 --> 00:44:05,280 So about three command line commands 1014 00:44:05,280 --> 00:44:06,700 cause all the traffic 1015 00:44:06,700 --> 00:44:08,040 that's coming through the shared connection 1016 00:44:08,040 --> 00:44:09,000 to pass through Burp 1017 00:44:09,000 --> 00:44:10,840 and now you can audit real devices. 1018 00:44:10,840 --> 00:44:11,480 Hey there. 1019 00:44:11,820 --> 00:44:13,160 Oh good, just on time anyway. 1020 00:44:13,700 --> 00:44:15,460 So I was gonna do this one live 1021 00:44:15,460 --> 00:44:17,060 and test your apps on your real phones 1022 00:44:17,060 --> 00:44:19,260 but I can't do it due to lack of a wired connection here 1023 00:44:19,260 --> 00:44:20,500 but you can do it 1024 00:44:20,500 --> 00:44:23,360 and I highly encourage you to test your mobile apps. 1025 00:44:23,600 --> 00:44:25,860 And if you want to test random apps out there, 1026 00:44:26,060 --> 00:44:28,060 an incredible number of them are vulnerable. 1027 00:44:28,260 --> 00:44:30,060 Something like 5 to 10% of all the apps 1028 00:44:30,060 --> 00:44:31,680 in the Google Play Store appear to be vulnerable. 1029 00:44:31,900 --> 00:44:32,920 I have found hundreds 1030 00:44:33,340 --> 00:44:35,260 and my students in like two days of testing 1031 00:44:35,260 --> 00:44:37,360 found 20 more and these are big names. 1032 00:44:37,640 --> 00:44:39,880 Major TV networks, major newspapers 1033 00:44:40,840 --> 00:44:41,940 just, it's awful. 1034 00:44:42,980 --> 00:44:44,280 Now only one 1035 00:44:44,720 --> 00:44:47,080 of the top 10 banks, insurance companies 1036 00:44:47,080 --> 00:44:47,680 and 1037 00:44:49,380 --> 00:44:50,460 stock broker apps 1038 00:44:50,460 --> 00:44:51,700 broke SSL. 1039 00:44:51,860 --> 00:44:54,520 They seem to have figured out that breaking SSL is bad up there. 1040 00:44:54,900 --> 00:44:57,480 But if you're not in the stratosphere 1041 00:44:57,980 --> 00:44:59,480 people just seem to comment out 1042 00:44:59,480 --> 00:45:01,020 the SSL verification all the time 1043 00:45:01,020 --> 00:45:01,680 and leave it that way. 1044 00:45:01,900 --> 00:45:03,520 The developers do not seem to understand 1045 00:45:03,520 --> 00:45:04,740 the consequences of what they're doing. 1046 00:45:05,060 --> 00:45:07,880 And there does not seem to be any security auditing process in there. 1047 00:45:08,060 --> 00:45:09,900 Anyway, I think that's all I've got. 1048 00:45:10,840 --> 00:45:11,180 Any questions out there? 1049 00:45:12,520 --> 00:45:12,840 Yeah? 1050 00:45:16,400 --> 00:45:16,800 What's that? 1051 00:45:18,680 --> 00:45:19,880 You want to get the slides you say? 1052 00:45:20,860 --> 00:45:22,440 Yeah, everything is all on my web page. 1053 00:45:22,700 --> 00:45:23,760 And what'll happen is 1054 00:45:25,420 --> 00:45:27,300 you go to samsclassstudyinfo 1055 00:45:27,300 --> 00:45:28,640 and right now 1056 00:45:28,640 --> 00:45:29,680 everything's right on the front 1057 00:45:29,680 --> 00:45:32,820 and in a week or so it'll move to old classes. 1058 00:45:33,440 --> 00:45:34,580 And it's all public domain 1059 00:45:34,580 --> 00:45:35,920 so you can totally use this stuff. 1060 00:45:36,080 --> 00:45:38,760 You can put it in a book, put your name on it, sell it and keep the money. 1061 00:45:38,900 --> 00:45:40,040 You can do any bloody thing you want. 1062 00:45:40,920 --> 00:45:42,420 Except the only thing you can't do 1063 00:45:42,420 --> 00:45:44,100 is if you do something rotten with it 1064 00:45:44,740 --> 00:45:46,640 it'll get you out of jail. 1065 00:45:47,780 --> 00:45:48,220 Yeah? 1066 00:45:48,460 --> 00:45:50,180 You talked a lot about people 1067 00:45:50,180 --> 00:45:51,100 leaking passwords. 1068 00:45:51,520 --> 00:45:53,680 Have you seen other sorts of information? 1069 00:45:54,260 --> 00:45:55,160 Oh yes, yeah. 1070 00:45:55,580 --> 00:45:58,200 I see other things besides passwords 1071 00:45:58,200 --> 00:45:59,760 and yes, if they leak passwords 1072 00:45:59,760 --> 00:46:01,160 they'll leak everything else too. 1073 00:46:01,380 --> 00:46:03,060 That's just the main thing I test for 1074 00:46:03,060 --> 00:46:04,580 just because it's easy to think about. 1075 00:46:04,760 --> 00:46:06,080 But to medical apps in particular 1076 00:46:06,080 --> 00:46:08,760 there's forms where you have your symptoms and your appointments 1077 00:46:11,220 --> 00:46:11,960 Anything else? 1078 00:46:16,020 --> 00:46:16,560 What's that? 1079 00:46:19,200 --> 00:46:19,640 Yeah. 1080 00:46:21,800 --> 00:46:23,980 No, to put the trojans in every module 1081 00:46:23,980 --> 00:46:25,540 all you have to do 1082 00:46:25,540 --> 00:46:27,220 is two search and replaces. 1083 00:46:27,780 --> 00:46:29,600 Every place there is a locals of zero 1084 00:46:29,600 --> 00:46:30,720 you have to make locals one 1085 00:46:30,720 --> 00:46:32,080 so there's room for one variable 1086 00:46:32,080 --> 00:46:34,160 and before the first line of the app 1087 00:46:34,160 --> 00:46:35,360 before the prologue statement 1088 00:46:35,360 --> 00:46:37,380 you put an entry in the log. That's all. 1089 00:46:40,840 --> 00:46:42,320 Well, you know, if you see my code 1090 00:46:42,320 --> 00:46:43,260 you'll just laugh at it. 1091 00:46:43,380 --> 00:46:45,060 It's just two search and replaces. 1092 00:46:45,680 --> 00:46:46,500 That's all it is. 1093 00:46:48,240 --> 00:46:49,580 So it is that easy. 1094 00:46:50,940 --> 00:46:52,380 That's why I'm just amazed. 1095 00:46:52,600 --> 00:46:53,540 I don't do anything difficult 1096 00:46:53,540 --> 00:46:54,920 because anything I do has to boil down 1097 00:46:54,920 --> 00:46:56,400 to a one hour homework assignment eventually 1098 00:46:57,180 --> 00:46:59,540 and it is far, far too easy 1099 00:46:59,540 --> 00:47:00,560 to mess with Android apps. 1100 00:47:02,220 --> 00:47:02,880 Anything else? 1101 00:47:04,260 --> 00:47:05,680 Alright, well I guess I better get out of here 1102 00:47:05,680 --> 00:47:06,740 for the next speaker. Thank you. 1103 00:47:10,840 --> 00:47:11,040 Thank you.