> For the complete documentation index, see [llms.txt](https://g4b0.gitbook.io/g4b0-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://g4b0.gitbook.io/g4b0-docs/documentation/cheatsheets/attacking-common-applications/os-ticket.md).

# oS Ticket

**osTicket** es un sistema de ticketing de soporte open-source (comparable a Jira, OTRS, Spiceworks). Integra consultas de email, teléfono y formularios web. En **PHP + MySQL**, Windows o Linux.

> El objetivo de esta sección no es solo atacar osTicket (tiene **pocos** CVEs, está bien mantenido) sino entender por qué los **portales de soporte no deben pasarse por alto** — su funcionalidad legítima habilita ataques.

### 1. Discovery / Enumeración

| Señal                | Detalle                                                 |
| -------------------- | ------------------------------------------------------- |
| Cookie **OSTSESSID** | Se setea al visitar la página.                          |
| Footer               | Logo osTicket + "powered by" / "Support Ticket System". |

> Nmap solo muestra el web server (Apache/IIS), no footprint la app.

### 2. Las 3 capas (por qué importa el flujo)

Aunque la app no sea vulnerable, su funcionalidad sirve al atacante:

| Capa           | Qué pasa                                                          | Oportunidad para el atacante                                                                                                                   |
| -------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **User Input** | Se reporta un problema al staff.                                  | Es open-source (docs/tutoriales). Solo staff/admin acceden al panel → **social engineering** ("play dumb" + problema técnico) para sacar info. |
| **Processing** | Staff reproduce el error en entorno aislado similar a producción. | —                                                                                                                                              |
| **Solution**   | Se involucran otros técnicos por email.                           | Nuevos **emails/usernames** → OSINT o password spraying en otros servicios.                                                                    |

### 3. Attacking — obtener un email de empresa

exploit-db muestra RFI, SQLi, upload arbitrario, XSS. osTicket 1.14.1 → **CVE-2020-24881 (SSRF)** → acceso a recursos internos / port scan interno.

Pero el vector más útil suele ser **abusar de la funcionalidad**: obtener un **email válido del dominio** de la empresa.

#### Flujo

1. Abrir un ticket nuevo (`open.php`).
2. El portal asigna un **email temporal interno** al ticket (ej. `940288@inlanefreight.local`).
3. Cualquier email enviado a esa dirección aparece en el portal.

> Con ese email, registrarse en servicios que exigen email corporativo (Slack, GitLab, Bitbucket, Wiki, Mattermost) → el confirmation email llega al portal de soporte. (Demostrado en el box **Delivery** de HTB.)

### 4. Sensitive Data Exposure (escenario de pentest externo)

#### OSINT — credenciales filtradas (Dehashed)

```bash
sudo python3 dehashed.py -q inlanefreight.local -p
# jclayton : JulieC8765!
# kgrimes  : Fish1ng_s3ason!
```

#### Enumeración de subdominios

Activos y prometedores: `support.inlanefreight.local` (osTicket) y `vpn.inlanefreight.local` (Barracuda SSL VPN **sin MFA**).

#### Login (el email como username)

```
support.inlanefreight.local/scp/login.php
```

> `jclayton` falla. `kgrimes` falla, pero el login **acepta email** → `kevin@inlanefreight.local` **funciona**. `kevin` es agente de soporte.

#### El botín: un ticket cerrado

Conversación entre un empleado remoto y el agente:

* El empleado quedó bloqueado del VPN, pide reset.
* El agente resetea al **"standard new joiner password"**.
* El empleado no lo tiene, pide que se lo digan por teléfono (buena conciencia de seguridad).
* El agente **comete el error** y envía la contraseña **por el portal**.

> Ese password estándar de nuevos usuarios → probar contra el **VPN portal** (el usuario puede no haberlo cambiado). Como es el password estándar de nuevos ingresos, probablemente sirva para **otros usuarios** → **password spraying** (con `linkedin2username` para armar la lista) contra el VPN.

> También exportar el **address book** de osTicket (emails/usernames) para el spraying.

### Prevención

| Medida                                                   | Objetivo                                                             |
| -------------------------------------------------------- | -------------------------------------------------------------------- |
| Limitar apps expuestas externamente                      | Reducir superficie.                                                  |
| **MFA** en todos los portales externos                   | Frena credenciales reusadas.                                         |
| Security awareness                                       | No usar email corporativo en servicios de terceros.                  |
| Política de contraseñas fuerte (AD + apps)               | Prohibir `welcome`, `password`, nombre de empresa, estaciones/meses. |
| Forzar cambio de password tras primer login + expiración | Anula el "standard new joiner password".                             |

***

### Resumen rápido

| Vector               | Cómo                                   | Resultado                           |
| -------------------- | -------------------------------------- | ----------------------------------- |
| **Email de empresa** | Abrir ticket → email temporal asignado | Registro en servicios corporativos. |
| **CVE-2020-24881**   | osTicket 1.14.1                        | SSRF → recursos internos.           |
| **Data exposure**    | Login con email + leer tickets         | Credenciales en conversaciones.     |
| **Password reuse**   | Standard password del ticket           | Spraying contra VPN/otros.          |

> Lección: aunque osTicket sea seguro, su **funcionalidad** (asignar emails, tickets con credenciales) es explotable. Los portales de soporte externos merecen testing: crear tickets, obtener emails corporativos, y buscar reuso de contraseñas.


---

# 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://g4b0.gitbook.io/g4b0-docs/documentation/cheatsheets/attacking-common-applications/os-ticket.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.
