Running Metasploit on Ubuntu Error - ruby

http://www.darkoperator.com/installing-metasploit-in-ubunt/
Here is the site I used for the installation process
I typed
msfconsole
after install rbenv ruby (I know its a longer installation, but I still did), and got this error.
/usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:370:in
parse: (/opt/metasploit-framework/config/database.yml): mapping
values are not allowed in this context at line 9 column 22
(Psych::SyntaxError)
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:370:in
parse_stream
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:318:in
parse
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:245:in load
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:464:in block
in load_file
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:464:in open
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:464:in
load_file
from /opt/metasploit-framework/lib/msf/ui/console/driver.rb:164:in
initialize
from /opt/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in
new
from /opt/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in
driver
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 /usr/local/bin/msfconsole:48:in
Please help!!!

Complete credit to Iraklis Mathiopoulos #https://medium.com/#iraklis/sometimes-you-need-metasploit-running-on-a-box-with-a-public-ip-in-order-to-get-reverse-shells-to-74fda07165a5#.2tplo6bnh:
Installing the Pre-requisites.
adduser msfdev
adduser msfdev sudo
apt-get update
apt-get -y install autoconf bison build-essential curl git-core libapr1 libaprutil1 libcurl4-openssl-dev libgmp3-dev libpcap-dev libpq-dev libreadline6-dev libsqlite3-dev libssl-dev libsvn1 libtool libxml2 libxml2-dev libxslt-dev libyaml-dev locate ncurses-dev openssl wget xsel zlib1g zlib1g-dev
Using msfdev for install
su - msfdev
wget https://raw.githubusercontent.com/iam1980/metasploit-vps-installer/master/msf_vps_installer.sh
bash msf_vps_installer.sh

I generally always use the free installer to install a standalone version of metasploit.
it is outlined here under installation.
You can simply git clone and then install
git clone https://github.com/rapid7/metasploit-framework.git

Related

error while installing new version of ruby using RVM

I'm switching my ruby version using RVM
rvm install 2.6.3
I get this error:
Installing required packages: libssl-dev...
Error running 'requirements_debian_libs_install libssl-dev',
please read /home/bondka/.rvm/log/1562836140_ruby-2.6.3/package_install_libssl-dev.log
Requirements installation failed with status: 100.
If you are using Ubuntu update your package repository (optional- ignore if already did).
sudo apt-get update
then run
sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
I hope that helpful.

Unable to install Ruby gem unf_ext 0.7.4 on Ubuntu

I am having a hell of a time installing unf_ext 0.7.4 on Ubuntu. I've tried every form of Google searching you can possibly imagined and installed almost everything I could think of, here's what I've installed so far:
libgmp-dev
ruby-dev
zlib1g-dev
liblzma-dev
build-essential
build-essential patch
libxml2
libxslt1.1
openssl
libreadline6
libreadline6-dev
curl
git-core
zlib1g
zlib1g-dev
libssl-dev
libyaml-dev
libsqlite3-0
libsqlite3-dev
sqlite3 (found a link somewhere that said this would help?)
libxml2-dev
libxslt-dev
autoconf
libc6-dev
ncurses-dev
automake
libtool
bison
However after having all of these installed it still does not work, so I tried
sudo apt-get update && sudo apt-get install libxml2-dev && sudo apt-get install libxslt-dev && sudo gem install unf_ext
During that I get this error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libxml2-dev : Depends: libxml2 (= 2.9.1+dfsg1-3ubuntu4.9) but 2.9.4+dfsg1-2.2 is to be installed
E: Unable to correct problems, you have held broken packages.
However, dpkg --get-selections displays no packages on hold and all are installed. How can I successfully get this gem installed?
I ran into a similar issue with installing unf_ext on Ubuntu. I had to add a swapfile to my server. Once I did that I was able to install the unf_ext gem.

Conflicting packages on ubuntu

I was installing Sass on ubuntu for that I first installed Ruby and then Sass. but when i tried sass -v it gave a deprecated message about currently install ruby1.9 version saying it will not be support in future. so i tried upgrading ruby version to 2.0 (2.3 is not being installed on ubuntu) using
$ sudo apt-get install ruby2.0
But when checking the ruby version it still showed 1.9 so i tried with UN-installing Ruby1.9 then it showed a dependent library to uninstalled. I even did that but after that on installing ruby 2.0 again it gives error
the following packages have unmet dependencies:
libantlr3c-antlrdbg-3.2-0 : Conflicts: libantlr3c-3.2-0
E: Unable to correct problems, you have held broken packages.
How to solve this??
Basically you should install it directly from source, like so:
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev
libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz
tar -xvzf ruby-2.0.0-p451.tar.gz
cd ruby-2.0.0-p451/
./configure --prefix=/usr/local
make
sudo make install
Solution found here.

What exact dependencies does Ruby need on Ubuntu?

When reading how to install Ruby on Ubuntu, I frequently see this kind of thing:
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
But which of these packages are actually needed and which are nice to have?
And also... why?
I can't seem to find any good information online that answers this question.
apt-cache showpkg <specific-ruby-version-package> will show you the package dependencies. As above comment says, apt-get install ... will automatically install the dependencies. Anything people are installing beyond that may have to do with their development environment or the ability to build specific gems with native extensions.

Installing OpenSSL on Ubuntu for Rails development?

I am running the latest RVM on Ubuntu 10.10 and I managed to get most of the development environment running, except for OpenSSL.
When I try to install the package I get the following error:
$ rvm package install openssl > error
ERROR: Error running 'tar zxf /home/ruby/.rvm/archives/openssl-0.9.8n.tar.gz -C
/home/ruby/.rvm/src', please read /home/ruby/.rvm/log/openssl/extract.log
ERROR: Error running './config -I/home/ruby/.rvm/usr/include -L/home/ruby/.rvm
/usr/lib
--prefix=/home/ruby/.rvm/usr zlib no-asm no-krb5 shared ', please read /home/ruby
/.rvm/log/openssl/configure.log
ERROR: Error running '/usr/bin/make ', please read /home/ruby/.rvm/log/openssl/make.log
ERROR: Error running '/usr/bin/make install', please read /home/ruby/.rvm/log/openssl
/make.install.log
It seems that the original downloaded file is corrupt when I get it via RVM. So, I downloaded and unpacked it to ~/.rvm/src/openssl0.9.8 and the first error is gone (error running tar zxf), but I still get the other ones.
Edit: my Ruby version, if anyone cares, is:
$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
Did you run rvm requirements after installing RVM? It shows a list of all needed dependencies, and supplies the recommended "apt-get" command.
/usr/bin/apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
This will install openssl and libssl-dev, both of which are required. I've installed RVM and Ruby many times on Ubuntu and always used RVM's recommended way without a problem.
Do you have libssl installed in Ubuntu?
sudo apt-get install libssl0.9.8
Also install the development package:
sudo apt-get install libssl-dev

Resources