The Wayback Machine - https://web.archive.org/web/20241008042717/https://www.geeksforgeeks.org/using-metasploit-and-nmap-to-scan-for-vulnerabilities-in-kali-linux/
Open In App

Using Metasploit and Nmap to Scan for Vulnerabilities in Kali Linux

Last Updated : 02 Jan, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The Metasploit framework is a penetration testing tool for exploiting and validating vulnerabilities. It includes the fundamental architecture, particular content, and tools required for penetration testing and extensive security evaluation. It is a well-known exploitation framework that is routinely updated; new exploits are included as soon as they are announced. It can be easily altered and used with most operating systems because it is an open-source framework.

Accessing Msfconsole

The Metasploit Framework can be accessed via the Kali Whisker Menu or by typing the following command directly into the terminal.

msfconsole

 

Nmap

Nmap, or network mapper, is an open-source program for scanning and finding network vulnerabilities. Pentesters and other security experts use Nmap to find devices operating on their networks. It also exposes possible dangers by displaying the services and ports of each host machine.

Nmap is highly adaptable, allowing it to monitor everything from a single host system to a large network with over a hundred devices. Nmap’s core features a port-scanning utility that collects data by sending packets to a host system. Nmap gathers packet responses and determines if a port is closed, open, or filtered.

 

Performing a basic Nmap Scan

Nmap can scan and discover a single IP address, a range of IP addresses, a DNS name, and content from text documents. We will demonstrate how to use Nmap to perform a basic scan using the localhost IP address.

Step 1: To view your localhost IP address, run the following command in the terminal. Your IP address is displayed as inet xx.x.x.xx in eth0, in our case 10.0.2.15, as shown below.

ifconfig

 

Step 2: Take note of this IP address and enter the command below into the terminal. It returns a result after scanning the first 1000 ports on the localhost machine.

sudo nmap 10.0.2.15

 

Step 3: Analyze the results.

Scanning “scanme” with Nmap

Nmap can scan the Nmap “scanme” domain and display all open, closed, and filtered ports. It also displays the encryption algorithms linked to those ports.

Step 1: Open a terminal window and type the following command.

nmap -v -A scanme.nmap.org

 

Step 2: Examine the outcomes. In the above terminal window, look for the PORT, STATE, SERVICE, and VERSION parts. You will notice the open ssh port as well as the operating system details. ssh-hostkey and its encryption technique are shown below.

Steps to use Metasploit and Nmap to Scan for Vulnerabilities 

Step 1: To begin, we launch Metasploit and activate the port scanner module.

use auxiliary/scanner/portscan/tcp

 

Step 2: Then we use show options to configure the settings for this module.

show options

 

Step 3: We configure RHOSTS with the IP/IP(s) of our machine(s), and if we want we can modify the scan for certain ports by setting PORTS.

set RHOSTS 192.168.56.103

set PORTS 22,25,80,110,21

 

Step 4: Following the scan, we will receive an output indicating the open ports on the previously defined target machine.

set THREADS 3

run

 

Step 5: Once we’ve established a clear picture of the available ports, we can begin enumerating them in order to observe and locate the operating services, as well as their versions.

db_nmap -sV -p 25,80,22 192.168.56.103

 

Step 6: Once we’ve identified the open ports and the services that operate on them, we can continue our scan to check for detailed version numbers on each service running on each port, so we may try different auxiliary modules in Metasploit to uncover potential vulnerabilities.

db_nmap -sV -A -p 25,80,22 192.168.56.103

 

Step 7: Analyze all the results.


Previous Article
Next Article

Similar Reads

