Web server vulnerability scanner for identifying security issues, misconfigurations, and outdated software versions...
Nikto is an open-source web server scanner that performs comprehensive tests against web servers for multiple security issues including dangerous files, outdated software versions, and server misconfigurations. This skill covers authorized security assessments of web servers and applications.
IMPORTANT: Nikto generates significant traffic and is easily detected. Only use with proper written authorization on systems you own or have explicit permission to test.
Basic web server scanning:
# Scan single host
nikto -h http://example.com
# Scan with SSL
nikto -h https://example.com
# Scan specific port
nikto -h example.com -p 8080
# Scan multiple ports
nikto -h example.com -p 80,443,8080
Progress: [ ] 1. Verify authorization for web server testing [ ] 2. Identify target web servers and ports [ ] 3. Perform initial reconnaissance scan [ ] 4. Run comprehensive vulnerability assessment [ ] 5. Analyze and categorize findings [ ] 6. Document vulnerabilities with remediation [ ] 7. Generate and deliver security report [ ] 8. Verify no testing artifacts remain
Work through each step systematically. Check off completed items.
CRITICAL: Before any web server scanning:
Perform basic web server scans:
# Standard scan
nikto -h http://example.com
# Scan with specific User-Agent
nikto -h http://example.com -useragent "Mozilla/5.0..."
# Scan through proxy
nikto -h http://example.com -useproxy http://proxy:8080
# Scan with authentication
nikto -h http://example.com -id username:password
# SSL/TLS scan
nikto -h https://example.com -ssl
# Force SSL even on non-standard ports
nikto -h example.com -p 8443 -ssl
Customize scan behavior:
# Specify tuning options
nikto -h http://example.com -Tuning 123bde
# Enable all checks (very comprehensive)
nikto -h http://example.com -Tuning x
# Scan multiple hosts from file
nikto -h hosts.txt
# Limit to specific checks
nikto -h http://example.com -Plugins "apache_expect_xss"
# Update plugin database
nikto -update
# Display available plugins
nikto -list-plugins
Tuning Options:
Generate scan reports:
# Output to text file
nikto -h http://example.com -o results.txt
# Output to HTML report
nikto -h http://example.com -o results.html -Format html
# Output to CSV
nikto -h http://example.com -o results.csv -Format csv
# Output to XML
nikto -h http://example.com -o results.xml -Format xml
# Multiple output formats
nikto -h http://example.com -o results.txt -Format txt -o results.html -Format html
Optimize scan performance:
# Increase timeout (default 10 seconds)
nikto -h http://example.com -timeout 20
# Limit maximum execution time
nikto -h http://example.com -maxtime 30m
# Use specific HTTP version
nikto -h http://example.com -vhost example.com
# Follow redirects
nikto -h http://example.com -followredirects
# Disable 404 guessing
nikto -h http://example.com -no404
# Pause between tests
nikto -h http://example.com -Pause 2
Evade detection (authorized testing only):
# Use random User-Agent strings
nikto -h http://example.com -useragent random
# Inject random data in requests
nikto -h http://example.com -evasion 1
# Use IDS evasion techniques
nikto -h http://example.com -evasion 12345678
# Pause between requests
nikto -h http://example.com -Pause 5
# Use session cookies
nikto -h http://example.com -cookies "session=abc123"
Evasion Techniques:
Document all Nikto scanning activities:
# Scan external web servers
for host in web1.example.com web2.example.com; do
nikto -h https://$host -o nikto_${host}.html -Format html
done
# Scan common web ports
nikto -h example.com -p 80,443,8080,8443 -o external_scan.txt
# Comprehensive internal scan
nikto -h http://intranet.local \
-Tuning 123456789abcde \
-timeout 30 \
-maxtime 2h \
-o internal_assessment.html -Format html
# SSL-specific testing
nikto -h https://example.com \
-Plugins "ssl" \
-ssl \
-o ssl_assessment.txt
# Scan with authentication
nikto -h http://example.com \
-id admin:password \
-cookies "sessionid=abc123" \
-Tuning 123456789 \
-o authenticated_scan.html -Format html
# Create host file
cat > web_servers.txt <<EOF
http://web1.example.com
https://web2.example.com:8443
http://web3.example.com:8080
EOF
# Scan all hosts
nikto -h web_servers.txt -o bulk_scan.csv -Format csv
#!/bin/bash
# ci_nikto_scan.sh - Automated web security scanning
TARGET_URL="$1"
OUTPUT_DIR="nikto_results/$(date +%Y%m%d_%H%M%S)"
mkdir -p "$OUTPUT_DIR"
# Run Nikto scan
nikto -h "$TARGET_URL" \
-Tuning 123456789 \
-maxtime 30m \
-o "$OUTPUT_DIR/nikto_report.xml" -Format xml
# Check for critical findings
if grep -i "OSVDB" "$OUTPUT_DIR/nikto_report.xml"; then
echo "CRITICAL: Vulnerabilities detected!"
exit 1
fi
echo "Scan completed successfully"
exit 0
# Export findings to JSON for SIEM
nikto -h http://example.com -o findings.xml -Format xml
# Parse XML to JSON (requires xmlstarlet or similar)
xmlstarlet sel -t -m "//item" -v "concat(@id,',',description,','
,uri)" -n findings.xml > findings.csv
Solutions:
# Limit scan duration
nikto -h http://example.com -maxtime 15m
# Reduce tuning scope
nikto -h http://example.com -Tuning 123
# Disable 404 checking
nikto -h http://example.com -no404
Solutions:
# Force SSL
nikto -h example.com -ssl -p 443
# Ignore SSL certificate errors
nikto -h https://example.com -ssl -nossl
# Specify SSL version
nikto -h https://example.com -ssl
Solutions:
Solutions:
# Use evasion techniques
nikto -h http://example.com -evasion 1234567
# Add delays
nikto -h http://example.com -Pause 10
# Use custom User-Agent
nikto -h http://example.com -useragent "legitimate-browser-string"
Protect web servers against Nikto scanning:
Web Application Firewall Rules:
Server Hardening:
Detection and Monitoring:
Common Nikto detection signatures: