1 00:00:09,140 --> 00:00:10,860 So, I'm Gabrielle. 2 00:00:10,860 --> 00:00:13,860 I'm an Offensive Security Advisor at Desjardins. 3 00:00:14,020 --> 00:00:16,420 And I do different things. 4 00:00:16,420 --> 00:00:20,080 I'm involved in the community, on different advisory boards. 5 00:00:20,080 --> 00:00:22,000 I'm not going to bore you too much with this. 6 00:00:22,000 --> 00:00:24,100 I'm going to go straight to the point. 7 00:00:25,240 --> 00:00:29,460 So, what is Android Application Pen Test? 8 00:00:31,400 --> 00:00:39,790 So, I'm pretty sure everyone here knows what a pen test is. 9 00:00:39,790 --> 00:00:42,930 So, I'm not going to make a definition of this. 10 00:00:43,210 --> 00:00:49,410 So, it's a type of pen test that is part of a list that pen testers usually provide. 11 00:00:49,690 --> 00:00:53,010 And so, most of us are generalists. 12 00:00:53,010 --> 00:00:58,030 But usually we can, you know, get an expertise in something. 13 00:00:58,030 --> 00:01:03,710 And so, we can be network experts, we can be mobile experts. 14 00:01:03,710 --> 00:01:05,050 So, it really depends. 15 00:01:05,150 --> 00:01:14,410 And so, Android app is different from other pen tests because most of the time we will have an executable to analyze. 16 00:01:15,070 --> 00:01:19,490 And so, for example, for web apps, you will have a URL. 17 00:01:19,590 --> 00:01:24,430 But for an external pen test, you will have an IP address. 18 00:01:24,530 --> 00:01:27,970 But for a mobile pen test, we have an executable. 19 00:01:27,970 --> 00:01:31,910 So, we can externalize it or we can dynamically analyze it. 20 00:01:32,410 --> 00:01:36,830 So, yeah, except if you're doing a white box pen test. 21 00:01:36,830 --> 00:01:39,750 So, you will have probably code on other pen tests. 22 00:01:39,750 --> 00:01:41,650 But most of the times, there's not. 23 00:01:41,850 --> 00:01:44,170 Except if you do white box, of course. 24 00:01:50,650 --> 00:01:52,430 So, why? 25 00:01:52,770 --> 00:01:54,450 That's a tough question. 26 00:01:54,690 --> 00:02:04,750 Well, even if Google Play carefully chooses the app for the store, there are still apps that are vulnerable or even dangerous. 27 00:02:04,750 --> 00:02:11,390 Like in July 2022, there was this family of app by Kelly Tech. 28 00:02:11,390 --> 00:02:17,270 It was installed about 3 million times on Android. 29 00:02:17,270 --> 00:02:20,010 And it was a malware family. 30 00:02:20,230 --> 00:02:29,430 So, it was describing users to premium services without them even knowing they were subscribing to premium services. 31 00:02:29,430 --> 00:02:35,790 And it took around six months to Google to remove it from the app stores. 32 00:02:37,290 --> 00:02:42,190 So, that's partly why. 33 00:02:42,190 --> 00:02:50,730 And also, I'm going to tell you what about Android APIs. 34 00:02:50,730 --> 00:02:54,130 So, why do dev use APIs in the first place? 35 00:02:54,130 --> 00:03:02,970 So, for example, it's a very convenient way to access to remote data. 36 00:03:02,970 --> 00:03:10,990 So, for example, if you want a weather forecast, if you want social media platforms, if you want cloud storage services, it's very convenient. 37 00:03:11,450 --> 00:03:19,750 It's also very convenient for third-party integration, like payment gateways or things like this. 38 00:03:19,750 --> 00:03:30,290 If you want to improve your app performance, it's also very convenient because it reduces the amount of data that needs to be transferred between app and server. 39 00:03:30,690 --> 00:03:34,890 And you can also request only the data that you need. 40 00:03:35,510 --> 00:03:39,130 And also, it's a way to avoid code reuse. 41 00:03:39,370 --> 00:03:49,070 So, instead of writing everything from scratch, you just take code that is already made, and it's very convenient, and you will save time and effort. 42 00:03:49,070 --> 00:04:00,410 And it's flexible and scalable, and so it's a way to separate back-end from front-end. 43 00:04:00,630 --> 00:04:06,830 And finally, if you want, you can make your own APIs, and you can monetize them. 44 00:04:07,210 --> 00:04:11,170 So, a lot of very good advantages. 45 00:04:13,210 --> 00:04:18,530 So, here is the Android application pen test process. 46 00:04:18,530 --> 00:04:21,630 So, first we have to define the scope. 47 00:04:21,970 --> 00:04:25,730 And so, we are going to take care of the legal matters. 48 00:04:25,730 --> 00:04:28,790 So, this is going to be the planning phase, the first one, you can see. 49 00:04:28,930 --> 00:04:30,710 Then you have the reconnaissance. 50 00:04:30,710 --> 00:04:34,030 So, it's as usual in a pen test, there is a reconnaissance phase. 51 00:04:34,250 --> 00:04:46,910 Here, what you can do more than in other pen tests is that you can check out on Google Play any infos you can find about the app, and do some reconnaissance on the company. 52 00:04:47,790 --> 00:04:50,810 And so, then you have the static analysis. 53 00:04:50,810 --> 00:04:52,930 So, you are going to look at the code. 54 00:04:53,350 --> 00:04:56,030 You are going to check for specific elements there. 55 00:04:56,030 --> 00:04:59,650 So, I'm going to go a little more in detail in this later. 56 00:04:59,870 --> 00:05:01,910 And then you have the dynamic analysis. 57 00:05:01,910 --> 00:05:06,870 So, you are going to intercept the traffic and look for potential vulnerabilities. 58 00:05:07,190 --> 00:05:15,070 And finally, you have the report phase, where you are going to present and explain the findings you've had. 59 00:05:15,070 --> 00:05:20,270 So, we'll dive into the three here a little later. 60 00:05:24,280 --> 00:05:27,020 So, about the lab... 61 00:05:27,020 --> 00:05:35,800 Okay, the lab installation is probably way bigger than in any other pen test, because you have this huge setup. 62 00:05:35,800 --> 00:05:41,200 And if you have never done this before, it can be a little overwhelming. 63 00:05:41,600 --> 00:05:50,920 So, I'm going to explain also how to set up an Android pen test application lab. 64 00:05:52,660 --> 00:05:54,460 So, what do you need? 65 00:05:56,600 --> 00:06:01,600 So, you will need JADX. 66 00:06:01,600 --> 00:06:05,280 So, JADX is going to be useful to decompile the code for analysis. 67 00:06:05,440 --> 00:06:10,900 You can also use an APK tool, which I really like, because it goes further than JADX. 68 00:06:10,900 --> 00:06:13,480 You can reverse-engineer the APK. 69 00:06:13,480 --> 00:06:20,800 You can make modifications to the code, and then you can put it back into an APK file, which is pretty convenient. 70 00:06:21,320 --> 00:06:23,320 You can also use ADB. 71 00:06:23,320 --> 00:06:28,920 So, you are going to be able to interact with the device or VM. 72 00:06:28,920 --> 00:06:32,160 And in our case, I'm going to show you the setup for a VM. 73 00:06:32,920 --> 00:06:37,500 And you have also Android Studio to create the VM. 74 00:06:37,600 --> 00:06:44,100 And you have Burpsheet to intercept the response and the request, and to analyze the traffic. 75 00:06:48,820 --> 00:06:51,920 So, this is the setup for the lab. 76 00:06:51,920 --> 00:06:52,920 So, how to install. 77 00:06:52,920 --> 00:06:54,820 So, this is made for Ubuntu. 78 00:06:55,140 --> 00:07:01,700 But if you check the resource at the end of the matrix, you will find the info for other systems. 79 00:07:02,340 --> 00:07:04,240 So, for JADX, you need Java. 80 00:07:04,300 --> 00:07:08,840 And you can use the command on the screen to install Java. 81 00:07:08,860 --> 00:07:13,320 And then you just launch it with ./.jadxgui. 82 00:07:14,020 --> 00:07:17,440 For ADB, you can also use the command on the screen. 83 00:07:17,440 --> 00:07:19,280 It's really, really straightforward. 84 00:07:19,340 --> 00:07:25,240 And for APK tool and Android Studio, just go to the links and follow the steps. 85 00:07:25,240 --> 00:07:30,160 Like, the documentation is very good, so you should be all set for this. 86 00:07:33,920 --> 00:07:40,140 So, first now, I'm going to show you a video on how to set up the emulator. 87 00:07:47,730 --> 00:07:51,730 Okay, if it's working... 88 00:07:53,470 --> 00:07:55,170 Okay, perfect. 89 00:08:03,060 --> 00:08:08,200 Okay, so you can go to Android Virtual Device Manager. 90 00:08:08,200 --> 00:08:13,160 And you can click on Add a Virtual Device. 91 00:08:13,400 --> 00:08:16,020 And so you can choose the hardware you want. 92 00:08:16,020 --> 00:08:21,900 So, depending on what hardware you want to use, really. 93 00:08:22,720 --> 00:08:26,500 So, then you choose it, you click Next. 94 00:08:26,500 --> 00:08:29,980 And then you will have to choose a system image. 95 00:08:30,000 --> 00:08:31,560 So, you have to be careful. 96 00:08:31,760 --> 00:08:36,260 In the Android manifest, you will be able to see the API level. 97 00:08:36,720 --> 00:08:45,000 So, this way you can choose the proper API level, so that your application actually works on the device you are going to do. 98 00:08:48,160 --> 00:08:51,520 And you give it a name, and you should be good to go. 99 00:08:56,460 --> 00:09:00,760 So, I had plenty, so I had to take another name. 100 00:09:00,760 --> 00:09:02,380 Like, it's not very creative. 101 00:09:03,680 --> 00:09:05,840 Okay, and then you just click here. 102 00:09:06,000 --> 00:09:08,120 And I'm going to go a little further. 103 00:09:08,120 --> 00:09:09,880 So, it's going to launch. 104 00:09:09,880 --> 00:09:11,180 It takes a little while. 105 00:09:11,180 --> 00:09:15,200 And then you will have a screen that looks like this here. 106 00:09:19,260 --> 00:09:20,060 Okay. 107 00:09:21,180 --> 00:09:25,060 So, next is going to be how to configure BURP. 108 00:09:25,060 --> 00:09:26,660 So, it's another video. 109 00:09:29,700 --> 00:09:36,260 So, you will have to go to proxy options. 110 00:09:36,420 --> 00:09:38,440 You are going to need a certificate. 111 00:09:39,220 --> 00:09:44,260 So, you select DER, but you are going to name it CER. 112 00:09:44,460 --> 00:09:46,900 And you put it in a place where you remember. 113 00:09:54,770 --> 00:09:59,110 Okay, and then you will have it successfully exported. 114 00:09:59,130 --> 00:10:01,890 And you can drag it and drop it in. 115 00:10:02,310 --> 00:10:06,190 You can actually use ADB, but you can also drag and drop. 116 00:10:06,190 --> 00:10:08,230 It's pretty fast and straightforward. 117 00:10:10,430 --> 00:10:14,910 And so, it's going to be in the phone, but you are going to need to install it as well. 118 00:10:14,910 --> 00:10:18,510 So, you have to go to the settings and security. 119 00:10:25,970 --> 00:10:33,810 And then you have to go to the... from... it's like here. 120 00:10:34,470 --> 00:10:36,150 Install from SD card. 121 00:10:36,150 --> 00:10:38,130 So, don't go to download straight away. 122 00:10:38,130 --> 00:10:39,710 Just go to internal storage. 123 00:10:39,710 --> 00:10:44,590 Like, there's a glitch on the video, but it's the one. 124 00:10:44,790 --> 00:10:46,690 And then you go to download. 125 00:10:47,890 --> 00:10:52,730 You give it a name that you will remember afterward. 126 00:10:53,610 --> 00:10:58,390 And you are going to be prompted to make a PIN, so just make a PIN. 127 00:10:59,870 --> 00:11:02,990 So, I always put this off because I don't need it. 128 00:11:02,990 --> 00:11:03,930 It's a VM. 129 00:11:04,870 --> 00:11:08,090 And I put a very safe PIN, as you can see. 130 00:11:15,680 --> 00:11:19,580 And yes, I disabled the notification as well, because it can be... 131 00:11:19,580 --> 00:11:21,320 But everything is installed. 132 00:11:23,520 --> 00:11:26,860 And then we can try to see... 133 00:11:26,860 --> 00:11:33,000 First, we need to go to the burp again. 134 00:11:33,000 --> 00:11:35,560 And to add the interface. 135 00:11:35,560 --> 00:11:38,720 So , you are going to need to bind it to a port. 136 00:11:38,720 --> 00:11:40,720 So, remember which one. 137 00:11:40,720 --> 00:11:44,660 I put 8082, but it can be anything that is not busy. 138 00:11:45,420 --> 00:11:46,880 And all interfaces. 139 00:11:46,880 --> 00:11:51,420 So, this way you will be able to intercept all the traffic on 8082. 140 00:11:52,060 --> 00:11:55,120 And you have to do the setup here. 141 00:11:55,560 --> 00:11:59,480 In the proxy tab, in the settings. 142 00:11:59,620 --> 00:12:02,820 There's a proxy tab, and you change it here. 143 00:12:02,820 --> 00:12:06,540 So, one thing here is to be careful, because you are going to change it. 144 00:12:06,540 --> 00:12:09,660 And the apply button is going to light up. 145 00:12:09,840 --> 00:12:12,400 Don't forget to click it once you have done the changes. 146 00:12:12,400 --> 00:12:17,480 Because if you don't do this, it's not going to remember the changes. 147 00:12:23,030 --> 00:12:25,470 And now we can just check. 148 00:12:25,470 --> 00:12:30,150 So, we check that the intercept is on, and we should be able to intercept traffic. 149 00:12:30,150 --> 00:12:31,610 And that's how it works. 150 00:12:39,620 --> 00:12:41,580 So, that's for... 151 00:12:41,580 --> 00:12:44,380 So, for the example, this is the apps I used. 152 00:12:44,380 --> 00:12:50,300 So, one is called PIVA, which is Purposefully Insecure and Vulnerable Android Application. 153 00:12:50,300 --> 00:12:53,380 And one is called Injured Android. 154 00:12:53,380 --> 00:12:59,620 And so, just a reminder that you need to have the authorization before testing anything. 155 00:13:08,000 --> 00:13:10,720 And next is the static analysis. 156 00:13:10,720 --> 00:13:14,060 So, we are going to check the Android manifest. 157 00:13:14,240 --> 00:13:16,440 And the strings.xml. 158 00:13:16,440 --> 00:13:18,860 We can also enumerate database. 159 00:13:18,860 --> 00:13:22,400 So, there are plenty of tools on GitHub for this purpose. 160 00:13:22,660 --> 00:13:24,980 And, of course, you can check for sensitive data. 161 00:13:24,980 --> 00:13:27,780 Like, I really recommend that you check for sensitive data. 162 00:13:28,200 --> 00:13:33,560 And so, first, I'm going to show you some examples on the Android manifest file. 163 00:13:33,960 --> 00:13:37,820 But before this, I want to show you how to check the code. 164 00:13:38,460 --> 00:13:42,800 So, you can use either JADX or APK tool. 165 00:13:42,800 --> 00:13:44,820 So, if you use JADX... So, this is a command. 166 00:13:44,820 --> 00:13:45,880 We saw it before. 167 00:13:45,880 --> 00:13:49,100 And if you use APK tool, you can use this one. 168 00:13:49,100 --> 00:13:52,600 And you will have the decompiled file that will look like this. 169 00:13:57,490 --> 00:14:04,730 And so, when you want to analyze the code for API endpoints... 170 00:14:05,530 --> 00:14:11,370 So, you can search for keywords like HTTP or HTTPS. 171 00:14:11,370 --> 00:14:16,690 You can look for functions or classes that will handle network requests or responses. 172 00:14:16,690 --> 00:14:18,810 So, I will show you an example later. 173 00:14:18,810 --> 00:14:22,190 You can analyze the manifest file. 174 00:14:22,390 --> 00:14:26,230 So, there are going to be metadata about the app. 175 00:14:26,230 --> 00:14:28,430 You can check for declared permissions. 176 00:14:28,430 --> 00:14:30,930 You can check for service and activities. 177 00:14:30,990 --> 00:14:35,930 You can also look for permissions that are related to network communications. 178 00:14:36,030 --> 00:14:41,290 And you can also analyze GES and AIDL files. 179 00:14:41,290 --> 00:14:48,390 So, if it uses WebView or Android interface definition language, which is AIDL. 180 00:14:48,390 --> 00:14:51,650 So, this is going to be used for inter-process communication. 181 00:14:51,830 --> 00:14:54,730 So, you might find API endpoints in there. 182 00:14:54,930 --> 00:14:59,490 And so, I'm going to show an example in GES also in another slide. 183 00:15:01,790 --> 00:15:04,270 So, this is how it's called. 184 00:15:04,270 --> 00:15:07,990 So, this is really an example of the code. 185 00:15:07,990 --> 00:15:11,110 So, you have here an asynchronous task. 186 00:15:11,110 --> 00:15:12,190 I'm sorry with my accent. 187 00:15:12,190 --> 00:15:13,130 It's awful. 188 00:15:13,430 --> 00:15:14,350 Asynchronous. 189 00:15:14,350 --> 00:15:18,530 And so, that makes a GET request to an API endpoint. 190 00:15:18,530 --> 00:15:20,150 So, what's an asynchronous task? 191 00:15:20,150 --> 00:15:28,230 It's a way to perform a long-running operation in the background without blocking the user interface. 192 00:15:28,230 --> 00:15:31,290 So, for example, say you want to load a large file. 193 00:15:31,490 --> 00:15:34,390 You're going to use an asynchronous task. 194 00:15:36,450 --> 00:15:39,750 So, that's the one. 195 00:15:39,750 --> 00:15:44,250 And then, this is how to fetch the API. 196 00:15:45,390 --> 00:15:52,810 So, here we are going to have an Android app that uses WebView to display a web page. 197 00:15:52,870 --> 00:15:59,190 And so, in the web page, we can see that GES communicates with an API to fetch data. 198 00:15:59,270 --> 00:16:05,210 And so, you have JavaScript code here that calls the fetch data function that you can see here. 199 00:16:05,230 --> 00:16:09,530 And it makes a GET request to an API endpoint. 200 00:16:09,530 --> 00:16:13,330 So, this is api.example.com. 201 00:16:13,330 --> 00:16:15,750 So, it's pretty obvious. 202 00:16:16,290 --> 00:16:20,850 So, now I'm going to show you a fun finding. 203 00:16:23,150 --> 00:16:27,750 Fun for Pentester, but not that fun for developers, I'm afraid. 204 00:16:28,670 --> 00:16:32,670 So, you can find hard-coded secrets. 205 00:16:32,670 --> 00:16:40,210 So, during static analysis phase, you might find hard-coded API keys. 206 00:16:40,210 --> 00:16:42,710 I hope you will find less and less of these. 207 00:16:43,250 --> 00:16:49,730 And so, in this article, we have an example of this in this article on your left. 208 00:16:53,870 --> 00:16:59,270 There are still lots of Android apps that still have hard-coded secrets. 209 00:16:59,270 --> 00:17:07,270 And in the video here that I really recommend you watch, Alyssa Knight found... 210 00:17:07,270 --> 00:17:11,470 She found a private key with a blank password. 211 00:17:11,870 --> 00:17:14,150 So, that's not working either. 212 00:17:14,730 --> 00:17:18,550 So, in the next slide, I'm going to show you an example of an API key. 213 00:17:22,020 --> 00:17:28,280 And this is in Geo.Android, and so they left us a Google API key. 214 00:17:30,700 --> 00:17:36,300 So, you can always check strings for .xml. 215 00:17:36,360 --> 00:17:40,900 So, it's located in slash res slash values. 216 00:17:40,900 --> 00:17:44,300 And this is a nice way to find things like this. 217 00:17:44,300 --> 00:17:46,360 So, here we have an API key. 218 00:17:46,400 --> 00:17:49,660 But it should be stored securely outside of the app. 219 00:17:49,660 --> 00:17:52,520 And if you find this, you have to report it. 220 00:17:53,100 --> 00:17:56,000 It's obvious, but I prefer to say it. 221 00:17:58,590 --> 00:18:06,670 Okay, so here is a quick video to make search with Jadix GUI. 222 00:18:10,870 --> 00:18:13,870 So, you have this little one tool here. 223 00:18:13,870 --> 00:18:19,310 And you can basically check for anything, and you will find everything in here. 224 00:18:21,050 --> 00:18:25,470 But as we are going to see, there are other ways as well. 225 00:18:29,530 --> 00:18:31,030 You can grab it. 226 00:18:31,850 --> 00:18:35,810 I really prefer this method to grab it. 227 00:18:35,990 --> 00:18:41,710 Because sometimes it's really way more simple to make a grab directly in the decompiled code. 228 00:18:41,750 --> 00:18:49,410 So, with APK tool, you probably have all the decompiled it all and everything. 229 00:18:49,410 --> 00:18:53,310 And you can grab it in the folder where you have all the decompiled code. 230 00:18:53,330 --> 00:18:58,190 And also, if you use MobSF, there's a slash uploads directory. 231 00:18:58,190 --> 00:19:03,190 And you will have a lot of code in here. 232 00:19:03,350 --> 00:19:07,570 And so, you can also grab in this directory if you want to. 233 00:19:07,870 --> 00:19:13,490 And if you want more grab commands, you can check out my Git book. 234 00:19:13,490 --> 00:19:18,970 There's a link here with more tips on grab. 235 00:19:25,150 --> 00:19:28,850 Here are some tools for static analysis. 236 00:19:28,850 --> 00:19:34,140 So, Firebase enum is going to let you find Firebase instances. 237 00:19:34,610 --> 00:19:39,290 And Firebase scan is going to check for misconfigurations. 238 00:19:39,310 --> 00:19:43,590 Cloud enum is going to check for cloud instances from different providers. 239 00:19:43,850 --> 00:19:50,150 And it's useful to enumerate database or public resources in the cloud. 240 00:19:50,150 --> 00:19:57,130 And sometimes, just like we saw before, you can find also AWS secret key. 241 00:19:57,130 --> 00:20:01,510 And so, you can try to use it to access resources on AWS. 242 00:20:01,830 --> 00:20:06,170 So, it's really also something that's worth mentioning in the report if you find it. 243 00:20:09,610 --> 00:20:11,970 So, what to check during the dynamic analysis? 244 00:20:11,970 --> 00:20:18,150 So, this is the part where we are going to intercept the traffic with burp and analyze it. 245 00:20:18,150 --> 00:20:23,170 So, this is the phase where we are going to check also for tabjacking. 246 00:20:23,390 --> 00:20:26,930 So, it's a clickjacking equivalent, but in mobile app. 247 00:20:26,930 --> 00:20:31,250 Are you able to capture screens that contain sensitive data? 248 00:20:32,010 --> 00:20:34,430 Also, check the AWS top 10. 249 00:20:34,770 --> 00:20:37,570 But I'm going to show you some examples. 250 00:20:41,580 --> 00:20:48,000 So, first, how to find API endpoint during the dynamic analysis phase? 251 00:20:48,000 --> 00:20:51,900 So, these are pretty common endpoints that we can find. 252 00:20:51,900 --> 00:20:57,280 But you can also fuzz and use a word list with plenty of API endpoints. 253 00:20:57,280 --> 00:21:00,360 This one is just an example, but you can find plenty online. 254 00:21:00,520 --> 00:21:03,500 And I really also recommend the Seqlist repository. 255 00:21:03,500 --> 00:21:04,560 It's very good. 256 00:21:07,820 --> 00:21:17,460 And now, I'm going to show you an example of a vulnerability for an Android application. 257 00:21:22,180 --> 00:21:27,260 So, this is not going to be a sensitive app. 258 00:21:27,260 --> 00:21:33,580 This is going to be PIVA, but let's pretend for the sake of the example that this is a banking application, for example. 259 00:21:33,580 --> 00:21:38,400 So, you go to this page, which should be, let's say, your information. 260 00:21:39,080 --> 00:21:43,480 And you go to anywhere else in the phone, and then you go back. 261 00:21:44,960 --> 00:21:48,460 And you still see all the information is private here. 262 00:21:48,460 --> 00:21:49,880 So, this should not happen. 263 00:21:49,880 --> 00:21:54,420 You have a specific function that could let you block this. 264 00:21:54,420 --> 00:21:57,320 So, this is a vulnerability that you have to mention. 265 00:21:57,800 --> 00:21:59,480 So, this is an example. 266 00:22:08,230 --> 00:22:13,870 So, just like with any other pen test, we have automatic tools. 267 00:22:13,870 --> 00:22:16,930 So, this does not replace your critical thinking. 268 00:22:16,970 --> 00:22:19,650 So, you cannot only rely on those. 269 00:22:19,650 --> 00:22:23,910 But you can also use them to gain some time. 270 00:22:23,910 --> 00:22:32,070 So, the thing that you have to do, though, is to verify that everything it finds is not a false positive. 271 00:22:32,270 --> 00:22:35,810 So, we can use MobSF, but you can also use Quark. 272 00:22:35,810 --> 00:22:40,530 So, Quark is going to help you to find common security vulnerabilities in Android. 273 00:22:40,530 --> 00:22:47,130 And you can also create a proof of concept, like evidence for tapjacking, for example. 274 00:22:47,130 --> 00:22:49,750 So, it's really a good gain of time. 275 00:22:53,270 --> 00:22:59,070 And so, these are general tips for common API vulnerabilities to look for. 276 00:22:59,070 --> 00:23:06,510 So, we have... the first one is one I have a tendency to find quite often. 277 00:23:06,510 --> 00:23:12,030 So, it's when you are able to access to resources that do not belong to you. 278 00:23:12,130 --> 00:23:14,510 So, you can check for these vulnerabilities. 279 00:23:14,570 --> 00:23:20,950 You can use the link to the OWASP top 10 here to find the more vulnerabilities that you can look for. 280 00:23:21,490 --> 00:23:27,530 And for more details on API pen test, there's also a link to my Git book here as well. 281 00:23:28,370 --> 00:23:34,610 And so, one thing to be careful is the context. 282 00:23:34,690 --> 00:23:43,190 Because sometimes you are going to find a vulnerability that is going to be exploitable in the context of a web application, but not of a mobile application. 283 00:23:43,190 --> 00:23:54,830 So, if we take CORS, for example, it's a mechanism that will allow a web app to make a request to a different origin than the one from which the application was served. 284 00:23:54,850 --> 00:24:03,250 So, it will allow you to prevent malicious website to access sensitive information from other websites. 285 00:24:03,250 --> 00:24:10,050 So, it's not applicable to an Android application because it's not in a web browser context. 286 00:24:10,050 --> 00:24:18,910 But, if the Android application interacts with a web service or an API that implements CORS, then it could be vulnerable. 287 00:24:18,910 --> 00:24:27,510 So, the context is really important and I would recommend that if you have a doubt, just still report it, but as informational. 288 00:24:33,290 --> 00:24:38,270 Another general tip is to use a checklist. 289 00:24:38,770 --> 00:24:43,470 So, you can use a checklist to have all the checks for OWASP top 10. 290 00:24:43,470 --> 00:24:50,210 So, it's really convenient because you have the most common vulnerabilities we have in the wild. 291 00:24:50,330 --> 00:24:53,010 There is an amazing tool that works for this. 292 00:24:53,010 --> 00:24:54,890 It's called MindAPI. 293 00:24:54,890 --> 00:24:55,710 You have the link here. 294 00:24:55,710 --> 00:24:57,170 It's by David Sopas. 295 00:24:57,170 --> 00:25:02,610 It's very, very good and it does good work as a checklist. 296 00:25:03,670 --> 00:25:12,710 And also, you have a snippet here of a checklist from the book that you can see here, Black Hat GraphQL. 297 00:25:12,710 --> 00:25:19,550 And it's for API pen test, for GraphQL API pen test. 298 00:25:19,590 --> 00:25:23,530 And you can find it in the book of Nick, Alex, and Dolev Pari. 299 00:25:23,790 --> 00:25:27,970 And so, there are also multiple advantages to using a checklist. 300 00:25:28,030 --> 00:25:32,630 Like, it's a way to make a consistent and standardized pen test. 301 00:25:32,970 --> 00:25:38,290 It's a way also to make sure that you are going to cover every aspect of your target. 302 00:25:38,290 --> 00:25:40,930 And also, it helps you stay organized. 303 00:25:40,930 --> 00:25:46,930 And you will have also a detailed record of your testing activities, which is really, really convenient. 304 00:25:46,930 --> 00:25:50,090 Because sometimes you might forget what you have tested. 305 00:25:50,090 --> 00:25:51,390 Believe me, it happens. 306 00:25:51,390 --> 00:25:54,350 I have a tendency sometimes to test multiple times. 307 00:25:54,350 --> 00:25:57,030 So, this is why I stick on a checklist. 308 00:25:57,310 --> 00:26:00,890 And it makes you more efficient and it helps you gain time. 309 00:26:01,110 --> 00:26:03,450 So, I really recommend this. 310 00:26:03,450 --> 00:26:10,890 And you can also make your own checklist if you don't feel like anything here is good. 311 00:26:10,890 --> 00:26:14,530 You can just make your own and do your thing. 312 00:26:18,530 --> 00:26:20,870 Okay, how to report. 313 00:26:23,900 --> 00:26:27,280 So, this is the usual structure of any pen test report. 314 00:26:27,280 --> 00:26:31,560 You have the executive summary and you have the part vulnerability report. 315 00:26:31,560 --> 00:26:35,600 The second part vulnerability report can also be used for bug hunters. 316 00:26:36,420 --> 00:26:42,080 So, the executive summary is going to be for the executives of a company. 317 00:26:42,160 --> 00:26:54,340 So, it's going to need a high-level explanation, no technical details, and a global posture on why findings and attack combination could impact the company. 318 00:26:55,980 --> 00:27:01,500 So, I'm going to show also an example of the vulnerability I mentioned before. 319 00:27:01,780 --> 00:27:04,020 So, here we have the severity. 320 00:27:04,020 --> 00:27:08,920 So, you change it according to the context and to the application. 321 00:27:09,420 --> 00:27:12,480 And it can be higher or lower. 322 00:27:12,700 --> 00:27:14,480 And the general description. 323 00:27:14,720 --> 00:27:18,580 So, then you have this general description until input. 324 00:27:18,580 --> 00:27:20,720 And then you have the context. 325 00:27:20,720 --> 00:27:22,720 The context is also very important. 326 00:27:25,320 --> 00:27:32,260 And this is also where you put your evidence, the request and the response. 327 00:27:35,090 --> 00:27:39,530 And then, here are the remediation steps. 328 00:27:39,530 --> 00:27:45,370 So, it can be more detailed than this, but the slide is quick. 329 00:27:45,370 --> 00:27:48,650 But you can put way more details than this. 330 00:27:48,650 --> 00:28:00,570 And you have also resources that you can provide for people who are going to correct a vulnerability to actually have references that they can rely on, which is really helpful. 331 00:28:04,440 --> 00:28:06,000 And that's it. 332 00:28:06,000 --> 00:28:10,460 So, you can get the slides and all the resources here. 333 00:28:10,460 --> 00:28:16,100 So, I didn't put together a list of resources because it would have been like 10 slides. 334 00:28:16,100 --> 00:28:18,420 So, you can find them all here. 335 00:28:18,520 --> 00:28:20,000 It's going to be easier. 336 00:28:20,000 --> 00:28:21,980 And it's organized and everything. 337 00:28:29,680 --> 00:28:35,400 And also, I did an article on Pentest Magazine. 338 00:28:35,400 --> 00:28:37,240 And I also did a blog post. 339 00:28:37,240 --> 00:28:41,340 So, the article is 29 USD, but the blog post is free. 340 00:28:41,400 --> 00:28:43,420 So, if you want to check it out. 341 00:28:45,100 --> 00:28:52,040 And if you want to check what you remembered from this presentation, there's also a quiz that you can do. 342 00:28:59,680 --> 00:29:00,780 Thank you. 343 00:29:00,840 --> 00:29:02,120 Thank you, everyone.