Magisk icon indicating copy to clipboard operation
Magisk copied to clipboard

Ing Bank app might have busted MagiskHide

Open djechelon opened this issue 7 years ago • 16 comments

Hi,

I am customer of ING Bank and use their app. The app is publicly downloadable and does not require log in to test for root detection.

The application does not yet prevent root users from logging in, but I am afraid that in the future, once they implement NFC payment, things will get harder.

I use Magisk 18.0 on Pixel 3XL and until the app's last update, MagiskHide successfully hid itself from ING. After the most recent app update, and perhaps after a temporary crash of Magisk which revealed root to SafetyNet and all the apps, ING started to recognize me as root and displayed a warning on its main screen.

I applied the latest OTA from Google (yes, I was a bit behind updates), and before flashing Magisk I gave another try to ING. Still, I was detected as root even with stock firmware.

I reinstalled Magisk nonetheless, reapplied MagiskHide to all apps I was interested in and wiped Cache/Dalvik.

Today...

  • Magisk's SafetyNet passes
  • Google Play Store recognizes the device as Certified. Netflix app is downloadable
  • Google Pay does not detect root and doesn't prevent me to add cards (disclaimer: I am prevented to add my card because it's unsupported, but Pay normally checks SafetyNet before checking the card)
  • Other apps I hid in MagiskHide do not recognize me as root
  • ING still recognizes me as root

I have no evidence suggesting me that since this last update once ING detects a hardware device ID that does not pass SafetyNet it will display the warning forever.

I have no evidence suggesting that SafetyNet was updated to detect if the bootloader is unlocked. In fact, when I flashed OTA, I was still unlocked.

I have no evidence suggesting that ING is using a brand new mechanism to detect root.

I am providing the link to the official Play Store listing, I can easily extract the APK from phone in case someone wants to take deeper analysis on it.

The application is fully localized in Italian. The presence of a warning ⚠together with a message as follows indicates that you have been busted as root. Its absence means you are either stock or undetected

Consigliamo di installare ed utilizzare l'App su dispositivi con sistema operativo autorizzato e certificato Android. Nel caso in cui il tuo dispositivo abbia subito un processo di rooting non è possibile garantire il corretto funzionamento e la completa sicurezza dell'App ING Italia

djechelon avatar Jan 21 '19 19:01 djechelon

Tested. No problems hiding root from the app in question.

You can close this issue.

Didgeridoohan avatar Jan 22 '19 03:01 Didgeridoohan

Have you tried running the app once without Magisk Hide enabled? I continue to get the same issue. No other root app is busted. SafetyNet passes. Tried to wipe application data.

Any help I can provide? Logs etc?

djechelon avatar Jan 30 '19 13:01 djechelon

I've tested with the app both off and on the Hide list, and with the Manager both repackaged and not. The app needs to be on the Hide list and the Magisk Manager need to be hidden, or I'll see the warning message.

Didgeridoohan avatar Jan 30 '19 14:01 Didgeridoohan

Confirmed repackaging Magisk blew the warning up. It is likely that the application has a list of known root-manager package names. I totally forgot about Manager Hide feature so I never tried that.

djechelon avatar Jan 30 '19 14:01 djechelon

This ticket shouldn't be closed... App is still sometimes capable to detect root...

enetec1 avatar Feb 16 '20 13:02 enetec1

@enetec1 There is one obvious method to detect Magisk exploiting fact that MagiskHide doesnt work properly for applications with an isolated context https://github.com/topjohnwu/Magisk/issues/2406

And who knows how many other methods exist and which one is used in this app.

kam821 avatar Feb 16 '20 13:02 kam821

@enetec1 I am not getting any more true positives from Ing. Perhaps your problem might be that Magisk became unstable on your device. I doubt that the bank already implemented isolated context, at least till they still don't offer mobile payment options (which is the mail leverage of anti root detection)

djechelon avatar Feb 17 '20 08:02 djechelon

To be honest ING app has a very weird behaviour... I've no issues with Google Pay and Sky Go (two of the hardest app in Italy...) and with Fineco bank app too. Ing with same settings was able to detect root (& show a warning splash screen...). Changing name to Magisk Manager app it worked fine for a while... now it's some days that of my two identical devices (really identical, even with apps, files & settings...) on one it works fine and on the other I have warning splash. I'll try to understand because of this behaviour and I would update here eventually...

enetec1 avatar Feb 17 '20 12:02 enetec1

Some updates... I've found ING app makes use of IBM Trusteer solution to "detect compromised mobile devices"... connecting to trusteer.com on startup.

I've so inhibited this access to app using AdAway blacklist.

Still not solved for now (I can't reset app so often since I've token enabled and I need it daily...) BUT app still works fine and I'm sure this could be a needed first step.

More, on the second device I've already seen warning splash screen to go away without resetting app, so it could fix itself in some days...

Anyway I think this app would eventually require a specific (Magisk or Xposed...) module to be maintained "safe" at the end and not a simple Magisk Hide setting... :/

enetec1 avatar Feb 19 '20 07:02 enetec1

That's very strange. My warning from ING disappears immediately once I restore Hide.

I think you need to reset your entire device for once at least

djechelon avatar Feb 19 '20 08:02 djechelon

This is not so strange... look in /data/data/it.ingdirect.app/tas/_dd_riskscore/ ;)

enetec1 avatar Feb 19 '20 09:02 enetec1

A simple device reboot after blocking (by AdAway...) the Trustee site access solved on my second device. Before reboot every tries I made was no success...

enetec1 avatar Feb 21 '20 10:02 enetec1

Latest version may look for the "su" binary in the path :)

Speculation:


    public static Shell getShell(boolean z, int i, Shell.ShellContext shellContext, int i2) throws IOException, TimeoutException, RootDeniedException {
        if (z) {
            return Shell.startRootShell(i, shellContext, i2);
        }
        return Shell.startShell(i);
    }


---

    public static boolean isRooted() {
        try {
            return searchPathForBinary("su");
        } catch (Exception e) {
            DeviceLog.exception("Rooted check failed", e);
            return false;
        }
    }

    public static boolean isBusyboxAvailable() {
        return findBinary("busybox", true).size() > 0 || findBinary("toybox", true).size() > 0;
    }

...

    private static boolean searchPathForBinary(String str) {
        File[] listFiles;
        for (String file : System.getenv("PATH").split(":")) {
            File file2 = new File(file);
            if (file2.exists() && file2.isDirectory() && (listFiles = file2.listFiles()) != null) {
                for (File name : listFiles) {
                    if (name.getName().equals(str)) {
                        return true;
                    }
                }
                continue;
            }
        }
        return false;
    }

---

hashMap3.put("rooted", isRooted());

    protected static Boolean isRooted() {
        String str = Build.TAGS;
        if (str != null && str.contains("test-keys")) {
            return true;
        }
        String[] strArr = {"/data/local/bin/su", "/data/local/su", "/data/local/xbin/su", "/sbin/su", "/su/bin", "/su/bin/su", "/system/app/SuperSU", "/system/app/SuperSU.apk", "/system/app/Superuser", "/system/app/Superuser.apk", "/system/bin/failsafe/su", "/system/bin/su", "/system/sd/xbin/su", "/system/xbin/daemonsu", "/system/xbin/su"};
        int i = 0;
        while (i < 15) {
            try {
                if (new File(strArr[i]).exists()) {
                    return true;
                }
                i++;
            } catch (RuntimeException e) {
                Log.e("o.b.g.d.a.a", "Exception while attempting to detect whether the device is rooted", e);
            }
        }
        return false;
    }


cr1cr1 avatar Jul 16 '20 22:07 cr1cr1

@enetec1 jsut for sake of our own discussion (as issue is closed), I found more. Blocking Trusteer from the DNS didn't work for me, at all.

But if you create a new Android user, e.g. a work profile, using Android's native multi-user feature, and don't install too many fancy apps, ING Bank won't detect you rooted while it does on your main profile. It may be that Trusteer scans for "common root apps" like AdAway, TitaniumBackup, which are not available, unless you explicitly install them, on the secondary account.

I chmodded 000 /data/app/it.ingdirect.app*/lib/arm64/libtaz_full*.so (mine being libtaz_full_5.1.0.29.so) so ING might unable to trigger the Trusteer scan. It worked only once, as after the subsequent reboot I again got the root warning

The app also tries insistently to restore files&chmods for /data/data/it.ingdirect.app/app_lib/*.so which contains a copy of libtaz.

djechelon avatar Aug 23 '20 12:08 djechelon

Upgraded to latest Magisk Manager, now root is undetected. I had and still have different name for Magisk Manager and unchanged settings. Probably ING app was capable to see Magisk Manager app anyway and no more with new version... :?

enetec1 avatar Oct 05 '20 10:10 enetec1

I have the same problem, disabling Addaway while opening ING app solved the issue.

pocheche avatar Mar 30 '23 22:03 pocheche