msfconsole error

Started by weVeg, November 15, 2012, 10:12:41 PM

Previous topic - Next topic

weVeg

Just runned msfupdate, at startup I've this error:
Quotenoyse@dogbox:~$ sudo msfconsole
/opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require': no such file to load -- rubygems (LoadError)
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/packetfu/packetfu.rb:12
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/packetfu.rb:4
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/msf/core/db.rb:28
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/msf/core/db_manager.rb:5
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/msf/core/framework.rb:69
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/msf/core.rb:34
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/msf/ui/console/driver.rb:2
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/msf/ui/console.rb:11
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /opt/backbox/msf/lib/msf/ui.rb:11
   from /opt/backbox/msf/lib/fastlib.rb:371:in `fastlib_original_require'
   from /opt/backbox/msf/lib/fastlib.rb:371:in `require'
   from /usr/bin/msfconsole:136
Searching on google http://tinyurl.com/d5ulkpr
i've found only about installation on ipad or other f***ng smartphone, problem seems to be fastlib that is lost.
My bbox is up to date, and msf is "Aggiornato alla revisione 16070."
I've also tried to update rubygem with:
gem install rubygems-update
gem update

but nothing change, any idea guyz?
perhaps I can't see the solutions??
I've forget some useful info??
una voce libera è sempre liberatrice
under_r00t

ZEROF

#1
Hi bro,

Try to install : gem install rubyzip

If this don't help, try SVN update :

cd /opt/backbox/msf
svn update


Sometimes after updates metasploit give errors, and if you run update few hours after,  problems stop. It's all about MSF repo, they make a lot of updates, but they don't test or explain them to free users.

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

weVeg

Hi bro! Thanks for the reply!
I've tried your suggestion but nothing to do...
btw, thanks again!
=)
una voce libera è sempre liberatrice
under_r00t

ZEROF

#3
I have just update MSF from terminal with msfupdate i don't have errors !

