用Nikto探測一個網站安全性
阿新 • • 發佈:2019-01-03
Nikto是一款開源的(GPL)網頁伺服器掃描器,它可以對網頁伺服器進行全面的多種掃描,包含超過3300種有潛在危險的檔案/CGIs;超過625種伺服器版本;超過230種特定伺服器問題,包括多種有潛在危險的檔案、CGI及其他問題,它可以掃描指定主機的WEB型別、主機名、特定目錄、COOKIE、特定CGI漏洞、返回主機允許的http模式等等。這是一款非常棒的工具,Nikto是網管安全人員必備的WEB審計工具之一。
當然,還可以用來探測目標網站究竟使用了什麼技術。
Nikto最新版本為2.1.5版,官方下載網站:http://www.cirt.net/nikto2
Nikto是基於PERL開發的程式,所以需要PERL環境。Nikto支援Windows(使用ActivePerl環境)、MacOSX、多種Linux 或Unix系統。在Windows平臺下使用,需要使用ActivePerl環境,ActivePerl可以其官方網站上下載,下載地址:http://www.activestate.com/activeperl
我這裡用的是Linux,自帶了perl,所以下載解壓就能直接使用了。
01 |
wget https: //cirt.net/nikto/nikto-2.1.5.tar.gz |
02 |
tar -zxvf nikto-2.1.5.tar.gz |
03 |
cd nikto-2.1.5 |
04 |
05 |
perl ./nikto.pl -h www.baidu.com |
06 |
07 |
[[email protected] nikto-2.1.5]# perl ./nikto.pl -h www.baidu.com |
08 |
- ***** SSL support not available (see docs for
SSL install) ***** |
09 |
- Nikto v2.1.5 |
10 |
--------------------------------------------------------------------------- |
11 |
+ Target IP: 115.239.210.27 |
12 |
+ Target Hostname: www.baidu.com |
13 |
+ Target Port: 80 |
14 |
+ Start Time: 2015-02-20 18:25:34 (GMT8) |
15 |
--------------------------------------------------------------------------- |
16 |
+ Server: BWS/1.1 |
17 |
+ Cookie BAIDUID created without the httponly flag |
18 |
+ Cookie BAIDUPSID created without the httponly flag |
19 |
+ Cookie BDSVRTM created without the httponly flag |
20 |
+ The anti-clickjacking X-Frame-Options header is not present. |
21 |
+ Uncommon header 'bduserid' found, with contents: 0 |
22 |
+ Uncommon header 'bdqid' found, with contents: 0xfc103f47000ce711 |
23 |
+ Uncommon header 'bdpagetype' found, with contents: 1 |
24 |
+ Server banner has changed from 'BWS/1.1' to
'Apache' which may suggest a WAF,load balancer or proxy is in place |
25 |
+ No CGI Directories found (use '-C all' to force check all possible dirs) |
26 |
+ Server leaks inodes via ETags, header found with file /robots.txt, fields: 0x91e 0x50b02db060c00 |
27 |
+ File/dir '/shifen/' in robots.txt returned a non-forbidden or redirect HTTP code (200) |
28 |
+ File/dir '/' in robots.txt returned a non-forbidden or redirect HTTP code (200) |
29 |
+ "robots.txt" contains 103 entries which should be manually viewed. |
30 |
+ Multiple index files found: index.php, index.htm, index.html |
31 |
+ OSVDB-5737: WebLogic may reveal its internal IP or hostname in the Location header. The value is . |
32 |
+ OSVDB-3092: /home/: This might be interesting... |
33 |
+ OSVDB-3092: /tw/: This might be interesting... potential country code (Taiwan) |
34 |
+ 6544 items checked: 28 error(s) and 15 item(s) reported on remote host |
35 |
+ End Time: 2015-02-20 18:26:12 (GMT8) (38 seconds) |
36 |
--------------------------------------------------------------------------- |
37 |
+ 1 host(s) tested |
在某些版本的Linux,可能會出現 -bash: ./nikto.pl: Permission denied 錯誤提示,可以用下面的命令試著用:
1 |
nikto -h www.baidu.com |
2 |
./nikto.pl -h www.baidu.com |
3 |
perl ./nikto.pl -h www.baidu.com |
下面是 Nikto 的一些引數設定:
01 |
-c(config):使用指定的config檔案來替代安裝在本地的config.txt檔案。 |
02 |
-C(Cgidirs):掃描包含指定內容的CGI目錄。所包含的內容在-C後面指定。如-C /cgi/。 |
03 |
-D(Display):開啟或關閉預設輸出。輸出選項: |
04 |
1 顯示重定向 |
05 |
2 顯示獲取的cookies資訊 |
06 |
3 顯示所有200/OK的迴應 |
07 |
4 顯示請求認證的URLs |
08 |
D Debug輸出 |
09 |
V 冗餘輸出 |
10 |
-dbcheck:檢查資料庫和其它重要檔案的句法錯誤。 |
11 |
-e(evasion):使用LibWhisker中對IDS的躲避技術,可使用以下幾種型別: |
12 |
1 隨機URL編碼 (非UTF-8方式) |
13 |
2 自選擇路徑(/./) |
14 |
3 過早結束的URL |
15 |
4 優先考慮長隨機字串 |
16 |
5 引數欺騙 |
17 |
6 使用TAB作為命令的分隔符 |
18 |
7 使用變化的URL |
19 |
8 使用Windows路徑分隔符“\” |
20 |
-f(findonly):只尋找HTTP或HTTPS埠,不進行完全掃描。 |
21 |
-F(Format):指定檢測報告輸出檔案的格式,預設是txt檔案格式(可以是htm、csv、txt或xml格式) |
22 |
-h(host):指定目標主機,可以是IP或域名。 |
23 |
-H(Help):顯示幫助資訊。 |
24 |
-i(id):用於主機鑑定,其格式為:userid:password |
25 |
-m(mutate):猜解更多的檔名: |
26 |
1 檢測根目錄下的所有檔案 |
27 |
2 猜測密碼檔名 |
28 |
3 通過Apache(/~user 請求型別)列舉使用者名稱 |
29 |
4 通過cgiwrap(/cgi-bin/cgiwrap/~user 請求型別)列舉使用者名稱 |
30 |
-n(nolookup):不執行主機名查詢。 |
31 |
-o(output):輸出到指定檔案 |
32 |
-p(port):指定使用的埠,預設為80。 |
33 |
-P(Pause):各項操作之間的延時時間。 |
34 |
-r(root):對所有請求優先考慮root的值,格式為:/目錄名 |
35 |
-s(ssl):強制在埠上使用ssl模式 |
36 |
-S(Single):實行對單個目標的請求模式。 |
37 |
-t(timeout):超時時間,預設為2秒。 |
38 |
-T(Tuning):控制Nikto使用不同的方式對目標進行掃描 |
39 |
0 檢查檔案上傳頁面 |
40 |
1 檢查Web日誌 |
41 |
2 檢查錯誤配置或預設檔案 |
42 |
3 檢查資訊洩漏問題 |
43 |
4 檢查XSS/Script/HTML問題 |
44 |
5 遠端檔案檢索,從根目錄檢查是否存在可訪問的檔案 |
45 |
6 檢查拒絕服務問題 |
46 |
7 遠端檔案檢索,從任意檔案檢索是否存在可訪問檔案 |
47 |
8 程式碼執行-遠端shell,檢查是否存在系統命令執行漏洞 |
48 |
9 檢查SQL注入漏洞 |
49 |
a 檢查認證繞過問題 |
50 |
b 識別安裝的軟體版本 |
51 |
c 檢查原始碼洩露問題 |
52 |
x 反向連結選項 |
53 |
-u(useproxy):使用在config.txt中定義的代理。 |
54 |
-update:從cirt.net上升級資料庫和外掛。 |
55 |
-V(Version):顯示外掛和資料庫的版本資訊。 |
56 |
-v(vhost):虛擬主機(針對主機頭)。 |
一些使用:
- nikto.pl -h 10.100.100.10 #掃描主機10.100.100.10的80口上的WEB
- nikto.pl -h 10.100.100.10 -p 443 -s -g #掃描主機10.100.100.10埠443強制使用SSL模式 ???-g
- nikto.pl -h 10.100.100.10 -p 80-90 掃描主機10.100.100.10 埠80-90 ,Nikto自動判定是HTTP還是HTTPS
- nikto.pl -h 10.100.100.10 -p 80,443,8000,8080 掃描主機 10.100.100.10 埠 80 443 8000 8080
- nikto.pl -h 10.100.100.10 -p 80 -e 167 -e 167使用IDS規避技術1 6 7