githubEdit

6. Android Bug Bounty

Android Bug Bounty Hunt

❗ Always refer to a HackerOne Bug Bounty program to find valid targets

πŸ”— HackerOne Android programsarrow-up-right

Install Temu app via Android Play Store - name com.einnovation.temu

frida-ps -Uai | grep temu  
	Temu com.einnovation.temu

Pull apk from the phone

cd ~/tcm/mapt/temu

adb shell pm list packages | grep temu
adb shell pm path com.einnovation.temu

adb pull /data/app/com.einnovation.temu-RKERNRo1SuGOM3UEbNeFIA==/base.apk
adb pull /data/app/com.einnovation.temu-RKERNRo1SuGOM3UEbNeFIA==/split_config.arm64_v8a.apk
adb pull /data/app/com.einnovation.temu-RKERNRo1SuGOM3UEbNeFIA==/split_config.xhdpi.apk

    .rw-r--r-- 19M base.apk
    .rw-r--r-- 15M split_config.arm64_v8a.apk
    .rw-r--r-- 77k split_config.xhdpi.apk

mv base.apk temu.apk

# or use apkpull tool by david-lee
curl -sL bit.ly/apkpull | bash -s -- com.einnovation.temu -d .

Open base.apk in jadx-gui

Check AndroidManifest.xml minSdkVersion, Permissions, exported activities, providers, links, keys etc. Search:

  • android:exported="true"

AndroidManifest.xml

Check strings.xml for hardcoded strings, databases (Firebase, etc), keys, email, phone numbers, etc.

Setup BurpSuite with Proxy listener to All interfaces and set the proxy on the device network connection (make sure BurpSuite certificate is installed)

  • Navigate the app. It seems certificate pinning is on.

Try to bypass Certificate Pinning

  • Certificate Pinning bypassed successfully. Traffic is intercepted in BurpSuite.

    • Navigate the app and check the HTTP history requests.

In Jadx-GUI search for URLs (http, https), API_KEY, Coupons, etc

https
API-KEY

Check internal storage for sensitive data store in files, cache, databases, etc

shared_prefs
  • Check for databases

  • After navigating and interacting with the app, Pull interesting db files and check them with SQLite Browserarrow-up-right, look through the database tables and structure.

Interaction with all the app's functions is important to further analyze the app during dynamic analysis.

Patching APK

patch-apkarrow-up-right tool can also be used for identifying the package name, extracting APKs, patching with objection, consolidating split APKs, enabling CA certificates, uninstalling the original app, and installing the patched version.

Reinstall the new patched app in the phone


Android Red Teaming

❗ Always use the following Hardware on permitted targets, from a Red Team perspectice.

Create Generic APK with Metasploit

The following command will generate a Main Activity app, that makes the Android device reach the Kali VM machine establishing a session.

  • Sign the android.apk and upload it to the device.

  • Open a meterpreter shell and listen for the connection

Inject App with Metasploit

Make sure Apktool is updated.

Download InjuredAndroid.

  • Inject a Meterpreter payload into the InjuredAndroid.apk

πŸ“Œ The reverse shell may not work correctly because of Android and emulator versions or incompatibility.

πŸ”— Manual - Embedding Meterpreter in Android APK - Black Hills Information Securityarrow-up-right

The Ghost Framework

πŸ”— kp-forks/ghost-1arrow-up-right - Ghost Framework is an Android post-exploitation framework that exploits the Android Debug Bridge to remotely access an Android device. Ghost Framework gives you the power and convenience of remote Android device administration

  • To make it work on port 5555, adb should be connected via tcp to the device


Last updated