DIVA - Hardcoding Issues - Part 2


This challenge is the second part of Hardcoding issues, where the objective is to find sensitive information which is the vendor code left by developer inside the application source code.
12-1
Let’s have a look inside source code
12-2
12-3
After analyzing the code above, we can understand that the activity is creating another class with the name of DivaJni, let’s have a look at that.
12-4
After analyzing the code above we could understand that there is a native library with the same name divajni, if you unzip the APK you will see the lib folder, which contains all the libraries inside it, let’s have a look
12-5
Let’s open any of the library and analyze it
12-6
After trying couple of strings, I finally found the correct string which can give us access [olsdfgad;lh]
12-7
Finally we found the correct key, see you in the last challenge.

More …

DIVA - Hardcoding Issues - Part 1


Now let’s come to our next vulnerability which is Hardcoding Issues
2-1
The one common mistake which many developers do while either making the web application or mobile application, they unintentionally forget to remove the hardcoded password or keys, which help an attacker to access sensitive information.
To solve this challenge we need to follow the same steps which we did in the last challenge
2-2
We need to use jad again to see the clear text of the file
2-3
KEY= “vendorsecretkey”
As you can see inside the code we can see the key, let’s try it inside application
2-4

Mükemmel As you can see the key worked perfectly and the access has been granted to us.

More …

DIVA - Access Control Issues - Part 3


Now we have reached to the last challenge of our Access Control Issues
11-1
The application is meant to save notes, but before accessing the notes we need to create a 4 digit pin, once we do that we can access the notes, but the objective of this challenge is to view the notes without entering the pin, let’s have a look in the application and then we will analyze AndroidManifest.xml
11-2
Put your 4 digit pin and click on create/change pin
Once you create a pin, you will able to see a new option to go to private notes
11-3
11-4
It will again ask you to enter your pin
11-5
Once you enter the correct pin, you will be able to see the private notes
Now let’s have a look at AndroidManifest.xml to find the vulnerable piece of code.
11-6
If you focus on the above highlighted line, it shows the content provider is set to [android:enabled:”true”]
Generally the content provider is represented like [content://] let’s have a look inside smali code and find the correct URI
11-7
If we try to find the content:// from all the file, we found the following inside the NotesProvider.smali, let’s open and have a look inside
11-8
As you can see in the above URI it provide us the exact URI path
[content://jakhar.aseem.diva.provider.notesprovider/notes]
If you remember few steps above we found that the content provider can we queried without any permission, let’s try to open it from adb shell
[adb shell content query –uri content://jakhar.aseem.diva.provider.notesprovider/notes]
11-9
As you can see we can view all the private notes from the application without providing any pin.

More …

DIVA - Access Control Issues - Part 2


Now we will move to our next challenge which is the second part of the Access Control Issues, in which there are two option either we can register and get a pin to see the Tveeter API credential, or if we already have the pin we can see the API credentials, So the objective of this challenge is to access the API credentials without registering for it.
10-1
Before we proceed let’s have a quick view of source code ()
10-2
If you solved the previous challenge, I explained in that the intent filter should not be considered as protection method, if you are using it in an activity, eventually it will be accessible to export publicly.
So let’s open our adb shell and exploit this
{ adb shell am start jakhar.aseem.diva/.APICreds2Activity}
10-3
10-4
But in the application it’s still asking for pin, now we need to find a way to bypass it
Let’s have a look at APICreds2Activity.class to understand the application in more detail
10-5
10-6
10-7
After analyzing both the source code, we could understand that to view the credential we need a pin, but if we disable the pin check it will ask for no further verification and land us directly to the API credentials, let’s try this
{adb shell am start jakhar.aseem.diva/.APICredsActivity check_pin false}
10-8
{ adb shell am start jakhar.aseem.diva/.APICredsActivity -ez check_pin false}
10-9
You can try both the commands, whichever works for you.
10-10
And it works like a charm, this time it didn’t ask for any PIN and landed us directly to the view credentials.

More …

DIVA - Access Control Issues - Part 1


This challange is about bypassing access controls, let’s find out how to solve this.
9-1
9-2
By clicking the View API Credentials we can see the credentials.
But the objective of this challenge is to access the API credentials without clicking the view button, there are couple of ways to do this, let’s try and find the most prominent way.
To understand the cause of this vulnerability let’s read the (AndroidManifest.xml)
9-3
If you remember we just unzipped the apk, that’s the reason the file is still in Android binary xml format, in able to read this file we need to decode the Apk properly using apktool
9-4
9-5
To understand the issue you need to focus on this piece of code
9-6
The intent-filter is generally used for protection mechanism, but if you use it with activity then it can be even used to export publicly. Which will allow any application from outside to use this activity and view the API credentials.
Now close your application in the emulator or you physical device, wherever you are testing
9-7
Now open ADB shell and write the following command anyone of the below, If you are outside the adb shell just type
{adb shell am start jakhar.aseem.diva/.APICredsActivity}
9-8
{ adb shell am start -n jakhar.aseem.diva/.APICredsActivity -a jakhar.aseem.diva.action.VIEW_CREDS }
9-9
If you are inside adb shell you can just type this
{ am start jakhar.aseem.diva/.APICredsActivity }
9-10
The moment the command get executed you will see the API credential popup on the screen
9-11

More …