Nikto 渗透测试工具的使用

环境搭建: 1: perl 支持环境 :https://soft.china.com/details/65/2655181.html
                   2:   Nikto 下载:https://github.com/sullo/nikto/releases
                   3:dmake 下载:https://metacpan.org/release/SHAY/dmake-4.12.2.2 

遇到的问题:运行时提示: ERROR: Required module not found: XML::Writer ,可通过命令: cpan install XML::Writer  安装解决,但是需要手动下载dmake安装包,解压后放到安装好的perl目录bin目录下。

 

📋 常用命令

1. 基础扫描:

nikto -h http://target.com


2. 指定端口扫描:

nikto -h http://target.com -p 8080,8443


3. HTTPS 扫描:

nikto -h https://target.com -ssl


4. 扫描多个主机:

nikto -h targets.txt # 主机列表文件


5. 保存报告:

# HTML 格式

nikto -h http://target.com -o report.html -Format html

# CSV 格式

nikto -h http://target.com -o report.csv -Format csv

# XML 格式

nikto -h http://target.com -o report.xml -Format xml


6. 交互式选项:

nikto -h http://target.com -Display V # 显示详细扫描过程

nikto -h http://target.com -Tuning 1 # 仅扫描信息类漏洞

⚙️ 常用参数

参数

作用

-h

目标主机

-p

指定端口(默认80/443)

-ssl

强制 SSL/HTTPS

-o

输出文件

-Format

输出格式(html, csv, xml, txt)

-Tuning

调优扫描类型(1-9,不同类别)

-mutate

暴力猜测子域名/文件名

-evasion

使用编码绕过简单 IDS

-timeout

超时时间

-id

HTTP 认证(user:pass)

-cookie

设置 Cookie
-Pause

每请求间隔时间
🎮 扫描类型调优(-Tuning)

类型

说明

-Tuning 1

文件上传/执行类漏洞

-Tuning 2

默认文件/错误文件

-Tuning 3

信息泄露

-Tuning 4

注入(XSS/SQL等)

-Tuning 5

远程文件获取

-Tuning 9

拒绝服务

💡 使用场景

场景1:上线前安全检测

nikto -h https://your-site.com -o pre-deploy-scan.html -Format html

Web 应用上线前,扫描是否存在已知漏洞

场景2:渗透测试信息收集

nikto -h http://target.com -p 80,443,8080 -ssl

快速了解目标服务器的指纹和暴露面

场景3:CTF 比赛

nikto -h http://challenge-server -Tuning 1,2,3

发现比赛环境中的配置错误和可利用点

场景4:授权红队测试

nikto -h 192.168.1.100 -p 1-1000 -ssl

对内网 Web 系统进行全面的漏洞排查

场景5:监控复检

nikto -h https://site.com -o scan_v2.xml -Format xml

# 与之前版本对比,验证修复

⚠️ 注意事项

仅扫描已授权目标 — 未授权扫描属违法行为!

扫描可能触发 IDS/IPS — 目标有防护会报警

扫描速度较慢 — 全量扫描可能要几十分钟

不能替代人工测试 — Nikto 只做已知漏洞匹配,逻辑漏洞发现不了

误报率较高 — 扫描结果需人工验证

🔧 实战示例

# 完整扫描 + 报告

nikto -h https://example.com -ssl -o full_scan.html -Format html -Tuning 1,2,3,4,5
————————————————
版权声明:本文为CSDN博主「aovenus」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/aovenus/article/details/159966107

posted @ 2026-10-30 18:38  fogwu  阅读(10)  评论(0)    收藏  举报