Red Teaming · · 7 min read

🛡️ Mastering Modern Red Teaming Infrastructure Part 3 — Securing Mail Services with DNS Records…

In this installment of the “🔒 Mastering Modern Red Teaming Infrastructure” series, we explore setting up and securing mail services for…

🛡️ Mastering Modern Red Teaming Infrastructure Part 3 — Securing Mail Services with DNS Records…

🛡️ Mastering Modern Red Teaming Infrastructure Part 3 — Securing Mail Services with DNS Records and OPSEC for Bypassing Mail Security Gateways

In this installment of the “🔒 Mastering Modern Red Teaming Infrastructure” series, we explore setting up and securing mail services for our domain online-notifications.net domain using DNS records such as SPF, DKIM, and DMARC, while implementing robust operational security (OPSEC) measures to bypass mail security gateways effectively. This guide walks through linking Zoho Mail with online-notifications.net domain that hosted on Cloudflare and creating a mail user account to operate stealthy phishing campaigns or other red team activities.

Table of Contents

  1. 🔎 Why Secure Mail Services Matter for Red Team Operations
  2. Step 1: Setting Up Zoho Mail for online-notifications.net domain
  3. Step 2: Adding MX, SPF, DKIM, and DMARC Records on Cloudflare
  4. Step 3: Implementing OPSEC Measures to Bypassing Mail Security Gateways
  5. Final Thoughts

🔎Why Secure Mail Services Matter for Red Team Operations

Email remains one of the most effective vectors for social engineering, credential harvesting, and phishing. To ensure the success of such campaigns, it’s critical to:

By correctly implementing SPF, DKIM, and DMARC records and adding OPSEC, you can significantly ⬆ increase the deliverability of your emails while ⬇ minimizing the risk of exposure.

⚙️Step 1: Setting Up Zoho Mail for online-notifications.net domain

  1. Create a Zoho Account

Open Zoho Mail and Register for an account using personal email.

Select a plan (Zoho was offering a free plan but now they changed their policy, so I will select 15 days free trial). (note: you can use other mail services. for example https://www.name.com provide free mail service)

Select a plan (Zoho was offering a free plan but now they changed their policy, so I will select 15 days free trial). (note https://www.name.com provide free mail service)

2. Link online-notifications.net Domain with Zoho

Add onlin-notificaions.net domain and proceed

Domain added and I will procced to domain verification

Zoho has recognized that my domain is managed by Cloudflare and has provided the following TXT record and value to verify domain ownership.

Therefore, I will add this TXT record to the Cloudflare DNS setting and save it

Click Add Record
Type:TXT. Name:@. Value: The unique verification string provided by Zoho.

Return to Zoho and click verify TXT record after adding it in cloud flare

3. Create a Mail User Account

Once the domain is verified and linked, I will create an admin user.

After user created in next page it will ask if I need more email users, I will click proceed to setup groups

In group settings I will click on proceed to DNS mapping

đź”§ Step 2: Adding MX, SPF, DKIM, and DMARC Records on Cloudflare

  1. Adding MX, SPF and DKIM records

After creating the admin user, I will proceed by adding the following records to the Cloudflare DNS settings, like the previous steps. This time, I will add MX and TXT records with their respective hosts, values and priority.

Then add them into the Cloudflare DNS as below.

MX to mention Zoho mail server
SPF and DKIM

Then click verify all records on Zoho

After click verify you will get the below verification (sometimes you need to wait some minutes until DNS update the settings)

Click on “Proceed to Email Migration,” then “Proceed to Go Mobile,” and finally “Proceed to Setup Completion.” Be sure to save the SMTP values provided, as we will need them later when configuring mail in GoPhish.

After that, the [email protected] user will be created using the same password I used during the Zoho registration process.

2. Adding a DMARC Record

Add a TXT record to your domain: type: TXT and Name: _dmarc and Value: v=DMARC1; p=none

DMARK policy option

đź”’ Step 3: Implementing OPSEC Measures to Bypassing Mail Security Gateways

  1. Test email security configuration score by mail-tester service

We will Mail-Tester service and it not only identifies issues but also provides actionable suggestions to improve your email deliverability and avoid spam filters.

Mail-Tester.com evaluates your email’s deliverability by checking:

Visit https://www.mail-tester.com/. The site will provide an email address to send a test message.

Send an email from your mail account. For this example, I will send an empty message from [email protected]. To do this, I will use Zoho Mail through the dashboard or directly access it via https://mail.zoho.sa/zm/.

After sending the email, return to the Mail Tester site and click “Check your score”.

Below is the result of the check:

2. Enhancing Email Credibility through Signature Collection Techniques

To increase the credibility of the email, it’s recommended to use some signature from an email from the client. some method to get the signature below:

3. Other OPSEC to bypass Mail Security Gateways

Final thoughts

Linking our domain’s mail services with Zoho Mail and securing it with SPF, DKIM, and DMARC not only improves deliverability but also ensures a high degree of stealth in red team engagements. Coupled with strong OPSEC practices, this setup enables us to bypass mail security gateways effectively, giving an edge in executing phishing campaigns and other social engineering attacks.

Part 4: Advanced OSINT Techniques, Credential Harvesting, and Azure AD Password Spraying Tactics

if you find this blog useful, don’t forget to hit the clap button and follow the blog.

Certifications:
OSEC3, CRTL, CRTO, OSCP, OSEP, OSWE, OSED, eMAPT … Others

Follow me on LinkedIn & Twitter(X) to stay updated and to know new things.

Bye Bye, Take Care.

Read next

Fire Up Your Defenses

Don't wait for a security incident to happen. Contact Firewire today for a free consultation and discover how we can protect your organization.

CTA