如何从Nmap扫描中排除主机?

Nmap is a very useful tool for network administration and security. It is the most used tool in these areas. But a lot of people use it with very basic means. Here we will look more sophisticated usage of Nmap step by step in this ant further posts.

Nmap是用于网络管理和安全性的非常有用的工具。 它是这些领域中使用最多的工具。 但是许多人使用非常基本的方式使用它。 在此蚂蚁的更多帖子中,我们将逐步介绍Nmap的更复杂用法。

目标主机 (Target Hosts)

Create a text file and add hosts/networks to it and then use this file with Nmap. You can use network blocks like 192.168.122.0/24 or ranges 192.168.122.10-20.

创建一个文本文件并向其添加主机/网络,然后将此文件与Nmap一起使用。 您可以使用诸如192.168.122.0/24或范围192.168.122.10-20之类的网络块。

开始扫描 (Start Scan)

We will start the scan with the -iL option by providing the target host file.

通过提供目标主机文件,我们将使用-iL选项开始扫描。

$ cat ismailbaydan.txt
192.168.122.0/24
192.168.43.0/24
8.8.8.8
192.168.122.10-20

$ sudo nmap -iL ismailbaydan.txt

Starting Nmap 6.45 ( http://nmap.org ) at 2014-08-01 10:19 EEST
Nmap scan report for openstack (192.168.122.146)
Host is up (0.000074s latency).
Not shown: 996 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
25/tcp open  smtp
49/tcp open  tacacs
80/tcp open  http
MAC Address: 52:54:00:0D:B8:D7 (QEMU Virtual NIC)

...

指定排除主机 (Specify Exclude Hosts)

Exclude some hosts with the same syntax used above. You can read them from file or specify by option. -v option is used for verbose output. We will use --exclude command by providing the IP address 192.168.122.254`

使用上面使用的相同语法排除某些主机。 您可以从文件中读取它们,也可以按选项指定。 -v选项用于详细输出。 我们将通过提供IP地址192.168.122.254使用--exclude命令。

$ cat ismailbaydan-exclude.txt
192.168.122.0-128

$ sudo nmap -iL ismailbaydan.txt --excludefile ismailbaydan-exclude.txt -v --exclude 192.168.122.254

Starting Nmap 6.45 ( http://nmap.org ) at 2014-08-01 10:23 EEST
Initiating ARP Ping Scan at 10:23
Scanning 127 hosts [1 port/host]
Completed ARP Ping Scan at 10:23, 1.42s elapsed (127 total hosts)
Nmap scan report for 192.168.122.129 [host down]
Nmap scan report for 192.168.122.130 [host down]
Nmap scan report for 192.168.122.131 [host down]
Nmap scan report for 192.168.122.132 [host down]

We can also use hostname but name resolving must be available.

我们也可以使用主机名,但名称解析必须可用。

$ sudo nmap ismailbaydan.com
LEARN MORE  What Is Radio Frequency Identification or RFID?
了解更多什么是射频识别或RFID?

翻译自: https://www.poftut.com/exclude-hosts-nmap-scan/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值