工具说明书 - nmap

nmap

常用操作

  1. 进行主机发现(不进行ping,只是发现地址段有哪些主机)
root@kali:~# nmap -sn <ip地址段>
  1. 进行端口扫描,扫描出开放的端口(以T4的模板的速率发送数据包,速率看情况设置大小,扫描出主机有哪些端口开放)
root@kali:~# nmap -T4 -p- <主机地址>
  1. 对开放的端口进行详细的扫描(进行ping连接端口,扫描端口服务版本,脚本扫描端口,扫描系统信息,并指定端口,最后将扫描结果以三种格式导出到文件filename里)(这里扫描端口服务版本,脚本扫描端口,扫描系统信息也可以直接用-A,这里是为了理解)
root@kali:~# nmap -sT -sV -sC -O -p<port/s> <主机地址> -oA <filename>
  1. 对开放端口进行udp扫描(进行UDP扫描,然后将结果以三种格式导出到文件filename里)
root@kali:~# nmap -sU  -p<port/s> <主机地址> -oA <filename>
  1. 对开放的端口进行常用漏洞扫描,然后将结果以三种格式导出到文件filename里
root@kali:~# nmap --script=vuln -p <port/s> <主机地址> -oA <filename>

译文

nmap

Nmap 是一款用于网络探索或安全审计的工具。它支持 ping 扫描(确定哪些主机正常运行)、多种端口扫描技术、版本检测(确定端口后监听的服务协议和应用程序版本)以及 TCP/IP 指纹识别(远程主机操作系统或设备识别)。Nmap 还提供灵活的目标和端口规范、诱饵/隐形扫描、sunRPC 扫描等功能。大多数 Unix 和 Windows 平台都支持图形用户界面和命令行模式。还支持几种流行的手持设备,包括 Sharp Zaurus 和 iPAQ。

