Nikto安装和使用

1 Nikto 简介

Nikto 是一款开放源代码的、功能强大的 WEB 扫描评估软件,能对 web 服务器多种安全项目进行测试的扫描软件,去寻找已知有名的漏洞,能在230多种服务器上扫描出2600多种有潜在危险的文件、CGI 及其他问题,它可以扫描指定主机的 WEB 类型、主机名、特定目录、COOKIE、特定 CGI 漏洞、返回主机允许的 http 模式等等。

它也使用 LibWhiske 库,但通常比 Whisker 更新的更为频繁。Nikto 是网管安全人员必备的 WEB 审计工具之一。

Nikto 是 perl 语言开发的,其特点扫描全面,速度快。

2 Nikto 安装

  1. 安装 perl
    $ sudo apt-get install perl
    
  2. 安装 libwhisker
    $ wget https://sourceforge.net/projects/whisker/files/libwhisker/2.5/libwhisker2-2.5.tar.gz
    $ tar xzvf libwhisker2-2.5.tar.gz
    $ mkdir -p /usr/local/share/perl/5.26.1/	#若没有创建该目录,在后面安装libwhisker时会报错
    $ cd libwhisker2-2.5
    $ perl Makefile.pl install
    
  3. 下载 nikto
    $ git clone https://github.com/sullo/nikto.git
    

3 命令行参数

官方介绍:https://github.com/sullo/nikto

以下所有选项,凡是有带 + 号的代表后面需要跟一个值:

-ask+
Whether to ask about submitting updates
yes  询问每个(默认)
no   不用询问,且不不发送
auto 不用询问,只是发送

-Cgidirs+	扫描CGI目录:"none", "all", 或者类似 "/cgi/ /cgi-a/"

-config+	使用指定的 config 文件来替代安装在本地的 config.txt 文件

-Display+
开启/关闭 Nikto 输出的显示
1 显示重定向
2 显示已收到的cookies信息
3 显示所有200/OK的响应
4 显示有认证请求的URL
D Debug输出
E 显示所有HTTP错误
P 将进度打印到标准输出
S 清除ip和主机的输出
V 详细输出

-dbcheck	检查数据库和其他关键文件的语法错误

-evasion+
使用 LibWhisker 中对 IDS 的逃逸技术,可使用以下几种类型:
1 随机URL编码(非UTF-8方式)
2 自选择路径(/./)
3 虚假的请求结束
4 前置长随机字符串
5 参数欺骗
6 使用制表符作为请求的分隔符
7 改变URL的大小写
8 使用Windows路径分隔符\替换/
A 使用回车(0x0d)作为请求的分隔符
B 使用二进制值0x0b作为请求的分隔符

-Format+
指定检测报告输出文件的格式
csv   Comma-separated-value
htm   HTML格式
msf+  记录到Metasploit
nbe   Nessus NBE格式
txt   文本格式
xml   XML格式

-Help		帮助信息

-host+		目标主机(主机名、IP地址、主机列表文件)

-IgnoreCode	Ignore Codes--treat as negative responses

-id+		ID和密码对于授权的HTTP认证。格式:id:password 或 id:pass:realm

-key+		客户端证书密钥文件

--list-plugins	列出所有可用的插件,不执行测试

-maxtime+	每个主机的最大测试时间

-mutate+
变化猜测技术
1 使用所有的root目录测试所有文件
2 猜测密码文件名字
3 列举Apache的用户名(/~user)
4 列举cgiwrap的用户名(/cgi-bin/cgiwrap/~user)
5 尝试暴力破解子域名,假设主机名是父域名
6 尝试从提供的字典文件中猜测目录名

-mutate-options	提供突变的信息

-nointeractive	禁用互动功能

-nolookup	禁用DNS查找

-nossl		禁用SSL的使用

-no404		禁止nikto尝试猜测404页面

-output+	指定报告输出路径和文件名

-Pause+     每次测试之间的延迟时间(seconds, integer or float)

-Plugins+   要运行的插件列表(default: ALL)

-port+		扫描端口指定,默认为80端口。

-RSAcert+	客户端证书文件

-root+		Prepend root value to all requests, format is /directory

-Save		Save positive responses to this directory ('.' for auto-name)

-ssl		强制在端口上使用SSL模式

-Tuning+
控制 Nikto 使用不同的方式来扫描目标。
0 文件上传
1.日志文件
2.默认的文件
3 信息泄漏
4 注入(XSS/Script/HTML)
5 远程文件检索(Web 目录中)
6 拒绝服务(DOS)
7 远程文件检索(服务器)
8 代码执行/远程shell
9 SQL注入
a 认证绕过
b 软件识别
c Remote Source Inclusion
x 反向调优选项(例如:包括除指定外的所有文件)

-timeout+		每个请求的超时时间,默认为10秒

-Userdbs
只加载用户数据库,而不加载标准数据库
all---禁用标准dbs,只加载用户dbs
tests-仅禁用db_tests和加载udb_tests

-until			运行到指定的时间或持续时间

