Post

Root Quest - Mobile Hacking Community CTF Writeup

Walkthrough for the Root Quest Android reverse engineering challenge from Mobile Hacking Community CTF.

Root Quest - Mobile Hacking Community CTF Writeup

Challenge Info

FieldDetails
CTFMobile Hacking Community CTF
ChallengeRoot Quest
CategoryAndroid / Reverse Engineering

Description

An application implements checks to detect rooted devices and emulators, preventing normal usage. Can you bypass these protections?

Solution

We can start by installing and opening the APK,

alt text

As expected, we cant enter the app as we are running it on a rooted emulator Now, we can inspect it in Jadx to understand how we should craft the bypass

alt text

It just calls two static methods isRunningOnEmulator() and isDeviceRooted from the classes EmulationUtil and RootUtil respectively. We can use Frida to force the return values of both the methods to 0(false)

1
2
3
4
5
6
7
8
9
10
11
Java.perform(() => {
    var Interceptor = Java.use("com.just.mobile.sec.challenge3.EmulationUtil");
    var Interceptor1 = Java.use("com.just.mobile.sec.challenge3.RootUtil");
    Interceptor.isRunningOnEmulator.implementation = function(){
        return 0;
    }
    Interceptor1.isDeviceRooted.implementation = function(){
        return 0
    }

})

We just need to load this script,

alt text

Flag

1
FLAG:MHC{j1qwqc01kbi1a08wamce3}
This post is licensed under CC BY 4.0 by the author.