> For the complete documentation index, see [llms.txt](https://oliver-3.gitbook.io/redteam-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oliver-3.gitbook.io/redteam-notes/recursos/ejptv2-notas/3.-evaluacion-de-vulnerabilidades.md).

# 3. Evaluación de vulnerabilidades

La evaluación de vulnerabilidades conecta la enumeración con la explotación. Ya sabés qué servicios corren y en qué versiones — ahora buscás qué vulnerabilidades afectan a esas versiones y si existen

Tipos de vulnerabilidades

| Tipo                                 | Qué permite                                                 | Ejemplo                                                 |
| ------------------------------------ | ----------------------------------------------------------- | ------------------------------------------------------- |
| **Divulgación de información**       | Acceder a datos confidenciales                              | Archivos de config expuestos, mensajes de error verbose |
| **Buffer Overflow**                  | Escribir en memoria no asignada, alterar flujo de ejecución | EternalBlue en SMBv1                                    |
| **Ejecución Remota de Código (RCE)** | Ejecutar comandos arbitrarios en el sistema de forma remota | Shellshock en Bash/CGI                                  |
| **Escalada de Privilegios**          | Elevar privilegios de usuario normal a admin/root           | Kernel exploits, SUID, cron                             |
| **Denegación de Servicio (DoS)**     | Consumir recursos impidiendo el funcionamiento normal       | SYN flood                                               |

***

### Escaneo con Metasploit

```bash
# Buscar exploits por servicio/versión
msf6 > search apache 2.4
msf6 > search type:exploit name:apache

# Sugerencia automática basada en info importada
msf6 > analyze
```

### searchsploit

Base de datos offline de Exploit-DB. Busca exploits sin conexión.

```bash
# Buscar por servicio y versión
searchsploit proftpd 1.3
searchsploit apache 2.4.49

# Ver código de un exploit
searchsploit -x 42315

# Copiar exploit al directorio actual
searchsploit -m 42315

# Actualizar base de datos
searchsploit -u
```

Los resultados marcan entre paréntesis los exploits que también están en Metasploit.

***

### Servicios de Windows frecuentemente explotados

| Servicio   | Puerto    | Vulnerabilidades conocidas             |
| ---------- | --------- | -------------------------------------- |
| SMB        | 445       | EternalBlue (MS17-010), sesiones nulas |
| RDP        | 3389      | BlueKeep (CVE-2019-0708)               |
| WinRM      | 5985/5986 | Fuerza bruta, ejecución remota         |
| IIS/WebDAV | 80/443    | Subida de webshells                    |
| MSRPC      | 135       | Enumeración de servicios               |

### Servicios de Linux frecuentemente explotados

| Servicio | Puerto | Vectores de ataque                    |
| -------- | ------ | ------------------------------------- |
| SSH      | 22     | Fuerza bruta, claves débiles          |
| FTP      | 21     | Acceso anónimo, versiones vulnerables |
| Apache   | 80/443 | Vulnerabilidades web, CGI/Shellshock  |
| Samba    | 445    | Similar a SMB en Windows              |
| MySQL    | 3306   | Credenciales débiles                  |

***

### Vulnerabilidades clave

#### EternalBlue (MS17-010 / CVE-2017-0144)

Vulnerabilidad en SMBv1 de Windows. Permite RCE como SYSTEM. Desarrollado por la NSA, filtrado en 2017 por The Shadow Brokers. Motor detrás de WannaCry y NotPetya.

Explota un buffer overflow en cómo SMBv1 maneja ciertas solicitudes — el atacante envía paquetes SMB diseñados que desbordan el buffer y permiten ejecución de código a nivel de kernel.

**Sistemas afectados:** Windows XP, Vista, 7, 8, 8.1, 10 y Server 2003 a 2016 (sin parche).

```bash
# Detectar
nmap -p 445 --script=smb-vuln-ms17-010 10.10.10.1

# Confirmar con MSF
use auxiliary/scanner/smb/smb_ms17_010
```

#### BlueKeep (CVE-2019-0708)

Vulnerabilidad en RDP de Windows. Permite RCE sin autenticación. Accede a memoria del kernel permitiendo ejecución de código a nivel de sistema.

**Sistemas afectados:** Windows XP, Vista, 7, Server 2003, 2008, 2008 R2.

Precaución: existen PoCs maliciosos. Usar solo módulos verificados.

```bash
# Detectar
use auxiliary/scanner/rdp/cve_2019_0708_bluekeep
```

#### Shellshock (CVE-2014-6271)

Vulnerabilidad en Bash que permite RCE. Afecta servidores Apache con scripts CGI. Bash ejecuta comandos tras la secuencia `() { :;};` en variables de entorno. Las cabeceras HTTP se pasan como variables de entorno al proceso Bash que ejecuta el CGI.

**Afecta:** cualquier sistema Linux con Bash < 4.3 y scripts CGI.

```bash
# Detectar
nmap -p 80 --script=http-shellshock --script-args uri=/cgi-bin/script.sh 10.10.10.1
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://oliver-3.gitbook.io/redteam-notes/recursos/ejptv2-notas/3.-evaluacion-de-vulnerabilidades.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
