Using adb shell to determine if a device is rooted

The simplest method to determine if a device is rooted is to use adb shell. This will open a shell on the device that will be accessed on the examiner's computer; this means that any commands run in the shell will be executed on the device. Once USB Debugging is enabled and Secure USB Debugging is bypassed (or from Recovery Mode, as discussed later), open a Terminal on the local computer and run the following:

adb shell

The shell will appear in one of two ways, either with $ or #:

On Linux systems, # is used to indicate a root user; $ indicates a non-root user. If the shell returns showing #, the shell has root access:

One further step may be required on some rooted devices. If the shell returns $, try running the su command (as you can see in the previous screenshot):

su

If the su binary is installed on the device, which is usually a part of the rooting process, this will escalate the shell's permissions to root if it did not open with them.

Note that some older devices automatically ran the shell as root; simply opening the adb shell may be enough to give an examiner root access.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.234.83