
Nikto
转载请注明,原文转自 http://www.voidcn.com/article/p-yrszhyiu-uh.html
一 简介
Nikto 是一款开放源代码的、功能强大的WEB扫描评估软件,能对web服务器多种安全项目进行测试的扫描软件,去寻找已知有名的漏洞,能在230多种服务器上扫描出 2600多种有潜在危险的文件、CGI及其他问题,它可以扫描指定主机的WEB类型、主机名、特定目录、cookie、特定CGI漏洞、返回主机允许的 http模式等等。它也使用libWhiske库,但通常比Whisker更新的更为频繁。Nikto是网管安全人员必备的WEB审计工具之一。
二 安装
a 安装libWhiske
wget http://sourceforge.net/projects/whisker/files/libwhisker/2.5/libwhisker2-2.5.tar.gz/download?_test=goal
tar -xzf libwhisker2-2.5.tar.gz
b 安装nikto
wget --no-check-certificate https://cirt.net/nikto/nikto-2.1.4.tar.gz
tar -xf nikto-2.1.4.tar
cd nikto-2.1.4
三 使用
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 3 多host扫描#扫描80~90共10个端口perl nikto.pl -h 192.168.0.1 -p 80-90
-h 参数的值为一个文件,该文件存一系列的host或者ip,文件的格式要求是,每个host必须占一行,端口号放行末,端口号通过冒号或者逗号和host,其他端口号区分开,给一个文件示例
192.168.0.1:80http://192.168.0.1:8080/192.168.0.3 4 交互功能 在扫描期间,按下下面任意键,可开启或关闭相关功能,注意这些命令是区分大小写的
| 空格 | 报告当前扫描状态 |
| v | 详细模式的开启/关闭 |
| d | 调试模式的开启/关闭 |
| e | 开启/关闭错误报告 |
| p | 进展情况报告的开启/关闭 |
四 命令行参数
-CgIDirs
扫描CGI目录。
-config
使用指定的config文件来替代安装在本地的config.txt文件
-dbcheck
选择语法错误的扫描数据库。
-evasion
使用libWhisker中对IDS的躲避技术,可使用以下几种类型:
1.随机URL编码(非UTF-8方式)
2.自选择路径(/./)
3.虚假的请求结束
4.长的URL请求
5.参数隐藏
6.使用TAB作为命令的分隔符
7.大小写敏感
8.使用windows路径分隔符\替换/
9.会话重组
-findonly
仅用来发现http和httpS端口,而不执行检测规则
-Format
指定检测报告输出文件的格式,默认是txt文件格式(csv/txt/htm)
-host
目标主机,主机名、IP地址、主机列表文件。
-ID
ID和密码对于授权的http认证。格式:ID:password
-mutate
变化猜测技术
1.使用所有的root目录测试所有文件
2.猜测密码文件名字
3.列举Apache的用户名字(/~user)
4.列举cgiwrap的用户名字(/cgi-bin/cgiwrap/~user)
-nolookup
不执行主机名查找
-output
报告输出指定地点
-port
扫描端口指定,默认为80端口。
-Pause
每次 *** 作之间的延迟时间
- display
控制Nikto输出的显示
1.直接显示信息
2.显示的cookies信息
3.显示所有200/OK的反应
4.显示认证请求的URLs
5.DeBUG输出
-ssl
强制在端口上使用SSL模式
-Single
执行单个对目标服务的请求 *** 作。
-timeout
每个请求的超时时间,默认为10秒
-Tuning
Tuning 选项控制Nikto使用不同的方式来扫描目标。
0.文件上传
1.日志文件
2.默认的文件
3.信息泄漏
4.注射(XSS/Script/HTML)
5.远程文件检索(Web 目录中)
6.拒绝服务
7.远程文件检索(服务器)
8.代码执行-远程shell
9.sql注入
a.认证绕过
b.软件关联
g.属性(不要依懒banner的信息)
x.反向连接选项
-useproxy
使用指定代理扫描
-update
更新插件和数据库
例子:使用Nikto扫描目标主机10.0.0.12的PHPwind论坛网站。
Perl nikto.pl –h 10.0.0.12 –o test.txt
五 配置文件
1.配置文件所在位置
加压后文件根目录下的nikto.conf
2.格式
类似于unix标准配置文件格式
3.参数
CliOPTS:设置默认的命令后缀,例如
CliOPTS=-output results.txt -Format text这样设置过后,以后敲命令时,就不用再写这些参数了
NIKTODTD:指定nikto.dtd文件的相对路径,此文件是什么角色,我猜想应该是测试用例数据库
RFIURL: 远程文件包含漏洞。此值设为你想要远程包含的文件
SKIPPORTS:掠过端口配置
SKIPIDS:掠过的ID,用于测试数据库的
六 输出报告
七 示例报告分析
在谷歌搜索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 Summary |
| Software Details | Nikto 2.00 |
| Cli Options | -host localhost -output nikto@localhost -F HTML |
| Hosts Tested | 1 |
首先,告诉了我们关于nikto的信息,你使用的是nikto软件,版本号,命令行参数
| localhost / 127.0.0.1 |
| Target IP | 127.0.0.1 |
| Target hostname | localhost |
| Target Port | 80 |
| http Server | Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6 |
| Start Time | 2007-11-14 0:09:00 |
| End Time | 2007-11-14 0:09:00 |
| Elapsed | 17 Seconds |
| Site link (name) | http://localhost:80/ |
| Site link (IP) | http://127.0.0.1:80/ |
| Items Tested | 4342 |
| Items Found | 8 |
上面的表格告诉我们的是目标服务器相关的信息,ip,域名,端口号,web服务器等等
| information | OSVDB-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 EntrIEs | OSVDB-877 |
| information | PHP/5.2.3-1ubuntu6 appears to be outdated (current is at least 5.2.4) |
| OSVDB EntrIEs |
| information | Apache/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 |
| information | PHP/5.2.3-1ubuntu6 appears to be outdated (current is at least 5.2.4) |
| OSVDB EntrIEs |
下面的表格厉害了,注意看description
| URI | /phpmyadmin/ ( 这是相对于host的路径) |
| http Method | GET |
| Description | phpmyadmin is for managing MysqL databases,and should be protected or limited to authorized hosts. (phpmyadmin是负责管理MysqL数据库的页面,应该限制访问权限) |
| Test links | http://localhost:80/phpmyadmin/ http://127.0.0.1:80/phpmyadmin/ |
| OSVDB EntrIEs | OSVDB-3092 |
| URI | /icons/ |
| http Method | GET |
| Description | Directory indexing is enabled: /icons indexing (目录遍历漏洞) |
| Test links | http://localhost:80/icons/ http://127.0.0.1:80/icons/ |
| OSVDB EntrIEs | OSVDB-3268 |
| URI | / |
| http Method | TRACE |
| Description | TRACE option appears to allow XSS or credential theft. See http://www.cgisecurity.com/whitehat-mirror/WhitePaper_screen.pdf for details |
| Test links | http://localhost:80/ http://127.0.0.1:80/ |
| OSVDB EntrIEs | OSVDB-877 |
| URI | /index.PHP?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 |
| http Method | GET |
| Description | PHP reveals potentially sensitive information via certain http requests which contain specific query strings. (访问上面的url,我们发现其实是PHPinfo页面啊,确实包含了很多敏感信息) |
| Test links | http://localhost:80/index.PHP?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 http://127.0.0.1:80/index.PHP?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 |
| OSVDB EntrIEs | OSVDB-12184 |
| URI | /PHPinfo.PHP |
| http Method | GET |
| Description | Contains PHP configuration information |
| Test links | http://localhost:80/PHPinfo.PHP http://127.0.0.1:80/PHPinfo.PHP |
| OSVDB EntrIEs | OSVDB-3233 |
| URI | /server-status |
| http Method | GET |
| Description | This reveals Apache information. Comment out appropriate line in httpd.conf or restrict access to allowed hosts. |
| Test links | http://localhost:80/server-status http://127.0.0.1:80/server-status |
| OSVDB EntrIEs | OSVDB-561 |
| URI | /readme |
| http Method | GET |
| Description | This might be interesting... |
| Test links | http://localhost:80/readme http://127.0.0.1:80/readme |
| OSVDB EntrIEs | OSVDB-3092 |
| URI | /doc/ |
| http Method | GET |
| Description | The /doc/ directory is browsable. This may be /usr/doc. |
| Test links | http://localhost:80/doc/ http://127.0.0.1:80/doc/ |
| OSVDB EntrIEs | OSVDB-48 |
八 后记
同许多渗透测试工具一样,nikto提供给你的信息有局限性,如果nikto确定一个问题,很值得我们深究到底,因为全世界的每个黑客都可以轻易的找到相同的问题,另一方面,如果nikto什么也没找到,也不代表就不存在安全问题
随着你的安全测试变的成熟,你从nikto的扫描中得到的收益将越来越少。
转载请注明,原文转自 http://www.voidcn.com/article/p-yrszhyiu-uh.html
九 参考资料
http://cirt.net/nikto2-docs/
总结以上是内存溢出为你收集整理的Nikto全部内容,希望文章能够帮你解决Nikto所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)