nikto官方文檔:https://cirt.net/nikto2-docs/
一、nikto基本的使用
1.掃描一個主機
nikto -h 104.192.80.196
2.掃描指定端口
nikto -h 104.192.80.196 -p 80
3.使用完整的url進行掃描
nikto -h https://104.192.80.196:443/
4.保存結果
nikto -h 104.192.80.196 -p 80 -o result.html
掃描結果如下:
格式化結果:
nikto -h 104.192.80.196 -p 80 -Format xml -o result.xml
這里將結果輸入格式化為xml格式,其他還支持csv、html、msf、txt等格式。如果不指定Format的話,會根據-o后面文件名的后綴名來決定。
5.掃描https時指定ssl
nikto -h 104.192.80.196 -p 443 -ssl
6.同時掃描多個端口
nikto -h 104.192.80.196 -p 80,443,8080
7.同時掃描多個主機
創建一個主機列表文件 hostlist.txt :
104.192.80.196 https://www.baidu.com:443/ www.163.com www.cnblogs.com
然后使用nikto掃描:
nikto -h hostlist.txt
8.將nmap掃到的結果直接給nikto
nmap -p80 192.168.4.0/24 -oG - | nikto -h - -o net192.html
結果:
Nikto v2.1.6 --------------------------------------------------------------------------- + nmap Input Queued: 17WiFi.lan:80 + Target IP: 192.168.4.1 + Target Hostname: 17WiFi.lan + Target Port: 80 + Start Time: 2020-04-16 04:06:42 (GMT-4) --------------------------------------------------------------------------- + Server: nginx/1.15.2 + The anti-clickjacking X-Frame-Options header is not present. + The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS + The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type + Root page / redirects to: /local/auth + No CGI Directories found (use '-C all' to force check all possible dirs) + 7785 requests: 0 error(s) and 3 item(s) reported on remote host + End Time: 2020-04-16 04:07:15 (GMT-4) (33 seconds) --------------------------------------------------------------------------- + 1 host(s) tested
可以看到,整個網段中,只有192.168.4.1主機開了80端口。nikto接受到這個主機IP和端口,進行了進一步的掃描,發現了使用的服務器版本以及一些漏洞。
二、nikto的一些操作
1.nikto版本升級
root@kali:~# nikto -update -update is deprecated in git versions of Nikto; please pull directly from git. + No updates required. + CIRT.net message: You should update via git and not use -update
使用-update進行升級被告知以作廢,要求我們通過git下載進行更新。
2.nikto掃描過程中的快捷鍵
在nikto掃描過程中,我們可以輸入一下按鍵來進行相應的操作:
SPACE - Report current scan status # 報告當前掃描狀態 v - Turn verbose mode on/off # 可以看到更多信息 d - Turn debug mode on/off # 開啟和關閉debug模式 e - Turn error reporting on/off # 開啟或關閉error報告 p - Turn progress reporting on/off # 開啟或關閉進展報告 q - Quit # 結束掃描 N - Next host # 下一個主機 P - Pause # 暫停
====