Back

A comprehensive OWASP-aligned security assessment of InsecureBankv2. Static + dynamic analysis. 6 vulnerabilities found. All confirmed exploitable.

Dhruv Sharma·Security Researcher·Dhruv15saraswat@gmail.com
0
Vulnerabilities Found
0
Analysis Methods
0
Tools Used
0%
OWASP Coverage

The Lab

Isolated virtual environment built for this assessment.

Kali Linux — Attacking Machine

VM Name: kali-linux-2026.1-virtualbox-amd64
OS: Debian 64-bit
RAM: 4096 MB | Processors: 2 Cores
Storage: 80.09 GB (VDI)
Network:
Adapter 1 (Bridged) → Intel Wi-Fi 6 AX203
[Same subnet as Android device — peer-to-peer traffic]
Adapter 2 (NAT) → Internet access
Tools running: Burp Suite · Frida · ADB

Android Target — Genymotion / Pixel 2

VM Name: Google Pixel 2 (factory-backup)
OS: Other Linux 64-bit (Android x86)
RAM: 4096 MB | Processors: 4 Cores
Display: 32 MB Video Memory (VBoxVGA)
Network:
Adapter 1 (Host-Only) → VirtualBox Host-Only Adapter
[Genymotion management]
Adapter 2 (Bridged) → Intel Wi-Fi 6 AX203
[Same network as Kali — enables proxy + ADB]
Target App: InsecureBankv2 / DVIA

Vulnerability Findings

01
VULN 01

Insecure Data Storage

VULNERABLE
Tools:ADB (Android Debug Bridge)

Observation

The application stores sensitive data in three insecure locations accessible via ADB shell with root access:

1. mySharedPreferences.xml — Stores superSecurePassword and EncryptedUsername. Values appear Base64-encoded (e.g. ZGl1ZXhNO...), not encrypted. Base64 is encoding, not a security control — instantly reversible.

2. com.android.insecurebankv2_preferences.xml — Exposes serverip and serverport in plain text, revealing internal infrastructure details.

3. databases/mydb — An unencrypted SQLite database file containing core application data.

Reproduction Steps

1
Connect ADB with root: adb connect 192.168.0.140:5555 → adb shell → cd /data/data
2
Navigate to app folder: cd com.android.insecurebankv2
3
cd databases/ → ls (reveals: mydb, mydb-journal)
4
cd shared_prefs/ → cat mySharedPreferences.xml → Reveals Base64-encoded password and username → cat com.android.insecurebankv2_preferences.xml → Reveals plaintext serverip: 192.168.0.130, serverport: 8888

Remediation

Vulnerability FoundInsecure PracticePrevention
Exposed SharedPreferencesStoring credentials in plain XML with Base64 encodingUse EncryptedSharedPreferences (AndroidX Security — AES-256-GCM for keys and values)
Unencrypted DatabasesStandard SQLiteOpenHelper / Room in plain .db filesUse SQLCipher — transparent 256-bit AES encryption for entire database file
Fake Encryption (Encoding)Base64/Hex/XOR obfuscation treated as encryptionOnly use AES-GCM or ChaCha20 via the Android Cipher API
Insecure Key StorageHardcoded keys in Java/Kotlin or stored alongside dataUse the Android Keystore — hardware-backed, keys cannot be extracted even on rooted devices
Over-Retention of DataStoring actual passwords permanently on deviceStore short-lived OAuth/JWT tokens — never actual passwords
02
VULN 02

Insecure Communication

VULNERABLE
Tools:Burp Suite (Proxy Listener)

Observation

The application transmits all user data over unencrypted http:// — no TLS. With Burp Suite configured as a proxy listener on 192.168.0.139:8090, and the Android device routing its traffic through it, every request is intercepted in full plain text.

The intercepted URL: http://192.168.0.139:8888/getaccounts Full credentials (username: dinesh, password) visible in the POST body without any encryption.

Reproduction Steps

1
Run ifconfig on Kali Linux → note IP (192.168.0.139)
2
On Android device: Settings → WiFi → Manual Proxy → Set Proxy Hostname: 192.168.0.139, Port: 8090
3
In Burp Suite → Proxy → Proxy Listeners → Add listener on 192.168.0.139:8090 (All interfaces)
4
Use the app → Login or fetch accounts
5
Burp intercepts the full request including credentials in plaintext
6
Request can be forwarded as-is OR modified before forwarding

Remediation

