Advertisement
Russell

Metasploit Framework Installation on Ubuntu or Debian

Sep 1st, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. These instructions are written assuming the server is running on Debian or Ubuntu, and the system username is "admin".
  2.  
  3. 1) Assuming it's a fresh server, we first update the repos and installed software:
  4.  
  5. sudo apt-get update
  6. sudo apt-get upgrade
  7.  
  8. 2) We then install the pre-requisite software:
  9.  
  10. 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
  11.  
  12. 3) Confirm your current working directory by typing "pwd". It sould return "/home/admin". If not, then type "cd /home/admin".
  13.  
  14. 4) We download MSF and set the correct user/group permision:
  15.  
  16. sudo git clone https://github.com/rapid7/metasploit-framework.git
  17. sudo chown -R admin:admin /home/admin/metasploit-framework
  18.  
  19. 5) We install RVM and Ruby:
  20.  
  21. curl -sSL https://rvm.io/mpapis.asc | gpg --import -
  22. curl -L https://get.rvm.io | bash -s stable
  23. source ~/.rvm/scripts/rvm
  24. echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
  25. source ~/.bashrc
  26. cd ~/metasploit-framework
  27. rvm --install .ruby-version
  28.  
  29. To confirm that Ruby is installed, type: ruby -v
  30.  
  31. 6) Now we install MSF:
  32.  
  33. gem install bundler
  34. bundle install
  35.  
  36. 7) We installed PostgreSQL on step 2, now as add a new user and a database:
  37.  
  38. sudo -s
  39. su postgres
  40. createuser msf -P -S -R -D
  41. createdb -O msf msf
  42. exit
  43. exit
  44.  
  45. Remember the password you used after using the "createuser" command.
  46.  
  47. 8) We add the database credentials:
  48.  
  49. cd config
  50. cp database.yml.example database.yml
  51. nano database.yml
  52.  
  53. Now, edit the following fields and put:
  54.  
  55. database: msf
  56. username: msf
  57. password: *** (the one you set on previous step)
  58.  
  59. Once done, press Ctrl+o to save, and Ctrl+x to exit Nano editor.
  60.  
  61. 9) We create soft links needed:
  62.  
  63. cd ~/metasploit-framework
  64. sudo bash -c 'for MSF in $(ls msf*); do ln -s /home/admin/metasploit-framework/$MSF /usr/local/bin/$MSF;done'
  65.  
  66. 10) Provided everything was done properly, we can now run MSF by typing:
  67.  
  68. msfconsole
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement