Can't load Metasploit after installation - ruby

After istallation of Metaploit via darkoperator/MSF-Installer try to start the msfconsole and it return:
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- /usr/local/bin/config/boot (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/bin/msfconsole:23:in `<main>'
using:
Linux ubuntu 3.13.0-32-generic
Have someone an idea?

For me it helped following:
sudo chmod o+r /var/lib/gems/1.9.1/gems/robots-0.10.1/lib/robots.rb
after that user is able to run metasploit.

As user4170357 but with a slight difference due to: Mac OS X 10.9.5
to fix, run:
sudo chmod o+r /Library/Ruby/Gems/2.0.0/gems/robots-0.10.1/lib/robots.rb
(path is a little bit different than original answer)

This is a bug in the kernel where file-system becomes read-only or inaccessible randomly. Read more here.
To fix Just reboot and it will be fixed.

From http://techlogbook.wordpress.com/2014/08/19/installing-metasploit-on-xubuntu-14-04/
$ msfconsole
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- /usr/local/bin/config/boot (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/local/bin/msfconsole:23:in `'
What I did was to edit /usr/local/bin/msfconsole line 23, and replace that line with:
require File.expand_path('/usr/local/share/metasploit-framework/config/boot.rb', __FILE__)
Make sure that the path for config/boot.rb is correct for your system.
Now, when I run msfconsole again, it gives me some warning of missing permission to write some log file.
Rails Error: Unable to access log file. Please ensure that /usr/local/share/metasploit-framework/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
So I need to create the directory and make sure it is accessible.
$ cd /usr/local/share/metasploit-framework/
$ mkdir log
$ chmod 777 log
Now, I can run msfconsole. Before reaching the prompt, however, I got the following warning:
[-] WARNING! The following modules could not be loaded!
[-] /usr/local/share/metasploit-framework/modules/auxiliary/scanner/smb/smb_login.rb: LoadError cannot load such file -- robots`
Maybe that can help you get started

this might be becuase you bundled or installed metasploit as root you might need to get root access to run metasploit

Related

Unicorn+Sinatra+Nginx | FATAL error adding listener

I have a Sinatra application hosted using Nginx and Unicorn. it went down when I upgraded the operating system (Ubuntu 14.04.5 LTS) on the server, and I was able to bring them all back up except this one, the lone Rack-based application. When I try to launch Unicorn (unicorn -c unicorn.rb -D), I get the following error:
I, [2017-08-06T15:39:54.426004 #6505] INFO -- : unlinking existing socket=/tmp/unicorn.wheels-within-wheels.sock
F, [2017-08-06T15:39:54.427777 #6505] FATAL -- : error adding listener addr=/tmp/unicorn.wheels-within-wheels.sock
/home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/socket_helper.rb:113:in `unlink': Operation not permitted # unlink_internal - /tmp/unicorn.wheels-within-wheels.sock (Errno::EPERM)
from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/socket_helper.rb:113:in `$
from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/socket_helper.rb:107:in `$
from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:231:in `li$
from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:808:in `bl$
from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:808:in `ea$
from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:808:in `bi$
from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:130:in `st$
from /home/deployer/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/unicorn-5.2.0/bin/unicorn:126:in `<top (required)>'
from /home/deployer/.rbenv/versions/2.2.3/bin/unicorn:23:in `load'
from /home/deployer/.rbenv/versions/2.2.3/bin/unicorn:23:in `<main>'
Anyone have an idea on how to fix this? Thanks.
It's fixed after I performed the following two steps:
As described in this Server Fault answer, I changed the group of the application owner, 'deployer', from 'deployer' to 'staff'.
I changed the owner of the socket file to deployer:staff (sudo chown deployer:staff /tmp/unicorn.wheels-within-wheels.sock).
Then I ran bundle update to update the gems, and finally Unicorn ran successfully and the application was live again.
The following link said that kind of problem is occured upgrading MacOSX to El Capitan. if you can follow the same path, maybe you could resolve the problem.
ERROR: While executing gem ... (Errno::EPERM) Operation not permitted

Set up jekyll on windows

I try to set up jekyll on window10 (x64)
Ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]
gem -v
2.6.6
D:\myblog>jekyll serve
Configuration file: D:/myblog/_config.yml
Source: D:/myblog
Destination: D:/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Error reading file C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/minima-1.0.1/_layouts/default.html: No such file or directory # rb_sysopen - /Ruby22-x64/lib/ruby/gems/2.2.0/gems/minima-1.0.1/_layouts/default.html
Error reading file C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/minima-1.0.1/_layouts/page.html: No such file or directory # rb_sysopen - /Ruby22-x64/lib/ruby/gems/2.2.0/gems/minima-1.0.1/_layouts/page.html
Error reading file C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/minima-1.0.1/_layouts/post.html: No such file or directory # rb_sysopen - /Ruby22-x64/lib/ruby/gems/2.2.0/gems/minima-1.0.1/_layouts/post.html
Can someone help me to fix it?
I was having the same problem. Following the path shown in the command line (for me it was) :
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/minima-1.0.1/_layouts/default.html
and copying the _layouts, _includes and _sass folders manually did the thing for me. Although this is not a permanent solution as there seems some bug which is preventing jekyll to copy file from the directory shown in the error.
Hope this helps you too for now.
The issue is due to your Project directory and Ruby installation, being on different drives (i.e. D: vs. C:).
To fix, you can simply create a (junction) link to C:/Ruby22-x64 from the location D:/Ruby22-x64.
Commands you need to enter:
D:
cd /
mklink /J "Ruby22-x64" "C:/Ruby22-x64"

Memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file

