Home

How to Use Metasploit Framework and Pro to Perform a Penetration Test

|
|  Updated:  
2021-12-14 21:06:04
Cybersecurity All-in-One For Dummies
Explore Book
Buy On Amazon
Metasploit is a penetration testing tool maintained by Rapid7. You can download a free trial for Linux or Windows and get it up and running pretty easily for test and use within minutes.

If you want to learn to use this penetration testing tool and run your first pen test with it, simply sign up for an account by accessing the free trial links. You’ll get a copy of Metasploit Pro for download; install it (an easy process), and then request a trial key via the login interface where you set up the tool and you’re on your way to penetration testing.

Before you discover the specifics of using this penetration testing tool, a few words of caution:

  • Be patient. Depending on your network segment and what options you select, the pen test can take some time.
  • Do not scan without permission. Make sure you’re conducting an ethical hack/pen test and that you not only have permission but have created awareness about it with key IT personnel. This way if something goes wrong, you can stop the scan and assess the damage and correct it. Even when you take precautions, scans cause issues at times, especially on a production network.
  • Always monitor a scan. Scanning and walking away from your pen test isn’t recommended because you may identify a critical risk that needs to be assessed (and perhaps corrected) immediately. It should also be monitored by security operations analysts for this reason alone.
  • Keep your tools up to date. The Metasploit Administration menu has a software update option (in the top-right corner of the dashboard).
  • Back up any critical data before you scan. You’ll want to back up data on hosts you think might be corrupted or otherwise negatively impacted by the scan.
Follow these steps to run a scan with Metasploit Pro:
  1. Access Metasploit on your local system by going to the URL set up for you during the installation process:https://localhost:3790/
  2. Log in and click the Quick PenTest link.The Quick PenTest wizard shown below opens.

    Metasploit Pro’s Quick PenTest wizard Metasploit Pro’s Quick PenTest wizard
  3. Choose a target profile, give your project a name, and enter the Target Addresses.You can choose the Everything option, which takes longer to conduct, or specific targets, such as Windows Targets. At this prompt you will want to leave all of the defaults (if you’re a beginner) and add a project name and a target address to scan. This tool has some intelligence to start with a default scan of the local subnet you’re attached to based on your IP address. Here it captured a small private addressing range of 192.168.1.0/24. It allows for the scanning of 254 hosts on the subnet.
  4. Click Start Scan.The image below shows the scan as it runs. One of the tools it starts with is a network mapping service with Nmap. Once the scan completes and the segment is mapped, the tool then probes, tests, and runs a series of vulnerability tests and other services to get a complete picture of the segments risks and what can be exploited.

    Metasploit Pro Running a quick pen test with Metasploit Pro
  5. When the scan is complete, access the findings by viewing the output on the Metasploit console window and buffer or in logs.When you complete your scanning and assessment, you’ll review reports and findings to see what you need to fix, monitor or add to a risk register.

Your penetration testing toolkit leverages some of the same tools found in other aspects of your toolset. For example, having Kali in your toolkit includes Nmap. Having Metasploit in Kali includes Nmap. You can also use Nmap by itself as a standalone tool.

About This Article

This article is from the book: 

About the book author:

Robert Shimonski is an ethical hacker and a professional IT leader who has led numerous efforts to architect, design, strategize and implement enterprise solutions that must remain secure. Rob has been involved in security and technology operations for over 25 years and has written his books from the trenches of experience.