nikto2 — Web应用漏洞扫描

来源:互联网 发布:办公无线键盘鼠标 知乎 编辑:程序博客网 时间:2024/06/07 22:01

nikto2 官网:https://cirt.net/nikto2

Nikto - The Manual:https://cirt.net/nikto2-docs/

kali下使用nikto扫描网站: http://cstriker1407.info/blog/kali-to-use-nikto-scans-web-sites/

nikto 参数

Nikto 是一个比较全面的网页扫描器。

   选项:       -ask+               Whether to ask about submitting updates                               yes   Ask about each (default)                               no    Don't ask, don't send                               auto  Don't ask, just send       -Cgidirs+           扫描这些CGI目录: "none", "all", or values like "/cgi/ /cgi-a/"       -config+            使用指定的config文件来替代安装在本地的config.txt文件       -Display+           Turn on/off display outputs:                               1     显示重定向                               2     显示接受 cookie                               3     显示所有200/OK响应                               4     显示要求验证的 URL                               D     调试输出                               E     显示所有HTTP错误                                  P     打印处理进度到STDOUT                               S     格式输出IP地址和主机名                               V     详细输出       -dbcheck           Check database and other key files for syntax errors       -evasion+          编码技术: 该选项能够对扫描包进行一些变形,绕过IDC检测。可使用以下几种类型:                               1     随机URI编码 (non-UTF8)                               2     使用相对路径作为参考 (/./)                               3     Premature URL ending  虚假的请求结束                               4     Prepend long random string  长的URL请求                               5     隐藏参数                               6     使用 TAB 作为命令的分隔符                               7     大小写敏感                               8     使用Windows路径分隔符\替换/                               A     Use a carriage return (0x0d) as a request spacer                               B     Use binary value 0x0b as a request spacer        -Format+           Save file (-o) format:                               csv   逗号分隔值                               htm   HTML格式                               nbe   Nessus的NBE格式                               sql   Generic SQL (see docs for schema)                               txt   文本(默认情况下,如果没有指定)                               xml   XML格式                               (if not specified the format will be taken from the file extension passed to -output)       -Help              帮助       -host+             目标主机       -404code           Ignore these HTTP codes as negative responses (always). Format is "302,301".       -404string         Ignore this string in response body content as negative response (always). Can be a regular expression.       -id+               主机使用的身份验证,格式是 ID:密码 或 ID:密码:领域       -key+              Client certificate key file       -list-plugins      列出所有可用的插件,不执行测试       -maxtime+          每个主机的最大测试时间 (e.g., 1h, 60m, 3600s)       -mutate+           猜额外的文件名。变化猜测技术:                               1     测试所有的文件,所有的根目录                               2     猜测密码文件名                               3     通过Apache枚举用户名(/~user type requests)                               4     通过cgiwrap枚举用户名(/cgi-bin/cgiwrap/~user type requests)                               5     试暴力破解子域名,假设主机名称是父域名                               6     尝试使用从提供的字典文件的目录名称       -mutate-options    Provide information for mutates       -nointeractive     禁用交互特性       -nolookup          禁止DNS查找       -nossl             禁止使用SSL       -no404             禁用Nikto尝试猜测404页       -Option            Over-ride an option in nikto.conf, can be issued multiple times       -output+           Write output to this file ('.' for auto-name)       -Pause+            测试之间的停顿(秒,整数或浮点数)       -Plugins+          列出正在运行的插件(默认:ALL)       -port+             要使用的端口(默认80)       -RSAcert+          Client certificate file       -root+             前面加上root值到所有请求,格式为/目录       -Save              Save positive responses to this directory ('.' for auto-name)       -ssl               强制SSL端口模式       -Tuning+           扫描选项: 选项控制Nikto使用不同的方式来扫描目标。                               1     日志文件                               2     默认文件                               3     信息泄漏                               4     注入 (XSS/Script/HTML)                               5     远程文件检索 - Inside Web Root                               6     拒绝服务                               7     远程文件检索 - Server Wide                               8     执行命令 / 远程shell                               9     SQL 注入                               0     文件上传                               a     认证绕过                               b     软件关联                               c     Remote Source Inclusion                               d     WebService                               e     Administrative Console                               x     反向连接选项 (i.e., include all except specified)       -timeout+          请求超时时间 (默认 10 秒)       -Userdbs           Load only user databases, not the standard databases                               all   Disable standard dbs and load only user dbs                               tests Disable only db_tests and load udb_tests       -useragent         Over-rides the default useragent       -until             Run until the specified time or duration       -update            从 CIRT.net 更新 数据库 和 插件       -useproxy          使用在 nikto.conf 定义的代理, 或者 使用参数 http://server:port       -Version           打印插件和数据库版本       -vhost+            虚拟主机(用于主机头)   + requires a value

