How To Install and Root Your Android Emulator - Cyber Treat Defense On Security Tutorials
How To Install and Root Your Android Emulator - Cyber Treat Defense On Security Tutorials
Tutorials
Mobile applications became an essential part of our lives, somehow we are dependent of them. We
are using a lot of mobile applications every day. If you are lost in a new city, Google Maps gets you out
of this situation. or if we want to make an appointment to the hairstylist, mobile applications assist us
in our daily tasks.
It comes natural to us to use applications for everything that we need so it’s good to know that some
applications might have security issues, and even know how to test their security.
Therefore, what if you want to learn how to do a mobile penetration test? Where would you begin? I
recommend you to start from this article.
I will get you through the two big steps in order to install and root an Android emulator on your
computer, which is the basis of an Android pentest.
Open Android-Studio , and select the AVD manager from the Tools tab.
In the newly tab that have been open hit the “ Create Virtual Device ” button.
Figure 1: Android-Studio AVD manager
Chose a device definition, (I have chosen Nexus 5X), and hit the “Next” button.
Under the “x86 tab” , Select Android 7.1.1 ( Google APIs ) and hit “Download” button.
After the download is finished, you can press the “ Next ” button.
In the new tab opened, you can choose a name for your virtual device under the AVD Name field,
all the other settings can be left as default. After that, you can hit the “ Finish” button.
You might want to close Android Studio now, as the system image was already created.
Figure 2: Finish the Android system image process
The bold values should be changed according to your system. By default, after the installation of
Android-Studio, the SDK_PATH is located in your home folder.
On my system, the following command is working:
Now, you have to open a new tab in the Ubuntu terminal and install adb.You can do that by typing
the following command: $ apt install adb
Adb – Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate
with a device. The adb command facilitates a variety of device actions, such as installing and
debugging apps, and it provides access to a Unix shell that you can use to run a variety of
commands on a device. [2]
After the installation of adb is completed, you can type the following command :
The previous command will Restart adbd as root and remount system as writable. Make sure you
restart the adbd while the emulator is running.
SuperSU allows for advanced management of Superuser access rights for all the apps on your
device that need root. SuperSU has been built from the ground up to counter a number of
problems with other Superuser access management tools[3]. In order to do that you have to type
the following commands in the Ubuntu terminal:
$ git clone https://github.com/0xFireball/root_avd
$ cd root_avd/
$ adb install SuperSU/common/Superuser.apk
At this stage, you should have the application SuperSU installed to the emulator. Next, you have to
type the following commands in Ubuntu terminal:
Instead of the bolded text $ARCH, you should type the architecture of your downloaded system
image. In my case, the architecture is x86, so the following command will work for me, and should
work for you too – if you downloaded the same system image as I did – $ adb push
SuperSU/x86/su /system/xbin/su
In order to finish the rooting process you have to enter some more commands in terminal.
$ adb shell chmod 0755 /system/xbin/su – This command will update permissions of the file that
have been pushed in the previous step.
$ adb shell setenforce 0 This command will Set SELinux to Permissive mode.
Finally, you can now open the superSU application on the emulator. The application will display the
following message: The SU binary needs to be updated. Continue? Hit “ Continue” and use normal
installation.
An error message is possible to de displayed : Installation failed ! Please reboot and try again. Don’t
worry about it, hit the “OK” button and you will have a rooted Android emulator.
At this stage, your emulator should be rooted, but I recommend you to type the following
commands in your terminal, otherwise, Superuser may not always persist after reboot:
$ adb shell – This command will open a root shell from your emulator.
That’s it.
Your emulator should be rooted now, even if you reboot it. Next time you want to open your emulator,
just type the command:
You have just installed and rooted an Android emulator, on your personal computer. This is the first
step in order to do mobile penetration testing, without having a physical Android device.
Write to us, in the comment section below, if the process went well for you or you have encounter any
sort of problems.
Razvan Furdui
Share this:
Tagged Android, cyber security, CyberThreatDefense, emulator, how to, how to install, how to root, install,
mobile aplications, Razvan Furdui, root
Related Articles
Tutorials
Adding CA to an Android system and bypass SSL pinning protections are two very important steps in
testing the security of different applications. After my latest article – How To Install And Root Your
Android Emulator – I received a couple of questions about what to do next. In the article that I mention
above […]
Share this:
Share this:
CTFs in Cyber-Sec… CA and Bypass SSL…
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Post Comment
Tutorials
Tools review
Security Management
Regulations
About Us
Contact Us
Recent Posts
Do not miss it
CTFs in Cyber-Security
April 14, 2019 Daniel Ciobanu
Guidance in Cyber Security Trainings
June 20, 2019 Andrei Pusoiu