How to setup an Android phone emulator under Kali Linux and test DroidJack 3.3

Hi everybody and welcome in a new day, In this tutorial I will run you through setting up the emulator of the Android SDK under Kali, convincing DroidJack to build apks under Linux and how to test your apk on this setup.

You'll want to do this in a VM or isolated physical box because I did not (yet) check for any unwanted behavior of this "cracked" DroidJack leak.

You'll need:


- A current Kali install. Google for tuts on this if you never did a Kali install.

- The Android SDK from here: https://developer.android.com/sdk/index.html#Other
  You only need the "SDK Tools Only" version, in my case this was "android-sdk_r24.2-linux.tgz"

- The "cracked DroidJack 3.3" rar (kjf.rar) from this here: https://www.rekings.com/droidjack-3-3-cracked/

Well then, let's get started.

Boot up your Kali Linux and open 2 console windows, on both stay in your home folder. You don't need root privileges for any of this btw.

First we are going to get the emulator working.

From your home dir in the 1st console window issue these commands:

If you're running a 64 bit system, skip this first one.

export ANDROID_EMULATOR_FORCE_32BIT=true

wget https://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar xvfz android-sdk_r24.2-linux.tgz
./android-sdk-linux/tools/android &

This will download, unpack and run the Android SDK Manager and you should see something like this:


It will immediately try to go online and check for new packages, act accordingly if this is a concern to you. But you will have to download some packages in any case.

Check, download and install these packages (uncheck everything else):

Tools
-> Android SDK Tools (Rev. 24.2 should already be installed and is sufficient for this tut)
-> Android SDK Platform-tools
-> Android SDK Build-tools

and i.e. for KitKat

Android 4.4.2 (API 19)
-> SDK Platform
-> ARM EABI v7a System Image
-> Google APIs (ARM System Image)

After the download/install has finished you can go to "Tools -> Manage AVDs..." in the window menu. It should open the AVD Manager, here click "Create" and configure a new AVD (virtual phone if you will). Here's the config I went with:


Click "OK" and then "Start..." and now wait until your virtual android phone has finished booting (this can take a while but the next starts will be faster).


Now that you have an emulated android mobile running that is eagerly waiting to install our test.apk, let's prepare DroidJack.


Go to your 2nd console window and create a directory for DJ, place your DJ archive (kjf.rar) in there and unpack it.

mkdir DJ; cd DJ

Copy kjf.rar to here, then:

unrar x kjf.rar
cd kjf

Now, since this version of DJ does not build apks on Linux out of the box, we have to use a little dirty hack. I won't go into why but what we will do is replace a .zip with an empty one and copy over the appropriate tool from the android sdk ourselfs:

mv Apktool/aapts.zip Apktool/aapts.zip.orig
echo UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA== | base64 -d >Apktool/aapts.zip
cp ~/android-sdk-linux/build-tools/22.0.1/aapt ./

Next we setup the environment for this console window so that Java 7 is used instead of Kali's default Java 6. DJ needs Java 7.

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/bin/java
PATH=/usr/lib/jvm/java-7-openjdk-i386/bin:$PATH

Now we are ready to run DJ:

java -jar DroidJack.jar &

In DJ's window click on "Create APK" and configure your apk. Most important for this tutorial is to set the "Dynamic DNS" to "10.0.2.2" since that's the IP with which the android emulator can reach the host system. Then click on "Generate". This is how it looked for me:


You should now have a "test.apk" in the current directory. In DJ click on "Devices" and set "Reception" to "ON", DJ is now listening on the specified port (should of course match the one that you have configured your apk with).

Now we are going to install "test.apk" onto our emulated phone. In the 2nd console window (should still be in the dir with the generated apk) issue:

~/android-sdk-linux/platform-tools/adb install test.apk

It should finish with a success message and you should now be able to find it on the phone:


Click on it, And the phone should show up as a victim in DJ:




Voila, that was all. Now you can test or even analyze DJ (or other android rats/apps) with all the nice tools Kali comes with. And without ruining your real mobile all the time. ;)

Troubleshooting:

- If DJ says all is fine after you generated a apk but the file is not there then some kind of internal exception occurred but DJ keeps that from you. And it means you did something wrong or my tut sucks.
- If you have questions / problems post them here and I'll try to optimize the tutorial and help you out.


I hope this was helpful to some. 

Have fun!

Do not forget to share our articles , it's the best support for us, thanks.
Previous
Next Post »

1 comments:

Click here for comments
henry
admin
January 22, 2021 at 2:23 PM ×

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. emulator android

Congrats bro henry you got PERTAMAX...! hehehehe...
Reply
avatar