News for hackers. Stuff that matters.
Re:Introducing Netflix Stethoscope by crudbug on Tuesday February 21, 2017 @01:55PM (#13698331)
How do you detect whether a device is Jailbroken/rooted ?

[Edit] : Found this - https://github.com/scottyab/rootbeer

I think this will be useful for applications that want to know if the execution environment is safe or not - Banking / Payments etc.

Re:Introducing Netflix Stethoscope by cprecioso on Tuesday February 21, 2017 @02:12PM (#13698590)
In Android, you can use the Google SafetyNet API, that checks whether the system partition has been modified or mounted r/w, the existence of the su binary and some more clues like those.

I don't know the current state of jailbreak detection in iOS, but I do remember that some time ago, as a rudimentary jailbreak detection, iBooks tried to run unsigned code at launch, and if it ran, the app would refuse to open.

Re:Introducing Netflix Stethoscope by crudbug on Tuesday February 21, 2017 @03:27PM (#13699569)
Interesting, I am guessing there is some kind of learning net behind SafetyNet API - Harvesting all the device infos.
Re:Introducing Netflix Stethoscope by evanreichard on Tuesday February 21, 2017 @04:31PM (#13700221)
SafetyNet is pretty flexible. It actually isn't implemented inside any APK - "The SafetyNet service reaches out to a Google server and downloads a binary package with the code. It goes to great lengths to validate the integrity of the package, for example using hardcoded certificates (pinning). This binary package is essentially a JAR file that contains a classes.dex file with java bytecode. Play Services caches it in dalvik-cache (snet.dex) and loads it dynamically using reflection." [1].

I think right now the only way "around" it has been Magisk [2].

[1] https://koz.io/inside-safetynet/

[2] https://forum.xda-developers.com/apps/magisk/official-magisk...

Re:Introducing Netflix Stethoscope by cprecioso on Tuesday February 21, 2017 @04:36PM (#13700265)
And suhide [1], but that one's a cat and mouse game, as acknowledged by the developer.

[1]: https://forum.xda-developers.com/apps/supersu/suhide-t345039...

Re:Introducing Netflix Stethoscope by cprecioso on Tuesday February 21, 2017 @04:33PM (#13700244)
I don't think that'd be necessary. Google's stated that SafetyNet's purpose is not excluding power-users, but ensuring the security model of the OS has not been compromised, in order to activate certain sensitive functions (e.g. Android Pay).

Given that developments in the root community are few but well-known, it'd only take a weekly visit to the XDA Developers forum by an intern to learn about any new rooting method, and not many resources to successfully block them.

No need for a complicated (and expensive) information gathering and mining rig _for SafetyNet_. Could they be gathering that information with other purposes? Given that Play Services de-facto has root powers within Android, maybe.

Re:Introducing Netflix Stethoscope by problems on Tuesday February 21, 2017 @03:05PM (#13699337)
You can try lots of things, detecting su binaries, UI applications, checksumming the entire filesystem, etc. But ultimately if the user doesn't want you to know, you won't know.

Rooting or jail breaking your device is taking control of your device into your own hands, if you use something like Magisk, you can fully bypass root detection, even via the nastiest methods on Android.

Detecting it as a security problem is moronic. In fact, I'd argue it's actually a security improvement due to things like XPrivacy.

Re:Introducing Netflix Stethoscope by twodayslate on Tuesday February 21, 2017 @04:15PM (#13700077)
> Detecting it as a security problem is moronic. In fact, I'd argue it's actually a security improvement

By definition a jailbroken device is vulnerable to something as that is how it was jailbroken in the first place. Having the most up to date version is usually the safest thing for a user.

Re:Introducing Netflix Stethoscope by problems on Tuesday February 21, 2017 @04:21PM (#13700125)
Sure, so detect that as the problem.

That's not true of rooted Android devices though, most Android devices allow you to enable a developer mode which will allow you to replace the ROM entirely if you like with no need to exploit anything.

Re:Introducing Netflix Stethoscope by kodroid on Tuesday February 21, 2017 @06:27PM (#13701241)
I think your talking about bootloader unlocking rather than dev mode
Re:Introducing Netflix Stethoscope by nissimk on Tuesday February 21, 2017 @03:20PM (#13699479)
I'm curious to hear other people's opinions about this. I feel like the smartphone security model provides security for the OS developers, the app developers and their advertising customers at the expense of usability for the users. But it also provides real security to the users.

I generally choose usability over security, but maybe I should be more paranoid.

I do not have android pay enabled on my phone but I'm not sure I'd be comfortable with it even if I wasn't rooted. I insist on root because I want to block ads and install themes. It's possible to do these things without root, but it's harder.

Please comment people with deeper knowledge of security.

Re:Introducing Netflix Stethoscope by problems on Tuesday February 21, 2017 @03:26PM (#13699553)
The sandbox has been good in that it hasn't let the Windows model of apps running rampant with admin privileges do whatever they want with your data. It's mostly prevented cross-app data access.

But that's not where it stops. You see, there's still plenty of great data they can grab when you blindly click accept on that permissions dialog. Contacts are grabbed by many applications, unique device identifiers, loading your app with ads, even grabbing GPS location are pretty much standard practice now.

These practices which used to be labeled spyware or adware and hunted down and removed are now the norm.

These apps grab this data and then throw it out onto the open internet, often over unencrypted connections to parties who you don't know or trust, who are often unrelated to the app developer almost entirely, most often just so some advertiser knows you play a certain game or live in a certain city.

It depends on your definition of security - if it's strictly clicking on an ad and getting malware - it's great - but if it includes things like leaking contacts, locations and identifying information - it's terrible. XPrivacy is the only solution I've seen to really hit back at it.

Rooting your device does NOT immediately lose all sandbox benefits. It only selectively bypasses it. If you don't approve EvilMalware to bypass the sandbox - it still can't break out.

As for Android Pay? Go ahead and use it. Rooted or not, to my understanding, you're not liable for fraud on it, your credit card company will still reverse transactions no problem.

Re:Introducing Netflix Stethoscope by deadcell on Tuesday February 21, 2017 @03:50PM (#13699793)
Interestingly, it's how Pokemon Go detects whether or not you're trying to 'cheat' the game, and flat-out refuses to run the game if you're in either a rooted OS or are running anything non-vanilla (I lost access to the game after they decided to block cyanogenmod in the same update).
Re:Introducing Netflix Stethoscope by problems on Tuesday February 21, 2017 @04:01PM (#13699918)
Yeah, so it depends on the way they detect it. You can bypass anything, even Google SafetyNet with stock ROM + magisk + systemless Xposed + phh su and using Magisk Hide if you're determined enough.

CM ships pre-rooted - you just enable it in the settings, but the su binary is present and can be detected by any app looking for it. So that's a very common way to detect it on CM.

Re:Introducing Netflix Stethoscope by voltagex_ on Tuesday February 21, 2017 @07:27PM (#13701668)
I did all this and still failed the SafetyNet check on a Motorola X Style.
Re:Introducing Netflix Stethoscope by problems on Wednesday February 22, 2017 @08:39AM (#13705351)
It seems things have shifted again since I last checked and now magisk has its own builtin su, magiskhide is greatly improved and many people are using suhide instead altogether.
Re:Introducing Netflix Stethoscope by Godel_unicode on Tuesday February 21, 2017 @05:07PM (#13700516)
> Detecting it as a security problem is moronic

That's an interesting stance, you don't care about rootkits? What about malware, which has been found in the wild, which abuses root privileges to steal account information? That malware is extremely difficult to detect directly.

Re:Introducing Netflix Stethoscope by problems on Tuesday February 21, 2017 @06:37PM (#13701333)
On Android, the standard root system most people apply to their device prompts you when you launch an application if you want to allow it root access. This makes it trivial to block malicious applications - that new game you downloaded probably doesn't need root for any good reason. Just hit deny. The sandbox is still fully in place, just now you can poke holes in it for certain applications of your choosing.

What you're thinking of are things which use exploits to gain root - this may be done by some users, but most often Android devices are rooted via bootloader unlocking these days, which does _not_ use an exploit.

Exploits however are used by malware - and not having your device rooted won't prevent them. They gain root via exploitation, whether you want them to or not.

Not to mention that the kind of root detection done is by looking for things that only the legitimate sort of root leaves behind, like a su binary which prompts the user if they want to permit root or not.

Often times, rooting your device legitimately may allow you to flash a custom ROM and get updates that your original vendor hasn't released for your device, allowing you to actually _prevent_ exploitation by malware, even after your vendor has long abandoned the device.

Re:Introducing Netflix Stethoscope by Godel_unicode on Tuesday February 21, 2017 @09:26PM (#13702388)
My experience has been that Android malware authors tend to be kind of sloppy, and frequently leave a modified su binary hanging around. YMMV.
Re:Introducing Netflix Stethoscope by problems on Wednesday February 22, 2017 @08:42AM (#13705373)
In the same place that you'd install it as a user?

That'd be some very stupid malware - anyone who was actually rooted would notice immediately when their root tool told them their support binary needs to be updated.

Re:Introducing Netflix Stethoscope by literallycancer on Tuesday February 21, 2017 @05:41PM (#13700829)
Presumably you use something to manage which apps get root access. Or is there actually malware that doesn't require any user screw ups?
Re:Introducing Netflix Stethoscope by kodroid on Tuesday February 21, 2017 @06:28PM (#13701258)
Depends on the method of rooting
Re:Introducing Netflix Stethoscope by Godel_unicode on Tuesday February 21, 2017 @09:20PM (#13702352)
For instance, if you get a malicious application which roots your phone and doesn't bother to tell you (the nerve!). You might have a security problem with your phone whose most easily detectable sign is the presence of root.
Re:Introducing Netflix Stethoscope by kodroid on Tuesday February 21, 2017 @06:32PM (#13701285)
Not moronic. If your front door is open, how do I know who opened the door?
Re:Introducing Netflix Stethoscope by rsync on Tuesday February 21, 2017 @04:46PM (#13700355)
"I think this will be useful for applications that want to know if the execution environment is safe or not - Banking / Payments etc."

Which is the safe one ? The default ecosystem or the jailbroken one ?

I ask because most of the advanced security measures and hardening that I ever considered doing on an android phone required jailbreaking ...

Re:Introducing Netflix Stethoscope by crudbug on Tuesday February 21, 2017 @05:16PM (#13700578)
Nothing is safe. The platforms can atleast do a better job to provide feedback or display on the UI, whether the current environment is safe, for monetary txns etc.

Secureboot [0] creates trust between hardware and software, but here you have to trust the hardware. An interesting question is how can software audit its hardware that is driving it ?

ARM TrustZone [1] is another way to offload all the sensitive computation onto another embedded SoC. But, its hard to know what the application is using. You sort of have to trust the banks to do the best job.

[0] https://source.android.com/security/verifiedboot/

[1] https://www.arm.com/products/security-on-arm/trustzone

Re:Introducing Netflix Stethoscope by tylorr on Tuesday February 21, 2017 @02:08PM (#13698538)
My first guess would be to attempt an operation that only works if the device is rooted.
Re:Introducing Netflix Stethoscope by elastic_church on Tuesday February 21, 2017 @02:08PM (#13698541)
One thing I used to do was check if the hosts file had been modified, or something like that.

I had conditional paths for showing ads, and some rooted phones had blocked ads based on IP address.

Re:Introducing Netflix Stethoscope by irfanka on Tuesday February 21, 2017 @02:11PM (#13698585)
Try executing something that needs root-level access(?)