# SMB

## Tools

***

### nmap

```bash
sudo nmap -v -p 139,445 -oG nmap/smb.txt 192.168.0.1-254
```

### nbtscan

```bash
sudo nbtscan -r 192.168.0.1/24
```

### net

```powershell
net view \\target.htb /all
```

### smbclient

```bash
smbclient -N -L //10.10.10.33 
```

```bash
smbclient -L //10.10.10.33 -U cub3
```

```bash
smb: \> recurse on
smb: \> prompt off
smb: \> mget *
```

### netexec

```bash
nxc smb 10.10.10.100 -u 'a' -p '' --shares
```

```bash
nxc smb 10.10.10.100 -u cub3 -p password --shares
```

```bash
nxc smb 10.10.10.100 -u cub3 -p password --pass-pol
```

```bash
nxc smb 10.10.10.100 -u cub3 -p password --users --rid-brute
```

```bash
nxcsmb 10.10.10.100 -u cub3 -p password --groups --local-groups
```
