There is a new version of this tutorial available for Ubuntu 22.04 (Jammy Jellyfish).

How to Install Metasploit Framework on Ubuntu 20.04

Metasploit is an open-source framework used to identify threats and vulnerabilities, offensive security testing, and research. It is designed for security researchers to find and exploit vulnerabilities in various systems, networks, and software. By default, Metasploit comes with a lot of exploits, it also allows you to create your own exploits and add to them.

In this post, we will show you how to install the Metasploit Framework on Ubuntu 20.04.

Prerequisites

  • A system running Ubuntu 20.04 Desktop.
  • A root password is configured on the server.

Download Metasploit Installer

By default, Metasploit is not included in the Ubuntu default repository. Rapid7 provides an open-source installer for installing Metasploit on Linux, Windows, and OS X systems. It will install Metasploit framework with msfconsole and other tools in your system.

First, download the Metasploit installer with the following command:

wget http://downloads.metasploit.com/data/releases/metasploit-latest-linux-x64-installer.run

Once the download is completed, set the execution permission with the following command:

chmod +x ./metasploit-latest-linux-x64-installer.run

Install Metasploit

Now, open your command-line interface and run the downloaded installer file using the following command:

./metasploit-latest-linux-x64-installer.run

You should see the Metasploit welcome page:

Metasploit

Click on the Forward button. You should see the License agreement page:

License

Accept the license agreement and click on the Forward button. You will be asked to select an installation folder:

Installation folder

Click on the Forward button. You will be asked to select Install as a service.

Install as a service

Select your desired option and click on the Forward button. You will be asked to disable the firewall:

Disable Firewall

Disable the firewall installed on your system and click on the Forward button. You will be asked to provide an SSL port as shown below:

Port

Provide the SSL port and click on the Forward button. You will be asked to provide your hostname as shown below:

Generate SSL cert

Provide your system hostname or localhost and click on the Forward button. You should see the following page:

Start the installation

Click on the Forward button to start the installation as shown below.

Installing Metasploit

Access Metasploit Web Interface

At this point, Metasploit is installed and listen on port 3790. You can access it using the URL https://localhost:3790. You should see the following screen:

Metasploit web UI

Provide your login information, other settings, and click on the Create Account button. You should see the following page:

Activate license

You can now get the product key, activate the License, and start working on the Metasploit framework.

Access Metasploit Console

Metasploit provides a command-line utility called mfconsole to manage the Metasploit. You can access it using the following command:

msfconsole

You should see the Metasploit console on the following screen:

Metasploit Console

Now, run the following command to show all available commands in msfconsole:

help

To display all available exploits, run the following command:

show exploits

To display all available payloads, run the following command:

show payloads

To show more information of any exploit, run the following command:

info exploit exploit-name

To show more information of any payload, run the following command:

info payload payload-name

To set the specific payload for your exploit, run the following command:

set PAYLOAD windows

To display all available target operating systems that can be exploited, run the following command:

show targets

To set your target's IP address, run the following command:

set RHOST target-ip-address

To set the local IP address for the reverse communications, run the following command:

set LHOST ip-address

Conclusion

In the above guide, you learned how to install Metasploit on Ubuntu 20.04. You also learned some basic commands to use the Metasploit framework. You can now use this tool to secure your local network.

Share this page:

0 Comment(s)