> For the complete documentation index, see [llms.txt](https://dhaneshsivasamy07.gitbook.io/oscp-2022/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dhaneshsivasamy07.gitbook.io/oscp-2022/enumeration/smtp.md).

# SMTP

SMTP is a mail protocol, which is used to enumerate users and send phising maills to the existing user

## User Enumeration

### Manual

```bash
nc 10.10.10.10 25
<banner> # check for vulnerability with banner 
HELO # start the connection
ELHO all
VRFY root # verify root user
mail from: dn@oscp # attacker mail
rcpt to: root@localhost # verify user with recipient
```

### Automated

* Tool : [smtp-user-enum](https://pentestmonkey.net/tools/smtp-user-enum/smtp-user-enum-1.2.tar.gz)

```bash
 smtp-user-enum -M RCPT -U /usr/share/seclists/Usernames/top-usernames-shortlist.txt -t $ip        
```

#### Phishing Mails

* Send automated phising links to a bunch of users&#x20;
* PREREQUISITE: Users emails

```bash
# listen on the port 
nc -lvnp 1234

# send mail to all the users with swaks
swaks --to $(cat files/mailuers.txt | tr '\n' ',' | less) --from dnoscp@oscp.htb --header "Subject: test" --body "please click here http://10.10.14.2:1234/" --server $ip
```

#### Machines

* Reel - <https://0xdf.gitlab.io/2018/11/10/htb-reel.html#smtp-enumeration>


---

# 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://dhaneshsivasamy07.gitbook.io/oscp-2022/enumeration/smtp.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.
