# SMTP - ports 25-587

## Énumération

Énumération avec des scripts nmap.

*`$ nmap -p25 --script smtp-commands <target IP>`*

*`$ nmap --script smtp-enum-users <target IP>`*

Avec metasploit:

```bash
$ msfconsole
msf > use auxiliary/scanner/smtp/smtp_enum 
msf auxiliary(smtp_enum) > set RHOSTS <target IP>
msf auxiliary(smtp_enum) > run
```

## Authentification

Avec un script nmap.

*`$ nmap -p587 --script smtp-ntlm-info.nse <target IP>`*

## DNS report

Tenter d'envoyer un mail à une adresse inconnue d'une organisation, le header de la réponse reçu du serveur smtp peut parfois contenir des informations sensibles (IP, info sur l'anti-virus etc)

## Swaks

Swaks est un outil de test SMTP fonctionnel, flexible, scriptable et orienté transaction.

Exemple d'utilisation:

*`$ swaks --to <destinataire> --server <serveur SMTP>`*

ressource: <https://github.com/jetmore/swaks>

## Ressources

<https://www.offensive-security.com/metasploit-unleashed/scanner-smtp-auxiliary-modules/>


---

# 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://blog.s1rn3tz.ovh/hacking-protocols/smtp-ports-25-587.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.
