Android Hacking

Build Your Own PwnPhone

Instructions on building your own PwnPhone running the Kali operating system and AOPP (Android Open Pwn Project) imageThe Pwn Phone is a real-life product made by a Boston-based startup called Pwnie Express. The “dream device for hackers” allows users to check if there are any vulnerabilities in wired, wireless, or Bluetooth networks, and it looks like a regular cell phone.

The company has decided to no longer sell Pwn Phone and Pwn Pad devices and will be continuing the project as open source running the AOPP.

Our focus now will be on the Android Open Pwn Project (AOPP), a hacking variant of the Android Open Source Project that we released last year (www.pwnieexpress.com/aopp). It has everything you need in order to keep using these devices, download the ROMs or build them for yourself, modify them and contribute back to the project.

If you are a fan of Mr.Robot you must have seen Elliot uses the PwnPhone in one of the episodes where he creates and sends a payload to the victims Sim card. Now let’s get started!

Flashing the Phone

  1. Download the Recovery image for your device:
    https://twrp.me/Devices
  2. Connect the device to the host machine via USB cable.
  3. Power off the device and boot into the Bootloader:
    Press and hold the Power & Volume-Down buttons
  4. Confirm the device is recognized by the host machine: 
    (a device should be listed when the command returns)
    $ fastboot devices
  5. Unlock the device:$ fastboot oem unlock
  6. Once unlocked, flash the Recovery image:$ fastboot flash recovery <name-of-recovery-image>.img
  7. Once the Recovery image has been flashed, boot into Recovery from the Bootloader:
    Use the Volume-Down/Up buttons to cycle through the Bootloader options and then the Power button to select
  8. If prompted, swipe “Swipe to Allow Modifications”.
  9. Once in Recovery, wipe the device:
    Tap Wipe > Advanced Wipe > tap: Dalvik/ART cache, System, Cache, Data > swipe “Swipe to Wipe”
  10. Once wiped, do NOT boot into System (You don’t have one; you just wiped it). Tap the Home button to return to the Recovery home screen.
  11. Confirm again the device is recognized by the host machine:
    (a device should be listed when the command returns)$ adb devices
  12. From the host machine, push the downloaded AOPP ROM zip to the device sdcard:
    $ adb push <name-of-rom-zip>.zip /sdcard/
  13. On device, tap Install and then select the AOPP ROM zip from /sdcard.
  14. Swipe “Swipe to Confirm Flash”
  15. Once installed, tap “Reboot System”

OK Now Let’s Build the Phone


Downloading the Source

  1. Refer to “Downloading and Building Requirements” before proceeding:
    https://source.android.com/source/requirements.html
  2. Refer to “Downloading the Source” before proceeding:
    https://source.android.com/source/downloading.html
  3. Create a directory for the build system to live in and cd into that directory:$ mkdir <WORKING_DIR>$ cd <WORKING_DIR>
  4. Initialize a local repository using this source tree, use the command:
    $ repo init -u [email protected]:aopp/android_platform.git -b px-0.1
  5. Sync the repository, use:
    $ repo sync

 Building

Devices are referred to by codename (e.g. hammerhead). Make sure to use this when substituting <device-codename> in the following instruction set.
  1. Refer to “Building the System” before proceeding:
    https://source.android.com/source/building.html
  2. To initialize the build environment, use the following command:$ . build/envsetup.sh
  3. Prepare the build environment (download device-tree and dependencies) for your specific device:$ breakfast <device-codename>
  4. Connect the device running a working AOPP/AOSP ROM to the host machine via USB.
  5. Make sure it is booted into system and confirm the device is recognized by the host machine:
    (a device should be listed when the command returns)$ adb devices
  6. Enter the device directory:$ cd <WORKING_DIR>/device/<vendor>/<device-codename>/
  7. Extract the proprietary binaries from your device:$ ./extract-files.sh
  8. Return to the root of the build system:$ croot
  9. Start a build run for your device:
    $ brunch <device-name>
  10. Once complete, the ROM zip can be found in the out/ directory:$ cd /out/target/product/<device-codename>
  11. The flashable ROM zip (product of the build run) will be located in the out/ directory as:
    aopp-0.1-<build-date>-UNOFFICIAL-<device-codename>.zip

 Flashing

  1. Download and install the command line tools for your OS: https://developer.android.com/studio/index.html#downloads
  2. Download the AOPP ROM for your device:https://wiki.pwnieexpress.com/index.php/Official_devices
  3. Download the Recovery image for your device:
    https://twrp.me/Devices
  4. Connect the device to the host machine via USB cable.
  5. Power off the device and boot into the Bootloader:
    Press and hold the Power & Volume-Down buttons
  6. Confirm the device is recognized by the host machine:(a device should be listed when the command returns)
    $ fastboot devices
  7. Unlock the device:
    $ fastboot oem unlock
  8. Once unlocked, flash the Recovery image:$ fastboot flash recovery <name-of-recovery-image>.img
  9. Once the Recovery image has been flashed, boot into Recovery from the Bootloader:
    Use the Volume-Down/Up buttons to cycle through the Bootloader options and then the Power button to select
  10. If prompted, swipe “Swipe to Allow Modifications”.
  11. Once in Recovery, wipe the device:
    Tap Wipe > Advanced Wipe > tap: Dalvik/ART cache, System, Cache, Data > swipe “Swipe to Wipe”
  12. Once wiped, do NOT boot into System (You don’t have one; you just wiped it). Tap the Home button to return to the Recovery home screen.
  13. Confirm again the device is recognized by the host machine:
    (a device should be listed when the command returns)$ adb devices
  14. From the host machine, push the downloaded AOPP ROM zip to the device sdcard:$ adb push <name-of-rom-zip>.zip /sdcard/
  15. On device, tap Install and then select the AOPP ROM zip from /sdcard.
  16. Swipe “Swipe to Confirm Flash”
  17. Download SuperSU from Chainfire here:
    https://download.chainfire.eu/969/SuperSU/UPDATE-SuperSU-v2.76-20160630161323.zip
  18. Push the SuperSU zip to /sdcard/:
    $ adb push <SuperSU-zip-name>.zip /sdcard/
  19. Once installed, tap “Reboot System”
  20. Hack the Gibson…and remember…hugs are worth more than handshakes
To Top

Pin It on Pinterest

Share This