Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This manual is applied for those that like to use metasploit but do not want to change to systemd linux (kali sana/rolling) .
- Staying in 1.1.0a will not update metaploit with "msfupdate" because wheezy repositories of kali are not maintained anymore .
- Steps to achieve :
- - change repositories
- - remove old metasploit from kali wheezy
- - install metasploit dependencies and ruby
- - install ruby 2.33
- - clone metasploit from git
- - configure metasploit and postgresql 9.1
- - configure new path environment for metasploit-framework
- Change repositories :
- add debian wheezy repositories to /etc/apt/sources.list
- Your sources list should have only these repositories :
- nano /etc/apt/sources.list
- deb http://old.kali.org/kali moto main non-free contrib
- deb-src http://old.kali.org/kali moto main non-free contrib
- deb http://httpredir.debian.org/debian wheezy main contrib non-free
- deb-src http://httpredir.debian.org/debian wheezy main contrib non-free
- deb http://httpredir.debian.org/debian wheezy-updates main contrib non-free
- deb-src http://httpredir.debian.org/debian wheezy-updates main contrib non-free
- deb http://security.debian.org/ wheezy/updates main contrib non-free
- deb-src http://security.debian.org/ wheezy/updates main contrib non-free
- update your system with :
- apt-get update && apt-get upgrade
- -remove old metasploit-framework previous installed in kali 1.1.0a
- apt-get remove --purge metasploit-framework
- * : armitage will be removed as also postgresql , but we will install postgresql later
- install metasploit dependencies , postgresql & ruby
- apt-get install postgresql python-software-properties libxslt1-dev libffi-dev autoconf bison build-essential libreadline-dev 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 postgresql postgresql-contrib wget xsel zlib1g zlib1g-dev -y
- - install ruby 2.33
- gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
- curl -sSL https://get.rvm.io | bash -s stable --ruby
- /bin/bash --login
- rvm install 2.3.3
- rvm use 2.3.3
- - clone metasploit from git to /opt/
- cd /opt
- git clone https://github.com/rapid7/metasploit-framework.git
- cd metasploit-framework
- - configure metasploit and postgresql 9.1
- gem install bundler
- gconftool-2 --set --type boolean /apps/gnome-terminal/profiles/Default/login_shell true
- bundle install
- service postgresql start
- cat <<EOF> $HOME/pg-utf8.sql
- update pg_database set datallowconn = TRUE where datname = 'template0';
- \c template0
- update pg_database set datistemplate = FALSE where datname = 'template1';
- drop database template1;
- create database template1 with template = template0 encoding = 'UTF8';
- update pg_database set datistemplate = TRUE where datname = 'template1';
- \c template1
- update pg_database set datallowconn = FALSE where datname = 'template0';
- \q
- EOF
- sudo -u postgres psql -f $HOME/pg-utf8.sql
- sudo -u postgres createuser msfdev -dRS
- sudo -u postgres psql
- "ALTER USER msfdev with ENCRYPTED PASSWORD 'msf';"
- Press CTRL+D to exit
- sudo -u postgres createdb --owner msfdev msf_dev_db
- sudo -u postgres createdb --owner msfdev msf_test_db
- cat <<EOF> $HOME/.msf4/database.yml
- # Development Database
- development: &pgsql
- adapter: postgresql
- database: msf_dev_db
- username: msfdev
- password: msf
- host: localhost
- port: 5432
- pool: 5
- timeout: 5
- # Production database -- same as dev
- production: &production
- <<: *pgsql
- # Test database -- not the same, since it gets dropped all the time
- test:
- <<: *pgsql
- database: msf_test_db
- EOF
- service postgresql start
- sudo -sE su postgres
- psql
- update pg_database set datallowconn = TRUE where datname = 'template0';
- \c template0
- update pg_database set datistemplate = FALSE where datname = 'template1';
- drop database template1;
- create database template1 with template = template0 encoding = 'UTF8';
- update pg_database set datistemplate = TRUE where datname = 'template1';
- \c template1
- update pg_database set datallowconn = FALSE where datname = 'template0';
- \q
- We have to setup the password for msfdev again because i was unable to figure out why msfconsole says password is wrong .
- sudo -u postgres psql
- \password msfdev
- Write for password & confirm it : msf
- Press CTRL+D to exit
- service postgresql restart
- - configure new path environment for metasploit-framework
- export PATH=/opt/metasploit-framework/:$PATH
- After this point you can write "msfconsole" on your terminal anywhere that will open metasploit-framework .
- To update metasploit write "msfupdate"
- Remember that postgresql must start before "msfconsole" , so msf can connect to its database .
- Write on terminal :
- service postgresql start
- This manual was written by pedropt for Kali "How TO" forum , the reason that is on pastebin is because kali server detects sql entries in the post and block the post automatically .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement