We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Install Metasploit Framework on Ubuntu / Debian

Learn how to – Install Metasploit Framework on Ubuntu / Debian.

In this article, we will discuss how to install Metasploit Framework on Ubuntu / Debian. Metasploit Framework is an open source project that provides the infrastructure, content, and tools to perform extensive security auditing and penetration testing.

The commercial editions of Metasploit are available to users who prefer to use a web interface to pentest. The Metasploit Framework runs the following services.

  • PostgreSQL Database server – used by Metasploit to store data from a project.
  • Ruby on Rails
  • Metasploit service

Metasploit Framework Requirements

Below are the minimum hardware requirements for running Metasploit Framework on Ubuntu / Debian.

  • 2 GHz+ processor
  • 4 GB RAM available (8 GB recommended)
  • 1 GB available disk space (50 GB recommended)
  • 64-bit version of Ubuntu / Debian

Install Metasploit Framework on Ubuntu / Debian

The easiest way of installing Metasploit Framework on Ubuntu / Debian is from the Metasploit installer. This installer ships with all the dependencies and tools required to run the Metasploit Framework.

Download Metasploit installer by running the commands below in your terminal.

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

Once the script is downloaded,make it executable

chmod 755 msfinstall

Then execute:

$ ./msfinstall
Adding metasploit-framework to your repository list..Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Updating package cache..W: http://downloads.metasploit.com/data/releases/metasploit-framework/apt/dists/lucid/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
OK
Checking for and installing update..
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  metasploit-framework
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 300 MB of archives.
After this operation, 724 MB of additional disk space will be used.
Get:1 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid/main amd64 metasploit-framework amd64 6.3.19+20230601103236~1rapid7-1 [300 MB]
Fetched 300 MB in 3s (94.8 MB/s)
Selecting previously unselected package metasploit-framework.
(Reading database ... 39082 files and directories currently installed.)
Preparing to unpack .../metasploit-framework_6.3.19+20230601103236~1rapid7-1_amd64.deb ...
Unpacking metasploit-framework (6.3.19+20230601103236~1rapid7-1) ...
Setting up metasploit-framework (6.3.19+20230601103236~1rapid7-1) ...
update-alternatives: using /opt/metasploit-framework/bin/msfbinscan to provide /usr/bin/msfbinscan (msfbinscan) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfconsole to provide /usr/bin/msfconsole (msfconsole) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfd to provide /usr/bin/msfd (msfd) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfdb to provide /usr/bin/msfdb (msfdb) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfelfscan to provide /usr/bin/msfelfscan (msfelfscan) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfmachscan to provide /usr/bin/msfmachscan (msfmachscan) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfpescan to provide /usr/bin/msfpescan (msfpescan) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfrop to provide /usr/bin/msfrop (msfrop) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfrpc to provide /usr/bin/msfrpc (msfrpc) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfrpcd to provide /usr/bin/msfrpcd (msfrpcd) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfupdate to provide /usr/bin/msfupdate (msfupdate) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfvenom to provide /usr/bin/msfvenom (msfvenom) in auto mode
Run msfconsole to get started
Scanning processes...
Scanning linux images...

Create and initialize the msf database.

$ msfdb init
Clearing http web data service credentials in msfconsole
Running the 'init' command for the database:
Creating database at /home/devops/.msf4/db
Creating db socket file at /tmp
Starting database at /home/devops/.msf4/db...success
Creating database users
Writing client authentication configuration file /home/devops/.msf4/db/pg_hba.conf
Stopping database at /home/devops/.msf4/db
Starting database at /home/devops/.msf4/db...success
Creating initial database schema
Database initialization successful

Launch msfconsole

Now  that database is initialized, you can launch msfconsole

msfconsole

Sample output:

Metasploit Park, System Security Interface
  Version 4.0.5, Alpha E
  Ready...
  > access security
  access: PERMISSION DENIED.
  > access security grid
  access: PERMISSION DENIED.
  > access main security grid
  access: PERMISSION DENIED....and...
  YOU DIDN'T SAY THE MAGIC WORD!
  YOU DIDN'T SAY THE MAGIC WORD!
  YOU DIDN'T SAY THE MAGIC WORD!
  YOU DIDN'T SAY THE MAGIC WORD!
  YOU DIDN'T SAY THE MAGIC WORD!
  YOU DIDN'T SAY THE MAGIC WORD!
  YOU DIDN'T SAY THE MAGIC WORD!


       =[ metasploit v6.3.19-dev-                         ]
+ -- --=[ 2318 exploits - 1213 auxiliary - 412 post       ]
+ -- --=[ 1230 payloads - 46 encoders - 11 nops           ]
+ -- --=[ 9 evasion                                       ]

Metasploit tip: Open an interactive Ruby terminal with
irb
Metasploit Documentation: https://docs.metasploit.com/

Verify database connectivity with the db_status command as shown below.

msf > db_status
 [*] postgresql connected to msf
 msf >

Updating Metasploit Framework

To update your Metasploit Framework on Ubuntu / Debian. run the command:

# msfupdate
 Updating package cache..OK
 Checking for and installing update..
 Reading package lists… Done
 Building dependency tree       
 Reading state information… Done
metasploit-framework is already the newest version (6.3.19+20230601103236~1rapid7-1).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

You can check your Framework version using:

# msfconsole  --version
Framework Version: 6.3.19-dev-

Cheers!. You now have Metasploit Framework installed on Ubuntu / Debian system.

Security books to read:

Cart

Your Cart is Empty

Back To Shop