Path: blob/master/tools/exploit/install_msf_apk.sh
19591 views
#!/usr/bin/env bash12# This script allows you install your msf payload apk to your Android emulator.3# Make sure you have Java and Android SDK.45apk_path=$1678if ! [ -x "$(command -v adb)" ]9then10echo "Android SDK platform-tools not included in \$PATH."11exit12fi1314if ! [ -x "$(command -v jarsigner)" ]15then16echo "jarsigner is missing."17exit18fi1920if ! [ -e "$HOME/.android/debug.keystore" ]21then22echo "Missing ~/.android/debug.keystore"23exit24fi2526if [ -z "$apk_path" ]27then28echo "APK path is required."29exit30fi3132if ! [ -a "$apk_path" ]33then34echo "APK not found."35exit36fi3738jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android -digestalg SHA1 -sigalg MD5withRSA $apk_path androiddebugkey39adb uninstall com.metasploit.stage40adb install -r $apk_path41adb shell am start -a android.intent.action.MAIN -n com.metasploit.stage/.MainActivity4243