Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Instance Analysis of nmap Command

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you to the nmap command example analysis, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Nmap is a free, open source web discovery and reconnaissance tool. Nmap can scan active hosts, open ports, operating system versions and services in the network, and perform information scanning in hidden ways.

Install in Ubuntu/Debian:

How to install

$sudo apt-y install nmap

Install in Centos/RHEL:

# yum-y install nmap

Install in Arch Linux:

# pacman-S nmap

Example 1: scan a single host

The nmap command plus ip address / domain name can be used to scan a single host without passing any parameters. The syntax is as follows:

[root@localhost ~] # nmap 192.168.0.12

The following is the specified domain name to scan:

[root@localhost ~] # nmap scanme.nmap.org

Example 2: scan multiple hosts

You can specify multiple IP addresses or domain names on one line, separated by spaces:

[root@localhost] # nmap 192.168.43.137 192.168.43.166 192.168.43.177

Instead of entering the full IP address, you can separate the end with a comma, as follows:

[root@localhost] # nmap 192.168.43.137166177

In addition, you can scan a specified range of ip addresses. For example, the following command changes the host from 192.168.43.100 to 192.168.43.200:

[root@localhost] # nmap 192.168.43.100-200

Example 3, scan a subnet

You can use wildcards to scan the entire subnet, as follows:

[root@localhost ~] # nmap 192.168.43.* or [root@localhost ~] # nmap 192.168.43.0

If you need to optimize the scanning speed and only find the active hosts in the subnet, instead of scanning the port information, use the-sn option, as follows:

[root@localhost] # nmap-sn 192.168.43.*

Example 4, scan the details using the-v option

Use the-v option to print out the details of the scan, such as the nature of the scan and the open port found.

[root@localhost] # nmap-v 192.168.43.180

Example 5, scan the hosts contained in the file

You can put the ip address or domain name in a text file, and then pass the file as a parameter using the-iL option:

[root@localhost ~] # nmap-iL list.txt

The following is the ip address information in the file:

Example 6: enable OS scanning

Nmap can also scan the operating system version of the target host. Use the-O option for OS detection. The following operation will scan what the two hosts are, 192.168.43.166 and 180.

[root@localhost] # nmap-O 192.168.43.166180

Example 7, port scan

One of the basic tasks of the nmap tool is to scan ports on the host. Use the-p option followed by the port number to specify the port to scan, as follows:

[root@localhost] # nmap-p 80 192.168.43.166

You can use commas to separate multiple ports to scan multiple ports, as follows:

[root@localhost] # nmap-p 2510 80110 192.168.0.12

You can also scan a specified range of ports and ip addresses in the following ways:

[root@localhost] # nmap-p 80-443 192.168.43.*

Example 8, specify the scan TCP or UDP port

To scan the TCP port, use the-sT option:

[root@localhost] # nmap-sT 192.168.43.180

To scan the DUP port, use the-sU option:

[root@localhost] # nmap-sU 192.168.43.180

Example 9, scan the software version information of the open port

[root@localhost] # nmap-sV 192.168.43.166

Example 10: perform concealment scanning

Nmap scans usually leave footprints, and footprints can be marked by a powerful intrusion detection system that can eventually be traced back to you. To remain anonymous, you can use the-sS option to perform a stealth scan:

[root@localhost] # nmap-sS 192.168.43.180

Example 11: scan the protocol for the host to open to the outside world

Use the-sO option to see what protocols are open to the target system.

[root@localhost] # nmap-sO 114.114.114.114

Example 12, perform active scanning

When using the-An option, nmap gives very detailed scan results, including the open port and the version of the service running, detecting the operating system, and even performing a trace route for the target host.

[root@localhost] # nmap-A-T4 192.168.43.180

Example 13, use nmap to view interface and routing information

[root@localhost] # nmap-- iflist

On the nmap command example analysis is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 222

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report