M 201: ADB on Genymotion (15 pts) M 201:关于Genymotion的ADB(15分)

What You Need for This Project你需要什么这个项目

Purpose目的

To configure your system so the Android Debug Bridge in Kali can access your Genymotion virtual machine.要配置系统,以便Kali中的Android Debug Bridge可以访问您的Genymotion虚拟机。

Finding Kali's IP Address找到Kali的IP地址

Start your VMware Kali virtual machine and connect to the Internet.启动VMware Kali虚拟机并连接到Internet。

On Kali, in a Terminal, execute this command:在Kali上,在终端中执行以下命令:

ip addr ip addr
Find your IP address, as highlighted in the image below.找到您的IP地址,如下图所示。

Find the Host Adapter Name找到主机适配器名称

On your host system, open a Terminal or Command Prompt.在主机系统上,打开终端或命令提示符。

If you are using Mac OS, execute this command:如果您使用的是Mac OS,请执行以下命令:

ifconfig使用ifconfig
Find the adapter with an IP address on the same subnet as your Kali machine.找到与Kali计算机位于同一子网的IP地址的适配器。

On my system, it was vmnet8 , as highlighted in the image below.在我的系统上,它是vmnet8 ,如下图所示。

Adding a Second Network Adapter to the Genymotion Machine将第二个网络适配器添加到Genymotion机器

If your Genymotion virtual Android phone is running, close it.如果您的Genymotion虚拟Android手机正在运行,请将其关闭。

Launch VirtualBox.启动VirtualBox。 If you are using a Mac, you may have to intall VirtualBox first from:如果您使用的是Mac,则可能必须先从以下位置安装VirtualBox:

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

In VirtualBox, click to select your "Google Pixel 3" device, as shown below.在VirtualBox中,单击以选择“Google Pixel 3”设备,如下所示。 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.不要在这里改变任何东西 - 这个适配器是为Genymotion需要的。

Click the " Adapter 2 " tab.单击“ 适配器2 ”选项卡。 Set this adapter to Bridged and connect it to the host adapter Kali is using, as shown below.将此适配器设置为Bridged并将其连接到Kali正在使用的主机适配器,如下所示。

Click Advanced and allow " Promiscuous Mode ", as shown below.单击“ 高级”并允许“ 混杂模式 ”,如下所示。

Click OK .单击确定

Troubleshooting故障排除

After this networking adjustment, you must always start VMware before Genymotion.在进行此网络调整后,您必须始终在Genymotion之前启动VMware。 Otherwise Genymotion will give an error and tell you to open Virtualbox to adjust the networking.否则Genymotion会给出错误并告诉您打开Virtualbox来调整网络。

Adjusting Android Networking to Bypass the Proxy调整Android网络以绕过代理

Start your Genymotion Android device.启动您的Genymotion Android设备。

Open Settings .打开设置

In Settings, click " Network & internet ".在“设置”中,单击“ 网络和Internet ”。

Click Wi-Fi .点击Wi-Fi

Click AndroidWiFi .单击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.找到您的IP地址,如下所示。 It should be on the same subnet as Kali.它应该与Kali在同一子网上。

Make a note of it--you will need it below.记下它 - 你需要它在下面。

Enabling USB Debugging启用USB调试

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.慢慢向下滚动以找到“ USB Debugging ”选项,如下所示。

Click the " USB Debugging " and click OK .单击“ USB调试 ”,然后单击“ 确定” The slider should turn green, as shown below.滑块应变为绿色,如下所示。

Pinging your Android Device from Kali从Kali ping您的Android设备

On Kali, in a Terminal, execute this command, replacing the IP address with the IP address of your Genymotion Android device:在Kali上,在终端中,执行此命令,将IP地址替换为您的Genymotion Android设备的IP地址:
ping -c 4 172.16.123.154 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使用ADB连接到您的Android设备

On Kali, in a Terminal, execute these commands, replacing the IP address with the IP address of your Genymotion Android device:在Kali上,在终端中,执行这些命令,将IP地址替换为您的Genymotion Android设备的IP地址:
apt update apt更新
apt install android-tools-adb -y apt安装android-tools-adb -y
adb connect 172.16.123.154 adb connect 172.16.123.154
adb devices -l 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.如果您看到一条错误消息“E:无法获取锁定/ var / lib / dpkg / lock-frontend - 打开(11:资源暂时不可用)”,请重新启动Kali计算机。
You should see your Genymotion device in the "List of devices attached", as shown below.您应该在“附加设备列表”中看到您的Genymotion设备,如下所示。

Using an ADB Shell使用ADB Shell

On Kali, in a Terminal, execute these commands:在Kali上,在终端中执行以下命令:
adb shell adb shell
uname -a uname -a
exit出口
You should see a root shell on the Android device, with the Linux version information.您应该在Android设备上看到一个带有Linux版本信息的root shell。

Find the text covered by a green box in the image below.找到下图中绿框所覆盖的文字。


M 201: Version (15 pts) M 201:版本(15分)

Find the text covered by a gray box in the image above.找到上图中灰色框所覆盖的文字。 That's the flag.那是旗帜。


Posted 1-14-19发表于1-14-19
Troubleshooting tip added 1-16-19故障排除提示已添加1-16-19
Mention of Windows removed 2-20-29 Windows的提及已删除2-20-29
Converted to a CTF 2-28-19转换为CTF 2-28-19