DEV Community

Sai prudhvi raja
Sai prudhvi raja

Posted on

Nmap Networking scanning in Ethical Hacking

About Nmap:
Nmap is an open-source networking scanning tool which is essential for ethical hackers to trace network packages, and perform network exploration and vulnerability assessment, we(Ethical Hackers)use it to map out networks, identify active devices, open ports, and the services or applications running on those devices, Nmap offers different scanning techniques, such as ping sweeps, port scanning, version detection, and OS fingerprinting. This helps us to access the network without launching actual attacks to reduce the risks and impacts on the target Machines
Nmap Scanning techniques:

  • ping Sweep: Detect which hosts are active on a network. It sends ICMP echo requests and measures the responses.

  • port Scanning:
    Port scanning reveals which ports are open or closed on a host. Common types of port scanning include:

  1. TCP Connect Scan: Completes the full TCP handshake.

  2. SYN Scan (Stealth Scan): Initiates the TCP handshake but does not complete it, making it less likely to be detected.

  3. UDP Scan: Scans for open UDP ports, do not require a handshake like TCP.

  • Service version Detection:
    Nmap can interrogate open ports and identify the specific software and version running on a service

  • OS Detection:
    OS fingerprinting in Nmap uses various signals from the network response to determine the operating system of a target.

Scanning a Single Host:
To scan a specified single host

nmap[target IP]
Enter fullscreen mode Exit fullscreen mode

Scanning Multiple IP Addresses:
You can scan multiple IP addresses in a single command:

nmap[target IP][target IP][target IP]
Enter fullscreen mode Exit fullscreen mode

Scanning a Range of IPs:
To scan an entire range of IP addresses, use:

nmap [target range]
Enter fullscreen mode Exit fullscreen mode

For example, to scan 192.168.1.1 through 192.168.1.255:

nmap 192.168.1.1-255
Enter fullscreen mode Exit fullscreen mode

Ping Sweep:
To check which hosts are online within a network:

nmap -sn [target IP range]
Enter fullscreen mode Exit fullscreen mode

command pings the target range and reports which IPs are active.

Scanning Specific Ports:
To scan specific ports on a target, use:

nmap -p [port numbers] [target IP]
Enter fullscreen mode Exit fullscreen mode

For example, to scan ports 80 and 443 on a specific host:

nmap -p 80,443 [target IP]
Enter fullscreen mode Exit fullscreen mode

Version Detection:
To detect the version of services running on a target’s open ports:

nmap -sV [target IP]
Enter fullscreen mode Exit fullscreen mode

OS Detection:
To detect the operating system of a host:

nmap -O [target IP]
Enter fullscreen mode Exit fullscreen mode

Ethical Hacking Best Practices:
When using Nmap, ethical hackers must always operate within legal boundaries. Always obtain permission from the system owners before performing scans. Unauthorized scanning of networks can result in legal consequences, as it may be considered a violation of cybersecurity laws.

Conclusion:
Nmap is an essential tool in the ethical hacker’s toolkit. It provides a wealth of information that can be used to assess a network’s security posture and identify potential vulnerabilities. By mastering basic Nmap commands and understanding its scanning techniques, ethical hackers can help secure networks and protect sensitive data from malicious threats.

Top comments (0)