Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Hacking Android
  • Table Of Contents Toc
Hacking Android

Hacking Android

By : Mohammed A. Imran, Rao Kotipalli
4.4 (5)
close
close
Hacking Android

Hacking Android

4.4 (5)
By: Mohammed A. Imran, Rao Kotipalli

Overview of this book

With the mass explosion of Android mobile phones in the world, mobile devices have become an integral part of our everyday lives. Security of Android devices is a broad subject that should be part of our everyday lives to defend against ever-growing smartphone attacks. Everyone, starting with end users all the way up to developers and security professionals should care about android security. Hacking Android is a step-by-step guide that will get you started with Android security. You’ll begin your journey at the absolute basics, and then will slowly gear up to the concepts of Android rooting, application security assessments, malware, infecting APK files, and fuzzing. On this journey you’ll get to grips with various tools and techniques that can be used in your everyday pentests. You’ll gain the skills necessary to perform Android application vulnerability assessment and penetration testing and will create an Android pentesting lab.
Table of Contents (12 chapters)
close
close
11
Index

Setting up an AVD

To get hands-on experience of most of the concepts in this book, readers must have an emulator or a real Android device (preferably a rooted device) up and running. So, let's see how to create an emulator using the setup we have from the previous installation:

  1. Click the AVD Manager icon at the top of the Android Studio interface, shown in the following image:
    Setting up an AVD
  2. This will open the following window. There is one emulator by default, which was created during Android Studio's installation process:
    Setting up an AVD
  3. Click the Create Virtual Device button in the bottom-left corner of the previous window. This will display the following window:
    Setting up an AVD
  4. Now, choose your device. I chose a device with the following specs, to create an emulator of a small size:
    Setting up an AVD
  5. Click Next and you will see the following window. If you check Show downloadable system Images, you will see more options for your system images. We can leave it to the default of x86 for now.

    Note

    SDK Manager helps us to manage all system images and SDKs installed on the system.

    Setting up an AVD
  6. Finally, give your AVD a name and click Finish. In our case, we named it Lab Device:
    Setting up an AVD
  7. Once you are done with the previous steps, you should see an additional virtual device, shown here:
    Setting up an AVD
  8. Select the emulator of your choice and click the Play button to start the emulator:
    Setting up an AVD

When it's ready, you should see an emulator, as shown here:

Setting up an AVD

Real device

It is recommended you have a real device along with an emulator to follow some of the concepts shown in this book.

The authors have used the following device for some of their demonstrations with real devices: Sony Xperia model c1504, rooted:

Real device

Apktool

Apktool is one of the most important tools that must be included in an Android penetration tester's arsenal. We will use this tool later for Android application reverse engineering, and for creating malware by infecting legitimate apps.

Download the latest version of Apktool from the following link (please download Apktool 2.0.2 or later to avoid some issues that exist in older versions):

http://ibotpeaches.github.io/Apktool/

We downloaded and saved it in the C:\APKTOOL directory, as shown in the following screenshot:

Apktool

Now, we can go ahead and launch Apktool, using the following command to see the available options:

java –jar apktool_2.0.2.jar  --help
Apktool

This completes the setup of Apktool. We will explore Apktool further in future chapters.

Dex2jar/JD-GUI

Dex2jar and JD-GUI are two different tools that are often used for reverse engineering Android apps. Dex2jar converts .dex files to .jar. JD-GUI is a Java decompiler that can decompile .jar files to the original Java source.

Download both the tools from the links provided. No installation is required for these tools, as they are executables:

http://sourceforge.net/projects/dex2jar/

http://jd.benow.ca

Dex2jar/JD-GUI

Burp Suite

Burp Suite is without a doubt one of the most important tools for any penetration testing engagement. Android apps are not an exemption. This section shows how we can set up Burp Suite to view the HTTP traffic from an emulator:

  1. Download the latest version of Burp Suite from the official website:

    http://portswigger.net/burp/download.html

  2. To launch Burp Suite, double-click on the downloaded file, or simply run the following command, assuming that the downloaded file is in the current working directory:
    Burp Suite
  3. The preceding command launches Burp Suite and you should see the following screen:
    Burp Suite
  4. Now we need to configure Burp by navigating to Proxy | Options. The default configuration looks like this:
    Burp Suite
  5. We have to click the Edit button to check the Invisible option. We can do this by clicking the Edit button, navigating to Request handling and then checking Support invisible proxying (enable only if needed). This is shown in the following figure:
    Burp Suite
  6. Now, let's start our emulator in order to configure it to send its traffic through Burp Suite.
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Hacking Android
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon