diff --git a/InsecureBankv2.apk b/InsecureBankv2.apk index 20b32a1..5c46aae 100644 Binary files a/InsecureBankv2.apk and b/InsecureBankv2.apk differ diff --git a/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/LoginActivity.java b/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/LoginActivity.java index 96a1a3c..d2a55c7 100644 --- a/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/LoginActivity.java +++ b/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/LoginActivity.java @@ -116,7 +116,6 @@ public void onClick(View v) { protected void createUser() { Toasteroid.show(this, "Create User functionality is still Work-In-Progress!!", Toasteroid.STYLES.WARNING, Toasteroid.LENGTH_LONG); - } /* diff --git a/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java b/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java index 2c1908f..e8f0b63 100644 --- a/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java +++ b/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java @@ -2,6 +2,7 @@ import android.app.Activity; import android.content.Intent; +import android.os.Build; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; @@ -17,6 +18,8 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; +import com.marcohc.toasteroid.Toasteroid; + /* The page that allows gives the user below functionalities @@ -44,10 +47,10 @@ protected void onCreate(Bundle savedInstanceState) { uname = intent.getStringExtra("uname"); root_status =(TextView) findViewById(R.id.rootStatus); - // Display root status + // Display root status showRootStatus(); - - + // Display emulator status + checkEmulatorStatus(); transfer_button = (Button) findViewById(R.id.trf_button); transfer_button.setOnClickListener(new View.OnClickListener() { @@ -82,7 +85,36 @@ public void onClick(View v) { }); } - void showRootStatus() { + private void checkEmulatorStatus() { + Boolean isEmulator = checkIfDeviceIsEmulator(); + if(isEmulator==true) + { + Toasteroid.show(this, "Application running on Emulator", Toasteroid.STYLES.ERROR, Toasteroid.LENGTH_LONG); + } + else + { + Toasteroid.show(this, "Application running on Real device", Toasteroid.STYLES.SUCCESS, Toasteroid.LENGTH_LONG); + } + } + + private Boolean checkIfDeviceIsEmulator() { + + if(Build.FINGERPRINT.startsWith("generic") + || Build.FINGERPRINT.startsWith("unknown") + || Build.MODEL.contains("google_sdk") + || Build.MODEL.contains("Emulator") + || Build.MODEL.contains("Android SDK built for x86") + || Build.MANUFACTURER.contains("Genymotion") + || (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic")) + || "google_sdk".equals(Build.PRODUCT)) + { + return true; + } + return false; + } + + + void showRootStatus() { boolean isrooted = doesSuperuserApkExist("/system/app/Superuser.apk")|| doesSUexist(); if(isrooted==true) diff --git a/README.markdown b/README.markdown index 305370e..9d83948 100644 --- a/README.markdown +++ b/README.markdown @@ -13,6 +13,7 @@ This is a major update to one of my previous projects - "InsecureBank". This vul * Local Encryption issues * Vulnerable Activity Components * Root Detection and Bypass +* Emulator Detection and Bypass * Insecure Content Provider access * Insecure Webview implementation * Weak Cryptography implementation