> For the complete documentation index, see [llms.txt](https://insecurecodes.gitbook.io/redbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://insecurecodes.gitbook.io/redbook/stages-of-ethical-hacking/enumeration/smb/smbmap.md).

# SMBMap

## Basic sintax

```bash
smbmap -u guest -p "" -d . -H $IP

smbmap -u administrator -p "$password_123" -d . -H $IP
```

### Remote commands

#### Run any command

```bash
smbmap  -H $IP -u administrator -p "$password_123" -x 'ipconfig'
```

#### Read SMB volume

```bash
smbmap  -H $IP -u administrator -p "$password_123" -r 'C$'
```

#### Upload file

```bash
smbmap  -H $IP -u administrator -p "$password_123" --upload '/tmp/trojan' 'C$\trojan'
```

#### Download file

```bash
smbmap  -H $IP -u administrator -p "$password_123" --download 'C$\download_file.txt'
```
