Linux-install Metasploit on CentOS

Source: Internet
Author: User

For a security need, we are put metasploit-framework on the remote machine.

OS Details:

[[email protected] centos]$  uname -aLinux localhost.localdomain 2.6.32-042stab104.1 #1 SMP Thu Jan 29 12:58:41 MSK 2015 i686 i686 i386 GNU/Linux[[email protected] centos]$  cat /etc/issueCentOS release 6.6 (Final)Kernel \r on an \m

We'll show you the install Metasploit-framework step by step.

    1. ADD a MSF user with normal privileges
    2. Clone Metasploit-framework
    3. Libraries Requirements
    4. Ruby env
    5. Database Setup
    6. Start Metasploit-framework
ADD a MSF user with normal privileges

Add a normal user for Metasploit called CentOS by Root.

# useradd -b /home/ -c ‘normal user‘ -m -u 1000 centos
Clone metasploit-framework

Let's get a lastest Metasploit copy from GitHub.

# cd /opt# git clone git://github.com:rapid7/metasploit-framework.git
Libraries Requirements
# yum update# yum upgrade# yum install -y patch libyaml-devel glibc-headers autoconf gcc-c++ glibc-devel patch readline-devel libffi-devel automake libtool bison sqlite-devel postgresql-devel libpcap-devel
Ruby env
Database Setup
# service postgresql initdb# service postgresql start# su postgres$ createuser msfuser -P   # set password: [msfpass]$ createdb -O msfuser msfdb$ exit$ cd /opt/metasploit-framework$ sudo mv config/database.yml.example config/database.yml$ cat config/database.ymlproduction: &pgsql  adapter: postgresql  database: msfdb  username: msfuser  password: msfpass  host: localhost  port: 5432  pool: 5  timeout: 5

When we start Metasploit, it does an error.

$  ./msfconsole[*] Starting the Metasploit Framework console...[-] Failed to connect to the database: FATAL:  Ident authentication failed for user "msfuser"

What we need are to modify /var/lib/pgsql/data/pg_hba.conf file as follow:

local   all         all                               trusthost    all         all         127.0.0.1/32          trusthost    all         all         ::1/128               trust
Start Metasploit-framework
$ cd /opt/metasploit-framework$ ./msfconsole

References
    1. Https://github.com/rapid7/metasploit-framework/wiki
    2. Install Metasploit on Arch

Linux-install Metasploit on CentOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.