Nikto is a classic web server vulnerability scanner. Core advantages:Rich checks(7000+ items) + ready to use out of the box(no configuration required) + broad coverage(outdated software/dangerous files/misconfigurations/known vulnerabilities).
Project address:https://github.com/sullo/nikto
Phase 1: Basic Scanning
# 扫描单个目标
nikto -h http://target.com
# 指定端口
nikto -h target.com -p 8080
# HTTPS 扫描
nikto -h https://target.com
Multi-port scanning
nikto -h target.com -p 80,443,8080,8443
## Phase 2: 扫描调优
```bash
# 指定扫描类型(Tuning)
# 1=文件上传 2=默认文件 3=信息泄露 4=注入 5=远程获取 6=DoS 7=远程shell 8=命令执行 9=SQL注入
nikto -h http://target.com -Tuning 123489
# 只做信息泄露检查
nikto -h http://target.com -Tuning 3
# 排除 DoS 类检查
nikto -h http://target.com -Tuning x6
# 指定插件
nikto -h http://target.com -Plugins apache_expect_xss,ssl
# 设置最大扫描时间
nikto -h http://target.com -maxtime 300
Phase 3: Authentication and Proxies
# Basic Auth
nikto -h http://target.com -id admin:password
# Cookie 认证
nikto -h http://target.com -Add-header "Cookie: session=abc123"
# 自定义 User-Agent
nikto -h http://target.com -useragent "Mozilla/5.0"
# 通过代理
nikto -h http://target.com -useproxy http://127.0.0.1:8080
# 禁用 404 猜测(减少误报)
nikto -h http://target.com -no404
Phase 4: Output Formats
# JSON 输出
nikto -h http://target.com -Format json -output results.json
# HTML 报告
nikto -h http://target.com -Format html -output report.html
# CSV 输出
nikto -h http://target.com -Format csv -output results.csv
# XML 输出
nikto -h http://target.com -Format xml -output results.xml
Common Scenario Quick Reference
| Scenario | Command |
|---|---|
| Quick scan | nikto -h http://target.com -maxtime 120 |
| Comprehensive scan | nikto -h http://target.com -Tuning 123456789abc |
| SSL check | nikto -h https://target.com -Plugins ssl |
| Information disclosure | nikto -h http://target.com -Tuning 3 |
| Scan with authentication | nikto -h http://target.com -id admin:pass |