githubEdit

Email Attacks

Protocols: SMTP, IMAP, POP3

ALL attacks have the same principle; there might be slight interaction differences between the protocols.

PORT 25 (relying server to server) 465 (mail client to server)

You can send a phishing email with this port to get a reverse shell.

1) Enumeration

Used to send, receive, and relay outgoing emails and Main attacks are user enumeration and using an open relay to send spam

nmap 192.168.10.10 --script=smtp* -p 25

Enumerate existing users

smtp-user-enum -M VRFY -U /usr/share/seclists/Usernames/Names/names.txt -t domain.local

Default results from this wordlist

bin
irc
mail
man
root
sys

2) Username Generation and credential extraction

Upon finding potential users by browsing on a web app, use this generator script

Run the script by creating a permutated wordlist of a username

OR gather any names you find in a text file, and run the script to generate permutations for all of the names in the file

Now, validate them by running smtp-user-enum, then add the users found in a validusers.txt file

Create a custom wordlist if you find a lot of content in a web app

Attack with Hydra (SMTP/IMAP/POP3 protocols)

If no valid credentials are found, make the attack again using the username as the password.

Login with credentials

SMTP

IMAP

POP3

3) Connection

Upon connecting, refer to this repo in the "Network Penetration Testing" section. There, the email protocols are explained in detail on how to interact with them.

4) Spear Phishing

Setup listener

Send an email with a malicious attachment to the target. (Files to use: .ods, .odt, .pdf, .exe, .dll, .xll, docm)

Send a basic password reset phishing attack

Swaks instead of sendemail

Last updated