Skip to content
-
Learn Cybersecurity & Ethical Hacking in Nepal with CyberSamir โ€” Start Learning โ†’
Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
Close

Search

Subscribe
  • Facebook
  • Telegram
  • Instagram
  • Youtube
  • Linkedin
  • Whasapp
Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
Close

Search

Subscribe
  • Facebook
  • Telegram
  • Instagram
  • Youtube
  • Linkedin
  • Whasapp
Ethical HackingPenetration testing

Explore Nmap Commands

By cybersamir
January 19, 2025 7 Min Read
Comments Off on Explore Nmap Commands

Nmap (Network Mapper) is a powerful open-source tool widely used for network discovery and security auditing. It allows users to scan networks, identify active devices, and assess the security posture of systems. Mastering Nmap commands is essential for penetration testing and effective network management. This guide provides a structured overview of essential and advanced Nmap commands, helping you harness the full potential of this versatile tool.

Introduction

Nmap is renowned for its ability to perform detailed scans of networks, making it an invaluable asset for network administrators, security professionals, and ethical hackers. Understanding how to use Nmap effectively can significantly enhance your capabilities in identifying vulnerabilities and managing network resources. This post aims to provide a comprehensive overview of Nmap commands, from basic usage to advanced techniques.

Section 1: Getting Started with Nmap

What is Nmap?

Nmap is a command-line tool designed for network exploration and security auditing. It can discover hosts and services on a computer network by sending packets and analyzing the responses. Common use cases include:

  • Network Inventory: Identifying active devices on a network.
  • Vulnerability Assessment: Checking for open ports and misconfigurations.
  • Security Auditing: Evaluating the security posture of systems.

Installation

Installing Nmap is straightforward across different operating systems:

  • Windows: Download the installer from the Nmap website and follow the installation prompts.
  • macOS: Use Homebrew to install Nmap by running:
  brew install nmap
  • Linux: Install via package managers. For Debian/Ubuntu:
  sudo apt-get install nmap

For CentOS/RedHat:

  sudo yum install nmap

Basic Syntax

The basic syntax for using Nmap is:

nmap [Scan Type] [Options] [Target]

Section 2: Basic Nmap Commands

1. Scan a Single Target

To scan a single IP address:

nmap 192.168.1.1

2. Scan Multiple Targets

To scan multiple IP addresses:

nmap 192.168.1.1 192.168.1.2 192.168.1.3

3. Scan a Range of IP Addresses

To scan a range of IP addresses:

nmap 192.168.1.1-100

4. Scan an Entire Subnet

To scan an entire subnet:

nmap 192.168.1.0/24

5. Check Nmap Version

To check the installed version of Nmap:

nmap --version

Section 3: Commonly Used Scan Types

1. TCP Connect Scan (-sT)

This scan establishes a full TCP connection with the target:

nmap -sT 192.168.1.1

2. SYN Scan (Default, -sS)

This stealthy scan only sends SYN packets to determine open ports:

nmap -sS 192.168.1.1

3. UDP Scan (-sU)

To discover open UDP ports on the target:

nmap -sU 192.168.1.1

4. OS Detection (-O)

To detect the operating system running on the target:

nmap -O 192.168.1.1

5. Service Version Detection (-sV)

To identify versions of services running on open ports:

nmap -sV 192.168.1.1

Section 4: Advanced Nmap Commands

1. Aggressive Scan (-A)

This comprehensive scan includes OS detection, version detection, script scanning, and traceroute:

nmap -A 192.168.1.1

2. Scan Specific Ports (-p)

To specify which ports to scan:

nmap -p 80,443 192.168.1.1

3. Exclude Hosts (–exclude)

To exclude specific hosts from the scan:

nmap 192.168.1.0/24 --exclude 192.168.1.5

4. Script Scanning (–script)

To run specific scripts against the target:

nmap --script=vuln 192.168.1.1

5. Save Results to a File (-oN, -oX)

To save output in normal format:

nmap -oN output.txt 192.168.1.1

For XML format:

nmap -oX output.xml 192.168.1.1

