How to scan a website for vulnerabilities (FREE!) (DETAILED WRITEUP)

Started by guccigang5 replies108 views

# Nikto — Web Server Scanner

## What it is
Nikto is a free, open-source **web server scanner**. It's not a "vulnerability scanner" in the burp/ZAP sense — it's a **fingerprinter and misconfiguration hunter**. It fires thousands of known-bad requests at a target and reports what it finds: outdated server versions, dangerous files, default installs, missing security headers, exposed admin panels, and ~7,000 potentially dangerous files/programs.

Think of it as **Nmap's chatty cousin for HTTP** — fast, noisy, and great at spotting the obvious stuff so you don't have to.

**What it checks (6,700+ checks incl. plugins and templates):**
- Server/software version out of date → CVEs
- Default/backup files (`/backup.zip`, `/config.php.bak`, `/index.php~`)
- Dangerous files & scripts (`/phpinfo.php`, `/server-status`, CGI issues)
- Default credentials on admin panels
- Missing headers (CSP, HSTS, X-Frame-Options)
- HTTP methods enabled (PUT, DELETE, TRACE)
- Directory indexing, exposed `.git`, `.svn`, `.env`
- TLS/SSL weak config

**What it is NOT:** a crawler (won't spider links), does not fuzz parameters, does not exploit. Pair it with Nmap + a fuzzer for full coverage.

---

## Install

```bash
# Debian / Ubuntu / Kali (usually preinstalled on Kali)
sudo apt install nikto

# macOS
brew install nikto

# From source / Perl
git clone Hidden link: log in and reply to this thread to see it
cd nikto/program
perl nikto.pl -h Hidden link: log in and reply to this thread to see it
```

Verify:
```bash
nikto -Version
```

---

## Basic Usage

```bash
# Scan a host
nikto -h Hidden link: log in and reply to this thread to see it

# HTTPS target
nikto -h Hidden link: log in and reply to this thread to see it

# Non-standard port
nikto -h Hidden link: log in and reply to this thread to see it

# IP address directly
nikto -h 192.168.1.10

# Scan a specific path
nikto -h Hidden link: log in and reply to this thread to see it
```

Default output is verbose to stdout. Core result lines start with `+` and vulnerabilities are flagged as `OSVDB` / `CVE`.

---

## The Flags That Matter

```bash
nikto -h Hidden link: log in and reply to this thread to see it -p 80,443,8080 # multiple ports
nikto -h Hidden link: log in and reply to this thread to see it -ssl # force SSL
nikto -h Hidden link: log in and reply to this thread to see it -Tuning 123 # control what it tests
nikto -h Hidden link: log in and reply to this thread to see it -Display V # verbose (show requests)
nikto -h Hidden link: log in and reply to this thread to see it -Display 1234 # show redirects/cookies/etc
nikto -h Hidden link: log in and reply to this thread to see it -evasion 1 # IDS evasion (see below)
nikto -h Hidden link: log in and reply to this thread to see it -useproxy Hidden link: log in and reply to this thread to see it # via Burp/proxy
nikto -h Hidden link: log in and reply to this thread to see it -timeout 10 # per-request timeout
nikto -h Hidden link: log in and reply to this thread to see it -maxtime 300 # whole-scan time limit
nikto -h Hidden link: log in and reply to this thread to see it -Pause 1 # slow down (polite/evasive)
nikto -h Hidden link: log in and reply to this thread to see it -Format htm -output report.html
```

### Tuning (`-Tuning`) — the single most useful flag
Control exactly which check categories run:
| Code | Tests |
|---|---|
| `1` | Interesting files / default files |
| `2` | Misconfiguration / default install |
| `3` | Information disclosure |
| `4` | Injection (XSS/Script/HTML) |
| `5` | Remote file retrieval — internal server |
| `6` | Denial of service |
| `7` | Remote file retrieval — external server |
| `8` | Command execution / remote shell |
| `9` | SQL injection |
| `0` | File upload |
| `a` | Authentication bypass |
| `b` | Software identification |
| `c` | Remote source inclusion |
| `x` | Reverse tuning (exclude these) |

```bash
# Fast recon only: files + misconfig + info disclosure + version
nikto -h Hidden link: log in and reply to this thread to see it -Tuning 123b

# Skip the slow/DoS-prone checks
nikto -h Hidden link: log in and reply to this thread to see it -Tuning x6 -maxtime 180
```

### Evasion (`-evasion`)
Hides your traffic from WAF/IDS. Codes `1`–`8`; **`8`** is the most reliable (Windows `%c0%af` URI encoding). You can **combine** them, e.g. `-evasion 128`.
```bash
nikto -h Hidden link: log in and reply to this thread to see it -evasion 8 -Pause 2
```

### Auth / cookies for authenticated scans
```bash
nikto -h Hidden link: log in and reply to this thread to see it -id admin:password
nikto -h Hidden link: log in and reply to this thread to see it -C all # try all cookie fields
nikto -h Hidden link: log in and reply to this thread to see it -Cookies "session=abc123; role=admin"
```

### Output formats
```bash
nikto -h Hidden link: log in and reply to this thread to see it -Format csv -output out.csv
nikto -h Hidden link: log in and reply to this thread to see it -Format htm -output out.html
nikto -h Hidden link: log in and reply to this thread to see it -Format xml -output out.xml
nikto -h Hidden link: log in and reply to this thread to see it -Format json -output out.json
nikto -h Hidden link: log in and reply to this thread to see it -Format txt -output out.txt
```
Great for piping into `jq` or a report pipeline.

---

## Scanning Multiple Targets

```bash
# From a file (one host per line)
nikto -h targets.txt

# Bash loop over subdomains
for h in $(cat subs.txt); do
nikto -h "Hidden link: log in and reply to this thread to see it" -Tuning 123b -maxtime 120 -output "scan_$h.html" -Format htm
done
```

---

## A Realistic Workflow

```bash
# 1. Discover web servers first
nmap -p- --open -T4 target.com -oG web.txt

# 2. Rewrite the URLs
cat web.txt | awk '/Ports:/ {print $2" "$5}' | sed 's|/open||'

# 3. Fire nikto at each
nikto -h Hidden link: log in and reply to this thread to see it -Tuning 123b -Format json -output nikto.json

# 4. Route through Burp for clean visual review
nikto -h Hidden link: log in and reply to this thread to see it -useproxy Hidden link: log in and reply to this thread to see it
```

---

## Reading the Output

```
+ Server: nginx/1.18.0
+ The anti-clickjacking X-Frame-Options header is not present. ← fixable, real
+ /admin/: Admin login page/section found. ← interesting, follow up
+ /backup.zip: Backup file found, may contain source. ← often a jackpot
+ OSVDB-3233: /icons/README: Apache default file found. ← low value
+ /phpinfo.php: Output from phpinfo() detected. ← info leak
+ Server may leak inodes via ETags. ← rare/cosmetic
```

**Triage rule:** `OSVDB` entries are mostly ancient (the database is dead) — treat as *hints*, confirm each by hand. Focus on **backup files, admin panels, exposed version banners, and PHPinfo** first.

---

## Defense / Hiding from Nikto
If you're on the other side:
- Strip version banners (`ServerTokens Prod` in Apache, `server_tokens off` in nginx)
- Block `/icons/`, `/server-status`, `/server-info`
- Add `X-Frame-Options`, `X-Content-Type-Options`, CSP, HSTS
- Kill directory listing & deny `.git`, `.env`, `.svn`
- Rate-limit + WAF signature matching catches nikto's signature UA immediately:
```bash
# nikto's default User-Agent — block it
Nikto/2.5.0
nikto -h Hidden link: log in and reply to this thread to see it -useragent "Mozilla/5.0 (legit browser UA)" # blend in
```

---

## Cheat Sheet — One-Liners

```bash
nikto -h Hidden link: log in and reply to this thread to see it # quick standard scan
nikto -h target.com -p 80,443,8080,8443 # multi-port
nikto -h target.com -Tuning 123b -maxtime 180 # fast, focused
nikto -h target.com -evasion 8 -Pause 1 # sneaky
nikto -h target.com -useproxy Hidden link: log in and reply to this thread to see it -Display V # burp + verbose
nikto -h target.com -Format json -output r.json # machine-readable
nikto -h target.com -maxtime 600 -nointeractive # CI/script friendly
```

---

## The Golden Rules
1. **Nikto is loud.** It fires thousands of requests. Never run it against infrastructure you don't own or lack written permission to test.
2. **It's a starting point, not a verdict.** Every hit is a lead — verify by hand or with Burp.
3. **Tune aggressively.** `-Tuning 123b x6` + `-maxtime` keeps it fast and non-DoS-y.
4. **Faithful companion:** Nmap (find servers) → Nikto (find the sloppy stuff) → Burp/ffuf (find the real bugs).

> **Scan wide with Nikto, dig deep with Burp.**
the NSE function in nmap can detect CVEs right away so in my opinion its a better solution than nikto.
lets have a look
hi my tg and dc is listed below if u need to contact me :)
  • dc: egdx
    • tg: deloads
pretty mid lol basic stuff
Good contribution

You must log in or register to reply here.

Back to Tutorials