Skip to content

Instantly share code, notes, and snippets.

@holms
Last active October 10, 2020 14:13
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save holms/7379090 to your computer and use it in GitHub Desktop.
Save holms/7379090 to your computer and use it in GitHub Desktop.
metasploit install in debian wheezy

Debian Wheezy Metasploit Setup

Install depedencies

apt-get install build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev openjdk-7-jre subversion git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev vncviewer libyaml-dev ruby1.9.3 nmap -y
gem install --verbose --debug pcaprub wirble pg sqlite3 msgpack activerecord redcarpet rspec simplecov yard bundler

Get the latest Metasploit from Git:

cd /opt
git clone https://github.com/rapid7/metasploit-framework.git

Create global commands and install the gems:

cd metasploit-framework
bash -c 'for MSF in $(ls msf*); do ln -s /opt/metasploit-framework/$MSF /usr/local/bin/$MSF;done'
bundle install

Setup the database:

su postgres
createuser msf -P -S -R -D
createdb -O msf msf
exit

Create the database file: nano /opt/metasploit-framework/database.yml adding to it:

production:
   adapter: postgresql
   database: msf
   username: msf
   password: 
   host: 127.0.0.1
   port: 5432
   pool: 75
   timeout: 5

Create an environmental variable:

sh -c "echo export MSF_DATABASE_CONFIG=/opt/metasploit-framework/database.yml >> ~/.bashrc"

Go to msfconsole and provision database

msfconsole # open msf console and connect to db
msf> db_connect -y /opt/local/config/database.yml
msf> exit

Launch metasploit service

This should be launched without ssl, or else Armitage won't work

msfrpcd -U msfuser2 -P msfpassword2 -S -a 127.0.0.1 -t Msg 

Armitage setup doesn't work

Download Armitage from here: http://www.fastandeasyhacking.com/download

I've tried to launch on 0.0.0.0, and connect to my server from my mac, it's just says request timeout. You can install armitage on vps, and use ssh xforwarding to launch it.

If you have some ideas, fork this doc, or add the comment. Thanks!

@fjms
Copy link

fjms commented Oct 9, 2014

Thank, a mistake... Go to msfconsole and provision database

msfconsole # open msf console and connect to db
msf> db_connect -y /opt/metasploit-framework/database.yml
msf> exit

If you have some problem with password connection to db

sudo su postgres
psql
alter user msf with password 'msf'; 
\q

And edit database.yml

production:
   adapter: postgresql
   database: msf
   username: msf
   password: msf
   host: 127.0.0.1
   port: 5432
   pool: 75
   timeout: 5

Reset services postgresql

service postgresql restart

;D

@SaavdhaanCyber
Copy link

intex aqua trend_2017-01-31-17-04-56
now what can i do to solve this error please help me thanx

@keeganjk
Copy link

keeganjk commented Apr 9, 2017

When I run bundle install it results in An error occurred while installing ffi (1.9.18), and Bundler cannot continue. Make sure that gem install ffi -v '1.9.18' succeeds before bundling. How do I fix this?

@Jimmytbane
Copy link

Jimmytbane commented Jul 2, 2017

@keeganjk try searching your package manager to see if that gem is available as it's own binary from, lets say, apt, or your package manager.

@nehlix
Copy link

nehlix commented Nov 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment