rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
34.03k stars 13.94k forks source link

Newbie- "Could not find rake-12.1.0 in any of the sources" - Raspberry Pi 3 #9117

Closed StuckOnThis closed 6 years ago

StuckOnThis commented 7 years ago

I just want to apologize in advance as I am new to using different languages and I'm fairly decent with the CLI I am running Kali rolling 2017.2 I have run into so many problems trying to get metasploit to install. I thought I had it figured out but every time I type msfconsole I get the message

root@kali:/opt/metasploit-framework# msfconsole
Could not find rake-12.1.0 in any of the sources
Run `bundle install` to install missing gems.

I then ran bundle install again and ll the required gems were in use properly I assume

Using rake 12.1.0
Using Ascii85 1.0.2
Using concurrent-ruby 1.0.5
Using i18n 0.9.0
Using minitest 5.10.3
Using thread_safe 0.3.6
Using tzinfo 1.2.3
Using activesupport 4.2.10
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using nokogiri 1.8.1

I installed Metasploit with:

I honestly don't rememeber

I'm not sure what to do at his point I have updated metasploit to the latest framework metasploit-framework (4.16.12-0kali1) Everytime I run msfupdate


msfupdate is no longer supported when Metasploit is part of the operating
system. Please use 'apt update; apt install metasploit-framework
StuckOnThis commented 7 years ago

I honestly do not know what I did to this but when I typed ./msfconsole it brought up


Unable to handle kernel NULL pointer dereference at virtual address 0xd34db33f
EFLAGS: 00010046
eax: 00000001 ebx: f77c8c00 ecx: 00000000 edx: f77f0001
esi: 803bf014 edi: 8023c755 ebp: 80237f84 esp: 80237f60
ds: 0018   es: 0018  ss: 0018
Process Swapper (Pid: 0, process nr: 0, stackpage=80377000)

Stack: 90909090990909090990909090
       90909090990909090990909090
       90909090.90909090.90909090
       90909090.90909090.90909090
       90909090.90909090.09090900
       90909090.90909090.09090900
       ..........................
       cccccccccccccccccccccccccc
       cccccccccccccccccccccccccc
       ccccccccc.................
       cccccccccccccccccccccccccc
       cccccccccccccccccccccccccc
       .................ccccccccc
       cccccccccccccccccccccccccc
       cccccccccccccccccccccccccc
       ..........................
       ffffffffffffffffffffffffff
       ffffffff..................
       ffffffffffffffffffffffffff
       ffffffff..................
       ffffffff..................
       ffffffff..................

Code: 00 00 00 00 M3 T4 SP L0 1T FR 4M 3W OR K! V3 R5 I0 N4 00 00 00 00
Aiee, Killing Interrupt handler
Kernel panic: Attempted to kill the idle task!
In swapper task - not syncing

       =[ metasploit v4.16.13-dev-cd35ae4661              ]
+ -- --=[ 1696 exploits - 969 auxiliary - 299 post        ]
+ -- --=[ 499 payloads - 40 encoders - 10 nops            ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]

/usr/local/rvm/gems/ruby-2.4.2/gems/activesupport-4.2.10/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``': Cannot allocate memory - infocmp (Errno::ENOMEM)
    from /usr/local/rvm/gems/ruby-2.4.2/gems/activesupport-4.2.10/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
    from /usr/local/rvm/gems/ruby-2.4.2/gems/rb-readline-0.5.5/lib/rbreadline.rb:1815:in `get_term_capabilities'
    from /usr/local/rvm/gems/ruby-2.4.2/gems/rb-readline-0.5.5/lib/rbreadline.rb:2027:in `_rl_init_terminal_io'
    from /usr/local/rvm/gems/ruby-2.4.2/gems/rb-readline-0.5.5/lib/rbreadline.rb:2564:in `readline_initialize_everything'
    from /usr/local/rvm/gems/ruby-2.4.2/gems/rb-readline-0.5.5/lib/rbreadline.rb:3849:in `rl_initialize'
    from /usr/local/rvm/gems/ruby-2.4.2/gems/rb-readline-0.5.5/lib/rbreadline.rb:4868:in `readline'
    from /opt/metasploit-framework/lib/rex/ui/text/input/readline.rb:162:in `readline_with_output'
    from /opt/metasploit-framework/lib/rex/ui/text/input/readline.rb:100:in `pgets'
    from /opt/metasploit-framework/lib/rex/ui/text/shell.rb:189:in `run'
    from /opt/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
    from /opt/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
    from ./msfconsole:48:in `<main>'
jmartin-tech commented 7 years ago

Unfortunately Kali packages their own installations for distribution. The arm packages are actually quite fragile and a raspberry pi is a very limited environment.

I would suggest if you are looking to interact just with metasploit on Raspberry Pi then a clean raspbian installation and usage of out omnibus installers may be a more stable place to start. See https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers.

busterb commented 6 years ago

To clarify a bit, metasploit-framework in Kali linux is a normal .deb package like anything else. The commands that 'msfupdate' prints are the same you would use to update any other package.

To make Metasploit work on Kali, it uses a special wrapper script located under /usr/bin/msfconsole - if you're curious, read this and look at what it does. What it basically means is, if you are not using /usr/bin/msfconsole, and are instead invoking msfconsole directly from the framework is installed, you are going to have problems, since Metasploit is now looking in the wrong place for gems and libraries.

It seems like you might have tried to install Metasploit at least 3 different ways, and now the different ways are conflicting with each other as well. Here is what I would suggest to cleanup your system and get things working as designed.

if it exists, delete /etc/apt/sources.list.d/metasploit-framework.list move or delete /usr/local/rvm run apt-get update; apt-get remove metasploit-framework move or delete /opt/metasploit-framework if you created it manually run apt-get install metasploit-framework

If all goes correctly, you should now have /usr/share/metasploit-framework, and /usr/bin/msfconsole. Run the later to start framework.

SHARPSHO0TER commented 6 years ago

$ msfconsole

/usr/bin/msfconsole: line 125: 27109 Killed $BIN/ruby $FRAMEWORK/$cmd "$@" $ $ WTF i cant execute