FedoraRHEL Based

How To Install Metasploit on Fedora 39

Install Metasploit on Fedora 39

In this tutorial, we will show you how to install Metasploit on Fedora 39. Metasploit is a powerful tool used by network security professionals, system administrators, and ethical hackers for penetration testing and identifying potential vulnerabilities in a system.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Metasploit framework on Fedora 39.

Prerequisites

Before diving into the installation process, let’s ensure that you have everything you need:

  • A server running one of the following operating systems: Fedora 39.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • You will need access to the terminal to execute commands. Fedora 39 provides the Terminal application for this purpose. It can be found in your Applications menu.
  • A network connection or internet access to download the Metasploit packages.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Metasploit on Fedora 39

Step 1. Before we begin the installation process, ensure that your Fedora system is up-to-date. This can be done by running the following command in the terminal:

sudo dnf clean all
sudo dnf update

Step 2. Installing Metasploit on Fedora 39.

To install Metasploit on Fedora 39, we’ll leverage the Rapid7 repository, which provides the latest builds of Metasploit. The Metasploit installer comes bundled with all the necessary dependencies to run the Metasploit Framework, including msfconsole and associated tools like Nmap.

Open the terminal and enter the following commands to add the Rapid7 repository and install the Metasploit Framework package:

# Add the Rapid7 repository
sudo dnf config-manager --add-repo http://rpm.metasploit.com/

# Install the Metasploit Framework package
sudo dnf install metasploit-framework

Step 3. Configuring the Database.

Metasploit utilizes a PostgreSQL database to store data. Therefore, it’s necessary to set up this database and configure Metasploit to connect to it.

First, install PostgreSQL on Fedora using the following command below:

sudo dnf install postgresql postgresql-server

After installing PostgreSQL, initialize the database with:

sudo postgresql-setup --initdb --unit postgresql

Start the PostgreSQL service with the following command:

sudo systemctl start postgresql

Next, initialize the Metasploit database using the msfdb command:

msfdb init

This command will create and initialize the Metasploit database. It will also generate a configuration file at /usr/share/metasploit-framework/config/database.yml with the database connection details.

Step 4. Starting Metasploit.

To start Metasploit, launch the msfconsole, the most commonly used interface to work with the Metasploit Framework. Enter the following command in the terminal:

msfconsole

When you launch msfconsole for the first time, you will be prompted to create admin user credentials. Follow the prompts to set up your user account.

Step 5. Updating and Managing Metasploit.

To keep your Metasploit installation up-to-date with the latest modules, it’s recommended to regularly update it. You can do this using the following command:

msfupdate

You can also manage Metasploit services using systemctl commands. For example, to start, stop, or restart the Metasploit service, use the following commands respectively:

sudo systemctl start metasploit
sudo systemctl stop metasploit
sudo systemctl restart metasploit

To automate updates, you can schedule tasks with cron. For example, to update Metasploit every day at midnight, you can add the following line to your crontab:

0 0 * * * /usr/bin/msfupdate

Step 6. Getting Started with Metasploit.

Once you have Metasploit installed and configured, you can start using it for penetration testing. Here are some basic Metasploit commands and components you should know:

  • msfconsole: This command launches the Metasploit console, which is the main interface for working with the Metasploit Framework.
  • search: This command allows you to search for modules based on their name, platform, type, author, and other attributes.
  • use: This command is used to select a module for use.
  • show options: This command displays the options available for the currently active module.
  • set: This command is used to set a value for a module’s option.
  • exploit: This command runs the currently active exploit module.

Here’s an example of a basic penetration testing walkthrough using Metasploit:

  1. Launch msfconsole.
  2. Search for an exploit module, for example, search type:exploit platform:windows.
  3. Select an exploit module, for example, use exploit/windows/smb/ms08_067_netapi.
  4. Display the options for the selected module with show options.
  5. Set the required options, for example, set RHOSTS 192.168.1.10.
  6. Run the exploit with exploit.

Congratulations! You have successfully installed Metasploit. Thanks for using this tutorial for installing the Metasploit framework on your Fedora 39 system. For additional or useful information, we recommend you check the official Metasploit website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button