Section 5: Nmap Scripting Engine (NSE)

What is NSE?

The Nmap Scripting Engine (NSE) allows users to write scripts that automate various networking tasks, enhancing Nmap’s capabilities.

Popular NSE Scripts:

  • Vulnerability Scans:
    “`bash
    nmap –script vuln 192.168.1.1
- **HTTP Enumeration**:

bash
nmap –script http-enum 192.168.1.1

## Section 6: Optimizing Scans

### Increase Speed 
You can speed up your scans using timing options:

bash
nmap -T4 192.168.1.1

(Timing options range from T0 (paranoid) to T5 (insane).)

### Reduce Bandwidth Usage 
To minimize bandwidth consumption during scans:

bash
nmap –scan-delay 100ms 192.168.1.1
“`

Section 7: Real-World Use Cases of Nmap

  • Network Inventory: Detecting active devices and services helps maintain an up-to-date inventory.
  • Vulnerability Assessments: Regular scans can identify open ports and misconfigurations that may pose security risks.
  • Firewall Evasion: Techniques like --spoof-mac or decoy options can help bypass firewall restrictions during testing.

Nmap is a powerful open-source tool widely used for network discovery and security auditing, particularly in identifying vulnerabilities in systems. With its extensive capabilities, Nmap can help security professionals proactively assess their networks for weaknesses that could be exploited by attackers. This guide will explain how to use Nmap to scan for specific vulnerabilities effectively.

Advertisement

How to Use Nmap to Scan for Specific Vulnerabilities

Overview of Nmap Vulnerability Scanning

Nmap employs a collection of NSE (Nmap Scripting Engine) scripts designed to check for known vulnerabilities in common network services such as HTTP, FTP, and SSH. By sending specific probesโ€”packets crafted to mimic potential attack scenariosโ€”Nmap analyzes the responses from target systems to identify potential weaknesses.

Step-by-Step Guide to Scanning for Vulnerabilities

  1. Install Nmap: Ensure you have Nmap installed on your system. You can download it from the official Nmap website or install it via package managers on Linux, macOS, or Windows.
  2. Basic Command Structure:
    The basic syntax for running an Nmap vulnerability scan is:
   nmap --script <script_name> <target>

This command tells Nmap to execute a specific NSE script against the target system.

  1. Using the --script vuln Option:
    To perform a broad vulnerability scan using all available vulnerability detection scripts, use:
   nmap --script vuln <target>

This command will run over 50 NSE scripts focused on identifying various vulnerabilities in the target system.

Examples of Specific Vulnerability Scans

Here are some targeted commands you can use with Nmap to check for specific vulnerabilities:

1. Cross-Site Request Forgery (CSRF) Check

To uncover CSRF vulnerabilities:

nmap -sV --script http-csrf <target>

2. Shellshock Vulnerability Exploitation

To check if the Shellshock vulnerability is present:

nmap -sV --script http-sherlock <target>

3. Slowloris DoS Attack Vulnerability Assessment

To assess a web server’s susceptibility to Slowloris DoS attacks:

nmap -sV --script http-slowloris-check <target>

4. VMware Path Traversal Vulnerability Probe

To check for VMware path traversal vulnerabilities:

nmap -sV --script http-vmware-path-traversal <target>

Analyzing Results

After executing your vulnerability scans, Nmap will provide detailed output indicating open ports, detected services, and any vulnerabilities found. Pay close attention to the severity and potential impact of each identified vulnerability. Prioritize remediation efforts based on this analysis.

Optimizing Your Scans

  • Increase Speed: Use timing options to speed up your scans without overwhelming the target:
  nmap -T4 --script vuln <target>
  • Reduce Bandwidth Usage: If you’re concerned about bandwidth consumption, you can include a delay between packets:
  nmap --scan-delay 100ms --script vuln <target>

How do I use Nmap to scan for CSRF vulnerabilities?

