> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/data-theft/file-transper/smb.md).

# 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 %}
