[Installing Metasploit Framework on CentOS_RHEL 6]在CentOS_RHEL 6上安装Metasploit的框架【翻译】

标记声明:蓝色汉子为翻译上段英文内容,黄色文字为执行命令。英文水平有限,如有疏漏还请指出。文章出处 博客园-初行

All command in the guide need to be ran as root. To switch to root and have all the proper variables run:

在本教程中的所有命令需要使用root账户。切换到root账户保证所变量正确执行:

su -

Installing Dependencies

安装依赖关系

We start by making sure that we have the latest packages by updating the system using yum:

首先,我们要确保我们所使用yum更新系统拥有最新的软件包:

yum update

yum upgrade

Now that we know that we are running an updated system we can install all the dependent packages that are needed by Metasploit Framework:

现在我们知道,我们正在运行一个更新过的系统,我们可以安装所有需要通过Metasploit的框架的依赖包:

yum groupinstall 'Development Tools'

yum install sqlite-devel libxslt-devel libxml2-devel java-1.7.0-openjdk libpcap-devel nano openssl-devel zlib-devel libffi-devel gdbm-devel readline-devel nano wget

Installing Ruby 1.9.3

安装Ruby1.9.3

CentOS/RHEL is a solid operating system but sadly it does not tend to run the latest in term of packages so we have to compile and install by hand the YAML and Ruby 1.9.3 software.

CentOS/ RHEL操作系统非常的稳定,但遗憾的是它对最新的软件包不能很好支持,所以我们要手动编译和安装YAML和Ruby1.9.3。

First we download and install the latest version of YAML.

首先我们下载并安装最新的YAML版本。

cd /usr/src

wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz

tar zxf yaml-0.1.4.tar.gz

cd yaml-0.1.4

./configure --prefix=/usr/local

make && make install

Now we download and install the latest version of Ruby 1.9.3

现在,我们下载并安装Ruby1.9.3的最新版本

cd /usr/src

wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p374.tar.gz

tar xvzf ruby-1.9.3-p374.tar.gz

cd ruby-1.9.3-p374

./configure --prefix=/usr/local --with-opt-dir=/usr/local/lib

make & make install

Installing Nmap

安装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:

其中一个是Metasploit的使用扫描的外部工具,Nmap不包含在源中。在这里,我们将介绍用于下载Nmap的最新的源代码,编译和安装:

cd /usr/src

svn co https://svn.nmap.org/nmap

cd nmap

./configure

make

make install

make clean

Configuring Postgre SQL Server

配置Postgre的SQL Server

The version that comes with CentOS/RHEL is quite old so we need to modify our system to install the latest from PostgreSQL directly. Open /etc/yum.repos.d/CentOS-Base.repo and add to the [base] and [update] sections:

CentOS/ RHEL中附带的版本很老,所以我们需要修改我们的系统可以直接安装最新的PostgreSQL的。打开/ etc / yum.repos.d/ CentOS-Base.repo,并加入到[base]和[updatge]部分:

exclude=postgresql*

Now we can install the Postgres official repository for CentOS 6 x64:

现在我们可以安装Postgres的官方库在CentOS6 x64的:

wget http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm

rpm -ivh pgdg-centos92-9.2-6.noarch.rpm

for X86 download: http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-redhat92-9.2-7.noarch.rpm

X86版本的下载地址:

Fot RHEL 6 x64

对于REHEL 6 x64版本

wget http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm

rpm -ivh pgdg-redhat92-9.2-7.noarch.rpm

for x86 download http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm

X86版本的下载地址:

To install Postgres and the necessary files we use yum:

要安装Postgres,我们必须使用的yum文件:

yum update

yum install postgresql92-server postgresql92-devel postgresql92

Now we initialize the server and configure it for automatic startup:

现在我们初始化服务器并将其配置为自动启动:

service postgresql-9.2 initdb

service postgresql-9.2 start

chkconfig postgresql-9.2 on

For when we compile the necessary gem for ruby we need to add the new install to our path so the compiler can find the binaries and libraries:

因为当我们编译所需的ruby gem包时我们需要添加新安装路径到我们的环境变量(path),这样编译器可以找到二进制文件和库:

echo export PATH=/usr/pgsql-9.2/bin:\$PATH >> /etc/bashrc

source ~/.bashrc

We start by switching to the Postgres user so we can create the user and database that we will use for Metasploit

首先,我们切换到Postgres用户,这样可以创建我们将使用的Metasploit用户和数据库。

su - postgres

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.

现在,我们创建用户和数据库,并记录您给了用户,因为它会在Metasploit和Armitage 用于连接到数据库的database.yml文件要使用的数据库。

createuser msf -P -S -R -D

createdb -O msf msf

exit

exit

To allow the user we created to connect to Postgres we need to add to /var/lib/pgsql/9.2/data/pg_hba.conf file the following lines above the rest of the other configured settings:

要允许我们创建的用户连接到Postgres,我们需要添加以下行到/ var/lib/pgsql/9.2/data/pg_hba.conf文件上面的其他设置的其余部分:

local msf msf md5

hostmsf msf 127.0.0.1/8 md5

hostmsf msf ::1/128 md5

Restart the service:

重新启动服务:

service postgresql-9.2 start

Installing Metasploit Framework

安装Metasploit的框架

Once the packages have been install we need to install the required Ruby libraries that metasploit depends on:

一旦包已经安装,我们需要安装所需的Ruby库的Metasploit取决于:

gem install wirble pg sqlite3 msgpack activerecord redcarpet rspec simplecov yard bundler

We will download the latest version of Metasploit Framework via Git so we can use msfupdate to keep it updated:

我们将下载的Metasploit Framework的最新版本通过Git的,所以我们可以使用msfupdate保持更新:

cd /opt

git clone https://github.com/rapid7/metasploit-framework.git

cd metasploit-framework

Lets create the links to the commands so we can use them under any user and not being under the framework folder:

让我们创建于命令的链接,这样我们就可以使用它们在任何用户,而不是根据框架文件夹为:

bash -c 'for MSF in $(ls msf*); do ln -s /opt/metasploit-framework/$MSF /usr/local/bin/$MSF;done'

ln -s /opt/metasploit-framework/armitage /usr/local/bin/armitage

From the Metasploit-Framework folder lets use the Bundler Gem to install the properly supportted Gem versions:

从Metasploit框架文件夹允许使用Bundler Gem安装正确的被支持 gem版本:

bundle install

Lets create the database.yml file that will contain the configuration parameters that will be use by framework:

让我们创建一个被框架使并用包含配置参数的database.yml文件:

nano /opt/metasploit-framework/database.yml

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:

复制YAML项目,并确保您提供您创建的步骤在密码字段为数据库中的用户输入的密码:

production:

adapter: postgresql

database: msf

username: msf

password:

host: 127.0.0.1

port: 5432

pool: 75

timeout: 5

Create and environment variable so it is loaded by Armitage and by msfconsole when running and load the variable in to your current shell:

由Armitage创建环境变量并,msfconsole运行时加载变量到当前的shell:

echo export MSF_DATABASE_CONFIG=/opt/metasploit-framework/database.yml >> /etc/bashrc

source ~/.bashrc

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.

现在,我们已经准备好运行Metasploit的第一次。我的建议是先以普通用户身份下运行它,因此文件夹你的home目录下创建具有适当的权限。首次运行时会在数据库中创建所需的Metasploit项目,以便将需要一段时间来加载。

msfconsole

原文地址:http://www.darkoperator.com/msf-centosrhel/

[Installing Metasploit Framework on CentOS_RHEL 6]在CentOS_RHEL 6上安装Metasploit的框架【翻译】的更多相关文章

  1. Metasploit Framework(6)客户端渗透(上)

    文章的格式也许不是很好看,也没有什么合理的顺序 完全是想到什么写一些什么,但各个方面都涵盖到了 能耐下心看的朋友欢迎一起学习,大牛和杠精们请绕道 前五篇文章讲解了Metasploit Framewor ...

  2. 在CentOS_RHEL 6上安装Metasploit的框架

    https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers 1. shyum update curl https:// ...

  3. Installing Metasploit Framework on Ubuntu 14.04 LTS and Debian 7

    原文链接:http://www.darkoperator.com/installing-metasploit-in-ubunt/ This Guide covers the installation ...

  4. 安装Windows Metasploit Framework

    Installing the Metasploit Framework on Windows 1. Visit http://windows.metasploit.com/metasploitfram ...

  5. Metasploit Framework(8)后渗透测试(一)

    文章的格式也许不是很好看,也没有什么合理的顺序 完全是想到什么写一些什么,但各个方面都涵盖到了 能耐下心看的朋友欢迎一起学习,大牛和杠精们请绕道 使用场景: Kali机器IP:192.168.163. ...

  6. Metasploit Framework(4)信息收集

    文章的格式也许不是很好看,也没有什么合理的顺序 完全是想到什么写一些什么,但各个方面都涵盖到了 能耐下心看的朋友欢迎一起学习,大牛和杠精们请绕道 使用场景: Kali机器一台:192.168.163. ...

  7. Metasploit Framework(1)基本命令、简单使用

    文章的格式也许不是很好看,也没有什么合理的顺序 完全是想到什么写一些什么,但各个方面都涵盖到了 能耐下心看的朋友欢迎一起学习,大牛和杠精们请绕道 基本的控制台命令介绍: banner 查看metasp ...

  8. Kali之Metasploit Framework环境配置

    运行Metasploit Framework 依照Kali Linux网络服务策略,Kali没有自动启动的网络服务,包括数据库服务在内.所以为了让Metasploit以支持数据库的方式运行有些必要的步 ...

  9. Docker Metasploit Framework

    https://hub.docker.com/r/usertaken/metasploit-framework/ docker pull usertaken/metasploit-framework ...

随机推荐

  1. BZOJ.3546.[ONTAK2010]Life of the Party(二分图匹配 ISAP)

    题目链接 题意:求哪些点一定在最大匹配中. 这儿写过,再写一遍吧. 求哪些点不一定在最大匹配中.首先求一遍最大匹配,未匹配点当然不一定在最大匹配中. 设一个未匹配点为A,如果存在边A-B,且存在匹配边 ...

  2. BZOJ.2287.[POJ Challenge]消失之物(退背包)

    BZOJ 洛谷 退背包.和原DP的递推一样,再减去一次递推就行了. f[i][j] = f[i-1][j-w[i]] + f[i-1][j] f[i-1][j] = f[i][j] - f[i-1][ ...

  3. 一款功能强悍的web磁盘管理工具 (A powerful web disk management tools)

    https://github.com/kingAnyWHere/web-ftp web-ftp 一款功能强悍的web磁盘管理工具 (A powerful web disk management too ...

  4. 深入一下Django的用户认证和cache

    深入一下Django的用户认证和cache 用户认证 首先明白一个概念,http协议是无状态的,也就是每一次交互都是独立的,那如何让服务器和客户端进行有状态的交互呢,现在较为常见的方法就是让客户端在发 ...

  5. thinkphp5 学习笔记

    一.开发规范: 二.API: 1.数据输出:新版的控制器输出采用 Response 类统一处理,而不是直接在控制器中进行输出,通过设置 default_return_type 就可以自动进行数据转换处 ...

  6. Sallen-Key Active Butterworth Low Pass Filter Calculator

    RC 2nd Order Passive Low Pass Filter The cut-off frequency of second order low pass filter is given ...

  7. API判断本机安装的Revit版本信息

    start [Transaction(TransactionMode.Manual)] [Regeneration(RegenerationOption.Manual)] public class c ...

  8. FPGA系列之一:Cyclone V中的时钟资源

    之前的项目中更多的是有师兄提供经验和帮助,追求的是快速上手,所以不管对于硬件电路设计,还是verilog电路编程,甚至是FPGA内部的资源,都没来得及系统地学习,最近在做算法到电路的实现,正好系统学习 ...

  9. 连接mysql 出现:java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.

    数据测试的时候出现: 网上查资料说的是mysql5.x 版本和 8.x版本的区别: 5.7版本是:default_authentication_plugin=mysql_native_password ...

  10. postgresql 函数获取多个字段的数字大小值

    1.GREATEST(n1,n2,n3,..........) 获取最大值 testdb=#SELECT GREATEST(,,,,,,,,,); +------------------------- ...