Nikto扫描器,扫描网站信息

Nikto 是一个功能强大的开源 Web 服务器扫描器,能够检测出 Web 服务器中的常见漏洞和配置错误。下面是如何安装和使用 Nikto 的步骤。

安装 Nikto

在 Ubuntu 22.04 上安装 Nikto:

sudo apt update
sudo apt install nikto

使用 Nikto 进行扫描

  1. 基本扫描

    使用 Nikto 扫描一个 Web 服务器,执行以下命令:

    nikto -h <目标网址或IP地址>
    

    示例:

    nikto -h www.example.com
    
  2. 扫描指定端口

    如果 Web 服务器运行在非默认端口上,可以指定端口进行扫描:

    nikto -h <目标网址或IP地址> -p <端口号>
    

    示例:

    nikto -h www.example.com -p 8080
    
  3. 输出结果到文件

    可以将扫描结果保存到文件中以便稍后查看:

    nikto -h <目标网址或IP地址> -o <输出文件名> -F <输出格式>
    

    其中 <输出格式> 可以是 txt, csv, htm, nbe 等格式。

    示例:

    nikto -h www.example.com -o scan_results.txt -F txt
    
  4. 使用 SSL 扫描

    如果目标网站使用 HTTPS,可以使用 -ssl 选项:

    nikto -h <目标网址或IP地址> -ssl
    

    示例:

    nikto -h www.example.com -ssl
    
  5. 使用代理进行扫描

    如果你需要通过代理进行扫描,可以使用以下命令:

    nikto -h <目标网址或IP地址> -useproxy <代理地址:端口>
    

    示例:

    nikto -h www.example.com -useproxy 127.0.0.1:8080
    

示例输出

运行以下命令:

nikto -h www.example.com

可能会得到如下输出:

- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          93.184.216.34
+ Target Hostname:    www.example.com
+ Target Port:        80
+ Start Time:         2024-07-04 12:34:56 (GMT)
---------------------------------------------------------------------------
+ Server: Apache/2.4.7 (Ubuntu)
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The X-Content-Type-Options header is not set. This can allow the user agent to interpret files as a different MIME type
+ Allowed HTTP Methods: GET, HEAD, POST, OPTIONS 
+ OSVDB-3092: /admin/: This might be interesting...
+ OSVDB-3268: /icons/: Directory indexing is enabled
+ OSVDB-3092: /test/: This might be interesting...
+ 6474 requests: 0 error(s) and 8 item(s) reported on remote host
+ End Time:           2024-07-04 12:35:56 (GMT) (60 seconds)
---------------------------------------------------------------------------

解释

  • Target IP: 目标服务器的 IP 地址。
  • Target Hostname: 目标服务器的主机名。
  • Target Port: 扫描的端口号。
  • Start Time: 扫描开始时间。
  • Server: 目标服务器的服务器类型和版本。
  • 扫描结果: 列出了发现的潜在漏洞和配置问题,例如未设置的安全头部、启用的目录索引等。
  • End Time: 扫描结束时间。

通过这些步骤和命令,你可以使用 Nikto 来检测 Web 服务器中的潜在漏洞,并采取相应的安全措施。如果你有任何进一步的问题或需要更详细的解释,请告诉我。

Nikto是一款Web安全扫描工具,可以扫描指定主机的web类型,主机名,特定目录,cookie,特定CGI漏洞,XSS漏洞,SQL注入漏洞等,非常强大滴说。。。 root@91ri.org:~# cd /pentest/web/nikto/ root@91ri.org:/pentest/web/nikto# ls docs nikto.conf nikto.pl plugins templates root@91ri.org:/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. 升级插件 root@91ri.org:/pentest/web/nikto# ./nikto.pl -update -h 指定扫描的目标 –p 端口 root@91ri.org:/pentest/web/nikto# ./nikto.pl -h www.91ri.org -p 80 -C 指定CGI目录 –all表示猜解CGI目录 root@91ri.org:/pentest/web/nikto# ./nikto.pl -h www.91ri.org -C all -T选项包含很多小选项 –T 9表示扫描SQL注入漏洞 root@91ri.org:/pentest/web/nikto# ./nikto.pl -h www.91ri.org -T 9 -D指定输出显示 2显示cookies root@91ri.org:/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 反向链接选项
### Nikto 安全漏洞扫描工具简介 Nikto 是一款专门用于扫描 Web 服务器的安全评估工具,能够识别多种类型的潜在安全风险。该工具可以检测超过 6700 种危险文件/程序,并检查配置错误以及过期的 cgi 文件等问题[^3]。 ### 获取与安装 对于大多数 Linux 发行版而言,可以通过包管理器轻松获取 Nikto: #### Ubuntu / Debian ```bash sudo apt-get update && sudo apt-get install nikto ``` #### CentOS / RHEL ```bash yum install epel-release yum install nikto ``` 或者也可以直接从源码编译安装最新版本。 ### 基本命令选项 - `-h` 或者 `--host`: 指定目标主机地址。 - `-p` 或者 `--port`: 设置端口号,默认为80 (HTTP) 和443 (HTTPS)。 - `-o` 或者 `--output`: 输出报告到指定文件中保存结果。 - `-Tuning` : 控制插件执行行为, 可以选择不同的组合来优化性能或覆盖范围。 例如要对某网站进行全面扫描并导出HTML格式的结果: ```bash nikto -h http://example.com -o report.html -Format html ``` ### 高级功能介绍 除了基本的功能外,Nikto 还支持自定义插件扩展其能力;允许用户创建自己的测试脚本来满足特殊需求。此外还提供了代理设置、SSL/TLS 支持等功能以便更好地适应各种环境下的应用。 ### 注意事项 尽管 Nikto 功能强大,在实际操作前应当获得合法授权以免触犯法律。同时由于某些高强度扫描可能会给目标站点带来较大负载甚至影响正常服务,请谨慎调整参数强度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

MonkeyKing.sun

对你有帮助的话,可以打赏

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

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

打赏作者

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

抵扣说明:

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

余额充值