unhappyghost

Installing ‪#‎Metasploit‬ Framework on ‪#‎Ubuntu‬

Jul 23rd, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1. Installing ‪#‎Metasploit‬ Framework on ‪#‎Ubuntu‬
  2. ----------------------------------------------
  3.  
  4. Installing Dependencies
  5. ---------------------------------
  6. We start by making sure that we have the latest packages by updating the system using apt-get:
  7.  
  8. $ sudo apt-get update
  9. $ sudo apt-get upgrade
  10.  
  11. Now that we know that we are running an updated system we can install all the dependent packages that are needed by Metasploit Framework:
  12.  
  13. $ sudo 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
  14.  
  15. Once the packages have been install we need to install the required Ruby libraries that metasploit depends on:
  16.  
  17. ‪#‎sudo‬ gem install wirble sqlite3 bundler
  18.  
  19. Installing ‪#‎Nmap‬
  20. ------------------------
  21. One of the external tools that Metasploit uses for scanning that is not included with the sources is Nmap. Here we will cover downloading the latest source code for Nmap, compiling and installing:
  22.  
  23. $ mkdir ~/Development
  24. $ cd ~/Development
  25. $ svn co https://svn.nmap.org/nmap
  26. $ cd nmap
  27. $ ./configure
  28. $ make
  29. $ sudo make install
  30. $ make clean
  31. $ Configuring ‪#‎Postgre‬ ‪#‎SQL‬ Server
  32.  
  33. We start by switching to the postgres user so we can create the user and database that we will use for Metasploit
  34.  
  35. $ sudo -s
  36. $ su postgres
  37.  
  38. Now we create the user and Database, do record the database that you gave to the user since it will be used in the database.yml file that Metasploit and Armitage use to connect to the database.
  39.  
  40. $ createuser msf -P -S -R -D
  41. $ createdb -O msf msf
  42. $ exit
  43. $ exit
  44.  
  45. Installing Metasploit Framework
  46. ------------------------------------------
  47. We will download the latest version of Metasploit Framework via Git so we can use msfupdate to keep it updated:
  48.  
  49. $ cd /opt
  50. $ git clone https://github.com/rapid7/metasploit-framework.git
  51. $ cd metasploit-framework
  52.  
  53. Install using bundler the requiered gems and versions:
  54.  
  55. Lets create the links to the commands so we can use them under any user and not being under the framework folder:
  56.  
  57. $ cd metasploit-framework
  58. $ sudo bash -c 'for MSF in $(ls msf*); do ln -s /opt/metasploit-framework/$MSF /usr/local/bin/$MSF;done'
  59.  
  60. Installing ‪#‎armitage‬:
  61. ----------------------------
  62. $ curl -# -o /tmp/armitage.tgz http://www.fastandeasyhacking.com/download/armitage-latest.tgz
  63. $ sudo tar -xvzf /tmp/armitage.tgz -C /opt
  64. $ sudo ln -s /opt/armitage/armitage /usr/local/bin/armitage
  65. $ sudo ln -s /opt/armitage/teamserver /usr/local/bin/teamserver
  66.  
  67. From the Metasploit-Framework folder lets use the Bundler Gem to install the properly supportted Gem versions:
  68.  
  69. $ bundle install
  70. $ cd metasploit-framework bundle install
  71.  
  72. Lets create the database.yml file that will contain the configuration parameters that will be use by framework:
  73.  
  74. $ sudo nano /opt/metasploit-framework/database.yml
  75.  
  76. Copy the YAML entries and make sure you provide the password you entered in the user creating step in the password field for the database:
  77.  
  78. production:
  79. adapter: postgresql
  80. database: msf
  81. username: msf
  82. password:
  83. host: 127.0.0.1
  84. port: 5432
  85. pool: 75
  86. timeout: 5
  87.  
  88. Create and environment variable so it is loaded by Armitage and by msfconsole when running and load the variable in to your current shell:
  89.  
  90. $ sudo sh -c "echo export MSF_DATABASE_CONFIG=/opt/metasploit-framework/database.yml >> /etc/profile
  91. source /etc/profile"
  92.  
  93. Install the pcaprun gem so we can use the portscanning modules:
  94.  
  95. $ cd /opt/metasploit-framework/external/pcaprub
  96. $ sudo ruby extconf.rb && sudo make && sudo make install
  97.  
  98. First Run
  99. -----------
  100. Now we are ready to run Metasploit for the first time. My recommendation is to run it first under a regular user so the folders create under your home directory have the proper permissions. First time it runs it will create the entries needed by Metasploit in the database so it will take a while to load.
  101.  
  102. msfconsole
  103.  
  104. Source : http://www.darkoperator.com/installing-metasploit-in-ubunt/
  105.  
  106. .‪#‎UnhappyGhost‬ ‪#‎GeekSchool‬ ‪#‎GeekSch00l‬
  107. .
  108.  
  109. ##############################################################
  110. # ṲИℋÅℙℙУḠ♓☮$✝ #
  111. ##############################################################
  112. || Website --------> http://unhappyghost.com/ ||
  113. || Facebook -------> https://www.facebook.com/unhappygh0st ||
  114. || FB Page --------> https://www.facebook.com/geeksch00l ||
  115. || Twitter --------> https://twitter.com/unhappygh0st ||
  116. || Google+ --------> http://goo.gl/WCHeJR ||
  117. || Youtube --------> http://goo.gl/A3mQIE ||
  118. || IPv6 Vids ------> http://goo.gl/Rbcxk ||
  119. || IPv6 Event -----> http://goo.gl/TaeXv ||
  120. ##############################################################
  121.  
  122. .
Advertisement
Add Comment
Please, Sign In to add comment