Nikto Web 服务器扫描工具详解
简介Nikto 是一款开源的 Web 服务器扫描工具由 CIRT.net 开发用于发现 Web 服务器的安全漏洞、配置问题和潜在风险。 安装Linux/macOS# Via aptsudo apt-get install nikto# Via Perl手动安装git clone https://github.com/sullo/niktocd nikto/programWindows需要 Perl 环境如 Strawberry Perl下载地址https://github.com/sullo/nikto 核心功能功能说明漏洞扫描检测服务器上已知的安全漏洞服务器指纹识别服务器类型、版本、操作系统配置检查发现配置错误和安全风险敏感文件扫描查找老旧/备份文件、配置文件泄露CGI 检测发现可能存在风险的 CGI 脚本 常用命令1. 基础扫描nikto -h http://target.com2. 指定端口扫描nikto -h http://target.com -p 8080,84433. HTTPS 扫描nikto -h https://target.com -ssl4. 扫描多个主机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 xml6. 交互式选项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超时时间-idHTTP 认证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 htmlWeb 应用上线前扫描是否存在已知漏洞场景2渗透测试信息收集nikto -h http://target.com -p 80,443,8080 -ssl快速了解目标服务器的指纹和暴露面场景3CTF 比赛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# 快速探查nikto -h http://example.com -p 80 -Tuning 9# 带认证扫描nikto -h http://example.com -id admin:password123# 绕过简单防护编码混淆nikto -h http://example.com -evasion 1,2典型输出示例- Nikto v2.1.6--------------------------------------------------------------------------- Target IP: 192.168.1.10 Target Hostname: www.example.com Target Port: 443 Start Time: 2026-04-08 18:00--------------------------------------------------------------------------- Server: Apache/2.4.41 (Ubuntu) /robots.txt - Retrieval of robots.txt rules (permitted) /admin/ - Admin page found (403 Forbidden) /backup.zip - Potentially dangerous file found /config.php~ - Backup file found (critical!) Apache mod_ssl/2.4.41 - OpenSSL vulnerability (CVE-XXXX-XXXX)---------------------------------------------------------------------------总结Nikto 是 Web 安全测试的入门级扫描器适合快速发现已知漏洞和配置问题但不能替代专业的渗透测试工具如 Burp Suite、OWASP ZAP。用于授权的安全检测和CTF都很不错