> For the complete documentation index, see [llms.txt](https://gitbook.ganeshicmc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.ganeshicmc.com/redes/pentest/smb.md).

# SMB

O SMB (*Server Message Block*) é um protolo de redes da camada de aplicação cujo o uso mais comum é o acesso compartilhado a arquivos, impressoras e portas seriais. O protocolo SMB é amplamente utilizado pelos sistemas operacionais Microsoft Windows. O seu uso em sistemas operacionais do tipo Unix (como por exemplo, Linux e MacOS) se dá a partir do software Samba. A porta padrão para a utilização do SMB é a 445.

## Diferença entre SMB e FTP

* No FTP, é necessário que o cliente tenha o arquivo localmente para então poder copiar para o servidor. Já no SMB, não há essa necessidade, já que o arquivo no servidor existe independente de arquivos locais. A escrita e leitura dele se dá diretamente pelo servidor.
* Qualquer mudança em um arquivo no SMB, é imediatamente visível para os outros usuários do mesmo arquivo.
* FTP é mais rápido do que o SMB, porém possui menos funcionalidades.
* O SMB é firewall-unfriendly.

## Ferramentas de Pentesting

### smbmap

O smbmap permite enumerar os sambas shares em um domínio, entre outras coisas: <https://github.com/ShawnDEvans/smbmap>

### smbclient

O smbclient inicia um cliente para poder acessar os recursos SMB de um servidor. <https://tldp.org/HOWTO/SMB-HOWTO-8.html>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://gitbook.ganeshicmc.com/redes/pentest/smb.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
