{"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<p>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<h2 class=\"wp-block-heading\" id=\"installing-metasploit-on-ubuntu-18-04-lts\">Install Metasploit on Ubuntu 18.04 LTS<\/h2>\n\n\n\n<p>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 <a href=\"https:\/\/github.com\/rapid7\/metasploit-framework\/wiki\/Nightly-Installers\" target=\"_blank\" rel=\"noopener\">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<p>Update and upgrade your system.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<pre id=\"block-5dd7b307-a371-471f-8219-5e4c78f7dce0\" class=\"wp-block-preformatted\">sudo apt upgrade<\/pre>\n\n\n\n<p>Hold on, before you can proceed with the installation of Metasploit, you can check these <a href=\"https:\/\/cybri.com\/penetration-testing-services\/\" target=\"_blank\" rel=\"noopener\">more information<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"download-metasploit-combined-installer\">Download Metasploit Combined Installer<\/h3>\n\n\n\n<p>The combined installers are available on <a href=\"https:\/\/github.com\/rapid7\/metasploit-framework\/wiki\/Downloads-by-Version\" target=\"_blank\" rel=\"noopener\">Metasploit framework wiki page<\/a>. Navigate to the page and grab the latest version of Linux installer.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/downloads.metasploit.com\/data\/releases\/metasploit-latest-linux-x64-installer.run<\/code><\/pre>\n\n\n\n<p>Once the download completes, make the installer executable by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chmod +x metasploit-latest-linux-x64-installer.run<\/code><\/pre>\n\n\n\n<p>Next, launch the Metasploit installer.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>.\/metasploit-latest-linux-x64-installer.run<\/code><\/pre>\n\n\n\n<p>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<pre class=\"scroll-box\"><code>----------------------------------------------------------------------------\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<p>Next, choose the installation folder. Press Enter to accept the default, <code>\/opt\/metasploit<\/code>.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>----------------------------------------------------------------------------\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<p>Install Metasploit as a service to make it easy to start started on system reboot.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>----------------------------------------------------------------------------\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<p>Next, you are asked to disable the anti-virus and firewall solutions if any is installed on the server.<\/p>\n\n\n\n<p>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<pre class=\"scroll-box\"><code>----------------------------------------------------------------------------\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<p>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<pre class=\"scroll-box\"><code>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<p>Add the SSL certificated to the OS trusted certificate store.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Yes, trust certificate [Y\/n]: y<\/code><\/pre>\n\n\n\n<p>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<pre class=\"scroll-box\"><code>----------------------------------------------------------------------------\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<p>The Metasploit is now ready to carry on its Magics. To access Metasploit UI, navigate to <code>https:\/\/&lt;msf-server-IP&gt;:3790<\/code>, if you are not accessing it from the locally.<\/p>\n\n\n\n<p>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<pre class=\"wp-block-preformatted\"><code>\/opt\/metasploit\/createuser<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;*] Please enter a username: <strong>amos<\/strong>\n\n&#91;*] Creating user 'amos' with password '<strong>{K&gt;y2BYr<\/strong>' ...\n\n&#91;*] User amos has been created, please change your password on login.<\/code><\/pre>\n\n\n\n<p>Note that if UFW is running, you need to open access to port 3790.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ufw allow 3790\/tcp\nufw reload<\/code><\/pre>\n\n\n\n<p>Add the SSL error on the browser to exception and proceed to Metasploit UI.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1271\" height=\"788\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/metasploit-login.png\" alt=\"\" class=\"wp-image-9710\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/metasploit-login.png?v=1626584388 1271w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/metasploit-login-768x476.png?v=1626584388 768w\" sizes=\"(max-width: 1271px) 100vw, 1271px\" \/><\/figure>\n\n\n\n<p>Enter the activation key. You can obtain the key by <a href=\"https:\/\/www.rapid7.com\/products\/metasploit\/download\/pro\" target=\"_blank\" rel=\"noopener\">submitting a request<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1368\" height=\"735\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/activate-metasploit.png\" alt=\"Installing Metasploit on Ubuntu 18.04 LTS\" class=\"wp-image-9711\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/activate-metasploit.png?v=1626584474 1368w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/activate-metasploit-768x413.png?v=1626584474 768w\" sizes=\"(max-width: 1368px) 100vw, 1368px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1366\" height=\"789\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/metasploit-dashboard.png\" alt=\"\" class=\"wp-image-9712\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/metasploit-dashboard.png?v=1626584506 1366w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/07\/metasploit-dashboard-768x444.png?v=1626584506 768w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/figure>\n\n\n\n<p>Your Metasploit is now ready.<\/p>\n\n\n\n<p>The Metasploit Framework is also available on command line. To launch it, just execute the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>msfconsole<\/code><\/pre>\n\n\n\n<p>Great. You can now run you Pentests projects.<\/p>\n\n\n\n<p>Happy pentesting&#8230;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"other-tutorials\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-nikto-web-scanner-on-rocky-linux-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Nikto Web Scanner on Rocky Linux 8<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-setup-nessus-scanner-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Setup Nessus Scanner on Ubuntu 20.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-wpscan-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install WPScan on Ubuntu 20.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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}]}}