nmap協助文檔

來源:互聯網
上載者:User

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 : Input from list of hosts/networks //從檔案讀取掃描目標  -iR : Choose random targets //隨機播放目標(後面要加個數字代表要掃描多少個目標) 如:nmap -iR 5 //隨機掃描5個目標  --exclude : Exclude hosts/networks //排除某些目標 ,排除什麼就在後面輸入什麼  --excludefile : 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 : 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 標記)  --scanflags : Customize TCP scan flags //定製的TCP掃描(通過指定任意TCP標誌位來設計您自己的掃描)  -sI : 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 bounce scan //FTP彈跳掃描PORT SPECIFICATION AND SCAN ORDER: //連接埠說明和掃描順序  -p : 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 : Scan  most common ports //掃描number個最常見的連接埠  --port-ratio : Scan ports more common than  //掃描更多常見連接埠(比ratio個還要多)SERVICE/VERSION DETECTION: //服務和版本探測  -sV: Probe open ports to determine service/version info //探測開放連接埠並確定服務和版本資訊  --version-intensity : 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=:  is a comma separated list of //使用某個或某類指令碼進行掃描,還可以以逗號分隔的列表(如vuln,malware,dos)           directories, script-files or script-categories  --script-args=: 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=: Show help about 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 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 : Parallel host scan group sizes //調整並行掃描組的大小,就是同時掃描多少主機連接埠或版本(這裡一個最小值,一個最大值)  --min-parallelism/max-parallelism : Probe parallelization //調整探測報文的並行度  --min-rtt-timeout/max-rtt-timeout/initial-rtt-timeout: Specifies      probe round trip time. //調整探測報文的並行度  --max-retries : Caps number of port scan probe retransmissions. //調整重試次數  --host-timeout: Give up on target after this long //調整逾時值  --scan-delay/--max-scan-delay: Adjust delay between probes //調整探測報文的時間間隔,或者叫每個報文之間的延遲,後面的那個是設定最大的探測報文間隔  --min-rate : Send packets no slower than  per second //調整每秒發送資料包的最小值  --max-rate : Send packets no faster than  per second //調整每秒發送資料包的最大值FIREWALL/IDS EVASION AND SPOOFING: //防火牆/IDS躲避和哄騙  -f; --mtu : fragment packets (optionally w/given MTU) //報文分段,這報文應該是ip,就是減少發送的每個資料包的大小,其思路是將TCP頭分段在幾個包中,使得包過濾器、 IDS以及其它工具的檢測更加困難。  -D : Cloak a scan with decoys //使用誘餌隱蔽掃描(就是後面可以加一些假的ip地址)  -S : Spoof source address //偽造源地址,這個必須和下面的-e一起使用,親測  -e : Use specified interface //指定網路介面(如eth0)  -g/--source-port : Use given port number //源連接埠欺騙---指定源連接埠  --proxies : Relay connections through HTTP/SOCKS4 proxies //設定HTTP或SOCKS4代理  --data-length : Append random data to sent packets //發送報文時 附加隨機資料(後面加附加的數量)  --ip-options : Send packets with specified ip options //指定特殊的ip協議的選項  --ttl : Set IP time-to-live field //設定TTL值  --spoof-mac : Spoof your MAC address //mac地址欺騙  --badsum: Send packets with a bogus TCP/UDP/SCTP checksum //發送錯誤校正和的資料包OUTPUT: //輸出  -oN/-oX/-oS/-oG : Output scan in normal, XML, s|%3Cbasename%3E: Output in the three major formats at once //可將掃描結果以標準格式、XML格式和Grep格式一次性輸出。分別存放在 .nmap,.xml和 .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 : Resume an aborted scan //恢複一個終止的掃描  --stylesheet : 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 : 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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.