Installing Metasploit Framework on *nix
Before we can start using Metasploit, we need to install it. Follow these steps:
- Installing Metasploit on *nix can be done by downloading and executing the Metasploit Nightly Installer for Linux and macOS systems or by using the following commands (CLI):
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall
The following screenshot shows the output of the preceding command:
The preceding command will download a shell script that will import the Rapid7 signing key (PGP) and install the packages that are required for all supporting Linux and macOS systems:
- Once the installation process is complete, running Metasploit is pretty simple. In the Terminal, just type the following command:
msfconsole
The following screenshot shows the output of the preceding command:
Note: Metasploit Framework v5.0.0 was released with lots of new features. You can take a look at these features and more at https://blog.rapid7.com/2019/01/10/metasploit-framework-5-0-released/.
We should now see Metasploit Framework up and running. When the MSF console is loaded for the first time, it automatically creates a database using PostgreSQL. This database is used to store any data that's collected if we perform scans, exploits, and more.
- Every week, new exploits and other modules are added to Metasploit, so it's always a good idea to update Metasploit every 2 weeks. This can be done by using the following command:
msfupdate
The following screenshot shows the output of the preceding command:
At the time of writing this book, Metasploit Framework provides 1,991 exploit modules, 1,089 auxiliary modules, 340 post modules, 560 payload modules, 45 encoder modules, 10 nops, and 7 evasion modules.