To scan for Cross-Site Request Forgery (CSRF) vulnerabilities using Nmap, you can utilize the built-in NSE (Nmap Scripting Engine) script specifically designed for this purpose. Here’s a step-by-step guide on how to effectively use Nmap to identify CSRF vulnerabilities in web applications.

Step-by-Step Guide to Scanning for CSRF Vulnerabilities with Nmap

1. Understanding CSRF Vulnerabilities

Cross-Site Request Forgery (CSRF) is an attack that tricks a user into executing unwanted actions on a web application in which they are authenticated. This can lead to unauthorized transactions or data manipulation without the user’s consent. Detecting CSRF vulnerabilities is crucial for ensuring the security of web applications.

2. Prerequisites

  • Nmap Installed: Ensure you have Nmap installed on your system. You can download it from the official Nmap website.
  • Target Application: Have a target web application ready for testing, and ensure you have permission to perform security assessments.

3. Using the CSRF Script

Nmap includes an NSE script called http-csrf that detects CSRF vulnerabilities by checking forms on the target website for unpredictable tokens. Hereโ€™s how to use it:

Command Syntax

To scan a target for CSRF vulnerabilities, use the following command:

nmap -p <port> --script http-csrf <target>
  • Replace <port> with the port number where the web service is running (commonly port 80 for HTTP or port 443 for HTTPS).
  • Replace <target> with the IP address or domain name of the target application.

Example Command

For example, if you want to scan a web application running on port 80 at example.com, you would run:

nmap -p 80 --script http-csrf example.com

4. Interpreting Results

After executing the command, Nmap will provide output indicating whether any CSRF vulnerabilities were found. The output will typically include:

  • The state of the port (open/closed).
  • Any forms that were checked and whether they contained predictable tokens.
  • Specific paths and form actions associated with potential vulnerabilities.

Example Output

PORT   STATE SERVICE
80/tcp open  http
| http-csrf:
|   Found CSRF vulnerabilities:
|   Path: http://example.com/login
|   Form id: login_form
|   Form action: /submit_login
|_  More details available in the report.

5. Best Practices

  • Permission: Always ensure you have explicit permission to test any web application to avoid legal repercussions.
  • Controlled Environment: Conduct scans in a controlled environment or during authorized testing periods to minimize impact on production systems.
  • Combine Scans: Consider combining the CSRF scan with other vulnerability checks using additional NSE scripts for a comprehensive assessment.

Using Nmap’s http-csrf script provides an effective way to identify potential CSRF vulnerabilities in web applications. By following this guide, you can leverage Nmap’s powerful capabilities to enhance your security assessments and help protect against unauthorized actions that could compromise user accounts and data integrity.

Conclusion

Nmap is an incredibly versatile tool that plays a crucial role in network scanning and security assessments in todayโ€™s cybersecurity landscape . Mastering its commands can significantly enhance your ability to manage networks effectively and identify vulnerabilities before they can be exploited.

We encourage you to practice these commands in a controlled lab environment to gain hands-on experience . As you become more familiar with Nmap, consider exploring advanced scripts and configurations for deeper insights into network security.

By investing time in mastering Nmap commands, you will equip yourself with essential skills that are increasingly valuable in the field of cybersecurity.


Author

cybersamir

Follow Me
Other Articles
Previous

How to Use Nmap for Penetration Testing in 2025

Next

TikTok Faces US Shutdown; Trump Considers 90-Day Reprieve

Your ad here

300 x 250 banner slot

Reach Nepali students, developers, and security learners reading about ethical hacking, CTFs, and cyber news.

Book on WhatsApp Or send an email

Sponsors: VPNs, courses, hosting, security tools

Recent Posts

  • How to Recover Money from Online Scam Nepal: 2026 Guide
  • How to Check If Your Data Was Leaked (Nepal 2026 Guide)
  • Is PHP Dead? A 2026 Reckoning
  • Nepal Cyber Shield CTF: Top 10 Teams Qualified for the Grand Finale
  • How to Report Cybercrime in Nepal: Step-by-Step Guide (2026)

Nepal Cyber Shield 2026

Been scammed or hacked?

