Nmap
Nmap
Basic to Advance
Support me and follow my LinkedIn profile for more insights and updates!
Thanks for your support.
Raj Bhatia
https://www.linkedin.com/in/raj-bhatia-1790901a8/
Introduction
Nmap (Network Mapper) is an open-source and versatile network
scanning tool widely used in cybersecurity and IT fields. Developed by
Gordon Lyon (Fyodor), it helps security professionals, network
administrators, and penetration testers to map out networks, discover
active hosts, and identify open ports and services. With its extensive
scripting engine and wide range of scan options, Nmap is an essential
tool for network auditing and security analysis.
Nmap is a powerful tool with a variety of features designed for network discovery,
analysis, and security assessment. Here are its key features:
1. Network Discovery
Identifies active hosts within a network.
Maps the network topology, uncovering relationships between devices.
2. Port Scanning
Scans for open, closed, or filtered ports on target systems.
Supports scanning individual ports, specific port ranges, or all 65,535 ports.
7. Output Customization
Generates reports in multiple formats:
Normal (-oN), XML (-oX), and grepable (-oG) formats.
Supports saving outputs for later analysis or integration with other tools.
9. IPv6 Support
Fully supports IPv6 scanning to accommodate modern network
configurations.
11. Traceroute
Maps the path packets take to reach the target.
Identifies intermediate devices and networks in the route.
Basic Scans: Commands for scanning single targets, multiple targets, ranges,
or subnets.
Port Scans: Includes specific port scans, all-port scans, and common-port
scans.
Service and OS Detection: Commands for identifying service versions and
operating systems.
Advanced Scans: Techniques like TCP connect, SYN, and UDP scans, as well as
aggressive scanning.
Output Options: Saving results in various formats (normal, XML, grepable, all
formats).
Script Usage: Leveraging Nmap scripts for vulnerability detection, HTTP
enumeration, and more.
Vulnerability Scanning: Scripts targeting specific CVEs and weaknesses like
SQL injection, XSS, and SSL/TLS issues.
Miscellaneous Options: Includes traceroute, adjusting scan speeds, and
customized packet settings.
Installation Steps
1. Windows
1. Download the installer:
Visit the official Nmap download page.
Select the Windows installer (e.g., nmap-setup.exe).
2. Run the installer:
Double-click the downloaded file to start the installation wizard.
Follow the prompts to choose installation options.
3. Verify Installation:
Open the command prompt and type:
cmd
nmap --version
2. Linux
1. Using Package Manager:
For Debian/Ubuntu:
sudo apt update
sudo apt install nmap
For RHEL/CentOS/Fedora
sudo yum install nmap
Or for Fedora:
sudo dnf install nmap
3. macOS
Using Homebrew:
Install Homebrew if not already installed:
/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
"
Install Nmap
brew install nmap
Nmap commands
Command Description
nmap <target> Basic scan of a target.
nmap -sn <target> Perform a ping scan to determine if hosts are alive.
nmap -D <decoys> <target> Use decoys to hide the source of the scan.
nmap --spoof-mac <MAC address> Spoof the MAC address of the scanning machine.
nmap -sN <target> Perform a Null scan (packets with no flags set).
nmap -PE <target> Use ICMP echo requests for host discovery.
Support me and follow my LinkedIn profile for more insights and updates!
Thanks for your support.
Raj Bhatia
https://www.linkedin.com/in/raj-bhatia-1790901a8/