What is Nikto?
Nikto is an open-source web server scanner that performs comprehensive tests against web servers for multiple security items. It's designed to find various default files, programs, and configurations that may pose security risks.
Nikto scans web servers for over 6700 potentially dangerous files and programs, checks for outdated server software versions, identifies configuration issues, and tests for various web server vulnerabilities.
Dangerous File Detection
Identifies potentially dangerous files, programs, and default installations
Server Version Detection
Detects outdated server software and specific version information
Configuration Testing
Tests for common configuration issues and security misconfigurations
Directory Enumeration
Discovers hidden directories and default installation paths
Nikto can be noisy and may trigger intrusion detection systems. Always obtain explicit permission before scanning any target. Avoid scanning production systems during peak hours to minimize disruption.
Installation Methods
Option 1: Git Repository (Recommended)
This method ensures you have the latest version with all recent updates and vulnerability checks.
git clone https://github.com/sullo/nikto.git
cd nikto/programThe main executable script is nikto.pl located in the program directory.
Option 2: Docker Installation
For containerized environments or when you prefer Docker-based tools.
git clone https://github.com/sullo/nikto.git
cd nikto
docker build -t sullo/nikto .Option 3: Package Managers
Some Linux distributions include Nikto in their package repositories.
sudo apt update && sudo apt install niktosudo pacman -S niktoBasic Usage & First Scan
Your First Nikto Scan
Run a simple scan against a target. Replace http://target.example.com with your authorized target URL.
./nikto.pl -h http://target.example.comperl nikto.pl -h http://target.example.comdocker run --rm sullo/nikto -h http://target.example.comUnderstanding Nikto Output
Nikto provides detailed output that helps identify potential security issues:
Key Output Elements:
| Element | Description | Security Implication |
|---|---|---|
| Server Headers | Web server software and version | Identify outdated versions with known vulnerabilities |
| Interesting Files | Config files, backups, info pages | Potential information disclosure |
| CGI Directories | Executable script directories | Potential command execution vulnerabilities |
| HTTP Methods | Allowed HTTP verbs | Identify dangerous methods (PUT, DELETE, etc.) |
| OSVDB References | Vulnerability database IDs | Reference for known vulnerabilities |
Advanced Options & Configuration
Essential Scanning Options
Nikto offers numerous options to customize scanning behavior for different scenarios.
./nikto.pl -h http://target.example.com -Tuning 34./nikto.pl -h http://target.example.com -Tuning x68./nikto.pl -h http://target.example.com -evasion 14./nikto.pl -h http://target.example.com -mutate 16Authentication & Session Options
./nikto.pl -h http://target.example.com -id username:password./nikto.pl -h http://target.example.com -usecookiesOutput & Reporting Options
./nikto.pl -h http://target.example.com -Format xml -o scan_report.xml./nikto.pl -h http://target.example.com -Format csv -o scan_results.csv./nikto.pl -h http://target.example.com -Save ./saved_responsesAdvanced Scanning Techniques
Targeted Scanning Strategies
Combine multiple options for powerful, targeted security assessments.
./nikto.pl -h http://target.example.com -Tuning 1234567890abc -Format xml -o full_scan.xml -Pause 2Performs a thorough scan with all tuning options, outputs to XML, and pauses 2 seconds between requests to avoid detection.
./nikto.pl -h http://target.example.com -Cgidirs /cgi-bin/ -id user:password -Display EFocuses on CGI directories, uses authentication, and shows only HTTP errors for cleaner output.
./nikto.pl -h 192.168.1.100 -vhost app.example.com -port 443 -sslScans a specific virtual host on HTTPS port with proper host header.
Maintenance & Updates
Keep Nikto updated and maintain database integrity for optimal performance.
./nikto.pl -updateDownloads the latest vulnerability databases and plugin updates from CIRT.net.
./nikto.pl -dbcheckValidates the syntax and integrity of Nikto's databases.
./nikto.pl -list-pluginsDisplays all available plugins that Nikto can use for specialized tests.
Always update Nikto before starting a new assessment. The web security landscape changes rapidly, and new vulnerabilities are discovered constantly. Regular updates ensure you're testing for the latest security issues.
Practical Activities & Scenarios
- Identify the target web server and obtain proper authorization
- Run a basic Nikto scan to gather initial information
- Analyze the output for server version and configuration details
- Identify potentially dangerous files and directories
- Document all findings with severity ratings
- Generate a comprehensive report in XML format
./nikto.pl -h http://target.example.com -Tuning 1234567890abc -Format xml -o assessment_report.xml -Pause 1- Use evasion techniques to avoid IDS/IPS detection
- Implement rate limiting to reduce scan noise
- Focus on high-value targets using tuning options
- Use mutation to discover hidden resources
- Save all positive responses for offline analysis
./nikto.pl -h http://target.example.com -evasion 1234 -Tuning 2349 -mutate 1 -Pause 3 -Save ./stealth_responses- Identify authentication-protected areas
- Use valid credentials to scan protected sections
- Test for session management issues
- Check for authentication bypass vulnerabilities
- Document access control issues
./nikto.pl -h http://target.example.com -id user:password -usecookies -Tuning 489aTroubleshooting & Common Issues
Common Problems and Solutions
Connection and Network Issues
| Issue | Cause | Solution |
|---|---|---|
| "Target not supplied" | Missing -h parameter or target URL |
Ensure you include -h http://target in your command |
| "Connection refused" | Server is down or wrong port/URL | Verify server connectivity and check port specification |
| SSL/TLS errors | Certificate issues or wrong port | Use -ssl for HTTPS ports or -nossl to force HTTP |
Performance and Output Issues
| Issue | Cause | Solution |
|---|---|---|
| Slow scans | Network latency or server response time | Use -Tuning to focus scans, increase -timeout |
| False positives | Generic checks matching non-issues | Use -IgnoreCode for known false positives |
| No output file | Wrong path or permissions | Check directory permissions and use absolute paths |
Nikto is a powerful scanning tool that can generate significant network traffic and trigger security alerts. Always:
- Obtain explicit written permission before scanning
- Schedule scans during off-peak hours for production systems
- Use rate limiting (
-Pause) to minimize impact - Inform relevant stakeholders about scanning activities
- Have a rollback plan for critical systems
Conclusion
Nikto remains one of the most comprehensive and reliable web server scanners available. Its extensive database of vulnerability checks, flexible configuration options, and powerful reporting capabilities make it an essential tool for any web security assessment.
- Nikto provides comprehensive web server security testing with minimal configuration
- Advanced options allow for targeted, stealthy, and authenticated scanning
- Regular updates ensure coverage of the latest vulnerabilities
- Multiple output formats enable integration with other security tools
- Proper tuning and mutation can significantly improve scan results
- Always operate within authorized scopes and follow ethical guidelines
Web security scanning tools like Nikto are powerful instruments that must be used responsibly. Always ensure you have explicit, written permission before scanning any systems. Unauthorized scanning is not only unethical but also illegal in many jurisdictions. Use these skills to improve security posture, not to compromise systems.