# SMB

SMB service is found in windows by default, and can be configured in linux aswell. Improper implementation provides the access to some contents, commonly used tools are SMBClient, cme and Enum4linux

## Enumeration

* Listing the shares

```bash
smbclient -U '' -N \\\\10.10.10.10\\
cme smb 10.10.10.10 -u 'username' -p 'password' --shares
```

* Accessing the share

```bash
smbclient -U 'user' \\\\10.10.10.10\\sharename
```

## Bruteforce

```bash
cme smb $ip -u users.txt -p pass.txt --continue-on-success

# hashes bruteforce
cme smb $ip -u users.txt -H "NTLMHASH" --continue-on-success

# enumerate users if the IPC share is readable
cme smb $ip -u user -p password --rid-brute
```

## File Operations

```bash
# download a file
get filename
# y/n prompt disable
prompt off
# recurse download
recurse on
prompt OFF
mget *
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dhaneshsivasamy07.gitbook.io/oscp-2022/enumeration/smb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
