Table of Contents#
- Installing Nikto on Linux
- Basic Nikto Scan
- Understanding Nikto Output
- Advanced Scanning Techniques
- Common Practices & Tips
- Best Practices for Effective Scanning
- Practical Examples
- Conclusion
- References
Installing Nikto on Linux#
Nikto is available in most Linux repositories. Here are installation methods for popular distros:
Debian/Ubuntu#
sudo apt update
sudo apt install niktoFedora/RHEL/CentOS#
sudo dnf install nikto # Fedora
sudo yum install nikto # RHEL/CentOS 7Arch Linux#
sudo pacman -S niktoVerify Installation#
nikto -VersionOutput: Nikto v2.5.0
Basic Nikto Scan#
Perform your first scan against a target domain or IP:
nikto -h http://example.comCommand Breakdown:
-h: Specifies the target host (HTTP/HTTPS).
Output Explained:#
- Nikto v2.5.0
- Target IP: 93.184.216.34
- Target Hostname: example.com
- Server: ECS (netlify/1.24.0)
+ Allowed HTTP Methods: GET, HEAD
+ /: Default account found for 'admin:admin'
+ /config/: Directory indexing enabled.
+ /backup/: Apache/2.4.7 appears outdated.
🚩 Key Indicators:
- Outdated software versions
- Exposed directories
- Default credentials
- Risky HTTP methods (e.g., PUT/DELETE)
Understanding Nikto Output#
Nikto categorizes findings using symbols:
+: Information-: Minor concern*: Important issue!: Severe vulnerability
Common Findings:#
- OSVDB Entries: References to Open Source Vulnerability Database IDs.
- HTTP Methods: Dangerous methods like
PUTorTRACE. - Cookie Security: Missing
HttpOnlyorSecureflags. - Directory Listings: Exposed sensitive directories.
- Server Version Disclosure: Exposes software versions.
Advanced Scanning Techniques#
Scan with Specific Port#
nikto -h http://example.com -p 8080Use SSL/HTTPS#
nikto -h https://example.com -sslAuthenticated Scans#
nikto -h http://example.com -id admin:password(-id provides username:password for HTTP Basic Auth)
Save Results to File#
nikto -h http://example.com -o scan_report.html -F htmlFormats: csv, txt, xml, nbe (Nessus).
Evasion Techniques (Stealth)#
nikto -h http://example.com -evasion 1Evasions:
1: Random URL encoding2: Directory self-reference3: Premature URL termination
Common Practices & Tips#
-
Combine with Proxies: Pipe Nikto through
proxychainsfor anonymity:proxychains nikto -h http://example.com -
Scan Multiple Hosts: Use file input:
nikto -h hosts.txt(Where
hosts.txtcontains one target per line) -
Performance Tuning:
- Speed up with
-Tuning x(e.g.,x=1scans for files only). - Slow down with
-delay 2(seconds) to evade rate limiting.
- Speed up with
-
Check Plugins: Nikto supports plugins for extended checks:
nikto -h http://example.com -Plugins cgi,robots
Best Practices for Effective Scanning#
- Permissions First: Always obtain written authorization.
- Schedule Off-Peak Scans: Avoid disrupting production traffic.
- Combine Tools: Use Nikto alongside OWASP ZAP, Nmap, or Burp Suite.
- Update Nikto Regularly:
nikto -update - Review False Positives: Manually verify critical findings.
- Scan Staging Environments: Test pre-production sites first.
Practical Examples#
Example 1: Full Audit with Reporting#
nikto -h https://test-site.local \
-ssl \
-Tuning 1,2,3,4,5,6,7,8,9 \ # Scan all types
-o report.xml \
-Format xmlExample 2: Check for XSS/CGI Risks#
nikto -h http://vulnerable-app.org \
-Plugins "cgi,xss" \
-evasion 1 # Evade basic WAFsExample 3: Aggressive Scan with Authentication#
nikto -h http://dev.internal \
-id api_user:S3curePass! \
-Tuning 0 \ # Disable tuning (scan all checks)
-timeout 3 \ # Faster timeout (seconds)
-Display v # Verbose modeConclusion#
Nikto is an indispensable tool for rapid web server reconnaissance. Its ability to detect misconfigurations, outdated software, and common vulnerabilities makes it a staple in security workflows. While not a replacement for manual testing or DAST suites, it provides a critical first layer of defense by identifying obvious weaknesses before attackers do.
Always update Nikto before scans, combine it with other tools, and adhere to ethical guidelines. Happy scanning!