# SMB

SMB 서버를 통해서 OS 간의 파일 전송을 위해 서버는 아래와 같이 열 수 있습니다.

{% tabs %}
{% tab title="Windows" %}

```powershell
mkdir C:\Shared
net share Shared=C:\Shared /grant:Everyone,FULL
net share
net start lanmanserver
netsh advfirewall firewall add rule name="Allow SMB" protocol=TCP dir=in localport=445 action=allow
```

{% endtab %}

{% tab title="UNIX" %}

```bash
impacket-smbserver share . -smb2support
```

{% endtab %}
{% endtabs %}

각 OS에서 SMB 서버를 실행했을 때 원격 서버에 접속하는 명령어는 각각 다음과 같습니다.

{% tabs %}
{% tab title="Windows" %}

<pre class="language-powershell"><code class="lang-powershell"><strong># SMB 서버 연결
</strong>net use Z: \\192.168.1.14\share /user:kali

<strong># SMB 서버로부터 파일만 다운로드
</strong>copy \\192.168.1.14\share\test.txt
</code></pre>

{% endtab %}

{% tab title="UNIX" %}

```bash
smbclient //192.168.1.14/shared -U Administrator  
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://www.pentestwiki.com/data-theft/file-transper/smb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
