{"id":2140,"date":"2019-01-31T19:24:14","date_gmt":"2019-01-31T16:24:14","guid":{"rendered":"http:\/\/kifarunix.com\/?p=2140"},"modified":"2024-03-11T22:00:10","modified_gmt":"2024-03-11T19:00:10","slug":"installing-metasploit-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/installing-metasploit-on-ubuntu-18-04-lts\/","title":{"rendered":"Installing Metasploit on Ubuntu 18.04 LTS"},"content":{"rendered":"\n

This guide is about how installing Metasploit on Ubuntu 18.04 LTS. Metasploit Framework provides a platform and tools for performing deep system security auditing as well as penetration testing to unearth, exploit and validate every other would-be vulnerability. Metasploit is available in both the commercial and opensource version (thanks to Rapid 7 for teaming up with OSS community). We are going to install the later in this guide.<\/p>\n\n\n\n

Install Metasploit on Ubuntu 18.04 LTS<\/h2>\n\n\n\n

Since Metasploit is available in both the commercial and open source version, it is upon you to choose which version to go with. This guide presents installation of the Metasploit using the Metasploit community \/ Pro Combined Installers. These installers include the Metasploit community, Pro UI as well as Metasploit Framework. However, if you do not want to take this route, you can use the Nightly build version<\/a>. This NIghtly versions ship with all the dependencies required for a successful installation and all you need to do the installation is just a simple script.<\/p>\n\n\n\n

Update and upgrade your system.<\/p>\n\n\n\n

sudo apt update<\/code><\/pre>\n\n\n\n
sudo apt upgrade<\/pre>\n\n\n\n

Hold on, before you can proceed with the installation of Metasploit, you can check these more information<\/a>.<\/p>\n\n\n\n

Download Metasploit Combined Installer<\/h3>\n\n\n\n

The combined installers are available on Metasploit framework wiki page<\/a>. Navigate to the page and grab the latest version of Linux installer.<\/p>\n\n\n\n

wget https:\/\/downloads.metasploit.com\/data\/releases\/metasploit-latest-linux-x64-installer.run<\/code><\/pre>\n\n\n\n

Once the download completes, make the installer executable by running the command below;<\/p>\n\n\n\n

chmod +x metasploit-latest-linux-x64-installer.run<\/code><\/pre>\n\n\n\n

Next, launch the Metasploit installer.<\/p>\n\n\n\n

.\/metasploit-latest-linux-x64-installer.run<\/code><\/pre>\n\n\n\n

When the installer runs, press Enter and scroll through the License. For the installation to proceed, you need to accept the License.<\/p>\n\n\n\n

----------------------------------------------------------------------------\nWelcome to the Metasploit Setup Wizard.\n\n----------------------------------------------------------------------------\nPlease read the following License Agreement. You must accept the terms of this \nagreement before continuing with the installation.\n\nPress [Enter] to continue: Enter\nRAPID7 END USER LICENSE AGREEMENT\n...\nLast Modified April 2018\n\nPress [Enter] to continue:\n\nDo you accept this license? [y\/n]: y   Accept the License\n<\/code><\/pre>\n\n\n\n

Next, choose the installation folder. Press Enter to accept the default, \/opt\/metasploit<\/code>.<\/p>\n\n\n\n

----------------------------------------------------------------------------\nInstallation folder\n\nPlease, choose a folder to install Metasploit\n\nSelect a folder [\/opt\/metasploit]: \n\n----------------------------------------------------------------------------\n<\/code><\/pre>\n\n\n\n

Install Metasploit as a service to make it easy to start started on system reboot.<\/p>\n\n\n\n

----------------------------------------------------------------------------\nInstall as a service\n\nYou can optionally register Metasploit as a service. This way it will \nautomatically be started every time the machine is started.\n\nInstall Metasploit as a service? [Y\/n]: y\n...\n<\/code><\/pre>\n\n\n\n

Next, you are asked to disable the anti-virus and firewall solutions if any is installed on the server.<\/p>\n\n\n\n

Since Metasploit will be running as a service, define a port in which it is listening on. Press Enter to accept TCP port 3790 as the default port.<\/p>\n\n\n\n

----------------------------------------------------------------------------\nMetasploit Service\n\nPlease enter the port that the Metasploit service will use.\n\nSSL Port [3790]: Enter\n<\/code><\/pre>\n\n\n\n

Set the server FQDN of your server for the purpose of SSL certificate that is generated. Set the validity of the SSL of the certificate. You can press Enter to accept the default period.<\/p>\n\n\n\n

Generate an SSL Certificate\n\nPlease provide the fully qualified domain name of this system below (e.g. \nmetasploit.example.com). A certificate is generated for a specific server name \nand web browsers will alert users if the name does not match.\n\nServer Name [localhost]: msf.example.com\n\nDays of validity [3650]: Enter\n<\/code><\/pre>\n\n\n\n

Add the SSL certificated to the OS trusted certificate store.<\/p>\n\n\n\n

Yes, trust certificate [Y\/n]: y<\/code><\/pre>\n\n\n\n

After that, proceed with installing Metasploit. Once the installation is done, you will be given a URL to access the Metasploit UI.<\/p>\n\n\n\n

----------------------------------------------------------------------------\nPlease wait while Setup installs Metasploit on your computer.\n\n Installing\n 0% ______________ 50% ______________ 100%\n #########################################\n\n----------------------------------------------------------------------------\nSetup has finished installing Metasploit on your computer.\n\nInfo: To access Metasploit, go to\n        https:\/\/localhost:3790 from your browser.\n<\/code><\/pre>\n\n\n\n

The Metasploit is now ready to carry on its Magics. To access Metasploit UI, navigate to https:\/\/<msf-server-IP>:3790<\/code>, if you are not accessing it from the locally.<\/p>\n\n\n\n

To login to Metasploit UI, you need to create Metasploit initial user account by running the script below. The script will prompt you for the username and auto-generate the password. You are required to reset this password upon login.<\/p>\n\n\n\n

\/opt\/metasploit\/createuser<\/code><\/pre>\n\n\n\n
[*] Please enter a username: amos<\/strong>\n\n[*] Creating user 'amos' with password '{K>y2BYr<\/strong>' ...\n\n[*] User amos has been created, please change your password on login.<\/code><\/pre>\n\n\n\n

Note that if UFW is running, you need to open access to port 3790.<\/p>\n\n\n\n

ufw allow 3790\/tcp\nufw reload<\/code><\/pre>\n\n\n\n

Add the SSL error on the browser to exception and proceed to Metasploit UI.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Enter the activation key. You can obtain the key by submitting a request<\/a>.<\/p>\n\n\n\n

\"Installing<\/figure>\n\n\n\n
\"\"<\/figure>\n\n\n\n

Your Metasploit is now ready.<\/p>\n\n\n\n

The Metasploit Framework is also available on command line. To launch it, just execute the command below;<\/p>\n\n\n\n

msfconsole<\/code><\/pre>\n\n\n\n

Great. You can now run you Pentests projects.<\/p>\n\n\n\n

Happy pentesting…<\/p>\n\n\n\n

Other Tutorials<\/h3>\n\n\n\n

Install Nikto Web Scanner on Rocky Linux 8<\/a><\/p>\n\n\n\n

Install and Setup Nessus Scanner on Ubuntu 20.04<\/a><\/p>\n\n\n\n

Install WPScan on Ubuntu 20.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

This guide is about how installing Metasploit on Ubuntu 18.04 LTS. Metasploit Framework provides a platform and tools for performing deep system security auditing as<\/p>\n","protected":false},"author":1,"featured_media":9713,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[34,312,150],"tags":[3856,3857,313,67],"class_list":["post-2140","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-metasploit","category-vulnerability-scanners","tag-install-metasploit-linux","tag-install-metasploit-ubuntu-18-04","tag-metasploit","tag-ubuntu-18-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2140"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=2140"}],"version-history":[{"count":9,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2140\/revisions"}],"predecessor-version":[{"id":21087,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2140\/revisions\/21087"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/9713"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=2140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=2140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=2140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}