Detecting and Exploiting the OpenSSL Heartbleed Vulnerability with Nmap and Metasploit
The Heartbleed bug, labeled as CVE-2014-0160, is one of the most notorious security vulnerabilities on current records. It affects the OpenSSL cryptographic library, which has been widely used to encrypt communications on the net. Heartbleed allows attackers to extract sensitive information directly from the memory of affected servers or clients wi
4 min read
How to Scan Vulnerabilities of Websites using Nikto in Linux?
Nikto is an open-source web server scanner which performs comprehensive tests against web servers for multiple items. You can use Nikto with any web servers like Apache, Nginx, IHS, OHS, Litespeed, and so on. Nikto can check for server configuration items such as the presence of multiple index files, HTTP server options, and will attempt to identif
2 min read
Vscan - Vulnerability Scanner Tool Using Nmap And NSE Scripts in Kali Linux
Vscan is a free and open-source tool available on GitHub. Vscan has based nmap scanning techniques, the easiest and useful tool for reconnaissance. Vscan interface is very similar to Metasploit 1 and Metasploit 2. Vscan has its own modules that add additional value to the standard scanner which is nmap. Vscan has NSE scripts that give additional fe
2 min read
How to use a Reverse Shell in Metasploit in Kali Linux
Metasploit is not just a single tool. It is a complete framework. It is a Ruby-based, modular penetration testing platform that enables you to write, test, and execute exploit code, it is flexible and extremely robust and has tons of tools to perform various simple and complex tasks. Metasploit Framework creates payloads in form of apk, exe, etc. f
4 min read
Working with Payload Metasploit in Kali Linux
The Metasploit framework is a penetration testing tool for exploiting and validating vulnerabilities. It includes the fundamental architecture, particular content, and tools required for penetration testing and extensive security evaluation. It is a well-known exploitation framework that is routinely updated; new exploits are included as soon as th
5 min read
Deploying a Payload with Metasploit in Kali Linux
A Metasploit framework is an open-Source tool that is developed and maintained by rapid7. It is a very powerful tool used by almost all penetration testers to scan for vulnerabilities in their system. Metasploit-framework has about 500+ payloads and over 1677 exploits organized for different platforms, including Android, PHP, Python, Java, etc. Met
4 min read
Creating a Persistent Reverse Shell with Metasploit in Kali Linux
A reverse shell is a type of network connection in which a command shell is executed on a remote machine, and the input and output of the shell are transmitted over the network back to the local machine. This allows a user on the local machine to execute commands on the remote machine and receive the output of those commands. Reverse shells are oft
4 min read
Validating a Vulnerability Metasploit in Kali Linux
Metasploit is a popular open-source platform for developing, testing, and executing exploits and payloads. It is widely used by security professionals and researchers to identify and exploit vulnerabilities in systems and networks. Metasploit consists of a large database of exploits and payloads that can be used to attack a wide range of systems an
6 min read
Vulscan - Vulnerability Scanning with Nmap in Kali Linux
Vulscan is a free and open-source tool available on GitHub. Vulscan uses nmap as the main scanner to scan the IP addresses and domains, the easiest and useful tool for reconnaissance of network. Vulscan interface is very similar to Metasploit 1 and Metasploit 2 which makes it easy to use. This tool provides a command-line interface that you can run
2 min read
OS Detection in Nmap in Kali Linux
NMAP stands for Network Mapper which is an open-source tool used for network exploration and security auditing, in comparison to this, a tool named Nessus is used by industry professionals. These tools are mainly used by cybersecurity experts and hackers. Its main purpose is: Provide the list of the live host.Find the open Ports.The real-time infor
3 min read
Footprinting with Nmap in Kali Linux
Footprinting is the technique of gathering information about a targeted network or computer system such as the version of OS the target is using, the kernel version (for Linux-based targets), the version of web hosting software (for server targets), etc. Footprinting could be both active and passive. Active Footprinting involves direct interaction
5 min read
Router Vulnerabilities in Kali Linux
A Linux distribution with Debian roots called Kali Linux is intended for penetration testing and digital forensics. Offensive Security oversees and provides maintenance for it. Around 600 penetration-testing applications (tools) are available in Kali Linux, such as the graphical cyber attack management tool Armitage, the port scanner Nmap, the pack
3 min read
How to start nmap and run a simple scan ?
Nmap is a free and open-source utility which is used to scan networks and security auditing. Nmap can discover hosts and services on a computer network by sending packets and analyzing the responses. The utility is available on almost every os, it is available for windows, linux and mac. Download Nmap - To download Nmap you can simply head towards
3 min read
Golismero - Scan Website, Vulnerability Scanning, WEB Server in Kali Linux
Golismero is a free and open-source tool available on GitHub. Golismero is an Open Source Intelligence and Information Gathering Tool based on (OSINT). Golismero is capable of doing everything almost you need for reconnaissance as per your need it can perform reconnaissance easily. Golismero works as an open-source tool intelligence tool. It integr
2 min read
Kali-Whoami - Stay anonymous on Kali Linux
In today's life, we are surrounded by a lot of cyber security tools and we talk about our online anonymity, but are we really anonymous? A single mistake can reveal our anonymity, so here is a tool that can help us to make anonymity possible and it is called WHOAMI. It is very useful and has a very simple UI. Note: if you are a parrot user then you
3 min read
Linux - Metasploit Command
Metasploit is an open-source penetration testing framework and a suite of security tools used for a myriad of purposes like information gathering, scanning, pen testing, exploiting, encoding, firewall evasion, and even post-exploitation phase. The framework is constituted of different categories and modules which makes Metasploit perfect to use as
5 min read
What is the Metasploit Framework in Linux?
A Metasploit framework is a tool that is used by ethical hackers, security researchers, and pentester to testing of the vulnerability. It helps us to find vulnerabilities in networks, systems, and IoT. It's an open-source tool. It can be customized with the operating system. It's a bunch of exploits for various platforms. This Framework is written
4 min read
How to Use Nmap Script Engine (NSE) Scripts in Linux?
Nmap or Network Mapper is an open-source tool that is used to discover hosts and services on a computer network. It is one of the most powerful and flexible port scanners ever built. To install Nmap on any OS such as Ubuntu or Kali Linux you can use the command. It is highly flexible due to the availability of many NSE scripts available. NSE stands
5 min read
How to Install python-nmap Library on Linux?
Python-Nmap is a network mapper that is exceptionally vital in handling security auditing and discovering the network. It exists as an open-source project; thus it is available for free. All the core operating systems support Python-Nmap. However, the binary packages are only available for Windows, Linux, and Mac OS X. Nmap is essential in port sca
5 min read
Nmap Command in Linux with Examples
Nmap is Linux command-line tool for network exploration and security auditing. This tool is generally used by hackers and cybersecurity enthusiasts and even by network and system administrators. It is used for the following purposes:  Real time information of a networkDetailed information of all the IPs activated on your networkNumber of ports open
6 min read
PHPvuln – Linux Tool to Find Vulnerabilities in PHP Code
PHP security vulnerabilities are a major cause for concern when it comes to web applications written in the PHP language since successful exploitation of such safety defects may lead to several regularly exploited attacks. Many vulnerabilities are usually not difficult to fix, but finding them in large codebases could be challenging without the rig
3 min read
Difference Between Sucuri and Metasploit
In this article, we will see the difference between Metasploit and Solana. The following topics will be discussed here: Information about SucuriInformation about MetasploitDifference between Sucuri and Metasploit Let’s discuss each of these topics in detail. SucuriSucuri is a web-based security company that offers website security for particular si
3 min read
What is Metasploit?
Metasploit is not just a single tool. It is a complete framework. It is a Ruby-based, modular penetration testing platform that enables you to write, test, and execute exploit code, it is flexible and extremely robust and has tons of tools to perform various simple and complex tasks. Metasploit has three editions available. Metasploit ProMetasploit
7 min read
How to Use Metasploit’s Interface
Metasploit itself is a free open-source software, with many contributors in the security community. It supports Vulnerability Research, Exploits development, and also the creation of custom security tools. Metasploit Frameworks are widely used for pen testing and other security purposes. Metasploit offers more than one interface to its underlying f
4 min read
Social Engineering Techniques in Metasploit
The Social-Engineer Toolkit (SET) was developed to coincide with the release of social-engineer.org. The purpose of SET is to fill a gap in the penetration testing community and bring awareness to social-engineering attacks. the toolkit attacks human's weaknesses, exploiting curiosity, and simple human stupidity. Social-Engineering Attacks are at a
9 min read
Find Vulnerable Webcams with Shodan [Metasploit Framework]
Finding vulnerable webcams with Shodan and Metasploit can sound intimidating for beginners, but let me try to explain the key ideas simply. Think of Shodan as a search engine for connected devices and servers instead of websites. We can use it to find webcams and other systems that are publicly accessible over the internet. Sometimes these devices
5 min read
Adding a third party Module into Metasploit Framework
Metasploit Framework is a popular open-source tool for security testing and penetration testing. It comes packed with hundreds of ready-to-use exploits, payloads, encoders, and more to help test systems for weaknesses. However, the true power of Metasploit lies in its modular architecture that allows the community to contribute and expand its capab
4 min read
Brute Force Attack in Metasploit
A Brute Force Attack is one of the most famous and widely known types of cyber attack out there. a brute force attack is a type of attack that uses a trial-and-error method to guess login credentials, and encryption keys, or find a hidden webpage. If someone repeatedly and unsuccessfully tries to log in to an account or network, it appears to be a
7 min read
Difference Between Arch Linux and Kali Linux
Arch Linux is an open-source Linux-based Operating System that is freely available for use. It belongs to the Pacman-based Linux family. It is a light weighted OS for daily use and could even be used by professionals. It was first released in March 2002. It is a beginner-friendly Linux Operating System. Features of Arch Linux: Minimalist approach:
4 min read
Port Scanning Techniques By Using Nmap
Nmap is a security auditing tool used in the security field to actively enumerate a target system/network. It is one of the most extensively used tools by network administrators and conversely attackers for reconnaissance (enumeration), the first step in the 5 phases of hacking. Nmap is used to actively probe the target network for active hosts(hos
5 min read