Why Blocking An App Execution On Jailbroken iPhone And Rooted Android Device Is Pointless

Jailbreak | rooted phone detection programmatically is popular. They think that it is a strong anti reverse-engineering method. Yes it is if the hacker cannot bypass the checking in any way. There's no 100% guaranteed way to block an app's execution on a jailbroken or rooted device. Remember the device is already been jailbroken or rooted, meaning the hacker can execute arbitrary code and they would modify whatever method you have to detect if the phone is rooted or jailbroken.


Popular Detection Method

Here's a list of well known method to detect tampered device programmatically:

iPhone

  1. File system based detection.
  2. System API based detection.
  3. Cydia scheme detection.

Android


Popular Way To Bypass Jailbreak | Rooted Phone Detection

Hackers can counter-attack and here's some popular ways they can bypass your checking:
  1. Using Frida.
  2. Using Cycript, Liberty-Lite, A-Bypass, KernByPass.

Summary

We can put detection to add extra security but in the end hackers can found a way to bypass it anyway. In my opinion, this detection don't contribute too much to the security side because they can targeted and disabled.

Let's give some example, ex. the app is using system-based api detection:
let pid = fork() // not allowed in non-jailbreak deviceif(!pid) { return true }else if(pid >= 0) { return false }


If the hackers found out that method they can simply made the fork() method to return a process id >= 0 to bypass the detection.

Here's another example, the android app is using Root Beer library. The hacker can insert JavaScript code then using Frida to bypass the detection. Here's the Frida Root Detection bypass script -> https://gist.github.com/pich4ya/0b2a8592d3c8d5df9c34b8d185d2ea35

Comments

Popular posts from this blog

How To Check If Your Android Phone Is Official Or Rooted

Android Reverse Engineering - Beginners Guide To Smali Coding

Conquering macOS Upgrades: A Guide for iOS App Developers