目錄
- 埠掃描
- 常見埠
- 掃描原理
- 掃描型別
- nmap
- 常用引數
- 漏洞掃描
- masscan
- tips
埠掃描
常見埠
21(ftp的默認埠,ftp常用來更新web,可能支持匿名訪問)
22(ssh的默認埠,ssh是linux的遠程管理埠)
23(telnet的默認埠,遠程管理埠,非PC設備比較常見)
443(https的默認埠)
445(SMB共享的默認埠,內網中很常見)
1433(mssql的默認埠,可能可以遠程登錄資料庫)
3306(mysql的默認埠,可能可以遠程登錄資料庫)
3389(windows的遠程桌面默認埠)
8000,8088,8888(常見的其他http埠)
其中21,22,23,1433,3306,3389都可能被用于暴力破解用戶名和密碼,其中22有root,1433有sa,3306有root,3389有administrator的默認高權限用戶名,比較容易利用,
COMMON_PORTS = (21, 22, 23, 25, 53, 80, 81, 82, 88, 89, 110, 135, 139, 389, 443, 445, 873, 1080, 1433, 1521, 1723, 2049, 2082, 2083, 3128, 3306, 3311, 3312, 3389, 3390, 3690, 3780, 4440, 4848, 4899, 5432, 5631, 5900, 5901, 5902, 5984, 6082, 6379, 7000, 7001, 7002, 7778, 8000, 8001, 8002, 8008, 8011, 8080, 8081, 8082, 8088, 8089, 8090, 8091, 8099, 8180, 8181, 8182, 8649, 8834, 8888, 8899, 9000, 9080, 9081, 9082, 9090, 9091, 9200, 9300, 10050, 11211, 27017, 27018, 28017, 50000, 50030, 50060, 50070)
掃描原理
參考:
https://blog.csdn.net/whatday/article/details/45504961
掃描型別
nmap
nmap掃描的準確性較高,但是掃描的比較慢,
參考:https://www.cnblogs.com/weihua2616/p/6599629.html
常用引數
掃描指定IP所開放的埠及服務:nmap -T4 -sT -p- -sV IP
掃描指定IP所開放的埠:nmap -sS -p 1-65535 -v XXX.XXX.XXX.XXX
掃描C段存活主機:nmap -sP XXX.XXX.XXX.XXX/24
指定埠掃描:nmap -p 80,1433,22,1521 XXX.XXX.XXX.XXX
探測主機作業系統:nmap -o XXX.XXX.XXX.XXX
全面的系統探測:nmap -v -A XXX.XXX.XXX.XXX(Nmap默認掃描主機1000個高危埠)
探測指定網段:nmap XXX.XXX.XXX.XXX-XXX
穿透防火墻進行掃描:nmap -Pn -A XXX.XXX.XXX.XXX(XXX.XXX.XXX.XXX禁止用ping的)
使用腳本,掃描Web敏感目錄:nmap -p 80 --script=http-enum.nse XXX.XXX.XXX.XXX
掃描C段指定埠: nmap -sS -p 3388,13388 ip/24
或者 portscan.exe(掃描不準,多掃描幾次) 7KB掃描可以自定義埠掃描
準確掃描目標的埠和服務:
nmap -n -sT -sV -p 1-11000 --open -Pn -v 222.74.213.243
nmap -sV -p 詳細埠 IP
批量掃描IP指定埠 :
nmap -sS -p 1-65535 -iL ip.txt
nmap -sS -p 1-65535 -iL vipkid.com.cn__full-ip.txt -oN ip-ports.txt
nmap -sS -sV -v -iL 1104.txt -oN 1104result.txt > /dev/null 2>&1 &
nohup nmap -sV -iL 1110.txt -oN 1110result.txt &
nohup nmap -sS -p 1-65535 -iL 1104.txt -oN 1104result.txt > /dev/null 2>&1 &
nohup nmap -sV -iL 11031030.txt -oN 11031030result.txt > /dev/null 2>&1 &
漏洞掃描
Nmap 進行 Web 漏洞掃描
cd /usr/share/nmap/scripts/
wget http://www.computec.ch/projekte/vulscan/download/nmap_nse_vulscan-2.0.tar.gz && tar xzf nmap_nse_vulscan-2.0.tar.gz
nmap -sS -sV --script=vulscan/vulscan.nse target
nmap -sS -sV --script=vulscan/vulscan.nse –script-args vulscandb=scipvuldb.csv target
nmap -sS -sV --script=vulscan/vulscan.nse –script-args vulscandb=scipvuldb.csv -p80 target
nmap -PN -sS -sV --script=vulscan –script-args vulscancorrelation=1 -p80 target
nmap -sV --script=vuln target
nmap -PN -sS -sV --script=all –script-args vulscancorrelation=1 target
masscan
參考:
https://www.cnblogs.com/guixia621/p/8820204.html
https://blog.csdn.net/zhaopengxslc/article/details/80568534
https://paper.seebug.org/1052/#_12
tips
當目標開啟了防火墻 nmap探測全埠 全埠都顯示開著,如何規避 或 繞過 而獲取真實埠開放情況呢?
1、可能工具的指紋被識別攔截了,用最簡單的socket 掃描就可以,或 masscan + nmap banner
2、不一定是防火墻,有其他工具可以做到,掃描時全埠開放,強行爆破,真正的埠回傳的不一樣
3、常見的服務可以根據banner(連接時的回傳資料),其他的 tcp 埠就只能遍歷了
如果有web:
可以curl請求目標,然后取title,
如果是http這種的banner探測不出來,可以試試常見存在的路徑,比如/favico.ico這種,或者js,css這種目錄的狀態碼,其他協議可通過發送請求的回傳結果的特征,作為指定協議識別方法
如果http(s)還可以通過域名去跑埠,有時候比直接ip好使
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/233601.html
標籤:其他