nikto 使用

1. 快速入门。最基本的nikto扫描只需要指定目标的host(通过 -h 参数指定),也可以指定要扫描的端口号(通过 -p 来指定),默认是80
perl nikto.pl -h 192.168.0.1
2 多端口扫描。
#扫描80,88,443三个端口
perl nikto.pl -h 192.168.0.1 -p 80,88,443
#扫描80~90共10个端口
perl nikto.pl -h 192.168.0.1 -p 80-90
3 多host扫描
-h 参数的值为一个文件,该文件存一系列的host或者ip。
文件的格式要求是:每个host必须占一行,端口号放行末,端口号通过冒号或者逗号和host其他端口号区分开,给一个文件示例
192.168.0.1:80
http://192.168.0.1:8080/
192.168.0.3

4 交互功能。在扫描期间,按下下面任意键,可开启或关闭相关功能,注意这些命令是区分大小写的

空格报告当前扫描状态v详细模式的开启/关闭d调试模式的开启/关闭e开启/关闭错误报告p进展情况报告的开启/关闭

5. CGI扫描 -C参数只能放在后面,应该可以指定相对目录。
Perl nikto.pl –h 192.168.0.1 -c
Perl nikto.pl –h 192.168.0.1 -c /phpbb
数据库扫描 此参数也需要跟在后面
Perl nikto.pl –h 192.168.0.1 -c -d

猜测apache默认配制密码 前提需要目标服务器允许guess
Perl nikto.pl –h 192.168.0.1 -m
报告输出指定地点
Perl nikto.pl –h 192.168.0.1 -o result.txt

Tuning选项控制Nikto使用不同的方式来扫描目标。 这个最有价值。-T参数后的数字是隐藏的,大家可以灵活搭配使用

Perl nikto.pl –h 192.168.0.1 -T 58
Perl nikto.pl –h 192.168.0.1 -T 58x
Perl nikto.pl –h 192.168.0.1 -T 默认不指定数字,应该是全部扫描吧, 没测试过
更新插件和数据库
Perl nikto.pl -update
完全点的检测一个主机信息
Perl nikto.pl –h 192.168.0.1 -m -T -c -o 结果.txt



示例报告分析

在谷歌搜索nikto reports 有了这样一份报告,我就拿他来试试我的小牛刀 

http://www.ruben-alves.com/ficheiros/nikto-AT-localhost.html

tip:这是一份html格式的报告,生成命令为 perl nikto.pl -h xxxx -o result.html -F htm

个人认为,html格式的报告比txt格式的报告清晰多了的说,建议使用html报告格式


Nikto Scan SummarySoftware DetailsNikto 2.00CLI Options-host localhost -output nikto@localhost -F htmlHosts Tested1
首先,告诉了我们关于nikto的信息,你使用的是nikto软件,版本号,命令行参数
localhost / 127.0.0.1Target IP127.0.0.1Target hostnamelocalhostTarget Port80HTTP ServerApache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6Start Time2007-11-14 0:09:00End Time2007-11-14 0:09:00Elapsed17 SecondsSite Link (Name)http://localhost:80/Site Link (IP)http://127.0.0.1:80/Items Tested4342Items Found8
上面的表格告诉我们的是目标服务器相关的信息,ip,域名,端口号,web服务器等等


InformationOSVDB-877: HTTP method ('Allow' Header): 'TRACE' is typically only used for debugging and should be disabled. This message does not mean it is vulnerable to XST.OSVDB EntriesOSVDB-877InformationPHP/5.2.3-1ubuntu6 appears to be outdated (current is at least 5.2.4)OSVDB Entries InformationApache/2.2.4 appears to be outdated (current is at least Apache/2.2.6). Apache 1.3.39 and 2.0.61 are also current.OSVDB Entries InformationPHP/5.2.3-1ubuntu6 appears to be outdated (current is at least 5.2.4)OSVDB Entries 上述是针对服务器提出的几种建议

下面的表格厉害了,注意看description

URI/phpmyadmin/
( 这是相对于host的路径)HTTP MethodGETDescriptionphpMyAdmin is for managing MySQL databases, and should be protected or limited to authorized hosts.
(phpmyadmin是负责管理mysql数据库的页面,应该限制访问权限)Test Linkshttp://localhost:80/phpmyadmin/
http://127.0.0.1:80/phpmyadmin/OSVDB EntriesOSVDB-3092URI/icons/HTTP MethodGETDescriptionDirectory indexing is enabled: /icons indexing
(目录遍历漏洞)Test Linkshttp://localhost:80/icons/
http://127.0.0.1:80/icons/OSVDB EntriesOSVDB-3268URI/HTTP MethodTRACEDescriptionTRACE option appears to allow XSS or credential theft. See http://www.cgisecurity.com/whitehat-mirror/WhitePaper_screen.pdf for detailsTest Linkshttp://localhost:80/
http://127.0.0.1:80/OSVDB EntriesOSVDB-877URI/index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000HTTP MethodGETDescriptionPHP reveals potentially sensitive information via certain HTTP requests which contain specific QUERY strings.
(访问上面的url,我们发现其实是phpinfo页面啊,确实包含了很多敏感信息)Test Linkshttp://localhost:80/index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
http://127.0.0.1:80/index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000OSVDB EntriesOSVDB-12184URI/phpinfo.phpHTTP MethodGETDescriptionContains PHP configuration informationTest Linkshttp://localhost:80/phpinfo.php
http://127.0.0.1:80/phpinfo.phpOSVDB EntriesOSVDB-3233URI/server-statusHTTP MethodGETDescriptionThis reveals Apache information. Comment out appropriate line in httpd.conf or restrict access to allowed hosts.Test Linkshttp://localhost:80/server-status
http://127.0.0.1:80/server-statusOSVDB EntriesOSVDB-561URI/readmeHTTP MethodGETDescriptionThis might be interesting...Test Linkshttp://localhost:80/readme
http://127.0.0.1:80/readmeOSVDB EntriesOSVDB-3092URI/doc/HTTP MethodGETDescriptionThe /doc/ directory is browsable. This may be /usr/doc.Test Linkshttp://localhost:80/doc/
http://127.0.0.1:80/doc/OSVDB EntriesOSVDB-48


许多 Nikto 的警报会返回 OSVDB 序号。这是由开源缺陷数据库(http://osvdb.org/)所指定。可以在 OSVDB 上找出相关缺陷的深入说明。


后记

同许多渗透测试工具一样,nikto提供给你的信息有局限性,如果nikto确定一个问题,很值得我们深究到底,因为全世界的每个黑客都可以轻易的找到相同的问题,另一方面,如果nikto什么也没找到,也不代表就不存在安全问题

随着你的安全测试变的成熟,你从nikto的扫描中得到的收益将越来越少。






原创粉丝点击