VulnerabilityPrevention StrategyImplementation
Plaintext HTTP TrafficEnforce HTTPS / TLSMigrate all endpoints to HTTPS. Use TLS 1.2 or 1.3. Block SSLv3, TLS 1.0/1.1.
Cleartext Allowed in OSNetwork Security ConfigurationConfigure res/xml/network_security_config.xml to globally restrict cleartext traffic
Custom CA Trust (MitM)SSL / Certificate PinningPin server's public key (SPKI) using OkHttp's CertificatePinner
Ignoring SSL ErrorsStrict Hostname VerificationNever override TrustManager or HostnameVerifier — common developer shortcut during testing
Sensitive Data in URLsUse POST/PUT BodiesURLs are logged by routers and servers — never put tokens or passwords in query params
03
VULN 03

Insecure Authentication

VULNERABLE
Tools:Burp Suite — Intruder (Pitchfork Attack)

Observation

The login endpoint returns verbose, differentiated error messages. When an existing username is entered with a wrong password, the response explicitly confirms the user exists:

{"message": "Wrong Password", "user": "jack"}

This enables username enumeration — an attacker can compile a list of valid usernames, then launch targeted brute-force or credential-stuffing attacks with precision.

Reproduction Steps

1
Intercept login request in Burp Suite
2
Send to Intruder → Pitchfork attack mode
3
Set payloads: username list + password list
4
Observe response messages → "Wrong Password" + username → user EXISTS → "User name or password incorrect" → user DOES NOT EXIST
5
Extract valid username list from differentiated responses

Remediation

VulnerabilityPreventionImplementation
Username EnumerationGeneric Error MessagesReturn identical string (e.g. "Invalid credentials") and same HTTP status for all failure types
Timing-Based EnumerationConsistent Response TimesSimulate password hashing time even for non-existent users to prevent timing attacks
Brute-Force AttacksRate Limiting & LockoutsCap login attempts per IP per minute; lock accounts after 5–10 failures
Weak PasswordsStrict Password PoliciesMinimum 12 characters, complexity required, check against Pwned Passwords API (Troy Hunt)
Credential StuffingMulti-Factor AuthenticationRequire TOTP, push notification, or hardware key — especially for admin accounts
04
VULN 04

Insecure Authorization

VULNERABLE
Tools:Burp Suite — Interceptor, Repeater

Observation

By intercepting a money transfer request and URL-encoding a different target username into the username parameter, it is possible to transfer funds to any account without any server-side ownership verification. The server trusts client-supplied parameters for determining who to act on behalf of — a classic Broken Object Level Authorization (BOLA / IDOR) vulnerability.

Reproduction Steps

1
Log in as a valid user (e.g. dinesh)
2
Initiate a transfer action in the app
3
Intercept the POST request in Burp Suite
4
URL-encode target username (e.g. Jack@1235 → Jack%40123%24)
5
Modify the username parameter to the new encoded value
6
Forward the request
7
Server responds: "Correct Credentials so get accounts will continue" → Transfer succeeds to the attacker-specified account

Remediation

VulnerabilityPreventionImplementation
Direct Credential TransmissionToken/Session-Based AuthAuthenticate once → issue secure HttpOnly, Secure cookie or JWT; use for all subsequent checks
IDOR / BOLAObject-Level AuthorizationBefore acting, verify logged-in user is the strict owner of the requested data object
Predictable Resource IDsUse UUIDsReplace sequential DB IDs in APIs with UUIDv4 — makes guessing other users' resources infeasible
Missing Function-Level Access ControlRBAC / Deny by DefaultImplement explicit permission checks (e.g. @RequireRole('ADMIN')) on all sensitive routes
Parameter TamperingServer-Side Trust OnlyNever trust username=jack or role=admin from request body/URL — extract from validated session token only
05
VULN 05

Code Injection

VULNERABLE
Tools:FridaADB

Observation

Using Frida — a dynamic instrumentation toolkit — it is possible to hook directly into the running InsecureBankv2 process and execute arbitrary JavaScript against live application memory. The app has no anti-debugging, no root/jailbreak detection, and no Frida detection in place.

Reproduction Steps

1
Install Frida on Kali: pip install frida frida-tools
2
Push Frida server to Android device: adb push frida-server-16.7.14-android-x86_64 /data/local/tmp
3
Start Frida server as root: adb shell → cd /data/local/tmp → adb root ./frida-server-16.7.14-android-x86_64 & (runs as PID e.g. 3718)
4
Enumerate running processes: frida-ps -U → Shows: PID 2697 → InsecureBankv2
5
Attach to process and inject: frida -U -n InsecureBankv2 → Connected to Galaxy S3 (id=192.168.0.140:5555) → [Galaxy S3::InsecureBankv2] → ready for script injection