Act fast: save screenshots, don't delete chats, and report it.

  • 100 Nepal Police emergency line
  • +9779851286770 Nepal Police Cyber Bureau
Report here (Nepal Police) Read the step-by-step reporting guide

Money lost? Call your bank first so they can try to freeze the transfer.

Categories

  • Awareness
  • Blog
  • Career & Learning
  • Cybersecurity
  • Ethical Hacking
  • Nepal Tech & Digital Safety
  • News
  • Penetration testing
  • Tools & Reviews

Latest security alerts

  • Foundational Doesn't Mean Easy: The Security Questions Business Leaders Should Ask About AI
  • New TZRat Android Malware Silently Hijacks Phones and Streams Victims' Screens
  • Microsoft Details AI-Assisted ISP Attack That Compromised Three Peer Servers in 13 Minutes
  • WhatsApp to Force iPhone Users to Update iOS as Website-Based Malware Attacks Spread
  • Google and Anthropic AI Found an 18-Year-Old UEFI Flaw That Can Bypass Secure Boot
  • PHP Vulnerability And Global Cybersecurity - The Rising Nepal
  • Nepal's digital vulnerability goes beyond PHP - myRepublica
  • SEBON introduces IT policy to strengthen cybersecurity in Nepalโ€™s capital market - OnlineKhabar English News
  • SEBON steps up effort to prevent cyber attacks in stock exchange platform - myRepublica
  • From heartbleed to PHP2Shell: Is Nepal ready for the next cyber crisis? - The Annapurna Express

You May Have Missed

how to recover money from online scam Nepal
Awareness

How to Recover Money from Online Scam Nepal: 2026 Guide

cybersamir
By cybersamir
November 28, 2026
data leak check nepal
Awareness

How to Check If Your Data Was Leaked (Nepal 2026 Guide)

cybersamir
By cybersamir
November 26, 2026
Cinematic PHP programming thumbnail with the headline โ€œIs PHP Dead? 2026 Reckoning,โ€ a glowing blue PHP elephant, and CyberSamir branding.
Awareness

Is PHP Dead? A 2026 Reckoning

cybersamir
By cybersamir
October 25, 2026
ctf top 10 selected teams
News

Nepal Cyber Shield CTF: Top 10 Teams Qualified for the Grand Finale

cybersamir
By cybersamir
October 4, 2026
How to report cybercrime in Nepal Cyber Bureau complaint guide
Awareness

How to Report Cybercrime in Nepal: Step-by-Step Guide (2026)

cybersamir
By cybersamir
September 27, 2026
Nepal Data Breach: 462,600 Citizens' IDs Allegedly Leaked," subtext "Dark web forum post claims mass PII theft from a .gov.np portal
News

Nepal Government Portal Allegedly Breached: 462,600 Citizens’ Data Reportedly Listed for Sale on Dark Web

cybersamir
By cybersamir
September 24, 2026
Cybersecurity

Top 10 Security Mistakes Nepali Websites Still Make in 2026

cybersamir
By cybersamir
September 23, 2026
News Cybersecurity

Nepal Data Hub Ransomware Attack: NEPSE Shutdown Explained

cybersamir
By cybersamir
September 23, 2026
News

Nepal Cyber Shield 2026: Everything You Need to Know About Nepal’s National CTF Championship

cybersamir
By cybersamir
September 19, 2026
CS

CYBERSAMIR

Explore. Hack. Secure. Learn.

About Us

CyberSamir provides cutting-edge insights into ethical hacking, penetration testing, and cybersecurity defense strategies for professionals and enthusiasts alike.

500+ Articles
15K+ Members
30+ Tools

Resources

  • Tutorials
  • Our Services
  • Tools
  • CTF Walkthroughs
  • Security News

Community

  • WhatsApp Group
  • Discord Server
  • Telegram Group
  • Upcoming Events
  • Certifications

Follow Us

Cyber Security Events Worldwide

ยฉ CyberSamir. All Rights Reserved.

Copyright 2026 — Cyber Samir. All rights reserved. Blogsy WordPress Theme