Proj 6: Android Debug Bridge (15 pts)

What You Need for This Project

Purpose

To configure your system so the Android Debug Bridge in Kali can access your Genymotion virtual machine.

Finding Kali's IP Address

Start your VMware Kali virtual machine and connect to the Internet.

On Kali, in a Terminal, execute this command:

ip addr
Find your IP address, as highlighted in the image below.

Find the Host Adapter Name

On your host system, open a Terminal or Command Prompt.

If you are using Mac OS, execute this command:

ifconfig
Find the adapter with an IP address on the same subnet as your Kali machine.

On my system, it was vmnet8, as highlighted in the image below.

Adding a Second Network Adapter to the Genymotion Machine

If your Genymotion virtual Android phone is running, close it.

Launch VirtualBox. If you are using a Mac, you may have to intall VirtualBox first from:

https://www.virtualbox.org/wiki/Downloads

In VirtualBox, click to select your "Google Pixel 3" device, as shown below. Click Settings.

On the Network tab, the first Adapter is set to "Host-only", as shown below. Don't change anything here--this adapter is reuired for Genymotion.

Click the "Adapter 2" tab. Set this adapter to Bridged and connect it to the host adapter Kali is using, as shown below.

Click Advanced and allow "Promiscuous Mode", as shown below.

Click OK.

Troubleshooting

After this networking adjustment, you must always start VMware before Genymotion. Otherwise Genymotion will give an error and tell you to open Virtualbox to adjust the networking.

Adjusting Android Networking to Bypass the Proxy

Start your Genymotion Android device.

Open Settings.

In Settings, click "Network & internet".

Click Wi-Fi.

Click AndroidWiFi.

Click Advanced.

In the "Network details" screen, at the top right, click the Pencil icon.

In the "Proxy" field, click the down-arrow.

Click None.

Then click Save.

Find your IP address, as shown below. It should be on the same subnet as Kali.

Make a note of it--you will need it below.

Enabling USB Debugging

In Settings, at the top, click the back-arrow three times to get back to the main Settings page.

Scroll to the bottom and click System.

Click Advanced, "Developer Options"

Scroll down slowly to find the "USB Debugging" option, as shown below.

Click the "USB Debugging" and click OK. The slider should turn green, as shown below.

Pinging your Android Device from Kali

On Kali, in a Terminal, execute this command, replacing the IP address with the IP address of your Genymotion Android device:
ping -c 4 172.16.123.154
You should see replies, as shown below.

If you don't, you need to troubleshoot your networking before proceeding.

Connecting to your Android Device with ADB

On Kali, in a Terminal, execute these commands, replacing the IP address with the IP address of your Genymotion Android device:
apt update
apt install android-tools-adb -y
adb connect 172.16.123.154
adb devices -l

Troubleshooting

If you see an error message saying "E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)", restart your Kali machine.
You should see your Genymotion device in the "List of devices attached", as shown below.

Using an ADB Shell

On Kali, in a Terminal, execute these commands:
adb shell
uname -a
exit
You should see a root shell on the Android device, with the Linux version information.

Find the text covered by a green box in the image below.

Recording Your Success

Use the form below to record your score in Canvas.
Name or Email:
Version information (redacted in the image above):

Posted 1-14-19
Troubleshooting tip added 1-16-19
Mention of Windows removed 2-20-29