Install Metasploit framework on CentOS 8 / CentOS 7

[*]

/ * Custom CSS * /
.tdi_3_7ed.td-a-rec-img {
Text alignment: left;
} .tdi_3_7ed.td-a-rec-img img {
The security deposit: 0 automatically 0 0;
}}}

In this article, we will discuss how to install Metasploit Framework on CentOS 8 / CentOS 7 Linux distribution. If you are new to the field of penetration testing, Metasploit Framework is a tool created by Rapid7 Used for penetration testing and finding security holes in IT environments and assets. It provides you with the infrastructure, content and tools to perform extensive security audits and penetration testing.

Metasploit framework requirements

These are the minimum hardware requirements to run Metasploit Framework on any Linux machine.

  • CPU – 2 GHz + processor
  • RAM-4 GB of RAM available (8 GB recommended)
  • Disk space-1 GB of free disk space (50 GB recommended)

Following are the core services of the Metasploit framework.

[*]

/ * Custom CSS * /
.tdi_2_e9e.td-a-rec-img {
Text alignment: left;
} .tdi_2_e9e.td-a-rec-img img {
The security deposit: 0 automatically 0 0;
}}}

  • PostgreSQL database servicer-Metasploit is used to store data in the project.
  • Ruby on Rails
  • Metasploit service

Install Metasploit framework on CentOS 8 / CentOS 7

Please follow these steps to install Metasploit Framework on CentOS 8 / CentOS 7 Linux distribution.

Download the Metasploit installer using the wget or curl command.

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall

Provides the installer script execution bit.

chmod +x msfinstall

Then execute the installer to install Metasploit Framework on CentOS 8 / CentOS 7.

$ ./msfinstall

Sample installation output:

$ ./msfinstall
Switching to root user to update the package
Checking for and installing update..
Adding metasploit-framework to your repository list..Metasploit                                                   [===                                  Metasploit                                                                                                              153 kB/s | 246 kB     00:01    
Dependencies resolved.
========================================================================================================================================================
 Package                               Arch                    Version                                                Repository                   Size
========================================================================================================================================================
Installing:
 metasploit-framework                  x86_64                  5.0.77+20200224112600~1rapid7-1.el6                    metasploit                  206 M

Transaction Summary
========================================================================================================================================================
Install  1 Package

Total download size: 206 M
Installed size: 462 M
Downloading Packages:

The installer script adds the Metasploit Framework repository to your list of repositories and installs all the tools you need. If your internet speed is slow, downloading may take a while.

Run the command to begin the initial setup.

$ msfdb init 

 ** Welcome to Metasploit Framework Initial Setup **
    Please answer a few questions to get started.


Would you like to use and setup a new database (recommended)? yes
Creating database at /home/cloud-user/.msf4/db
Starting database at /home/cloud-user/.msf4/db...success
Creating database users
Writing client authentication configuration file /home/cloud-user/.msf4/db/pg_hba.conf
Stopping database at /home/cloud-user/.msf4/db
Starting database at /home/cloud-user/.msf4/db...success
Creating initial database schema
[?] Initial MSF web service account username? [cloud-user]: admin
[?] Initial MSF web service account password? (Leave blank for random password): 
Generating SSL key and certificate for MSF web service
Attempting to start MSF web service...success
MSF web service started and online
Creating MSF web service user admin
....

MSF web service credentials shown in the storage configuration output:

Creating MSF web service user admin

    ############################################################
    ##              MSF Web Service Credentials               ##
    ##                                                        ##
    ##        Please store these credentials securely.        ##
    ##    You will need them to connect to the webservice.    ##
    ############################################################

MSF web service username: admin
MSF web service password: password
MSF web service user API token: eee4cda702f0bdc0625c828cf56817dfd07a13c23e55000230f23fe33340ab0ef9e28f483e11312f


MSF web service configuration complete
The web service has been configured as your default data service in msfconsole with the name "local-https-data-service"

If needed, manually reconnect to the data service in msfconsole using the command:
db_connect --token eee4cda702f0bdc0625c828cf56817dfd07a13c23e55000230f23fe33340ab0ef9e28f483e11312f --cert /home/cloud-user/.msf4/msf-ws-cert.pem --skip-verify https://localhost:5443

The username and password are credentials for the API account:
https://localhost:5443/api/v1/auth/account


 ** Metasploit Framework Initial Setup Complete **

The installation of Metasploit Framework should be completed:

Check your Framework version using:

$ msfconsole --version
Framework Version: 5.0.77-dev-

Start msfconsole

Now that the database is initialized, you can start msfconsole

$ msfconsole
                                                  

MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMM                MMMMMMMMMM
MMMN$                           vMMMM
MMMNl  MMMMM             MMMMM  JMMMM
MMMNl  MMMMMMMN       NMMMMMMM  JMMMM
MMMNl  MMMMMMMMMNmmmNMMMMMMMMM  JMMMM
MMMNI  MMMMMMMMMMMMMMMMMMMMMMM  jMMMM
MMMNI  MMMMMMMMMMMMMMMMMMMMMMM  jMMMM
MMMNI  MMMMM   MMMMMMM   MMMMM  jMMMM
MMMNI  MMMMM   MMMMMMM   MMMMM  jMMMM
MMMNI  MMMNM   MMMMMMM   MMMMM  jMMMM
MMMNI  WMMMM   MMMMMMM   MMMM#  JMMMM
MMMMR  ?MMNM             MMMMM .dMMMM
MMMMNm `?MMM             MMMM` dMMMMM
MMMMMMN  ?MM             MM?  NMMMMMN
MMMMMMMMNe                 JMMMMMNMMM
MMMMMMMMMMNm,            eMMMMMNMMNMM
MMMMNNMNMMMMMNx        MMMMMMNMMNMMNM
MMMMMMMMNMMNMMMMm+..+MMNMMNMNMMNMMNMM
        https://metasploit.com


       =[ metasploit v5.0.77-dev-                         ]
+ -- --=[ 1973 exploits - 1087 auxiliary - 339 post       ]
+ -- --=[ 559 payloads - 45 encoders - 10 nops            ]
+ -- --=[ 7 evasion                                       ]

msf5 > 

As shown below, use the db_status command to verify database connectivity.

$ db_status
[*] Connected to remote_data_service: (https://localhost:5443). Connection type: http. Connection name: local-https-data-service.

Update Metasploit framework

To update your Metasploit framework on Debian 10 / Debian 9, run the following command:

$ msfupdate
Switching to root user to update the package
Checking for and installing update..
Adding metasploit-framework to your repository list..Metasploit                                                   [===                                  Metasploit                                                                                                              3.0 kB/s | 3.0 kB     00:01    
Package metasploit-framework-5.0.77+20200224112600~1rapid7-1.el6.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Enjoy using the Metasploit framework for penetration testing operations. For more related content, please check:

How to install Metasploit framework on Debian

Launch Metasploit framework on Kali Linux

Install and use Linux malware detection on CentOS / Fedora / Ubuntu / Debian

How to install Nessus Scanner on Ubuntu / Debian

[*]

/ * Custom CSS * /
.tdi_4_2e1.td-a-rec-img {
Text alignment: left;
} .tdi_4_2e1.td-a-rec-img img {
The security deposit: 0 automatically 0 0;
}}}

Sidebar