Principiante
18 min

Nikto

Scanner de vulnerabilidades de servidores web open source

¿Qué es Nikto?

Nikto es un escáner de servidores web open source que realiza pruebas exhaustivas contra servidores web para detectar archivos/CGIs peligrosos, versiones desactualizadas, y configuraciones inseguras.

Qué detecta Nikto

  • ✅ Versiones de servidor vulnerables
  • ✅ Archivos/directorios peligrosos
  • ✅ Configuraciones inseguras
  • ✅ Headers de seguridad faltantes
  • ✅ Plugins/módulos desactualizados
  • ✅ Default credentials
  • ✅ 6700+ plugins de checks

Instalación

# Linux (Debian/Ubuntu)
sudo apt install nikto

# Kali Linux (pre-instalado)
nikto -Version

# macOS
brew install nikto

# GitHub (última versión)
git clone https://github.com/sullo/nikto
cd nikto/program
perl nikto.pl -h

Uso Básico

Scan Simple

# Scan básico
nikto -h http://target.com

# Output:
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP:          192.168.1.100
+ Target Hostname:    target.com
+ Target Port:        80
+ Start Time:         2024-01-15 10:00:00
---------------------------------------------------------------------------
+ Server: Apache/2.4.41 (Ubuntu)
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-Content-Type-Options header is not set.
+ No CGI Directories found
+ Apache/2.4.41 appears to be outdated (current is at least 2.4.54)
+ /admin/: Admin directory found
+ /phpinfo.php: Output from the phpinfo() function
+ 7500 requests: 0 error(s) and 12 item(s) reported

Opciones Comunes

# Especificar puerto
nikto -h http://target.com -p 8080

# HTTPS
nikto -h https://target.com -ssl

# Multiple puertos
nikto -h target.com -p 80,443,8080

# Guardar output
nikto -h target.com -o report.html -Format html

# Formato JSON
nikto -h target.com -o report.json -Format json

# Especificar User-Agent
nikto -h target.com -useragent "Mozilla/5.0 Custom"

Tuning (Filtrar Tests)

# -Tuning options:
# 1: Interesting files
# 2: Misconfiguration
# 3: Information disclosure
# 4: Injection (XSS/Script/HTML)
# 5: Remote file retrieval
# 6: Denial of service
# 7: Remote file retrieval (server wide)
# 8: Command execution
# 9: SQL injection
# 0: File upload
# a: Authentication bypass
# b: Software identification
# c: Remote source inclusion

# Solo buscar archivos interesantes
nikto -h target.com -Tuning 1

# Múltiples tunings
nikto -h target.com -Tuning 124

# Excluir tests
nikto -h target.com -Tuning x6  # excluir DoS tests

Plugins y Bases de Datos

Actualizar Plugins

# Actualizar bases de datos
nikto -update

# Listar plugins disponibles
nikto -list-plugins

# Output:
Plugin: apache_expect_xss
Plugin: cookies
Plugin: headers
Plugin: httpoptions
Plugin: ssl

Usar Plugins Específicos

# Solo plugin de headers
nikto -h target.com -Plugins headers

# Múltiples plugins
nikto -h target.com -Plugins "headers,cookies,ssl"

Evasión y Sigilo

# Evasion techniques
nikto -h target.com -evasion 1

# Evasion options:
# 1: Random URI encoding (non-UTF8)
# 2: Directory self-reference (/./,//)
# 3: Premature URL ending
# 4: Prepend long random string
# 5: Fake parameter
# 6: TAB as request spacer
# 7: Change case
# 8: Use Windows directory separator

# Throttle requests (menos agresivo)
nikto -h target.com -Pause 2  # 2 segundos entre requests

# No lookup hostname
nikto -h 192.168.1.100 -nolookup

Formatos de Reporte

HTML Report

nikto -h target.com   -o report.html   -Format html

# Genera reporte HTML
# navegable con hallazgos

CSV Report

nikto -h target.com   -o report.csv   -Format csv

# CSV para Excel/análisis

JSON Report

nikto -h target.com   -o report.json   -Format json

# JSON para parsear
# automáticamente

XML Report

nikto -h target.com   -o report.xml   -Format xml

# XML estructurado

Ejemplo Completo

# Scan completo con todas las opciones
nikto -h https://target.com   -ssl   -p 443   -Tuning 123456789ab   -o nikto-report.html   -Format html   -useragent "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"   -Pause 1

# Output:
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP:          203.0.113.50
+ Target Hostname:    target.com
+ Target Port:        443
+ SSL Info:           TLS 1.2, cipher TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
---------------------------------------------------------------------------
+ Server: nginx/1.18.0 (Ubuntu)
+ OSVDB-3233: /icons/README: Apache default file found.
+ OSVDB-3092: /phpmyadmin/: phpMyAdmin directory found
+ OSVDB-3268: /config/: Directory indexing enabled
+ OSVDB-3233: /admin/: Admin panel found
+ Cookie PHPSESSID created without the httponly flag
+ Missing X-Frame-Options header
+ 8765 requests: 0 error(s) and 45 item(s) reported
---------------------------------------------------------------------------
+ End Time:           2024-01-15 10:15:23 (923 seconds)
---------------------------------------------------------------------------

Limitaciones

  • ⚠️ Muchos falsos positivos (verificar manualmente)
  • ⚠️ No detecta vulnerabilidades complejas (SQLi logic, business logic)
  • ⚠️ Muy ruidoso (genera muchos logs en servidor)
  • ⚠️ No reemplaza testing manual
  • ✅ Ideal para reconocimiento inicial rápido
  • ✅ Detecta low-hanging fruit y misconfigurations

¡Wiki Completada!

Has explorado todas las categorías de la Wiki de Seguridad Web

← Volver al Inicio de la Wiki