How dineshshetty/android-insecurebankv2 works
1. This repository is a deliberately vulnerable Android banking lab, not a single app. The main product is the InsecureBankv2 mobile client plus a Python backend server, with additional exploit/demo apps and walkthrough documents bundled alongside.
2. The central runtime boundary is:
- Android client app in InsecureBankv2/
- Python server in AndroLabServer/
- Local backend data stored in the server’s SQLite database file mydb.db
3. The Android app is built as a multi-activity app. Key screens/components include login, post-login, transfer, password change, statement viewing, and a failure screen. The app source is organized by feature-like activities rather than a layered domain model, which matches its training-lab purpose.
4. The app’s main security-relevant surfaces are explicit Android components:
- MyBroadCastReceiver for broadcast-based entry
- TrackUserContentProvider for content-provider access
- MyWebViewClient for web content handling
- FilePrefActivity for preference/file storage behavior
These are the main IPC and data-access boundaries an attacker or tester would target.
5. CryptoClass and related code indicate local encryption/cryptography behaviors inside the app. The README says these are intentionally weak, so the architecture includes both server-side authentication/data and client-side “security” logic that is expected to be bypassable.
6. The backend server in AndroLabServer/ is the authoritative application service for bank data and authentication. Its code split (app.py, database.py, models.py) suggests a small Python web/API application with a persistence layer and data model layer, backed by the included SQLite database.
7. The primary data flow is user credentials and banking actions moving from the Android app to the server, then to the database, and results flowing back to the app for login success/failure, statements, transfers, and password updates. The README’s hardcoded sample credentials show that authentication is part of the lab scenario.
8. Network communication is an important boundary. The README explicitly warns about insecure HTTP connections and network access requirements, so the app depends on reachable local network/host connectivity to the Python server rather than on-device-only logic.
9. The repository also contains prebuilt APKs and build artifacts (InsecureBankv2.apk, app-debug.apk, app-release.apk). These are distribution/testing outputs, not separate subsystems, but they show the lab is intended to be used both from source and as installable binaries.
10. wip-attackercode/ is a separate set of attacker/demo Android projects, not part of the banking app itself:
- ExploitAES for cryptography-related exploitation
- SniffIntents for intent interception/sniffing
- insecurebankRootBypass.js for runtime/root-detection bypass work
These likely interact with the InsecureBankv2 app as an external adversary layer.
11. The Walkthroughs/ and Usage Guide.pdf folders are documentation assets that explain exploit paths and testing scenarios. They do not change runtime architecture, but they are part of the repo’s “training environment” boundary.
12. For an architecture diagram, the core shape is: user -> Android client -> Python backend -> SQLite DB, with several vulnerable Android IPC/storage/UI surfaces inside the client and separate exploit tooling/documentation outside the trusted system boundary.
Main entry points: InsecureBankv2 InsecureBankv2 · app.py Server App · DoLogin.java Do Login · PostLogin.java Post Login
Components 22
Android client
InsecureBankv2 vulnerable mobile app and its internal feature/security surfaces.
- InsecureBankv2 · Main Android banking client used for login, transfers, statements, and password changes.
InsecureBankv2 - Login · Entry screen for credentials and authentication.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/LoginActivity.java - Do Login · Login request handler and authentication flow coordination.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoLogin.java - Post Login · Main authenticated hub after successful sign-in.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java - Transfer · Funds transfer screen and request flow.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoTransfer.java - Change Password · Password update screen and submission flow.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ChangePassword.java - Statement · Account statement viewing screen.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ViewStatement.java - Wrong Login · Failure screen shown for invalid authentication attempts.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/WrongLogin.java - Crypto Class · Local cryptography and obfuscation logic that is intentionally weak.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/CryptoClass.java - Broadcast Rx · Broadcast-based entry point and attack surface.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/MyBroadCastReceiver.java - Content Provider · Content-provider boundary for track/user data access.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/TrackUserContentProvider.java - WebView Client · Web content handling boundary inside the app.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/MyWebViewClient.java - File Prefs · Preference and file-storage behavior exposed by the app.
InsecureBankv2/app/src/main/java/com/android/insecurebankv2/FilePrefActivity.java
Backend server
Python service and database backing banking/authentication flows.
- Server App · Backend application entrypoint serving banking and authentication logic.
AndroLabServer/app.py - Database Layer · Database access and connection handling for the backend.
AndroLabServer/database.py - Models · Backend data model definitions for users and banking entities.
AndroLabServer/models.py - mydb.db · Local SQLite database storing authoritative lab data.
AndroLabServer/mydb.db
External assets
Exploit tooling, walkthroughs, and packaged binaries around the lab.
- APK builds · Prebuilt APKs and build outputs for installing or testing the lab.
InsecureBankv2/app/app-debug.apk - Walkthroughs · Exploit and lab walkthrough documents describing attack paths.
Walkthroughs - Attacker Tools · Separate demo/exploit Android projects used against the lab.
wip-attackercode - Root Bypass JS · Runtime/root-detection bypass helper for adversarial testing.
wip-attackercode/insecurebankRootBypass.js
Other components
- User · Person using the lab app and entering credentials or banking actions.
Connections 24
- User → InsecureBankv2: uses · User interacts with the banking client.
- InsecureBankv2 → Login: starts at · Launches into the login flow.
- Login → Do Login: submits · Credentials are handed to the authentication handler.
- Do Login → Server App: auth request · Client sends login data to the backend over the network.
- Server App → Database Layer: reads/writes · Backend resolves accounts and authentication state through the data layer.
- Database Layer → mydb.db: persists · Database operations hit the bundled SQLite file.
- Server App → InsecureBankv2: returns result · Backend response drives success or failure in the app.
- Do Login → Wrong Login: on failure · Failed auth routes to the failure screen.
- Do Login → Post Login: on success · Successful auth opens the authenticated hub.
- Post Login → Transfer: navigates · Authenticated user can initiate transfers.
- Post Login → Change Password: navigates · Authenticated user can change password.
- Post Login → Statement: navigates · Authenticated user can view statements.
- Transfer → Server App: transfer API · Transfer requests are sent to the backend service.
- Change Password → Server App: password API · Password changes are submitted to the backend.
- Statement → Server App: statement API · Statement data is fetched from the backend.
- Crypto Class → InsecureBankv2: protects weakly · Client-side crypto influences stored or transmitted data but is intended to be bypassable.
- Broadcast Rx → InsecureBankv2: exposes · Broadcast receiver is an external entry surface into the app.
- Content Provider → InsecureBankv2: exposes · Content provider exposes app data through IPC.
- WebView Client → InsecureBankv2: handles · WebView client mediates loaded web content.
- File Prefs → InsecureBankv2: stores · Preference/file behavior affects local app state.
- Attacker Tools → InsecureBankv2: targets · External exploit apps interact with the vulnerable client.
- Root Bypass JS → Attacker Tools: supports · Bypass script assists attacker workflows.
- Walkthroughs → Attacker Tools: documents · Training material explains exploit scenarios and tooling.
- APK builds → InsecureBankv2: builds · Packaged APK artifacts correspond to the main client.