Auditing an Email Server Patrick Mattson May 2019
Total Page:16
File Type:pdf, Size:1020Kb
Auditing an Email server Patrick Mattson May 2019 [email protected] Page 1 of 34 Table of Contents Proposal notes ........................................................................................................................................ 4 Learning objective 1 ................................................................................................................................ 6 Learning objective 2 ................................................................................................................................ 6 Learning objective 3 ................................................................................................................................ 6 Learning objective 4 ................................................................................................................................ 6 What are the components of an email server. ......................................................................................... 6 Microsoft Exchange Components ........................................................................................................ 7 Edge Transport - Mail Transfer Agent (MTA) ................................................................................... 7 Other components: ............................................................................................................................. 7 DNS Settings .................................................................................................................................... 7 The email............................................................................................................................................. 9 Communication methods .................................................................................................................. 10 Defenses against email spoofing ............................................................................................................ 11 SPF - Sender Policy Framework .......................................................................................................... 11 DKIM - DomainKeys Identified Mail ................................................................................................... 13 DMARC - Domain-based Message Authentication, Reporting, and Conformance ............................... 13 Reading a DMARC record ............................................................................................................... 15 Defensive domains ............................................................................................................................ 15 Unsecured email server ......................................................................................................................... 15 Authentication................................................................................................................................... 15 Spam filtering .................................................................................................................................... 15 Retry sending emails.......................................................................................................................... 17 Disabling VRFY/EXPN ......................................................................................................................... 17 Collect logs ........................................................................................................................................ 18 Auditing mailboxes in Microsoft Exchange ......................................................................................... 18 Defenses ............................................................................................................................................... 18 SSL Certificate.................................................................................................................................... 18 SSL, TLS, and STARTTLS Email Encryption ........................................................................................... 19 Spam filtering .................................................................................................................................... 19 Block file extensions .......................................................................................................................... 19 Virus scanning ................................................................................................................................... 20 Greylisting ......................................................................................................................................... 20 Page 2 of 34 Outbound scanning for Spam ............................................................................................................ 20 Avoiding being a Spammer ................................................................................................................ 21 Checking if your servers are on blacklists ........................................................................................... 21 Tools/Demo........................................................................................................................................... 21 Demonstration ...................................................................................................................................... 22 Dig commands through Linux, can get dig for Windows or use NSLOOKUP ........................................ 22 MX record look up ......................................................................................................................... 22 IP/A record of your mail server ...................................................................................................... 25 dig Short example .......................................................................................................................... 26 dig SPF/TXT record ......................................................................................................................... 26 NSLOOKUP SPF/TXT record ............................................................................................................ 27 Open relay ......................................................................................................................................... 29 Running an Open Relay against a machine ..................................................................................... 29 Mxtoolbox.com ................................................................................................................................. 31 Checking SSL security ......................................................................................................................... 33 Testing checklist: ............................................................................................................................... 33 Page 3 of 34 Proposal notes Auditing an Email server Understanding an email server, and how to secure it Presentation title: Understanding an email server and how to review and secure one Condensed Title for Promotional Use: Review and secure an email server Target Audience: Beginner Short description: Email is a service that is used by every business, verifying it is setup properly can help prevent a server from sending spam and reducing dangerous emails from entering your business. Learning objective 1: After completing this session, the participate will have a basic understanding of the components in an email server and how an email is sent through the server. Learning objective 2: After completing this session, the participate will understand what command line tools they can utilize to verify the settings on an email server. Learning objective 3: After completing this session, the participate will understand industry best practices used to verify and reduce the risk that their domain is spoofed. Learning objective 4: After completing this session, the participate will be able to describe risks associated with an unsecured mail server. Abstract: Email is a service that is used by every business and it is a primary way to communicate with others. There are some industry standards/settings that a company should have implemented. Missing a setting or two can cause a server to receive large amounts of spam or allow someone to send spam from their server(s). This presentation will discuss standard components of any mail server and how a message passes through the server. Today spammers will try to impersonate your domain when sending spam, we will discuss ways to reduce the risk by implementing DKIM, SPF, and DMARC records. An unsecure mail server can become a spamming host, we will discuss ways to check this. By explaining and demonstrating various command line tools and other resources the audience can see how to verify current settings. In a final demonstration I will pretend to be a spammer using an open source tool to spoof an email showing whatever information I would like. Audience Engagement: The presentation will cover the topic, I will add in experiences I have had dealing with my mail server. The presentation will continually be reviewed in the event there are new settings that should be implemented. I also plan to demonstrate on a live mail server the commands to show current settings and using an open source tool send an email from a live server. Additional information: Page 4 of 34 A company I own hosts email for businesses. We