# SMB
(server message block protocol)
###### tags: `service` `network`
## Working

## Enumerate
Gather usernames, passwords, network information, hostnames, application data, services
SMB server usually could be leek the sensitive information if we could exploit it.
->log
->some file have the username or password
### Tools
**Enum4Linux**
https://github.com/CiscoCXSecurity/enum4linux
```
./enum4linux.pl -U 10.10.40.130
```

#### Share list
```
./enum4linux.pl -U 10.10.40.130 -S
```

-U get userlist
-M get machine list
-N get namelist dump (different from -U and-M)
-S get sharelist
-P get password policy information
-G get group and member list
-a all of the above (full basic enumeration)
## Exploit
### Tpye
- remote code execute
- misconfigurations
### smbclient
Access romote smb server
```
smbclient //<ip>/<share path>
```
```
- U <username>
- P <password>
```
check out the file
```
more <fileName>
```
smb: \> recurse ON
smb: \> prompt OFF
smb: \> mget *

```
chmod 660 id_rsa
```
