nmap -sL 和 -sP 输出的区别

nmap -sL 和 -sP 输出的区别

我正在尝试生成当前活动主机的列表。

我通过做这个来得到它-sP 192.168.1.0/24

Starting Nmap 6.40 ( http://nmap.org ) at 2014-09-24 19:40 MDT
RTTVAR has grown to over 2.3 seconds, decreasing to 2.0
RTTVAR has grown to over 2.3 seconds, decreasing to 2.0
RTTVAR has grown to over 2.3 seconds, decreasing to 2.0
Nmap scan report for android-29a3b02532e1b92b.lan (192.168.1.68)
Host is up (5.2s latency).
MAC Address: 3C:43:8E:F9:80:4D (Motorola Mobility)
Nmap scan report for 192.168.1.93
Host is up (5.0s latency).
MAC Address: 70:8D:09:D3:73:2F (Unknown)
Nmap scan report for android-b867c4068b5f964c.lan (192.168.1.94)
Host is up (4.3s latency).
MAC Address: 40:BA:61:A2:60:6C (Arima Communications)
Nmap scan report for 192.168.1.253
Host is up (0.25s latency).
MAC Address: A6:B1:E9:1C:A1:10 (Unknown)
Nmap scan report for dsldevice.lan (192.168.1.254)
Host is up (4.5s latency).
MAC Address: A4:B1:E9:1C:A1:10 (Technicolor)
Nmap scan report for Teratia.lan (192.168.1.76)
Host is up.
Nmap done: 256 IP addresses (6 hosts up) scanned in 46.76 seconds

...并且通过做-sL 192.168.1.0/24

Starting Nmap 6.40 ( http://nmap.org ) at 2014-09-24 19:42 MDT
Nmap scan report for 192.168.1.0
Nmap scan report for 192.168.1.1
Nmap scan report for 192.168.1.2
Nmap scan report for 192.168.1.3
Nmap scan report for 192.168.1.4
Nmap scan report for 192.168.1.5
Nmap scan report for 192.168.1.6
Nmap scan report for 192.168.1.7
Nmap scan report for 192.168.1.8
Nmap scan report for 192.168.1.9
Nmap scan report for 192.168.1.10
Nmap scan report for 192.168.1.11
Nmap scan report for 192.168.1.12
Nmap scan report for 192.168.1.13
Nmap scan report for 192.168.1.14
Nmap scan report for 192.168.1.15
Nmap scan report for 192.168.1.16
Nmap scan report for 192.168.1.17
Nmap scan report for 192.168.1.18
Nmap scan report for 192.168.1.19
Nmap scan report for 192.168.1.20
Nmap scan report for 192.168.1.21
Nmap scan report for 192.168.1.22
Nmap scan report for 192.168.1.23
Nmap scan report for 192.168.1.24
Nmap scan report for 192.168.1.25
Nmap scan report for 192.168.1.26
Nmap scan report for 192.168.1.27
Nmap scan report for 192.168.1.28
Nmap scan report for 192.168.1.29
Nmap scan report for 192.168.1.30
Nmap scan report for 192.168.1.31
Nmap scan report for 192.168.1.32
Nmap scan report for 192.168.1.33
Nmap scan report for 192.168.1.34
Nmap scan report for 192.168.1.35
Nmap scan report for 192.168.1.36
Nmap scan report for 192.168.1.37
Nmap scan report for 192.168.1.38
Nmap scan report for 192.168.1.39
Nmap scan report for 192.168.1.40
Nmap scan report for 192.168.1.41
Nmap scan report for 192.168.1.42
Nmap scan report for 192.168.1.43
Nmap scan report for 192.168.1.44
Nmap scan report for 192.168.1.45
Nmap scan report for 192.168.1.46
Nmap scan report for 192.168.1.47
Nmap scan report for 192.168.1.48
Nmap scan report for 192.168.1.49
Nmap scan report for 192.168.1.50
Nmap scan report for 192.168.1.51
Nmap scan report for 192.168.1.52
Nmap scan report for 192.168.1.53
Nmap scan report for 192.168.1.54
Nmap scan report for 192.168.1.55
Nmap scan report for 192.168.1.56
Nmap scan report for 192.168.1.57
Nmap scan report for 192.168.1.58
Nmap scan report for 192.168.1.59
Nmap scan report for 192.168.1.60
Nmap scan report for 192.168.1.61
Nmap scan report for 192.168.1.62
Nmap scan report for 192.168.1.63
Nmap scan report for 192.168.1.64
Nmap scan report for 192.168.1.65
Nmap scan report for 192.168.1.66
Nmap scan report for 192.168.1.67
Nmap scan report for android-29a3b02532e1b92b.lan (192.168.1.68)
Nmap scan report for 192.168.1.69
Nmap scan report for 192.168.1.70
Nmap scan report for messackgames-PC.lan (192.168.1.71)
Nmap scan report for proframary-PC.lan (192.168.1.72)
Nmap scan report for 192.168.1.73
Nmap scan report for 192.168.1.74
Nmap scan report for 192.168.1.75
Nmap scan report for Teratia.lan (192.168.1.76)
Nmap scan report for 192.168.1.77
Nmap scan report for 192.168.1.78
Nmap scan report for 192.168.1.79
Nmap scan report for 192.168.1.80
Nmap scan report for 192.168.1.81
Nmap scan report for 192.168.1.82
Nmap scan report for 192.168.1.83
Nmap scan report for 192.168.1.84
Nmap scan report for ALBERTO-PC.lan (192.168.1.85)
Nmap scan report for 192.168.1.86
Nmap scan report for 192.168.1.87
Nmap scan report for 192.168.1.88
Nmap scan report for 192.168.1.89
Nmap scan report for 192.168.1.90
Nmap scan report for 192.168.1.91
Nmap scan report for 192.168.1.92
Nmap scan report for 192.168.1.93
Nmap scan report for android-b867c4068b5f964c.lan (192.168.1.94)
Nmap scan report for Pavilion.lan (192.168.1.95)
Nmap scan report for 192.168.1.96
Nmap scan report for 192.168.1.97
Nmap scan report for 192.168.1.98
Nmap scan report for 192.168.1.99
Nmap scan report for 192.168.1.100
Nmap scan report for 192.168.1.101
Nmap scan report for 192.168.1.102
Nmap scan report for 192.168.1.103
Nmap scan report for 192.168.1.104
Nmap scan report for 192.168.1.105
Nmap scan report for 192.168.1.106
Nmap scan report for 192.168.1.107
Nmap scan report for 192.168.1.108
Nmap scan report for 192.168.1.109
Nmap scan report for 192.168.1.110
Nmap scan report for 192.168.1.111
Nmap scan report for 192.168.1.112
Nmap scan report for 192.168.1.113
Nmap scan report for 192.168.1.114
Nmap scan report for 192.168.1.115
Nmap scan report for 192.168.1.116
Nmap scan report for 192.168.1.117
Nmap scan report for 192.168.1.118
Nmap scan report for 192.168.1.119
Nmap scan report for 192.168.1.120
Nmap scan report for 192.168.1.121
Nmap scan report for 192.168.1.122
Nmap scan report for 192.168.1.123
Nmap scan report for 192.168.1.124
Nmap scan report for 192.168.1.125
Nmap scan report for 192.168.1.126
Nmap scan report for 192.168.1.127
Nmap scan report for 192.168.1.128
Nmap scan report for 192.168.1.129
Nmap scan report for 192.168.1.130
Nmap scan report for 192.168.1.131
Nmap scan report for 192.168.1.132
Nmap scan report for 192.168.1.133
Nmap scan report for 192.168.1.134
Nmap scan report for 192.168.1.135
Nmap scan report for 192.168.1.136
Nmap scan report for 192.168.1.137
Nmap scan report for 192.168.1.138
Nmap scan report for 192.168.1.139
Nmap scan report for 192.168.1.140
Nmap scan report for 192.168.1.141
Nmap scan report for 192.168.1.142
Nmap scan report for 192.168.1.143
Nmap scan report for 192.168.1.144
Nmap scan report for 192.168.1.145
Nmap scan report for 192.168.1.146
Nmap scan report for 192.168.1.147
Nmap scan report for 192.168.1.148
Nmap scan report for 192.168.1.149
Nmap scan report for 192.168.1.150
Nmap scan report for 192.168.1.151
Nmap scan report for 192.168.1.152
Nmap scan report for 192.168.1.153
Nmap scan report for 192.168.1.154
Nmap scan report for 192.168.1.155
Nmap scan report for 192.168.1.156
Nmap scan report for 192.168.1.157
Nmap scan report for 192.168.1.158
Nmap scan report for 192.168.1.159
Nmap scan report for 192.168.1.160
Nmap scan report for 192.168.1.161
Nmap scan report for 192.168.1.162
Nmap scan report for 192.168.1.163
Nmap scan report for 192.168.1.164
Nmap scan report for 192.168.1.165
Nmap scan report for 192.168.1.166
Nmap scan report for 192.168.1.167
Nmap scan report for 192.168.1.168
Nmap scan report for 192.168.1.169
Nmap scan report for 192.168.1.170
Nmap scan report for 192.168.1.171
Nmap scan report for 192.168.1.172
Nmap scan report for 192.168.1.173
Nmap scan report for 192.168.1.174
Nmap scan report for 192.168.1.175
Nmap scan report for 192.168.1.176
Nmap scan report for 192.168.1.177
Nmap scan report for 192.168.1.178
Nmap scan report for 192.168.1.179
Nmap scan report for 192.168.1.180
Nmap scan report for 192.168.1.181
Nmap scan report for 192.168.1.182
Nmap scan report for 192.168.1.183
Nmap scan report for 192.168.1.184
Nmap scan report for 192.168.1.185
Nmap scan report for 192.168.1.186
Nmap scan report for 192.168.1.187
Nmap scan report for 192.168.1.188
Nmap scan report for 192.168.1.189
Nmap scan report for 192.168.1.190
Nmap scan report for 192.168.1.191
Nmap scan report for 192.168.1.192
Nmap scan report for 192.168.1.193
Nmap scan report for 192.168.1.194
Nmap scan report for 192.168.1.195
Nmap scan report for 192.168.1.196
Nmap scan report for 192.168.1.197
Nmap scan report for 192.168.1.198
Nmap scan report for 192.168.1.199
Nmap scan report for 192.168.1.200
Nmap scan report for 192.168.1.201
Nmap scan report for 192.168.1.202
Nmap scan report for 192.168.1.203
Nmap scan report for 192.168.1.204
Nmap scan report for 192.168.1.205
Nmap scan report for 192.168.1.206
Nmap scan report for 192.168.1.207
Nmap scan report for 192.168.1.208
Nmap scan report for 192.168.1.209
Nmap scan report for 192.168.1.210
Nmap scan report for 192.168.1.211
Nmap scan report for 192.168.1.212
Nmap scan report for 192.168.1.213
Nmap scan report for 192.168.1.214
Nmap scan report for 192.168.1.215
Nmap scan report for 192.168.1.216
Nmap scan report for 192.168.1.217
Nmap scan report for 192.168.1.218
Nmap scan report for 192.168.1.219
Nmap scan report for 192.168.1.220
Nmap scan report for 192.168.1.221
Nmap scan report for 192.168.1.222
Nmap scan report for 192.168.1.223
Nmap scan report for 192.168.1.224
Nmap scan report for 192.168.1.225
Nmap scan report for 192.168.1.226
Nmap scan report for 192.168.1.227
Nmap scan report for 192.168.1.228
Nmap scan report for 192.168.1.229
Nmap scan report for 192.168.1.230
Nmap scan report for 192.168.1.231
Nmap scan report for 192.168.1.232
Nmap scan report for 192.168.1.233
Nmap scan report for 192.168.1.234
Nmap scan report for 192.168.1.235
Nmap scan report for 192.168.1.236
Nmap scan report for 192.168.1.237
Nmap scan report for 192.168.1.238
Nmap scan report for 192.168.1.239
Nmap scan report for 192.168.1.240
Nmap scan report for 192.168.1.241
Nmap scan report for 192.168.1.242
Nmap scan report for 192.168.1.243
Nmap scan report for 192.168.1.244
Nmap scan report for 192.168.1.245
Nmap scan report for 192.168.1.246
Nmap scan report for 192.168.1.247
Nmap scan report for 192.168.1.248
Nmap scan report for 192.168.1.249
Nmap scan report for 192.168.1.250
Nmap scan report for 192.168.1.251
Nmap scan report for 192.168.1.252
Nmap scan report for 192.168.1.253
Nmap scan report for dsldevice.lan (192.168.1.254)
Nmap scan report for 192.168.1.255
Nmap done: 256 IP addresses (0 hosts up) scanned in 14.04 seconds

如您所见,IP 71 和 85 没有显示在-sP扫描中。

它似乎-sL打印出了在指定范围内曾经分配过的所有 IP 的列表。

有人可以证实/丰富这一点吗?

答案1

Nmap 的-sL选项是“列表扫描”,它只列出请求的 IP 地址,而不向其发送任何探测。这对于反向 DNS 名称查找(默认情况下执行,使用 关闭-n)或为其他工具生成 IP 地址列表很有用。

-sn选项(以前称为-sP)是“跳过端口扫描”选项。它会进行主机发现,因此它会显示哪些主机实际上正在响应网络探测。选项语法已更改,因此所有关闭某些功能的选项都以 结尾n

  • -n- 关闭反向名称解析
  • -Pn- 关闭主机发现 (以前-P0-PN)
  • -sn- 关闭端口扫描

答案2

我认为 -n 在这种情况下会很有用。

无需在已连接的网络上进行 DNS 解析。另外要小心使用 -Pn,因为它会欺骗你。

相关内容