1 00:00:00,090 --> 00:00:05,830 - Hello, and welcome to the Android Security and Exploitation training video 2 00:00:05,830 --> 00:00:11,272 series by Pentester Academy. My name is Aditya and in this particular video, we 3 00:00:11,272 --> 00:00:18,380 are having a look at Damn Insecure and Vulnerable Application. Currently we are 4 00:00:18,380 --> 00:00:24,310 at the Challenge 3 which is insecure data storage, the first part. Now this is a lot 5 00:00:24,310 --> 00:00:29,631 similar to something which you have already learned in the Video 8 of 6 00:00:29,631 --> 00:00:35,928 Android Security for Pentesters course by SecurityTube-Training. Right. So if we 7 00:00:35,928 --> 00:00:42,407 have a look at the application, the insecure data storage part one, it tells 8 00:00:42,407 --> 00:00:49,820 us to find out where the credentials are being stored and the venerable code. And 9 00:00:49,820 --> 00:00:55,995 it simply asks to enter the third party service user name and the password. So, 10 00:00:55,995 --> 00:01:01,121 let's try to enter something over here-- just simply write attify and 11 00:01:01,121 --> 00:01:08,494 securitytubetraining. And go ahead and save it. Now there are a couple of places 12 00:01:08,494 --> 00:01:14,649 where an application can store the data, and one of them being shared-preferences. 13 00:01:14,649 --> 00:01:20,226 Now even though shared-preferences are not recommended to be used for sensitive 14 00:01:20,226 --> 00:01:25,142 information, a lot of developers end up using...storing any kind of sensitive 15 00:01:25,142 --> 00:01:30,869 information in the shared-preferences. And if you're already familiar with adb or the 16 00:01:30,869 --> 00:01:36,250 Android Debug Bridge, you can find out the shared-preferences at this location which 17 00:01:36,250 --> 00:01:45,080 is /data/data/[packagename]/shared_prefs. So let's go ahead and maybe first have a 18 00:01:45,080 --> 00:01:53,130 look at the file responsible for storing the data. So I guess this should be the 19 00:01:53,130 --> 00:02:00,571 InsecureDataStorage1. So let's look at it, and if you look here in the 20 00:02:00,571 --> 00:02:06,928 saveCedentials code block, it simply uses the preference manager and 21 00:02:06,928 --> 00:02:13,468 getDefaultSharedPreferences and stores the username and password and prints out that 22 00:02:13,468 --> 00:02:18,687 "third party credentials have been saved successfully." So this is an indication 23 00:02:18,687 --> 00:02:24,983 that shared preferences are being used to store the data. Now let's go ahead and 24 00:02:24,983 --> 00:02:30,955 analyze the file system and look at it's shared-preferences. So we'll do a adb 25 00:02:30,955 --> 00:02:41,579 shell and go to /data/data/jakhar.aseem.diva and go to the 26 00:02:41,579 --> 00:02:48,892 shared_prefs. And if you look over here there is a preferences.xml which is stored 27 00:02:48,892 --> 00:02:56,407 over here. And if you simply cat this file, you will see that the username and 28 00:02:56,407 --> 00:03:00,689 password which is attify and securitytubetraining, which is the exact 29 00:03:00,689 --> 00:03:07,392 same thing which we saved over here. So this is how an application stores data in 30 00:03:07,392 --> 00:03:13,973 the shared preferences and this is how you can access it. So that is all for this 31 00:03:13,973 --> 00:03:18,079 short video and in the upcoming videos we will have a look at the other ways of 32 00:03:18,079 --> 00:03:23,969 insecure data storage and so on. So thanks for watching the video and if you have any 33 00:03:23,969 --> 00:03:29,534 feedback or queries, feel free to reach out to me on Twitter, which is @adi1391. 34 00:03:29,534 --> 00:03:34,000 Or you can send me email at adi@attify.com. Thank you.