> 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/password-attacks/brute-force-openssh-.enc.md).

# تكسير مفاتيح OpenSSH المشفرة

> الـ **.enc** الامتداد يشير عادةً إلى **مشفّر** (ملف مشفّر). يُستخدم هذا التعبير للدلالة على أن محتوى الملف محمي بواسطة خوارزمية حماية بيانات، مما يجعل البيانات غير مقروءة بدون الرمز أو رمز المرور المناسب. قد تحتوي هذه الملفات على أنواع مختلفة من البيانات (نصوص، صور، مقاطع فيديو، إلخ) وتُستخدم لتأمين المعلومات الحساسة.

الـ `.enc` الملف مشفّر باستخدام **AES-256-CBC** وخُزّن بترميز **Base64**.

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

**الخطوة 1: فك ترميز Base64**

```bash
cat .drupal.txt.enc | base64 -d > file_decoded.enc
```

<figure><img src="/files/219458323b78ad58eb8419a796e25cc0dd7fd95f" alt=""><figcaption></figcaption></figure>

**الخطوة 2: فك التشفير باستخدام OpenSSL**

لفك تشفير الملف، نحتاج إلى كلمة مرور. نفّذ الأمر لمحاولة فك التشفير يدويًا:

```bash
openssl enc -aes-256-cbc -d -in .drupal.txt.enc -out .drupal.txt -base64
```

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

**الخطوة 3: سكربت أتمتة للهجوم بالقوة الغاشمة**

نستخدم سكربت Bash لاختبار قائمة من كلمات المرور (مثال: `rockyou.txt`).

```bash
#!/bin/bash

function ctrl_c(){
    echo -e "/n/n[!] جارٍ الخروج.../n"
    tput cnorm; exit 1
}

# Ctrl+C
trap ctrl_c INT

tput civis
for password in $(cat /usr/share/wordlists/rockyou.txt); do
    openssl aes-256-cbc -d -in drupal.enc -out drupal.decrypted -pass pass:$password &>/dev/null

    if [ "$(echo $?)" == "0" ]; then
        echo -e "/n[+] كلمة المرور هي : $password/n"
        exit 0
    fi
done; tput cnorm
```

**النتيجة:**

كلمة المرور التي تم العثور عليها هي: **friends**

<figure><img src="/files/865b2894b3f9bce7348727c5c2a35686a9403844" alt=""><figcaption></figcaption></figure>

#### **الرسالة المفكوكة**

يحتوي الملف المفكوك على كلمة مرور جديدة:

```bash
openssl enc -aes-256-cbc -d -in .drupal.txt.enc -out .drupal.txt -base64

friends
```

* **PencilKeyboardScanner123**

<figure><img src="/files/5400bb17395a4a0d8c5af6b373acc3fd5797b820" 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/password-attacks/brute-force-openssh-.enc.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.
