dana-at-cp / backdoor-apk

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 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.
Apache License 2.0
2.21k stars 702 forks source link

Failed to decompile RAT APK file #71

Closed Vancer closed 7 years ago

Vancer commented 7 years ago

First of all I read the previous issue and i have the apk file in the same directory of the bash script.

Error: meterpreter/reverse_http 4) shell/reverse_http meterpreter/reverse_https 5) shell/reverse_https meterpreter/reverse_tcp 6) shell/reverse_tcp [?] Please select an Android payload option: 2 [?] Please enter an LHOST value: 192.168.1.7 [?] Please enter an LPORT value: 4433 [+] Handle the payload via resource script: msfconsole -r backdoor-apk.rc [] Generating RAT APK file...done. [] Decompiling RAT APK file...done. [!] Failed to decompile RAT APK file

Thats weird, and the run.log file states the usage of ' apktool ', like it was misused or something in the script. Any help :) ?

dana-at-cp commented 7 years ago

@Vancer Can you share the run.log file?

Vancer commented 7 years ago

Sure I can, there you go: Ghostbin Paste

dana-at-cp commented 7 years ago

@Vancer Ahh, alright. Looks like you are using Apktool 1.5.2 which is pretty old.

My up-to-date Kali VM is running Apktool 2.2.1:

root@kali:~# apktool -version
2.2.1-dirty
root@kali:~#

Upgrade to the latest Apktool version and you should be all set.

Vancer commented 7 years ago

I'll try this ASAP and close the issue if it's fixed!

Vancer commented 7 years ago

The decompiling worked but im facing a new error here is a dump: [] Running backdoor-apk.sh v0.1.9 on Tue Jan 24 15:04:10 EST 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: 3 [?] Please enter an LHOST value: 172.16.200.129 [?] Please enter an LPORT value: 4444 [+] Handle the payload via resource script: msfconsole -r backdoor-apk.rc [] Generating RAT APK file...done. [] Decompiling RAT APK file...done. [] Decompiling original APK file...done. [] Merging permissions of original and payload projects...done. [] 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. [!] Failed to copy RAT smali files

Before reading the run.log note that it added the needed permissions such as SMS and CALL and INTERNET e.t.c, you get me if you wrote an android application, just clarifying this is not the whole dump, the full run.log dump is Here This is the run.log: Copying resources from program directory [/root/Downloads/backdoor-apk-master/backdoor-apk/bin/classes] Copying resources from program directory [/root/Downloads/backdoor-apk-master/backdoor-apk/libs] I: Using Apktool 2.2.2 on Rat.apk I: Baksmaling classes.dex... I: Copying assets and libs... I: Copying unknown files... I: Copying original files... payload_tld is: org payload_primary_dir is: database1 payload_sub_dir is: pc30 mkdir: created directory ‘/root/Downloads/backdoor-apk-master/backdoor-apk/original/smali/org/database1’ mkdir: created directory ‘/root/Downloads/backdoor-apk-master/backdoor-apk/original/smali/org/database1/pc30’ ‘/root/Downloads/backdoor-apk-master/backdoor-apk/payload/smali/com/metasploit/stage/MainBroadcastReceiver.smali’ -> ‘/root/Downloads/backdoor-apk-master/backdoor-apk/original/smali/org/database1/pc30/AppBoot.smali’ cp: cannot stat ‘/root/Downloads/backdoor-apk-master/backdoor-apk/payload/smali/com/metasploit/stage/MainService.smali’: No such file or directory Forcing cleanup due to a failure or error state!

dana-at-cp commented 7 years ago

@Vancer I think your version of Metasploit framework is out of date. Can you update Metasploit and try again?

dana-at-cp commented 7 years ago

@Vancer Any update?

Vancer commented 7 years ago

Metasploit messes up after an update, i really don't know what's going on. If you want I can close the issue and open a new one once i fix metasploit ? Really sorry for being late. Sorry again. @dana-at-cp

dana-at-cp commented 7 years ago

@Vancer No problem. Open a new issue if needed.

ghost commented 7 years ago

Hello have you tried using the backdoor-apk and have data the next error, [!] Failed to generate RAT APK file. I've already put the original APK in the backdoor-apk folder, backdoor-apk, and even then the error that I showed above, how can I fix this?