25, 465, 587 - SMTP(S)

// SMTP
nc -vn <IP> 25

// SMTPS
openssl s_client -crlf -connect smtp.mailgun.org:465     #SSL/TLS without starttls command
openssl s_client -starttls smtp -crlf -connect smtp.mailgun.org:587

Find Organization MX Server

dig +short mx google.com

Remote - Connect to SMTP server with netcat

kyle@writer:/etc/postfix$ nc localhost 25
220 writer.htb ESMTP Postfix (Ubuntu)
HELO writer.htb
  250 writer.htb
MAIL FROM:<kyle@writer.htb>
  250 2.1.0 Ok
RCPT TO:<kyle@writer.htb>
  250 2.1.5 Ok
DATA
  354 End data with <CR><LF>.<CR><LF>
Subject: This is a email.
.
  250 2.0.0 Ok: queued as 9FF0C802

Remote - NTML Auth

Remote - Enum Users

Local - Setup Postfix SMTP server

Local - Swaks

Local - sendEmail (MSDT Follina example)

Local - Thunderbird GUI

An alternative if you need to check another users inbox and/or sent emails. Need creds!

Local - Send mail using Pyhon

Interesting Files

Postfix master.cf

Contains scripts to be executed if condition is met.

Analyzing the last line means /etc/postfix/disclaimer will be executed if a new mail is received from user john.

Edit disclaimer-file to execute whatever bash commands you'd like and send an email to trigger it.

Force NTLM Authentication

In the real world, it's unlikely you can just jump onto the console of a machine as a privileged user and authenticate to your malicious SMB server. Nor can you do NTLM authentication on demand, but there are lots of techniquest to "force" the user to do it unknowingly.

1x1 Images in Emails:

A sneaky way would be to modify the email signature, so that even legitimate emails send will trigger NTLM authentication from every recipient who reads them.

Last updated

Was this helpful?