-update			从 CIRT.net 更新插件和数据库

-useproxy		使用在 nikto.conf 中定义的代理

-Version		打印插件和数据库版本

-vhost+			Virtual host (for Host header)

4 Nikto 使用

  1. 快速入门

    进行最基本的 nikto 扫描,你只需要指定 host(通过 -h 参数指定),也可以指定要扫描的端口号(通过 -p 来指定),默认端口是80。nikto.pl 是在 program 目录下,需要进入到该目录下,才能运行以下的命令。

    $ perl nikto.pl -host 192.168.0.1
    
  2. 多端口扫描

    (1)扫描80,88,443三个端口

    $ perl nikto.pl -host 192.168.0.1 -port 80,88,443
    

    (2) 扫描80~90共10个端口

    $ perl nikto.pl -host 192.168.0.1 -port 80-90
    
  3. 多 host 扫描

    $ perl nikto.pl -host url.txt
    

    -host 参数的值为一个文件,该文件存一系列的 host 或者 ip,文件的格式要求是,每个 host 必须占一行,端口号放行末,端口号通过冒号或者逗号和 host,其他端口号区分开,给一个文件示例:

    192.168.0.1:80
    http://192.168.0.1:8080/
    192.168.0.3
    
  4. 扫描 https 网站

    $ perl nikto.pl -host www.baidu.com -ssl -port 443
    
  5. 使用代理进行扫描

    $ perl nikto.pl -host https://www.baidu.com -ssl -useproxy http://127.0.0.1:8080
    
  6. 使用 LibWhisker 绕过 IDS 的检测

    $ perl nikto.pl -host www.baidu.com -ssl -port 443 -evasion 1358
    
  7. 交互功能

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

    参数功能
    空格报告当前扫描状态
    v显示详细信息
    d显示调试信息
    e显示http错误信息
    p显示扫描进度
    r显示重定向信息
    c显示cookie
    a显示身份认证过程
    q退出程序
    N扫描下一个目标
    P暂停扫描
  8. 生成报告

    $ perl nikto.pl -host xxxx -output result.html -F html
    

5 参考

本文由下列两篇文章整理而来,并经过测试验证:

https://blog.csdn.net/fly_heart_yuan/article/details/6799043
https://blog.csdn.net/smli_ng/article/details/105994754

  • 4
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
Nikto是一款Web安全扫描工具,可以扫描指定主机的web类型,主机名,特定目录,cookie,特定CGI漏洞,XSS漏洞,SQL注入漏洞等,非常强大滴说。。。 [email protected]:~# cd /pentest/web/nikto/ [email protected]:/pentest/web/nikto# ls docs nikto.conf nikto.pl plugins templates [email protected]:/pentest/web/nikto# ./nikto.pl -h Option host requires an argument -config+ Use this config file -Cgidirs+ scan these CGI dirs: ‘none’, ‘all’, or values like “/cgi/ /cgi-a/” -dbcheck check database and other key files for syntax errors -Display+ Turn on/off display outputs -evasion+ ids evasion technique -Format+ save file (-o) format -host+ target host -Help Extended help information -id+ Host authentication to use, format is id:pass or id:pass:realm -list-plugins List all available plugins -mutate+ Guess additional file names -mutate-options+ Provide extra information for mutations -output+ Write output to this file -nocache Disables the URI cache -nossl Disables using SSL -no404 Disables 404 checks -port+ Port to use (default 80) -Plugins+ List of plugins to run (default: ALL) -root+ Prepend root value to all requests, format is /directory -ssl Force ssl mode on port -Single Single request mode -timeout+ Timeout (default 2 seconds) -Tuning+ Scan tuning -update Update databases and plugins from CIRT.net -vhost+ Virtual host (for Host header) -Version Print plugin and database versions + requires a value Note: This is the short help output. Use -H for full help. 升级插件 [email protected]:/pentest/web/nikto# ./nikto.pl -update -h 指定扫描的目标 –p 端口 [email protected]:/pentest/web/nikto# ./nikto.pl -h www.91ri.org -p 80 -C 指定CGI目录 –all表示猜解CGI目录 [email protected]:/pentest/web/nikto# ./nikto.pl -h www.91ri.org -C all -T选项包含很多小选项 –T 9表示扫描SQL注入漏洞 [email protected]:/pentest/web/nikto# ./nikto.pl -h www.91ri.org -T 9 -D指定输出显示 2显示cookies [email protected]:/pentest/web/nikto# ./nikto.pl -h www.91ri.org -D 2 -T选项包含的小选项解释: 0 检查文件上传页面 1 检查web日志 2 检查错误配置或默认文件 3检查信息泄露问题 4 检查XSS/Script/HTML问题 5 从根目录检查是否存在可访问的文件 6 检查拒绝服务问题 7 从任意文件检索是否存在可访问文件 8 检查是否存在系统命令执行漏洞 9 检查SQL注入漏洞 a 检查认证绕过问题 b 识别安装的软件版本 c 检查源代码泄露问题 x 反向链接选项

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

半砖

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值