M 104: BlueStacks Android Emulator on Windows (15 pts)

What You Need for This Project

Purpose

To get BlueStacks working, a game-oriented Android emulator.

Task 1: Installing Bluestacks

Downloading and Installing BlueStacks

In a Web browser, go here:

http://www.bluestacks.com/

Download and install it, as shown below.

Click the "LET'S GO" button and log in to a Google account. You'll need to provide a Google login.

When it's done, you'll see the BlueStacks home page, as shown below.

Troubleshooting

If Bluestacks won't start, or freezes, it's usually a problem with the graphics settings.

Use Task Manager to kill Bluestacks and start it again. While it's starting, at the top right, click the gear icon.

In Settings, click the Engine tab. Try different settings, such as OpenGL, as shown below. It may also help to use a lower resolution on the Display tab.

To do that, some adjustments are needed in VMware Settings.

Turning on USB Debugging

In BlueStacks, at the top right, click the Gear, Settings, Preferences, and check "Enable Android Debug Bridge (ADB)", as shown below.

Turning Off Windows Firewall

Click Start and type FIREWALL

Launch "Windows Firewall", as shown below.

On the left side, click "Turn Windows Firewall on or off".

Check both "Turn off Windows Firewall (not recommended)" buttons, as shown below.

Click OK.

On your Windows machine, in Control Panel, open the Firewall utility and turn off the Firewall.


Task 2: Port Fowarding

Observing the Listening Port

On your host computer, click Start and type CMD

Right-click "Command Prompt" and click "Run as Administrator".

In the Administrator Command Prompt window, execute this command:

netstat -an | findstr "5555"
You should see a LISTENING port on the loopback address, as shown below.

Port Forwarding

We need to forward that port to the Kali virtual machine with Socat. Execute this command:
netsh interface portproxy add v4tov4 listenport=5556 listenaddress=0.0.0.0 connectport=5555 connectaddress=127.0.0.1
To see that it's working, execute this command:
netstat -an | findstr "5556"
You should see a LISTENING port on the arbitrary address "0.0.0.0", as shown below.


Connecting with ADB

Finding the Host's Address

On your Kali virtual machine, execute this command:
ip addr
Find the IP address of the interface that goes to the host, which is usually "eth0", as highlighted in the image below.

On the host computer, execute ipconfig and find the interface address that's on the same subnet as the Kali machine.

Connecting to the Bluestacks Emulator

On your Kali virtual machine, execute these commands, replacing the IP address with the correct address of your host system:
apt update
apt install android-tools-adb -y
adb connect 172.16.123.1:5556
adb devices -l
You see a device attached, as shown below.


M 104: Device Name (15 pts)

Find the text covered by a green box in the image above. That's the flag.
Updated 2-5-19
Converted to a CTF 2-28-19