Cloud Mail
CPTS Notes
- Foundations
- Enumeration with Nmap
- Passwords
- Wordlists
- Cracking
- Protected Files
- Spraying and Defaults
- Hunting (Windows)
- Hunting (Linux)
- Hunting (Shares)
- Hunting (Traffic)
- Looting (Windows)
- Looting (Linux)
- File Services
- FTP
- SMB
- NFS
- Rsync
- Network
- DNS
- SNMP
- SMTP
- Mail Retrieval
- Cloud Mail
- Databases
- MySQL
- MSSQL
- Remote Access
- SSH
- R-Services
- RDP
- WinRM
- WMI
- Linux
- Reading Files
- Editing Files
- Searching Files
- Requests and Transfer
- Local Enumeration
- Privesc Primer
- File Transfer
- Choosing a Method
- Serving Files
- Windows Transfers
- Linux Transfers
- Code One-Liners
- Session Transfers
- Protected Transfers
- Detection & Evasion
- Windows
- Reading Files
- Editing Files
- Searching Files
- Requests and Transfer
- Local Enumeration
- Privesc Primer
- Reference
- Port References
- DNS Resolution
- The Mail Pipeline
- SMB & NetBIOS
TL;DR
Most companies run mail in the cloud now: Microsoft 365, Google Workspace, or Zoho. There are no
VRFY or open-relay tricks here. The provider owns the server, so the attack moves to the tenant:
confirm the domain uses a provider, enumerate valid accounts, then spray.
An MX lookup names the provider. outlook.com is Microsoft 365,
google.com is Google Workspace, zoho.com is Zoho.
Cloud endpoints block standard tools such as Hydra. Use provider-specific tools, and keep them current: when the provider changes an endpoint, the tool breaks until an update catches up.
Confirm the provider
o365spray confirms a domain as a Microsoft 365 tenant:
o365spray --validate --domain $DOMAIN # [VALID] in the output means the domain uses O365Enumerate users
o365spray abuses an O365 endpoint that answers whether an account exists:
o365spray --enum -U users.txt --domain $DOMAIN # valid accounts land in enum_valid_accounts.<ts>.txt-U is the candidate list. Each [VALID] line is a real account, and the tool writes them to a
file for the spray step.
Password spray
Spray one password across the valid accounts, slowly, to stay under the lockout policy:
o365spray --spray -U usersfound.txt -p 'March2022!' --count 1 --lockout 1 --domain $DOMAIN-U is the valid-account list from the enum step. -p is the single password. --count 1 tries
one password per round. --lockout 1 waits one minute between rounds. Season-and-year and
company-name passwords are the usual hits.
Tools by provider
| Provider | Enumerate | Spray |
|---|---|---|
| Microsoft 365 | o365spray, MailSniper | o365spray, MailSniper |
| Google Workspace | CredKing | CredKing |
| Okta | CredKing | CredKing |
Common misconfigurations
- No lockout policy, so spraying runs unthrottled.
- No multi-factor authentication, so a sprayed password is a full login.
- Legacy auth endpoints left enabled, which skip modern authentication and conditional access.
Practice boxes
Outlook Web Access (OWA) is on-prem Exchange webmail, and you brute-force its login like any portal:
| Box | Difficulty | Mail’s role |
|---|---|---|
| Rabbit | Insane | Brute-force the OWA login, then phish a user with a macro document. |
The cloud mail attack is account discovery then a careful spray. Lockout and multi-factor authentication are what stop it, so count passwords and pace the spray.