_                                                      _
/  \  / \        __                          _   __    /_/ __
| |\ /  | _____  \ \            ___   _____ | | /   \  _   \ \
| | \/| | | ___\ |- -|   /\    / __\ | -__/ | | | |  || | |- -|
|_|   | | | _|__  | |_  / -\ __\ \   | |    | |_ \__/ | |  | |_
     |/  |____/  \___\/ /\  \___/   \/      \__|     |_\  \___\


      =[ metasploit v4.5.0-dev [core:4.5 api:1.0]
+ -- --=[ 984 exploits - 532 auxiliary - 162 post
+ -- --=[ 262 payloads - 28 encoders - 8 nops
      =[ svn r16070 updated today (2012.11.14)

And, try to install ruby 1.9.1 :

sudo apt-get install ruby1.9.1

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

weVeg

Quoteruby1.9.1 è già alla versione più recente.
yesterday msf was ok!!
una voce libera è sempre liberatrice
under_r00t

ZEROF

I see now, i made update right now after 24 days :), but theire repo version was update 14.11.2012, not sure why your system don't load. When this happen to me i check modules files and if some gem is not installed that can make problem, but don't worry bro, next update will fix your issue :), hope that you can wait.

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

weVeg

Ok bro! no problem! I can wait!
Thank you again for quickly reply!
I'll pay you some beers ;)
Good night!
una voce libera è sempre liberatrice
under_r00t

r083rt

#7

sudo apt-get -y install ruby1.9.1
sudo apt-get -y install ruby1.9.1-dev
sudo gem install rubygems-update
sudo gem update



again i don't know what backbox is running  im guessing 1.9.3  make sure you using the right ruby-rvm 1.9.3 is faster and more affective or should i say efficient at loading the modules faster  

Metasploit do let modules out sometimes with some import errors and have many a time had to fix them within the modules

but in this case that was'nt the issue !!!!

AND while I'm on the point !! if you having an issue with a certain gem remember while it will install the latest gem by the above You may also have an early version that will cause a conflict

example :

sudo gem install nokigiri --version "number"



sudo gem uninstall nokigiri


this will then ask .. if there is two installed  do you want to remove x or x & y { versions } .. example !! then you can remove both then  and use the below to update to the latest  


sudo gem install nokigiri

to install the latest


and etc etc blah blah gem dep etc etc and look up man gem etc .. search for whats in the gems database etc etc ..ok im getting bored listening to my self now !!!

I might as well finish what I started

so if you need to get lets say a version that is the latest or whatver


sudo gem search --remote nokigiri | sort -n | tail -1


etc etc you can use grep , awk ,sed what ever you like or makes you happy  ;D



But if you have an issue post and the guys will help !!!!


ostendali

can you post here the lines 370-393 of /opt/backbox/msf/lib/fastlib.rb and also an ls -l on this file pls?

r083rt

#9
hey ostendali


sed '371,391!d' /opt/backbox/msf/lib/fastlib.rb > $HOME/fastlib.txt


if its a faulty gem in metasploit or corrupt just remove the folder and do msfupdate .. remove the gem or folder
removing the folder will replace the folder all the files in that folder


sudo rm -rf  /opt/backbox/msf/lib/fastlib.rb


if it persists !! then check out that gem or the module that is giving problems

As Far as i can see he has weVeg has got it sorted

weVeg

Sorry for delay guys!!
So, this is the paste, I've pasted 357-398
http://pastebin.com/PsWhJvkB
and:
-rwxr-xr-x 1 root root 10403 nov 15 21:32 /opt/backbox/msf/lib/fastlib.rb

I can't understand the last robert's reply... Sorry bros but till yesterday's update msf worked fine, so, imho, there is a oversight on msf code

una voce libera è sempre liberatrice
under_r00t

ostendali

Quote from: weVeg on November 16, 2012, 05:26:31 PM
Sorry for delay guys!!
So, this is the paste, I've pasted 357-398
http://pastebin.com/PsWhJvkB
and:
-rwxr-xr-x 1 root root 10403 nov 15 21:32 /opt/backbox/msf/lib/fastlib.rb

I can't understand the last robert's reply... Sorry bros but till yesterday's update msf worked fine, so, imho, there is a oversight on msf code


As you can see yourself the fastlib.rb has been modified yesterday.......
so, follow the r083rt suggestion by removing the library dir and do an update...

Probably something went wrong when you have updated and the library corrupted...

weVeg

#12
ok i'll try!!
Thank you a lot!!!

EDIT:
removed the folder, and while updating for the first time:
Quotesvn: REPORT di '/svn/!svn/vcc/default': Impossibile leggere il corpo della risposta: Connessione sicura terminata (https://www.metasploit.com)

second time:
Quotesvn: access to '/svn/framework3/branches' forbidden
I'm not very lucky in this day :/
una voce libera è sempre liberatrice
under_r00t

r083rt

#13
thanks zerof and ostendali for you input excellent stuff and taking the time to search the database on the fastlib import updates !!!

weVeg if you have problems with Metasploit these are the first things you do

1 ) remove that folder what lists the gem or modules and do an msfupdate
2 ) if it persists i.e like an import error i.e the devs appended the file or either upgraded and it conflicts with another module
    then either ..fix it your self by looking at the problem i.e output error TRACE THE FILE AND IMPORTS and examine the file
    OR if you cant figure the problem out look up the latest version and compare it to yours ..


sometimes its a case of fix it yourself as when theres a problems the devs don't catch it quick enough or get delayed on it
My experience in the pass was never to wait for the devs as sometimes it was taking too long so I always fixed it myself

once again thanks ZeroF and ostendali .. quick response and perfect input ... as usual nothing strange
  ;)

sorry weVeg  IF the post was hard to understand   ;D THE FORMAT was not as clean as it should have been My fault Not yours

r083rt

#14
Im in the middle of getting a full svn refresh from source if can wait ill zip the lib folder and upload it for you

if you want a pacific  folder or file do this


svn checkout https://www.metasploit.com/svn/framework3/trunk msf --depth empty
cd msf
svn filename or folder

### then just move the file or folder you svn'ed and move it to the location i.e /opt/backbox/msf/ etc etc


ok I uploaded the files for you ..from a fresh svn source
!!

here is the fastlib file  fastlib.rb link removed by r083rt
here is the lib folder lib folder link removed by r083rt


cd Downloads
tar -xf lib.tar.gz
sudo rm -rf /opt/backbox/msf/lib
sudo mv  lib /opt/backbox/msf




svn is very slow the project would be better moving to git .. git is better in many ways