Situation: I installed memcached on a CenTOS 5 (64 bit). I also ended up installing some PHP plugins using PECL, though they're unnecessary now.
Problem:When I execute
/etc/init.d/memcached start
I get the following error:
Starting memcached: memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
But the file libevent-2.0.so.5 is present in /opt/couchbase/lib/.
Should it be there in some other folder ? How to get memcached to start ?
/opt/couchbase/lib will not be set on your system library path by default. That's why your unable to find libevent when running /etc/init.d/memcached.
To quickly solve this you can just run the command as follows:
LD_LIBRARY_PATH=/opt/couchbase/lib /etc/init.d/memcached
or to solve this over the long term add the following file (assuming your using centos):
/etc/ld.so.conf.d/couchbase.conf
and in that file add the path "/opt/couchbase/lib". Then run ldconfig and re-run the command to start memcached.
sudo ln -s /usr/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6
for libevent-2.0.so.5 the same.

Compass only running in parts

As i am trying to get my version on the command line by typing:
compass -version
I am receving the following error:
Errno::ENOENT on line ["25"] of /usr/lib/ruby/vendor_ruby/compass/version.rb: No such file or directory - /usr/lib/ruby/vendor_ruby/compass/../../VERSION.yml
Run with --trace to see the full backtrace
Apart from that everything is running fine.
Anyone with the same problem, a workaround, a solution ?
This is a reported and confirmed bug: https://bugs.launchpad.net/ubuntu/+source/ruby-compass/+bug/1100018

Ruby: What does Errno::EEXIST mean when installing a gem?

I am trying to install a ruby gem called activeldap, however, it won't let me install it. I keep getting all kinds of errors including the Errno::EEXIST error. I added the error info below. Any ideas?
C:\Ruby\www\demo>gem install activeldap
ERROR: While executing gem ... (Errno::EEXIST)
File exists - C:
C:\Ruby\www\demo>gem install activeldap --debug -V
Exception `NameError' at C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:164 - uninitialized constant Gem::Commands::InstallCommand
Exception `NoMethodError' at C:/Ruby187/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
Exception `Gem::LoadError' at C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:779 - Could not find RubyGem test-unit (>= 0)
Exception `Gem::LoadError' at C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:779 - Could not find RubyGem sources (> 0.0.1)
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:/Users/ktemplar/.gem/specs/rubygems.org%80
GET http://rubygems.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
304 Not Modified
Installing gem locale-2.0.5
Exception `IOError' at C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/format.rb:50 - closed stream
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:/Ruby187/lib/ruby/gems/1.8
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:/Ruby187/lib/ruby/gems/1.8/gems/locale-2.0.5
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:/Ruby187/lib/ruby/gems/1.8/gems/locale-2.0.5/lib
C:/Ruby187/lib/ruby/gems/1.8/gems/locale-2.0.5/lib/locale.rb
Exception `Errno::ENOENT' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - No such file or directory - C:/Ruby187/lib/ruby/gems/1.8/gems/locale-2.0.5/lib/locale/tag
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:219 - File exists - C:
ERROR: While executing gem ... (Errno::EEXIST)
File exists - C:
C:/Ruby187/lib/ruby/1.8/fileutils.rb:243:in `mkdir'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:201:in `each'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:517:in `extract_files'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:500:in `each'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:500:in `extract_files'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:196:in `install'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:277:in `install'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:247:in `each'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:247:in `install'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:119:in `execute'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:116:in `each'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:116:in `execute'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command.rb:270:in `invoke'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:134:in `process_args'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
C:/Ruby187/bin/gem:21
Update 13 July 2010
It is very likely that this problem is caused by installation of E Text Editor on Windows 7. In order to provide compatibility with TextMate on Windows, E automatically installs Cygwin. During installation a bash script is run which tries to modify permissions on C:. Here's the line:
chmod o-w `cygpath $HOMEDRIVE`
Apparently when Cygwin sets permissions, it is making a mess of the Windows ACL
permissions. In order to protect the integrity of the system root drive, Windows UAC does something known as Virtualization or Data Redirection. More info here. In our case, instead of messing up the permissions on the real root directory, Virtualization kicks in and corrupts permissions on the VirtualStore (%localappdata%\VirtualStore) directory instead, making its root inaccessible (although any directories within remain untouched and accessible). When Ruby installs gems it tries to access the root C:\ directory, which UAC disallows, so it tries to access %localappdata%\VirtualStore, which it can't if you have corrupt permissions, thus you get the failure.
You can fix this by removing the bad permissions from VirtualStore (you'll need to unhide protected system files in Explorer to see VirtualStore). The correct permissions should inherit from the parent folder and should be:
SYSTEM (full control)
*your users* (full control)
Administrators (full control)
Here's a gist comparing the broken permissions vs the correct permissions:
http://gist.github.com/471087
The author of E is aware of this problem and working on a fix.
This seems to be a weird permissions error that is apparently only occurring on Windows 7. Try opening an elevated command prompt and installing from there. Here's what I get when elevated:
[C:\Users\charlesr]gem install activeldap
Successfully installed activeldap-1.2.2
1 gem installed
Installing ri documentation for activeldap-1.2.2...
Installing RDoc documentation for activeldap-1.2.2...
If I run from a standard command prompt, I get this:
[C:\Users\charlesr]gem install activeldap
ERROR: While executing gem ... (Errno::EEXIST)
File exists - C:
I'll update this answer if a better solution comes to light. It never has been a requirement to elevate when installing gems on Windows and so the behaviour we're seeing here is wrong.
There is a discussion related to this issue here: http://groups.google.com/group/rubyinstaller/browse_thread/thread/df7b7c217ad7d882
This is a file-system error on a mkdir call. The author of this gem wrote their file path code in such a way that it breaks on win32 with backslashes instead of forward slashes, resulting in a busted mkdir call. Looks like your gem isn't supported on win32.

Resources