Skip to content

nutcracker-sh/nutbank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

D82A3018-6034-4B56-A12B-CDEC14104903

πŸ₯œ NutBank β€” Intentionally Vulnerable Android App

⚠️ WARNING: This application is intentionally vulnerable. It is designed exclusively for security research, education, and testing purposes. Do NOT use in production environments.

Platform Language Purpose GitHub Stars GitHub Issues GitHub License GitHub last commit API

πŸ“– About

NutBank is part of nutcracker.sh β€” an Android security analysis platform. It is a deliberately insecure Android application that simulates a banking app with multiple intentional vulnerabilities and real-world RASP protections.

This app allows security researchers, pentesters, and students to practice identifying and exploiting real-world mobile vulnerabilities in a safe, controlled environment.

πŸ”— nutcracker.sh β€” Android mobile security testing platform

πŸ” Intentional Vulnerabilities

Hardcoded Secrets (MASVS-CODE-9)

  • API keys, database credentials, Stripe keys, Firebase config, AWS credentials, and more β€” all hardcoded in plaintext inside Secrets.kt.

Insecure Data Storage (MASVS-PLATFORM-2)

  • Session tokens stored in SharedPreferences in plaintext.
  • Sensitive data written to external storage, cache, and an insecure SQLite database.

Weak Cryptography (MASVS-CRYPTO-1)

  • ECB mode encryption.
  • MD5 and SHA-1 hashing for passwords and integrity checks.

Insecure Network Communication (MASVS-NETWORK)

  • No certificate pinning.
  • No hostname verification.
  • HTTP endpoints used alongside HTTPS.

Exported Components (MASVS-PLATFORM-1)

  • ContentProvider exported with sensitive data accessible to any app.
  • BroadcastReceiver accepting implicit intents from any application.
  • Activities exported without proper permission checks.

Insecure Logging (MASVS-CODE-4)

  • Credentials, session tokens, API keys, and database connection strings logged to Logcat.

Insecure WebView (MASVS-PLATFORM-5)

  • JavaScript enabled with no restrictions.
  • Mixed content allowed.

Weak Biometric Authentication (MASVS-AUTH-8)

  • Biometric check that can be bypassed.

Deep Link Vulnerabilities (MASVS-PLATFORM-6)

  • Implicit intents with sensitive data (credentials, API keys) sent through insecure deep links.

πŸ›‘οΈ RASP Protection

NutBank implements Runtime Application Self-Protection (RASP) with multiple layers of defense that aim to resist bypass attempts. These protections serve as a real-world challenge for security researchers and mobile app pentesters.

Detection Mechanisms

  • 🌱 Root Detection β€” via RootBeer library: su binary, root management apps (Magisk, SuperSU), test-keys build, writable system partitions
  • πŸ‰ Frida Detection β€” port scanning (27042), /proc/*/cmdline process inspection, /proc/self/maps memory analysis for Frida artifacts (frida-server, frida-agent, frida-gadget, etc.)
  • πŸ–₯️ Emulator Detection β€” Build fingerprint analysis, QEMU pipe/socket detection, hardware property checks
  • πŸ› Debugger Detection β€” android.os.Debug.isDebuggerConnected(), ptrace status via /proc/self/status
  • πŸ”§ Hooking Framework Detection β€” Xposed, Substrate, and LSPOSED module scanning
  • πŸ” Repackaging / Tamper Detection β€” APK signature verification, package certificate hash comparison
  • πŸ“± Screen Capture Prevention β€” FLAG_SECURE on all activities to prevent screenshots and screen recording

Response Strategy

When a threat is detected, NutBank can:

  • Display a blocking dialog that forces app closure
  • Run checks continuously in the background via coroutines, not just at startup
  • Use obfuscated check logic to hinder static analysis
  • Employ timing-based anomalies to detect hooking interference

πŸ’‘ These RASP controls are designed to be robust but bypassable β€” the goal is to provide a realistic training target. Advanced attackers using nutcracker.sh can practice bypassing each protection type.

πŸ—οΈ Architecture

app/src/main/java/sh/nutcracker/nutbank/
β”œβ”€β”€ MainActivity.kt            # Login screen + RASP checks
β”œβ”€β”€ DashboardActivity.kt       # Displays all "leaked" secrets
β”œβ”€β”€ AdminActivity.kt           # Exported admin panel (no auth)
β”œβ”€β”€ Secrets.kt                 # Hardcoded credentials & API keys
β”œβ”€β”€ CryptoHelper.kt            # Weak crypto (ECB, MD5, SHA-1)
β”œβ”€β”€ DataStoreManager.kt        # Insecure storage patterns
β”œβ”€β”€ NetworkClient.kt           # No SSL pinning / hostname verification
β”œβ”€β”€ ContentProviderHandler.kt  # Exported content provider
β”œβ”€β”€ BroadcastReceiverHandler.kt# Exported broadcast receiver
β”œβ”€β”€ DeepLinkActivity.kt        # Insecure deep link handling
β”œβ”€β”€ WebActivity.kt             # Insecure WebView
β”œβ”€β”€ BiometricAuthActivity.kt   # Weak biometric implementation
└── DataStoreManager.kt        # File/database preference storage

πŸš€ Getting Started

Prerequisites

  • Android Studio (latest stable)
  • Android Emulator or physical device (API 28+)
  • RootBeer library (included via Gradle)

Build & Run

# Clone the repository
git clone https://github.com/nutcracker-sh/nutbank.git
cd nutbank

# Build and install
./gradlew installDebug

# Launch on connected device/emulator
adb shell am start -n sh.nutcracker.nutbank/.MainActivity

Default Credentials

  • Username: admin
  • Password: P@ssw0rd123!

πŸ”§ Use with Nutcracker

This app is designed as a companion target for nutcracker.sh:

  1. Install NutBank on your test device/emulator
  2. Run nutcracker security analysis against the app
  3. Identify all intentional vulnerabilities
  4. Practice writing remediation reports

πŸ“‹ OWASP MASVS Coverage

MASVS Category Vulnerability Status
MASVS-CRYPTO-1 Weak crypto algorithms βœ…
MASVS-PLATFORM-1 Exported components βœ…
MASVS-PLATFORM-2 Insecure data storage βœ…
MASVS-PLATFORM-5 Insecure WebView βœ…
MASVS-PLATFORM-6 Insecure deep links βœ…
MASVS-NETWORK-1 No certificate pinning βœ…
MASVS-NETWORK-2 Weak TLS configuration βœ…
MASVS-CODE-4 Insecure logging βœ…
MASVS-CODE-9 Hardcoded secrets βœ…
MASVS-AUTH-8 Weak biometric auth βœ…

βš–οΈ Disclaimer

This application is provided for educational and authorized security testing purposes only. The authors assume no liability and are not responsible for any misuse or damage caused by this project.

πŸ‘€ Author

Carlos Ganoza (@drneox) β€” carlos.ganoza@owasp.org

πŸ“„ License

This project is licensed for educational and security research purposes.

About

NutBank is an intentionally vulnerable Android app designed for security research and mobile pentesting demos. Built to showcase nutcracker's RASP bypass capabilities. Features hardcoded secrets, insecure components, and real RASP protections (RootBeer, Frida detection, emulator detection) that nutcracker can detect and bypass.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages