Nikto 进行web安全扫描

版权声明:墨痕诉清风 https://blog.csdn.net/u012206617/article/details/90065379

1. 安装 nikto(有特征)

1.1. 安装 perl

centos 6.8 默认的 Perl 5.10 不行,报错 ERROR: Required module not found: Time::HiRes
安装了最新的 Perl 5.26 可以运行

1.2. 安装 libwhisker

wget https://10gbps-io.dl.sourceforge.net/project/whisker/libwhisker/2.5/libwhisker2-2.5.tar.gz
tar xzf libwhisker2-2.5.tar.gz
mkdir /usr/local/share/perl5
cd libwhisker2-2.5
perl Makefile.pl install

1.3. 下载nikto

git clone https://github.com/sullo/nikto.git

2. 执行 nikto

cd nikto
perl program/nikto.pl -h 192.168.1.100 -p 8080
  • 执行结果示例:
root@vbcent68x32: /opt/nikto/program # perl nikto.pl -h 192.168.1.100 -p 8080
- ***** SSL support not available (see docs for SSL install) *****
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          192.168.1.100
+ Target Hostname:    192.168.1.100
+ Target Port:        8080
---------------------------------------------------------------------------
+ SSL Info:        Subject:
                   Ciphers:
                   Issuer:
+ Start Time:         2018-03-28 16:08:56 (GMT8)
---------------------------------------------------------------------------
+ Server: nginx/1.12.2 + Phusion Passenger 5.2.0
+ Cookie _redmine_session created without the secure flag
+ Retrieved x-powered-by header: Phusion Passenger 5.2.0
+ Uncommon header 'x-runtime' found, with contents: 0.032617
+ Uncommon header 'x-request-id' found, with contents: 5d492c2c-93fa-4aa1-8073-1cc8f360014a
+ The site uses SSL and the Strict-Transport-Security HTTP header is not defined.
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Entry '/issues/gantt/' in robots.txt returned a non-forbidden or redirect HTTP code (200)
+ Entry '/issues/calendar/' in robots.txt returned a non-forbidden or redirect HTTP code (200)
+ Entry '/activity/' in robots.txt returned a non-forbidden or redirect HTTP code (200)
+ Entry '/search/' in robots.txt returned a non-forbidden or redirect HTTP code (200)
+ "robots.txt" contains 4 entries which should be manually viewed.
+ Server banner has changed from 'nginx/1.12.2 + Phusion Passenger 5.2.0' to 'nginx/1.12.2' which may suggest a WAF, load balancer or proxy is in place
+ Hostname '192.168.56.99' does not match certificate's names:
+ OSVDB-112004: /login.cgi: Site appears vulnerable to the 'shellshock' vulnerability (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6278).
+ OSVDB-112004: /login.php: Site appears vulnerable to the 'shellshock' vulnerability (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6278).
+ OSVDB-112004: /login.pl: Site appears vulnerable to the 'shellshock' vulnerability (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6278).
+ OSVDB-3092: /login/: This might be interesting...
+ OSVDB-3092: /news: This might be interesting...
+ OSVDB-3093: /login.php3?reason=chpass2%20: This might be interesting... has been seen in web logs from an unknown scanner.
+ /login.asp: Admin login page/section found.
+ /login.html: Admin login page/section found.
+ /login.php: Admin login page/section found.
+ 7831 requests: 0 error(s) and 20 item(s) reported on remote host
+ End Time:           2018-03-28 16:10:27 (GMT8) (91 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

2.1. 生成 html 报告

perl nikto.pl -h xxxx -o result.html -F html

2.2. 扫描过程信息查看

扫描过程中

  • v显示详细扫描信息
  • d显示更加详细的扫描信息
  • e显示错误信息
  • p显示进度

3. Nikto 的一些参数设置:

-c(config):使用指定的config文件来替代安装在本地的config.txt文件。
-C(Cgidirs):扫描包含指定内容的CGI目录。所包含的内容在-C后面指定。如-C  /cgi/。
-D(Display):打开或关闭默认输出。输出选项:
       1     显示重定向
       2     显示获取的cookies信息
       3     显示所有200/OK的回应
       4     显示请求认证的URLs
       D     Debug输出
       V     冗余输出
-dbcheck:检查数据库和其它重要文件的句法错误。
-e(evasion):使用LibWhisker中对IDS的躲避技术,可使用以下几种类型:
       1     随机URL编码 (非UTF-8方式)
       2     自选择路径(/./)
       3     过早结束的URL
       4     优先考虑长随机字符串
       5     参数欺骗
       6     使用TAB作为命令的分隔符
       7     使用变化的URL
       8     使用Windows路径分隔符“\”
-f(findonly):只寻找HTTP或HTTPS端口,不进行完全扫描。
-F(Format):指定检测报告输出文件的格式,默认是txt文件格式(可以是htm、csv、txt或xml格式)
-h(host):指定目标主机,可以是IP或域名。
-H(Help):显示帮助信息。
-i(id):用于主机鉴定,其格式为:userid:password
-m(mutate):猜解更多的文件名:
       1     检测根目录下的所有文件
       2     猜测密码文件名
       3     通过Apache(/~user 请求类型)枚举用户名
       4     通过cgiwrap(/cgi-bin/cgiwrap/~user 请求类型)枚举用户名
-n(nolookup):不执行主机名查找。
-o(output):输出到指定文件
-p(port):指定使用的端口,默认为80。
-P(Pause):各项操作之间的延时时间。
-r(root):对所有请求优先考虑root的值,格式为:/目录名
-s(ssl):强制在端口上使用ssl模式
-S(Single):实行对单个目标的请求模式。
-t(timeout):超时时间,默认为2秒。
-T(Tuning):控制Nikto使用不同的方式对目标进行扫描
       0     检查文件上传页面
       1     检查Web日志
       2     检查错误配置或默认文件
       3     检查信息泄漏问题
       4     检查XSS/Script/HTML问题
       5     远程文件检索,从根目录检查是否存在可访问的文件
       6     检查拒绝服务问题
       7     远程文件检索,从任意文件检索是否存在可访问文件
       8     代码执行-远程shell,检查是否存在系统命令执行漏洞
       9     检查SQL注入漏洞
       a     检查认证绕过问题
       b     识别安装的软件版本
       c     检查源代码泄露问题
       x     反向链接选项
-u(useproxy):使用在config.txt中定义的代理。
-update:从cirt.net上升级数据库和插件。
-V(Version):显示插件和数据库的版本信息。
-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

猜你喜欢

转载自blog.csdn.net/u012206617/article/details/90065379