手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

怎样用 WPScan,Nmap 和 Nikto 扫描和检查一个 WordPress 站点的安全性

[日期:2015-04-26] 来源:Linux中国  作者:Linux [字体:大 中 小]

用 Nikto 扫描你网站的缺陷

Nikto 网络扫描器是一个开源的 web 服务器的扫描软件,它可以用来扫描 web 服务器上的恶意的程序和文件。Nikto 也可以用来检查软件版本是否过期。Nikto 能进行简单而快速地扫描以发现服务器上危险的文件和程序。扫描结束后会给出一个日志文件。`

 

在 Linux 服务器上下载和安装 Nikto

Perl 在 Linux 上是预先安装好的,所以你只需要从项目页面下载 nikto ,解压到一个目录里面,然后开始测试。

  1. wget https://cirt.net/nikto/nikto-2.1.4.tar.gz

你可以用某个归档管理工具解包,或者如下同时使用 tar 和 gzip :

  1. tar zxvf nikto-2.1.4.tar.gz
  2. cd nikto-2.1.4
  3. perl nikto.pl

安装正确的话会得到这样的结果:

  1. -***** SSL support not available (see docs for SSL install)*****
  2. -Nikto v2.1.4
  3. ---------------------------------------------------------------------------
  4. + ERROR:No host specified
  5. -config+Usethis config file
  6. -Cgidirs+ scan these CGI dirs:'none','all',or values like "/cgi/ /cgi-a/"
  7. -dbcheck check database and other key files for syntax errors
  8. -Display+Turn on/off display outputs
  9. -evasion+ ids evasion technique
  10. -Format+ save file (-o) format
  11. -host+ target host
  12. -HelpExtended help information
  13. -id+Host authentication to use, format is id:passor id:pass:realm
  14. -list-plugins List all available plugins
  15. -mutate+Guess additional file names
  16. -mutate-options+Provide extra information for mutations
  17. -output+Write output to this file
  18. -nocache Disables the URI cache
  19. -nossl Disablesusing SSL
  20. -no404 Disables404 checks
  21. -port+Port to use(default80)
  22. -Plugins+List of plugins to run (default: ALL)
  23. -root+Prepend root value to all requests, format is/directory
  24. -ssl Force ssl mode on port
  25. -SingleSingle request mode
  26. -timeout+Timeout(default2 seconds)
  27. -Tuning+Scan tuning
  28. -update Update databases and plugins from CIRT.net
  29. -vhost+Virtual host (forHost header)
  30. -VersionPrint plugin and database versions
  31. + requires a value
  32. Note:Thisis the short help output.Use-H for full help.

这个报错只是告诉我们没有给出必要的参数。SSL 支持可以通过安装相关的 perl ssl 模块得到(sudo apt-get install libnet-ssleay-perl)。

 

更新 nikto 数据库

在开始使用之前我们需要先更新 nikto 数据库:

  1. /usr/local/bin/nikto.pl -update

下面的命令可以列出可用的 nikto 插件。

  1. nikto.pl -list-plugins // To list the installed plugins //

 

扫描以寻找缺陷

我们用一个 url 来在做个简单的测试。

  1. perl nikto.pl -h http://www.host-name.com

输出样例

会有十分冗长的输出,可能一开始会让人感到困惑。许多 Nikto 的警报会返回 OSVDB 序号。这是由开源缺陷数据库(http://osvdb.org/)所指定。你可以在 OSVDB 上找出相关缺陷的深入说明。

  1. $ nikto -h http://www.host-name.com
  2. -Nikto v2.1.4
  3. ---------------------------------------------------------------------------
  4. +Target IP:1.2.3.4
  5. +TargetHostname: host-name.com
  6. +TargetPort:80
  7. +StartTime:2012-08-1114:27:31
  8. ---------------------------------------------------------------------------
  9. +Server:Apache/2.2.22(FreeBSD) mod_ssl/2.2.22OpenSSL/1.0.1c DAV/2
  10. + robots.txt contains 4 entries which should be manually viewed.
  11. + mod_ssl/2.2.22 appears to be outdated (current is at least 2.8.31)(may depend on server version)
  12. +ETag header found on server, inode:5918348, size:121, mtime:0x48fc943691040
  13. + mod_ssl/2.2.22OpenSSL/1.0.1c DAV/2- mod_ssl 2.8.7and lower are vulnerable to a remote buffer overflow which may allow a remote shell (difficult to exploit). CVE-2002-0082, OSVDB-756.
  14. +Allowed HTTP Methods: GET, HEAD, POST, OPTIONS, TRACE
  15. + OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST
  16. +/lists/admin/:PHPList pre 2.6.4 contains a number of vulnerabilities including remote administrative access, harvesting user info and more.Default login to admin interfaceis admin/phplist
  17. + OSVDB-2322:/gallery/search.php?searchstring=<script>alert(document.cookie)</script>: Gallery 1.3.4 and below is vulnerable to Cross Site Scripting (XSS). Upgrade to the latest version. http://www.securityfocus.com/bid/8288.
  18. + OSVDB-7022:/calendar.php?year=<script>alert(document.cookie);</script>&month=03&day=05: DCP-Portal v5.3.1is vulnerable to CrossSiteScripting(XSS). http://www.cert.org/advisories/CA-2000-02.html.
  19. + OSVDB-3233:/phpinfo.php:Contains PHP configuration information
  20. + OSVDB-3092:/system/:This might be interesting...
  21. + OSVDB-3092:/template/:This may be interesting as the directory may hold sensitive files or reveal system information.
  22. + OSVDB-3092:/updates/:This might be interesting...
  23. + OSVDB-3092:/README: README file found.
  24. +6448 items checked:1 error(s)and14 item(s) reported on remote host
  25. +EndTime:2012-08-1115:52:57(5126 seconds)
  26. ---------------------------------------------------------------------------
  27. +1 host(s) tested
  28. $

Nikto 是一个非常轻量级的通用工具。因为 Nikto 是用 Perl 写的,所以它可以在几乎任何服务器的操作系统上运行。

希望这篇文章能在你检查 wordpress 站点的缺陷的时候给你一些提示。我之前的文章如何安全加固 WordPress 站点记录了一个清单,可以让你保护你的 WordPress 站点的工作变得更简单。

有想说的,留下你的评论。

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-04/116718.htm

linux
相关资讯       NMAP  Nikto  WordPress安全  WPScan 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款