In this article, we will discuss how to Install Metasploit Framework on Debian 12/11/10 Linux system. Metasploit Framework is the world’s most popular open source penetration testing framework for security professionals and researchers. It provides the infrastructure, content, and tools to perform extensive security auditing and penetration testing.
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
The minimum hardware requirements for running Metasploit Framework on Debian are:
- CPU – 2 GHz+ processor
- RAM – 4 GB RAM available (8 GB recommended)
- Disk Space – 1 GB available disk space (50 GB recommended)
Install Metasploit Framework on Debian
Installing Metasploit framework on Debian has been made easy by provision of Metasploit installer script. You just need to download the installer and run it.
Install curl tools:
sudo apt update && sudo apt install curl wget gnupg2
Download Metasploit installer using wget or curl command.
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 +x msfinstall
Then execute the installer to install Metasploit Framework.
./msfinstall
The installer script will add Metasploit Framework repository to your repository list and install all tools required. If you have slower internet, the download may take a while.
....
Setting up metasploit-framework (6.4.4+20240415102543~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...
When installation is completed, create and initialize the msf database.
$ msfdb init
Running the 'init' command for the database:
Creating database at /home/jkmutai/.msf4/db
Creating db socket file at /tmp
Starting database at /home/jkmutai/.msf4/db...server starting
success
Creating database users
Writing client authentication configuration file /home/jkmutai/.msf4/db/pg_hba.conf
Stopping database at /home/jkmutai/.msf4/db
Starting database at /home/jkmutai/.msf4/db...server starting
success
Creating initial database schema
Database initialization successful
This will create an initial database schema, set service account and start services. Output similar to below should be printed.
Check your Framework version using:
$ msfconsole --version
** Welcome to Metasploit Framework Initial Setup **
Please answer a few questions to get started.
** Metasploit Framework Initial Setup Complete **
Framework Version: 6.4.4-dev-
Launching msfconsole
Now that database is initialized, you can launch msfconsole
$ msfconsole
Metasploit tip: Tired of setting RHOSTS for modules? Try globally setting it
with setg RHOSTS x.x.x.x
. .
.
dBBBBBBb dBBBP dBBBBBBP dBBBBBb . o
' dB' BBP
dB'dB'dB' dBBP dBP dBP BB
dB'dB'dB' dBP dBP dBP BB
dB'dB'dB' dBBBBP dBP dBBBBBBB
dBBBBBP dBBBBBb dBP dBBBBP dBP dBBBBBBP
. . dB' dBP dB'.BP
| dBP dBBBB' dBP dB'.BP dBP dBP
--o-- dBP dBP dBP dB'.BP dBP dBP
| dBBBBP dBP dBBBBP dBBBBP dBP dBP
.
.
o To boldly go where no
shell has gone before
=[ metasploit v6.4.4-dev- ]
+ -- --=[ 2410 exploits - 1242 auxiliary - 423 post ]
+ -- --=[ 1465 payloads - 47 encoders - 11 nops ]
+ -- --=[ 9 evasion ]
Metasploit Documentation: https://docs.metasploit.com/
msf6 >
Verify database connectivity with the db_status command as shown below.
msf6 > db_status
[*] Connected to msf. Connection type: postgresql.
Updating Metasploit Framework
To update your Metasploit Framework on Debian system. run the command:
$ msfupdate
Switching to root user to update the package
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.4.4+20240415102543~1rapid7-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
To ameliorate your understanding of Metasploit Framework, visit Wiki page.
Thank you very much.
this helped thank you
Welcome
Fails with Hash Sum mismatch. Seems to be a problem in den Metasploit repo (30.03.2023)
Tested today on Debian 11 and it works. You’re on which os version?
perfect tutorial, just switch with “root” and other “user” for the update and install (connection)
ty homboy.