This Guide covers the installation of Metasploit Framework OSS Project on Ubuntun Linux LTS. If you do not wish to run the Open Source version or set up a development environment and do not mind giving your email address to Rapid 7 for marketing I would recommend downloading their comercial installer from http://www.metasploit.com/ Installing Dependencie
如果你不介意把自己的邮件地址提供给 Rapid 7,可以考虑使用官方的installer,会更加方便,在参考资料[2]中有说明这种方法。
Dependent Packages
|
|
安装依赖包
安装Ruby
这里我使用的是rbenv
,原文中还有RVM
的方法。
|
|
安装Nmap
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:
|
|
Configuring Postgre SQL Server
|
|
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.
If you experience problems with the database setup this fedora guide offers a good guide for troubleshooting and setup https://fedoraproject.org/wiki/Metasploit_Postgres_Setup
Installing Metasploit Framework
安装目录为/opt/metasploit-framework
We will download the latest version of Metasploit Framework via Git so we can use msfupdate to keep it updated:
Install using bundler the required gems and versions:
添加软链接
Lets create the links to the commands so we can use them under any user and not being under the framework folder, for this we need to be in the metasploit-framework folder if not already in it:
Metasploit for Development and Contribution
关于数据库配置文件
If you wish to develop and contribute to the product you can follow the additional steps here Metasploit Dev Environment . For this you will need a GitHub account and you will fork the project in to your own account. I personally keep my dev copy of Metasploit in ~/Development folder and after an initial run of msfconsole I keep my database.yml file in ~/.msf4/cofig folder and adjust the MSF_DATABASE_CONFIG variable for it or run msfconsole with the -y option and point it to a YAML file with the correct configuration.
Installing armitage:
|
|
Lets create the database.yml file that will contain the configuration parameters that will be use by framework:
添加如下内容,别忘记之前设置的密码
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:
Create and environment variable so it is loaded by Armitage and by msfconsole when running and load the variable in to your current shell:
First Run
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.
|
|
参考资料
[1] Installing Metasploit Framework on Ubuntu 14.04 LTS and Debian 7
[2] Ubuntu 下安装metasploit
[3] Setting Up a Metasploit Development Environment - Rapid 7
[4] Armitage