root@kali:~# nmap -h
Nmap 7.94SVN ( https://nmap.org )
使用方法: nmap [Scan Type(s)] [Options] {target specification}

目标说明:
  可以是主机名, IP地址, 网络地址, 等等.
  例如: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254
  -iL <inputfilename>: 						输入主机/网络列表
  -iR <num hosts>: 							选择随机目标
  --exclude <host1[,host2][,host3],...>: 	排除主机/网络地址
  --excludefile <exclude_file>: 			从文件中排除列表
  
主机发现:
  -sL: 									列表扫描 - 简要列出扫描目标
  -sn: 									Ping 扫描 - 禁用端口扫描
  -Pn: 									将所有主机视为在线主机 -- 跳过主机发现
  -PS/PA/PU/PY[portlist]: 				TCP SYN/ACK, UDP 或 SCTP 发现指定端口
  -PE/PP/PM: I							搜索探针:
  										CMP echo, 
  										timestamp, 
  										netmask request 
  -PO[protocol list]: 					IP 协议 Ping
  -n/-R: 								从不进行 DNS 解析/总是进行解析 
  										[default: sometimes](默认:有时)
  --dns-servers <serv1[,serv2],...>: 	指定自定义域名服务器
  --system-dns: 						使用操作系统的 DNS 解析器
  --traceroute: 						路由追踪
  
扫描技术:
  -sS/sT/sA/sW/sM: 					TCP SYN/Connect()/ACK/Window/Maimon 扫描
  -sU: 								UDP 扫描
  -sN/sF/sX: 						TCP Null, FIN, 和 Xmas 扫描
  --scanflags <flags>: 				自定义 TCP 扫描 标记
  -sI <zombie host[:probeport]>: 	空闲扫描
  -sY/sZ: 							SCTP INIT/COOKIE-ECHO 扫描
  -sO: 								IP 协议扫描
  -b <FTP relay host>: 				FTP 反弹扫描
  
端口规范和扫描顺序:
  -p <port ranges>: 				只扫描指定端口
    								例如:-p22; 
    									-p1-65535; 
    									-p 	U:53,111,137,
    										T:21-25,80,139,8080,
    										S:9
  --exclude-ports <port ranges>: 	排除扫描端口
  -F: 								快速模式 - 扫描的端口数少于默认扫描的端口
  -r: 								顺序扫描端口y - 不随机
  --top-ports <number>: 			扫描 <number> 最常用的端口
  --port-ratio <ratio>: 			扫描比 <ratio> 更常用的端口
  
服务/版本检测:
  -sV: 								探测开放端口以确定服务/版本信息
  --version-intensity <level>: 		设置范围从 0(少)到 9(尝试所有探针)
  --version-light: 					仅限于最有可能的探针 (强度 2)
  --version-all: 					尝试每个探针 (强度 9)
  --version-trace: 					显示详细的版本扫描活动(用于调试)
  
脚本扫描:
  -sC: 									相当于 --script=default
  --script=<Lua scripts>: 				<Lua scripts> 是以逗号分隔的 目录、脚本文件或脚本类别
  --script-args=<n1=v1,[n2=v2,...]>: 	为脚本添加参数
  --script-args-file=filename:			 提供文件中 NSE 脚本参数
  --script-trace: 						显示所有发送和接收的数据
  --script-updatedb: 					更新脚本数据库.
  --script-help=<Lua scripts>: 			显示有关脚本的帮助.
           
操作系统检测:
  -O: 				启用操作系统检测
  --osscan-limit: 	将 系统 检测限制在有希望的目标
  --osscan-guess: 	更主动地猜测操作系统
  
时间和性能:
  使用 <time> 的选项以秒为单位, 或在值后附加 'ms'(毫秒),'s' (秒), 'm' (分), 或 'h' (小时) 的值 (例如 30m).
  -T<0-5>: 														设置计时模板 (越高越快)
  --min-hostgroup/max-hostgroup <size>: 						并行主机扫描组的大小
  --min-parallelism/max-parallelism <numprobes>:	 			探针并行化
  --min-rtt-timeout/max-rtt-timeout/initial-rtt-timeout <time>: 指定探针往返时间.
  --max-retries <tries>: 										端口扫描探针重传次数上限.
  --host-timeout <time>: 										超过这个时间后放弃目标
  --scan-delay/--max-scan-delay <time>: 						调整探针之间的延迟
  --min-rate <number>: 		发送数据包的速度不低于每秒 <number> 的速度
  --max-rate <number>: 		发送数据包的速度不高于每秒 <number> 的速度
  
防火墙/IDS 规避和欺骗:
  -f; --mtu <val>: 									分片数据包(可选,带给定的 MTU)
  -D <decoy1,decoy2[,ME],...>: 						用诱饵隐蔽扫描
  -S <IP_Address>: 									伪造源地址
  -e <iface>: 										使用指定接口
  -g/--source-port <portnum>: 						使用给定的端口号
  --proxies <url1,[url2],...>: 						通过 HTTP/SOCKS4 代理转发连接
  --data <hex string>: 								在发送的数据包中附加自定义有效载荷
  --data-string <string>: 							在发送的数据包中附加自定义 ASCII 字符串
  --data-length <num>: 								在发送的数据包中添加随机数据
  --ip-options <options>: 							在发送的数据包中指定的 IP 选项
  --ttl <val>:  									设置 IP 生存时间字段
  --spoof-mac <mac address/prefix/vendor name>: 	伪造你的 MAC 地址
  --badsum: 										发送带有假 TCP/UDP/SCTP 校验和的数据包
  
输出:
  -oN/-oX/-oS/-oG <file>: 以普通、XML、s|<rIpt kIddi3、 和 Grepable 格式分别输出到给定的文件名中.
  -oA <basename>: 			同时输出三种主要格式
  -v: 						提高详细程度(使用 -vv 或更高,效果更佳)
  -d: 						提高调试级别(使用 -dd 或更高级别效果更佳)
  --reason: 				显示端口处于特殊状态的原因
  --open: 					只显示已打开(或可能已打开)的端口
  --packet-trace: 			显示所有发送和接收的数据包
  --iflist: 				打印主机接口和路由(用于调试)
  --append-output: 			附加到指定的输出文件,而不是掐头去尾
  --resume <filename>: 		恢复中断的扫描
  --noninteractive: 		禁用键盘交互
  --stylesheet <path/URL>: 	XSL 样式表将 XML 输出转换为 HTML
  --webxml: 				参考 Nmap.Org 提供的样式表,获取更多可移植的 XML
  --no-stylesheet: 			防止将 XSL 样式表与 XML 输出关联起来
  
杂项:
  -6: 						启用 IPv6 扫描
  -A: 						启用操作系统检测, 版本检测, 脚本扫描, 和跟踪路由
  							相当于:-O -sV -sC --traceroute
  --datadir <dirname>: 		指定自定义 Nmap 数据文件位置
  --send-eth/--send-ip: 	使用原始以太网帧或 IP 数据包进行发送
  --privileged: 			假设用户拥有完全权限
  --unprivileged: 			假设用户没有原始套接字权限
  -V: 						打印版本号
  -h: 						打印本帮助摘要页面.
  
示例:
  nmap -v -A scanme.nmap.org
  nmap -v -sn 192.168.0.0/16 10.0.0.0/8
  nmap -v -iR 10000 -Pn -p 80
  
参见手册 (https://nmap.org/book/man.html) 了解更多选项和示例

原文

nmap

Nmap is a utility for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques, version detection (determine service protocols and application versions listening behind ports), and TCP/IP fingerprinting (remote host OS or device identification). Nmap also offers flexible target and port specification, decoy/stealth scanning, sunRPC scanning, and more. Most Unix and Windows platforms are supported in both GUI and commandline modes. Several popular handheld devices are also supported, including the Sharp Zaurus and the iPAQ.

nmap

Network exploration tool and security / port scanner

root@kali:~# nmap -h
Nmap 7.94SVN ( https://nmap.org )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
  Can pass hostnames, IP addresses, networks, etc.
  Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254
  -iL <inputfilename>: Input from list of hosts/networks
  -iR <num hosts>: Choose random targets
  --exclude <host1[,host2][,host3],...>: Exclude hosts/networks
  --excludefile <exclude_file>: Exclude list from file
HOST DISCOVERY:
  -sL: List Scan - simply list targets to scan
  -sn: Ping Scan - disable port scan
  -Pn: Treat all hosts as online -- skip host discovery
  -PS/PA/PU/PY[portlist]: TCP SYN/ACK, UDP or SCTP discovery to given ports
  -PE/PP/PM: ICMP echo, timestamp, and netmask request discovery probes
  -PO[protocol list]: IP Protocol Ping
  -n/-R: Never do DNS resolution/Always resolve [default: sometimes]
  --dns-servers <serv1[,serv2],...>: Specify custom DNS servers
  --system-dns: Use OS's DNS resolver
  --traceroute: Trace hop path to each host
SCAN TECHNIQUES:
  -sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans
  -sU: UDP Scan
  -sN/sF/sX: TCP Null, FIN, and Xmas scans
  --scanflags <flags>: Customize TCP scan flags
  -sI <zombie host[:probeport]>: Idle scan
  -sY/sZ: SCTP INIT/COOKIE-ECHO scans
  -sO: IP protocol scan
  -b <FTP relay host>: FTP bounce scan
PORT SPECIFICATION AND SCAN ORDER:
  -p <port ranges>: Only scan specified ports
    Ex: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9
  --exclude-ports <port ranges>: Exclude the specified ports from scanning
  -F: Fast mode - Scan fewer ports than the default scan
  -r: Scan ports sequentially - don't randomize
  --top-ports <number>: Scan <number> most common ports
  --port-ratio <ratio>: Scan ports more common than <ratio>
SERVICE/VERSION DETECTION:
  -sV: Probe open ports to determine service/version info
  --version-intensity <level>: Set from 0 (light) to 9 (try all probes)
  --version-light: Limit to most likely probes (intensity 2)
  --version-all: Try every single probe (intensity 9)
  --version-trace: Show detailed version scan activity (for debugging)
SCRIPT SCAN:
  -sC: equivalent to --script=default
  --script=<Lua scripts>: <Lua scripts> is a comma separated list of
           directories, script-files or script-categories
  --script-args=<n1=v1,[n2=v2,...]>: provide arguments to scripts
  --script-args-file=filename: provide NSE script args in a file
  --script-trace: Show all data sent and received
  --script-updatedb: Update the script database.
  --script-help=<Lua scripts>: Show help about scripts.
           <Lua scripts> is a comma-separated list of script-files or
           script-categories.
OS DETECTION:
  -O: Enable OS detection
  --osscan-limit: Limit OS detection to promising targets
  --osscan-guess: Guess OS more aggressively
TIMING AND PERFORMANCE:
  Options which take <time> are in seconds, or append 'ms' (milliseconds),
  's' (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m).
  -T<0-5>: Set timing template (higher is faster)
  --min-hostgroup/max-hostgroup <size>: Parallel host scan group sizes
  --min-parallelism/max-parallelism <numprobes>: Probe parallelization
  --min-rtt-timeout/max-rtt-timeout/initial-rtt-timeout <time>: Specifies
      probe round trip time.
  --max-retries <tries>: Caps number of port scan probe retransmissions.
  --host-timeout <time>: Give up on target after this long
  --scan-delay/--max-scan-delay <time>: Adjust delay between probes
  --min-rate <number>: Send packets no slower than <number> per second
  --max-rate <number>: Send packets no faster than <number> per second
FIREWALL/IDS EVASION AND SPOOFING:
  -f; --mtu <val>: fragment packets (optionally w/given MTU)
  -D <decoy1,decoy2[,ME],...>: Cloak a scan with decoys
  -S <IP_Address>: Spoof source address
  -e <iface>: Use specified interface
  -g/--source-port <portnum>: Use given port number
  --proxies <url1,[url2],...>: Relay connections through HTTP/SOCKS4 proxies
  --data <hex string>: Append a custom payload to sent packets
  --data-string <string>: Append a custom ASCII string to sent packets
  --data-length <num>: Append random data to sent packets
  --ip-options <options>: Send packets with specified ip options
  --ttl <val>: Set IP time-to-live field
  --spoof-mac <mac address/prefix/vendor name>: Spoof your MAC address
  --badsum: Send packets with a bogus TCP/UDP/SCTP checksum
OUTPUT:
  -oN/-oX/-oS/-oG <file>: Output scan in normal, XML, s|<rIpt kIddi3,
     and Grepable format, respectively, to the given filename.
  -oA <basename>: Output in the three major formats at once
  -v: Increase verbosity level (use -vv or more for greater effect)
  -d: Increase debugging level (use -dd or more for greater effect)
  --reason: Display the reason a port is in a particular state
  --open: Only show open (or possibly open) ports
  --packet-trace: Show all packets sent and received
  --iflist: Print host interfaces and routes (for debugging)
  --append-output: Append to rather than clobber specified output files
  --resume <filename>: Resume an aborted scan
  --noninteractive: Disable runtime interactions via keyboard
  --stylesheet <path/URL>: XSL stylesheet to transform XML output to HTML
  --webxml: Reference stylesheet from Nmap.Org for more portable XML
  --no-stylesheet: Prevent associating of XSL stylesheet w/XML output
MISC:
  -6: Enable IPv6 scanning
  -A: Enable OS detection, version detection, script scanning, and traceroute
  --datadir <dirname>: Specify custom Nmap data file location
  --send-eth/--send-ip: Send using raw ethernet frames or IP packets
  --privileged: Assume that the user is fully privileged
  --unprivileged: Assume the user lacks raw socket privileges
  -V: Print version number
  -h: Print this help summary page.
EXAMPLES:
  nmap -v -A scanme.nmap.org
  nmap -v -sn 192.168.0.0/16 10.0.0.0/8
  nmap -v -iR 10000 -Pn -p 80
SEE THE MAN PAGE (https://nmap.org/book/man.html) FOR MORE OPTIONS AND EXAMPLES

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值