Android Pentest Lab Set-Up P-1

Amey Rugge
4 min readNov 22, 2021
Img

For a Pentester at a beginner level, it is important to explore all the available options out there. The most important is to set up your own lab and try all the possible attacks without hesitation. As a beginner, I also tried, failed to do certain set-ups, but, keep trying and remember CONSISTENCY IS THE KEY.

Let’s set up the android lab with Android Studio over ubuntu. For reference, the following are the pre-requisites

  1. Ubuntu 20.04 (Which I am using)
  2. ParrotOS (For Pentesting)
  3. Virtualbox (Hypervisor)
  4. Android Studio 2020.3.1 (For Emulators and APKs)

Let’s First install Virtualbox in Ubuntu

We can install Virtualbox in two ways…

1. “sudo apt install virtualbox”

The first way is as simple as that, It will take care of its own from here.

2. Follow the steps

Step 1- Download the .deb package

Step 2- Open Terminal, locate the downloaded package, and hit command

“sudo dpkg -i <package-name.deb>”

  • Note: In case it doesn’t work change permissions with the command

“chmod -x <package-name.deb>”

and follow Step 2

Step 3- Check with command

“virtualbox” and hit enter

You will see something like the following image. Now you are good to go with further installations

img-1

Now Let’s install ParrotOS in Virtualbox

Steps for installation are here

Now you are couple steps behind of your AIM. Let’s go further.

Install Android Studio

  1. Unpack the “.zip” or “.tar.gz” file you downloaded to an appropriate location for your applications, such as within /usr/local/ for your user profile, or /opt/ for shared users.
  • Note- If you’re using a 64-bit version of Linux, make sure you first install the required libraries for 64-bit machines. Use the following command.
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

2. To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute studio.sh.

You’ll see the screen like this…

img-2

Install Emulator and Launch

Locate settings and open AVD Manager as follows…

img-3

Now, create a virtual device(emulator) with the option “create virtual device” in the following image you can see some devices are already created.

img-4

Select the device of your choice and click Next

img-5

Select Android Version. If the version is not yet used it needs to be downloaded. Select and click download.

img-6

You’ll see the following screen when you initiate the download

img-7

Finish the download when it completes and select the Android version, click Next.

img-8

Now Finish the job. Start the device that you just created.

img-9

Now you can start the device without Android Studio as well. Let me walk you through it.

Locate Directory “/Android/Sdk/emulator” open terminal in the same folder and hit the following command

./emulator -list-avds

./emulator -avd <avd-name>

e.g. ./emulator -avd Pixel_4

We are done with the first part of Set-Up. Now we can install any APK to the device and start exploring.

With the next article, we’ll check certain set-ups that are needed for further pentests. Till then remember “CONSISTENCY IS THE KEY”.

--

--