*注: www.heihei.work 為本人測試網站,可由 官方測試網站 scanme.nmap.org代替。
NO.1
1.掃描端口開放的服務
nmap -T4 -A -v www.heiehi.work
或
nmap -Pn www.heihei.work (防止觸發防火牆)
2.端口狀態
-Open 開放
-Closed 關閉
-Filterd 過濾
-Opend/UnFilterd 開放或未過濾
-Closed/Filterd 關閉或過濾
3.Nmap識別服務指紋(server Version)
=nmap -sV www.heihei.work
4.侵略性探測
=nmap -T4 -A -v www.heihei.work
》》》效果同第一個
=nmap -sC -sV -O www.heihei.work
-sV版本
-sC使用默認腳本
-O操作系統
5.存活主機發現
=ping www.heihei.work
-單個。手動太累。。。
=nmap -sP 192.168.1.1/24
-即nmap -sP CIDR
=nmap -sn 192.168.43.1/24
=nmap -sn 192.168.43.1/24 -oX test.xml
-掃描結果保存到 當前目錄 下的 text.xml
6.精准探測(技巧)
=nmap -p 80 www.heihei.work
-80端口
=nmap -p80 ,21 www.heihei.work
-探測多個
=nmap -p1-100 www.heihei.work / nmap -p [1-100] www.heihei.work (大范圍)
-探測一定范圍
=nmap -p T:22 scanme.nmap.org
-指定協議探測端口
=nmap -p ssh scanme.nmap.org
=nmap -p s* scanme.nmap.org / nmap -p *s scanme.nmap.org
-以s開頭(ssh)/結尾的服務(netbios-ns、micfosoft-ds等)
7.Nmap NSE 腳本
可以設定掃描策略
-內置腳本位置
軟件Nmap/script 或 KaliLinux /usr/share/nmap/script/
=nmap --script http-title www.heihei.work
-探測Web服務的title信息(網站標題)
=nmap --script http-headers www.heihei.work
-探測http的http頭
先看一下我們的網站首頁標題
結果一致
耗時較長。。。
8.Nmap NSE 探測目標漏洞弱點
=nmap -sV --script vuln www.heihei.work
-列出可能存在注入漏洞的網址
-可以xss攻擊的網址
-可利用的攻擊方式
-開放的端口可利用的漏洞
9.NSE 分類展示詳細信息
=nmap -sV --script="version,discovery" www.heihei.work
-網關、網卡、IP
-端口、開放的服務、環境版本
-網頁信息
=nmap -sV --script="not exploit" www.heiehi.work
-移除一些分類(exploit)
=nmap -sV --script"(http*) and not(http-slowlors and http-brute)" www.heihei.work
-使用所有http腳本,除暴力破解和dos攻擊之外(http-brut、http-slowlors)
10.NSE 調試功能
=nmap -sV --script exploit -d 3 --script-trace www.heihei.work
-d (debug 強度范圍0~9)
-查看掃描過程遇到的錯誤
內容很多,不太友好
11.NSE 參數
=nmap -sV --script http-title --script-args http.useragent="Mozilla 999" www.heihei.work
-偽裝瀏覽器版本
12.通用
=nmap --script-updatedb
-更新腳本數據庫
=腳本用法介紹
-官網:www.nmap.org/nsedoc
NO.2
1.對特定網卡進行探測
=nmap -e eth0 192.168.43.81
-用於電腦有多張網卡、處於多個網絡的場景
-e 切換網卡
2.Nmap擴展工具之diff(windows中叫ndiff)
用於比較兩次探測結果的差別,達到監控網絡的目的。
=nmap -T4 -A -v 192.168.43.81 -oX file1.xml
-保存在 file1.xml
=nmap -T4 -A -v 192.168.43.81 -oX file2.xml
-保存在file2.xml
=diff file1.xml file2.xml
-對比結果
-時間
-端口狀態、服務等
Nmap 的可視化版本 Zenmap
傻瓜式操作哈哈哈
。。。