zoukankan      html  css  js  c++  java
  • nmap帮助文档

    什么是nmap?

    Nmap (“Network Mapper(网络映射器)”) 是一款开放源代码的网络探测和安全审核的工具。它的设计目标是快速地扫描大型网络,当然用它扫描单个主机也没有问题。


    建议查找时使用ctrl+f

    其实主要也是方便自己,同时记忆一下

    以下来源于 

    nmap -h

    -h只是最常用的选项,更详细的看官方文档吧,直接man namp也行

    -T4 可以加快扫描速度

    Nmap 6.47 ( http://nmap.org )
    Usage: nmap [Scan Type(s)] [Options] {target specification} //用法: nmap 扫描类型 参数 扫描目标
    TARGET SPECIFICATION //目标可以怎么输入呢
      Can pass hostnames, IP addresses, networks, etc. //可用域名,ip地址或某个网络
      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 //随机选择目标(后面要加个数字代表要扫描多少个目标) 如:nmap -iR 5 //随机扫描5个目标
      --exclude <host1[,host2][,host3],...>: Exclude hosts/networks //排除某些目标 ,排除什么就在后面输入什么
      --excludefile <exclude_file>: Exclude list from file //从文件读取要排除的目标
    HOST DISCOVERY: //主机发现
      -sL: List Scan - simply list targets to scan //列表扫描:仅仅列出主机的ip,不执行扫描
      -sn: Ping Scan - disable port scan //ping扫描,不进行端口扫描
      -Pn: Treat all hosts as online -- skip host discovery //跳过主机发现,直接当它是在线的
      -PS/PA/PU/PY[portlist]: TCP SYN/ACK, UDP or SCTP discovery to given ports //TCP SYN,TCP ACK,UDP ,SCTP 来扫描端口进而确认主机是否在线
      -PE/PP/PM: ICMP echo, timestamp, and netmask request discovery probes //ping回显扫描,时间戳请求扫描,地址掩码请求扫描
      -PO[protocol list]: IP Protocol Ping //那个是0,无ping,跳过Nmap发现阶段
      -n/-R: Never do DNS resolution/Always resolve [default: sometimes] //-n 永远不用域名解析 -R:总是域名解析
      --dns-servers <serv1[,serv2],...>: Specify custom DNS servers //指定DNS服务器
      --system-dns: Use OS's DNS resolver //使用系统设置的DNS服务器
      --traceroute: Trace hop path to each host //数据包跟踪(看看经过了哪些结点)
    SCAN TECHNIQUES: //扫描技术
      -sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans //SYN扫描,连接扫描(开放的话会3次握手),ACK扫描,TCP窗口扫描(开放端口用正数表示窗口大小(甚至对于RST报文) 而关闭端口的窗口大小为0),Maimon 扫描和Null,FIN,以及Xmas扫描完全一样
      -sU: UDP Scan //UDP扫描
      -sN/sF/sX: TCP Null, FIN, and Xmas scans //Null,FIN,以及Xmas扫描(XMAS扫描打开FIN,URG,PUSH 标记)</span>
      --scanflags <flags>: Customize TCP scan flags //定制的TCP扫描(通过指定任意TCP标志位来设计您自己的扫描)
      -sI <zombie host[:probeport]>: Idle scan //空闲扫描?这个可以伪造ip
      -sY/sZ: SCTP INIT/COOKIE-ECHO scans // SCTP INIT扫描(会发送SCTP INIT包)COOKIE-ECHO扫描(会发送SCTP COOKIE-ECHO包)
      -sO: IP protocol scan //IP协议扫描
      -b <FTP relay host>: FTP bounce scan //FTP弹跳扫描
    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 //例子
      -F: Fast mode - Scan fewer ports than the default scan //快速模式:扫描比较少的端口
      -r: Scan ports consecutively - don't randomize //端口是连续地扫描(就是递增的咯),不要随机化
      --top-ports <number>: Scan <number> most common ports //扫描number个最常见的端口
      --port-ratio <ratio>: Scan ports more common than <ratio> //扫描更多常见端口(比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) //设置版本扫描强调(默认是7,数值越高, 服务越有可能被正确识别。 然而,高强度扫描花更多时间,官方文档说太高强调一般没什么大的用处,可能版本探测的效果差不多)
      --version-light: Limit to most likely probes (intensity 2) //轻量级扫描,就是强度2
      --version-all: Try every single probe (intensity 9) //尝试每个探测,保证对每个端口尝试每个探测报文,强度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 //使用某个或某类脚本进行扫描,还可以以逗号分隔的列表(如vuln,malware,dos)
               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 //针对指定的目标进行操作系统检测
    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 //<span style="font-family: Arial, Helvetica, sans-serif;">调整超时值</span>
      --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: //防火墙/IDS躲避和哄骗
      -f; --mtu <val>: fragment packets (optionally w/given MTU) //报文分段,这报文应该是ip,就是减少发送的每个数据包的大小,其思路是将TCP头分段在几个包中,使得包过滤器、 IDS以及其它工具的检测更加困难。
      -D <decoy1,decoy2[,ME],...>: Cloak a scan with decoys //使用诱饵隐蔽扫描(就是后面可以加一些假的ip地址,让目标以为有多个ip在做同样的扫描)
      -S <IP_Address>: Spoof source address //伪造源地址,这个必须和下面的-e一起使用,亲测
      -e <iface>: Use specified interface //指定网络接口(如eth0)
      -g/--source-port <portnum>: Use given port number //源端口欺骗---指定源端口
      --proxies <url1,[url2],...>: Relay connections through HTTP/SOCKS4 proxies //设置HTTP或SOCKS4代理
      --data-length <num>: Append random data to sent packets //发送报文时 附加随机数据(后面加附加的数量)
      --ip-options <options>: Send packets with specified ip options //指定特殊的ip协议的选项
      --ttl <val>: Set IP time-to-live field //设置TTL值
      --spoof-mac <mac address/prefix/vendor name>: Spoof your MAC address //mac地址欺骗
      --badsum: Send packets with a bogus TCP/UDP/SCTP checksum //发送错误校验和的数据包
    OUTPUT: //输出
      -oN/-oX/-oS/-oG <file>: Output scan in normal, XML, s|<rIpt kIddi3, //分别是标准输出,XML输出,-oS这个好像也是保存在文件中,我测试的时候,-oG是grep输出(它是一种简单格式,每行一个主机,可以 通过UNIX工具(如grep、awk、cut、sed、diff)和Perl方便地查找和分解。)
         and Grepable format, respectively, to the given filename. 
      -oA <basename>: Output in the three major formats at once //可将扫描结果以标准格式、XML格式和Grep格式一次性输出。分别存放在 <basename>.nmap,<basename>.xml和 <basename>.gnmap文件中。
      -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) //输出接口和路由
      --log-errors: Log errors/warnings to the normal-format output file //将错误和警告以标准格式输出到文件中
      --append-output: Append to rather than clobber specified output files //在输出文件中添加(相当于在文件中追加内容),这样其实就是将多次扫描结果可以放一个文件中
      --resume <filename>: Resume an aborted scan //恢复一个终止的扫描
      --stylesheet <path/URL>: XSL stylesheet to transform XML output to HTML //通过XSL样式表转换XML,输出HTML
      --webxml: Reference stylesheet from Nmap.Org for more portable XML //从namp网站搞个轻便的XML?
      --no-stylesheet: Prevent associating of XSL stylesheet w/XML output //禁止Nmap的XML输出关联任何XSL样式表
    MISC: //综合的,其他的,各式各样
      -6: Enable IPv6 scanning //打开IPv6扫描
      -A: Enable OS detection, version detection, script scanning, and traceroute //打开系统探测,(服务)版本探测,脚本扫描,还有路由追踪
      --datadir <dirname>: Specify custom Nmap data file location //指定用户Nmap数据文件位置,不知道有什么用,知道的告诉我(这些文件有 nmap-service-probes, nmap-services, nmap-protocols, nmap-rpc, nmap-mac-prefixes和 nmap-os-fingerprints。Nmap首先 在--datadir选项说明的目录中查找这些文件。 未找到的文件,将在BMAPDIR环境变量说明的目录中查找。)
      --send-eth/--send-ip: Send using raw ethernet frames or IP packets //使用原以太网帧发送,后面就是以原IP套接字发送报文
      --privileged: Assume that the user is fully privileged //假定用户具有全部权限
      --unprivileged: Assume the user lacks raw socket privileges //假定用户没有使用原始套接字权限
      -V: Print version number //打印nmap的版本号
      -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



  • 相关阅读:
    Android游戏开发22:Android动画的实现J2me游戏类库用于Android开发
    android sqlite SQLiteDatabase 操作大全 不看后悔!必收藏!看后精通SQLITE (第三部分,完整代码)
    使用OGR创建dxf格式矢量数据
    mysql 数据库引擎 MyISAM InnoDB 大比拼 区别
    android sqlite SQLiteDatabase 操作大全 不看后悔!必收藏!看后精通SQLITE (第二部分)
    mysql 更改数据库引擎
    android sqlite SQLiteDatabase 操作大全 不看后悔!必收藏!看后精通SQLITE (第一部分)
    android 数字键盘使用
    MySQL Innodb数据库性能实践
    eclipse : Error while performing database login with the driver null
  • 原文地址:https://www.cnblogs.com/cnsec/p/13286544.html
Copyright © 2011-2022 走看看