Remediation

Defense LevelTechniqueImpact
BasicDisable DebuggingPrevents easy discovery — remove debuggable: true from manifest
IntermediateRoot / Jailbreak DetectionBlocks the environment Frida needs to operate in
AdvancedNative Memory / Pipe ScanningActively scans for and detects the Frida agent at runtime
ExpertCustom LLVM ObfuscationControl-flow obfuscation makes manual hooking nearly impossible
06
VULN 06

Reverse Engineering

VULNERABLE
Tools:jadxjadx-guiADB

Observation

The APK can be pulled directly from the device using ADB and decompiled to near-original Java source code using jadx-gui. No obfuscation, no minification. All application logic — including the ChangePassword class, cryptographic methods, and hardcoded encryption keys — is fully readable. The encryption key extracted here was then used to decrypt intercepted Burp Suite traffic.

Reproduction Steps

1
Find APK path on device: adb shell pm path com.android.insecurebankv2 → /data/app/~~eInegrNjaOVF0lF59FEng==/com.android.insecurebankv2-.../base.apk
2
Pull APK to Kali: adb pull /data/app/[path]/base.apk
3
Open in jadx-gui: jadx-gui base.apk
4
Browse decompiled source: → com.android.insecurebankv2 → ChangePassword.java → CryptoClass.java → exposes encryption key used for passwords → All business logic readable in plain Java

Remediation

PhaseDefense StrategyKey Action
ImmediateBasic ObfuscationEnable minifyEnabled true + shrinkResources true to activate R8
ImmediateSecret RemovalAudit and remove all hardcoded API keys, passwords, salts from source
Short-TermString EncryptionEncrypt strings at compile time, decrypt dynamically via XOR/AES
Short-TermRuntime ProtectionSignature verification — crash app if APK is modified and repackaged
Long-TermNative Code (JNI/NDK)Migrate crypto/proprietary logic from Java/Kotlin to C/C++ .so libraries
Long-TermCommercial ObfuscationUpgrade from R8 to DexGuard or DashO for control-flow obfuscation
ArchitecturalBackend MigrationRefactor to thin-client — all sensitive logic lives on secure server only

Full Assessment Overview

Every vulnerability, tool, evidence, and fix in one place.

#VulnerabilityTool UsedStatusMitigation Summary
01Insecure Data StorageADBVULNERABLEEncryptedSharedPreferences, SQLCipher, Android Keystore, token-based auth
02Insecure CommunicationBurp SuiteVULNERABLEHTTPS/TLS 1.2+, network_security_config.xml, Certificate Pinning
03Insecure AuthenticationBurp Suite IntruderVULNERABLEGeneric errors, rate limiting, MFA, Pwned Passwords API
04Insecure AuthorizationBurp Suite RepeaterVULNERABLEJWT/session auth, BOLA prevention, UUIDs, RBAC, server-side trust
05Code InjectionFrida, ADBVULNERABLEAnti-debug, root detection, memory scanning, LLVM obfuscation
06Reverse Engineeringjadx, ADBVULNERABLER8 obfuscation, secret removal, native code migration, DexGuard

Takeaways

What Was Demonstrated

  • Built a full isolated mobile pentesting lab (Kali + Genymotion)
  • Applied both static analysis (jadx) and dynamic analysis (Burp Suite, Frida, ADB)
  • Identified and exploited 6 OWASP-aligned vulnerabilities end-to-end
  • Developed concrete, actionable remediations for each finding
  • Gained hands-on proficiency with: ADB, Burp Suite, Frida, jadx

Limitations Acknowledged

  • Target is InsecureBankv2 — intentionally vulnerable, not a production app
  • Testing environment was fully isolated (VirtualBox + Genymotion) — no live cellular networks
  • Real-world banking apps have additional custom controls not covered here

Stack & References

Tools & Environments

  • Oracle VirtualBox — isolated testing environment
  • Kali Linux (Debian 64-bit) — attacking machine
  • Genymotion (Google Pixel 2) — Android emulator
  • InsecureBankv2 / DVIA — intentionally vulnerable target apps
  • ADB (Android Debug Bridge) — device shell management
  • Burp Suite Community Edition — HTTP/HTTPS interception, Intruder, Repeater
  • Frida + frida-tools — dynamic instrumentation / code injection
  • jadx / jadx-gui — APK decompiler for reverse engineering

Standards

  • OWASP Mobile Security Project — threat definitions used throughout
  • OkHttp CertificatePinner — recommended for SSL pinning implementation