Updated November 2026: checked against Nikto 2.6.1, with the current tuning codes and output formats, a fixed mitmproxy example, and a new section on scanning a site’s origin server.
Nikto comes preinstalled on Kali Linux, so this Nikto tutorial for Kali Linux starts with the one command most people need: nikto -h https://example.com. That runs a full scan of a single web server and prints each finding as it goes. The rest of this guide covers tuning the scan, saving reports, routing it through a proxy and what to do when the target sits behind Cloudflare.
Nikto is one of the best-known open-source web server scanners in the penetration tester’s toolkit. Chris Sullo wrote it in Perl, and it has been around for over two decades, but it is still genuinely useful for quickly finding misconfigurations, outdated software and known vulnerabilities on web servers.
What is Nikto?
Nikto is a command-line web server scanner that checks targets against a database of over 7,000 potentially dangerous files, outdated server versions and common misconfigurations. It supports HTTP and HTTPS, can scan multiple ports, and saves results in several formats. It is part of Kali’s default tool set and is easy to install on any Debian-based system.
It’s worth being clear about what Nikto is and isn’t. It’s a noisy scanner. It makes no attempt to be stealthy, and any competent IDS or WAF will spot it straight away. That makes it ideal for authorised assessments of your own infrastructure, CTF boxes and lab environments, but unsuitable where stealth matters. Always get written permission before scanning any system you don’t own.
Installing and Updating Nikto on Kali Linux
On a standard Kali install Nikto is already there. Kali’s tools page lists it in the kali-linux-default metapackage. Check which version you have with:
nikto -Version
If you’re on a minimal Kali image, or any other Debian-based system, install it from the repositories:
sudo apt update && sudo apt install nikto
To update an existing install on Kali, upgrade the package:
sudo apt update && sudo apt install --only-upgrade nikto
You can also clone the latest version straight from GitHub and run it with Perl. Run git pull in that folder later to update it:
git clone https://github.com/sullo/nikto cd nikto/program perl nikto.pl -h example.com
Basic Usage
The simplest scan just needs a host:
nikto -h example.com
By default Nikto doesn’t tell you much while it runs. Verbose output shows what’s happening in real time, and P prints progress:
nikto -Display VP -h example.com
To scan a specific port (useful when a web server isn’t on the default port):
nikto -h example.com -p 8443
To use HTTPS, either pass a full https:// URL or force SSL mode on the port with -ssl:
nikto -h https://example.com nikto -h example.com -p 8443 -ssl
A full scan can take a long time against a slow server. -maxtime caps the time spent on each host:
nikto -h example.com -maxtime 30m
Tuning Scans
One of Nikto’s most useful features is the -Tuning flag, which limits the scan to specific test categories rather than running everything. That speeds things up and cuts the noise when you’re looking for something particular. These are the codes in Nikto 2.6:
- 1 – Interesting File / Seen in logs
- 2 – Misconfiguration / Default File
- 3 – Information Disclosure
- 4 – Injection (XSS/Script/HTML)
- 5 – Remote File Retrieval – Inside Web Root
- 6 – Denial of Service
- 7 – Remote File Retrieval – Server Wide
- 8 – Command Execution / Remote Shell
- 9 – SQL Injection
- 0 – File Upload
- a – Authentication Bypass
- b – Software Identification
- c – Remote Source Inclusion
- d – WebService
- e – Administrative Console
- x – Reverse Tuning (run everything except the codes that follow)
For example, to run only the SQL injection checks:
nikto -Tuning 9 -h example.com
Or to run everything except the Denial of Service tests:
nikto -Tuning x6 -h example.com
Saving Results
Nikto writes results to a file with -o (short for -output), and -Format picks the format: csv, json, htm, sql, txt or xml. If you leave out -Format, Nikto takes the format from the file extension. For example, to run an information disclosure scan and save it as an HTML report with verbose terminal output:
nikto -Display V -o results.html -Format htm -Tuning 3 -h example.com
The JSON and XML formats are the handy ones if you want to feed results into another tool or parse them with a script.
Using a Proxy with Nikto
You can send Nikto’s traffic through an HTTP proxy with the -useproxy flag. It takes a URL in the form http://server:port, or uses the proxy set in nikto.conf if you give it no argument. This is useful for capturing requests in Burp Suite:
nikto -h example.com -useproxy http://127.0.0.1:8080
Nikto and Cloudflare: Why Scans Get Blocked
If your target sits behind Cloudflare, you’ll quickly hit a frustrating problem: Nikto’s requests get blocked before they reach the origin server, often with a 403, a challenge page or a dropped connection.
It isn’t the User-Agent that gives it away. Nikto 2.6 sends a normal browser User-Agent from its own database by default. Several other things do:
- The TLS fingerprint. Cloudflare looks at the TLS ClientHello each client sends, using fingerprints such as JA3. Nikto makes its HTTPS connections through Perl’s Net::SSLeay bindings to OpenSSL, and that handshake looks nothing like a real browser’s.
- The request pattern. Thousands of requests in a few minutes, almost all for known-bad paths, is exactly what bot detection and rate limiting are built to catch.
- WAF rules. Many of Nikto’s test requests match Cloudflare’s managed WAF rules on their own, whatever the fingerprint.
The practical result is that nikto -h https://target-behind-cloudflare.com either times out or reports on Cloudflare rather than the real application.
Option 1: Route through mitmproxy
mitmproxy is an interactive HTTPS proxy. It makes its own upstream TLS connection, so Cloudflare sees mitmproxy’s handshake rather than Nikto’s. That can get you past a block that is purely fingerprint-based, though not past rate limits or WAF rules. Start mitmproxy in regular proxy mode:
mitmproxy --listen-port 8080
Then point Nikto at it:
nikto -h https://target.com -useproxy http://127.0.0.1:8080
Don’t add -nossl here, as older versions of this guide suggested. That flag turns SSL off altogether, which is the opposite of what you want for an HTTPS target. In mitmproxy’s interface you can watch the requests flowing through and see whether responses come from the origin or from a Cloudflare block page.
Option 2: Route through Burp Suite
Burp Suite Community or Professional works the same way. Burp also makes its own upstream TLS connections. Make sure the proxy listener is running on 127.0.0.1:8080, then run:
nikto -h https://target.com -useproxy http://127.0.0.1:8080
Every Nikto request then shows up in Burp’s HTTP history, which is handy for seeing exactly what’s being sent and why particular requests are blocked.
Option 3: Scan the origin server directly
For an authorised test this is the most reliable option. Ask the site owner for the origin server’s IP address, then scan it directly while sending the real hostname in the Host header with -vhost:
nikto -h 203.0.113.10 -p 443 -ssl -vhost example.com
Many origins only accept traffic from Cloudflare’s IP ranges, so the owner may need to allow your IP address at the origin firewall, or add a WAF skip rule for it in Cloudflare if you need to test through the proxy. Either way, scanning the origin shows you the real server rather than Cloudflare’s edge. Proxy tricks alone rarely get a full scan through, because Cloudflare’s bot detection has several layers: behavioural analysis, rate limiting and JavaScript challenges among them.
Nikto’s Limitations
Nikto is a great first step in a web assessment, but it has real limits. It produces a lot of false positives, particularly around headers and version detection. It doesn’t do authenticated scanning by default, though -id passes HTTP credentials in the form user:pass or user:pass:realm. And as covered above, any WAF or IDS will spot it.
For deeper application-layer testing, pair Nikto with Burp Suite for manual testing, Wapiti for automated web app scanning, or a template-based scanner like Nuclei. Run it against a lab environment like those on Hack The Box or TryHackMe when you want to check findings without worrying about authorisation.
Nikto on Kali Linux: Common Questions
Is Nikto installed on Kali Linux by default?
Yes, on a standard install. Kali lists Nikto in its kali-linux-default metapackage. On a minimal image, install it with sudo apt install nikto.
How do I update Nikto on Kali?
Through apt, like any other Kali package: sudo apt update && sudo apt install --only-upgrade nikto. If you run it from a GitHub clone instead, use git pull in the clone.
Is Nikto a vulnerability scanner?
It’s a web server scanner. It finds dangerous files, default content, outdated software and misconfigurations on the web server itself. For broader network vulnerability scanning, see the Nessus tutorial.
Is it legal to use Nikto?
Nikto itself is legal, but scanning a system without the owner’s permission may not be. Only scan servers you own or have written authorisation to test.
Once Nikto has given you a list of possible vulnerabilities to look into, my Metasploit tutorial is a good next step.
