Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- These instructions are written assuming the server is running on Debian or Ubuntu, and the system username is "admin".
- 1) Assuming it's a fresh server, we first update the repos and installed software:
- sudo apt-get update
- sudo apt-get upgrade
- 2) We then install the pre-requisite software:
- sudo 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 postgresql postgresql-contrib wget xsel zlib1g zlib1g-dev
- 3) Confirm your current working directory by typing "pwd". It sould return "/home/admin". If not, then type "cd /home/admin".
- 4) We download MSF and set the correct user/group permision:
- sudo git clone https://github.com/rapid7/metasploit-framework.git
- sudo chown -R admin:admin /home/admin/metasploit-framework
- 5) We install RVM and Ruby:
- curl -sSL https://rvm.io/mpapis.asc | gpg --import -
- curl -L https://get.rvm.io | bash -s stable
- source ~/.rvm/scripts/rvm
- echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
- source ~/.bashrc
- cd ~/metasploit-framework
- rvm --install .ruby-version
- To confirm that Ruby is installed, type: ruby -v
- 6) Now we install MSF:
- gem install bundler
- bundle install
- 7) We installed PostgreSQL on step 2, now as add a new user and a database:
- sudo -s
- su postgres
- createuser msf -P -S -R -D
- createdb -O msf msf
- exit
- exit
- Remember the password you used after using the "createuser" command.
- 8) We add the database credentials:
- cd config
- cp database.yml.example database.yml
- nano database.yml
- Now, edit the following fields and put:
- database: msf
- username: msf
- password: *** (the one you set on previous step)
- Once done, press Ctrl+o to save, and Ctrl+x to exit Nano editor.
- 9) We create soft links needed:
- cd ~/metasploit-framework
- sudo bash -c 'for MSF in $(ls msf*); do ln -s /home/admin/metasploit-framework/$MSF /usr/local/bin/$MSF;done'
- 10) Provided everything was done properly, we can now run MSF by typing:
- msfconsole
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement