From Defensive Registration to Subdomain Protection: Evaluation of Email Anti-Spoofing Schemes for High-Profile Domains
Total Page:16
File Type:pdf, Size:1020Kb
From Defensive Registration to Subdomain Protection: Evaluation of Email Anti-Spoofing Schemes for High-Profile Domains Sourena Maroofi, Maciej Korczynski,´ Andrzej Duda Univ. Grenoble Alpes, CNRS, Grenoble INP, LIG, F-38000 Grenoble, France Email: fi[email protected] Abstract—Sending forged emails by taking advantage of do- Microsoft support team with a fake landing page looking alike main spoofing is a common technique used by attackers. The lack a real Microsoft login page to steal user credentials [2]. In this of appropriate email anti-spoofing schemes or their misconfigu- paper, we investigate this last type of email spoofing. ration lead to successful phishing attacks or spam dissemination. In this paper, we evaluate the adoption of the SPF and DMARC The Simple Mail Transfer Protocol (SMTP) for email dis- security extensions by high-profile domains and analyze spoofing tribution does not provide support for preventing spoofing [3]. possibilities enabled by the absence or misconfigurations of their The system needs to rely on security extensions such as rules. The results show that for top 500 domains of 139 countries, the Sender Policy Framework (SPF) [4], the DomainKeys the adoption rate of SPF and DMARC rules are 65.9% and Identified Mail (DKIM) [5], and Domain-based Message Au- 34.3%, respectively. For banking websites, we obtain almost the same results (64.9% and 35.9%) as for the TOP500 list. thentication, Reporting, and Conformance (DMARC) [6] to However, for defensively registered domains, the results are authenticate the sender and decide what to do with suspicious significantly higher especially in terms of published SPF records mails. The extensions define a set of rules that specify who with 95.37% adoption and 40.1% for DMARC. We also, for is allowed to send emails on behalf of a domain name and the first time, investigate the problem of subdomains in the provide strategies for dealing with spoofed messages. Care- anti-spoofing techniques and their possible abuse to send forged emails. We show that even major companies such as Microsoft or fully implementing the extensions can completely mitigate the ESET Security do not correctly configure the SPF rules, which problem of domain spoofing. However, to be effective, both leads to the possibility of mail spoofing. Based on the emulation the domain owner and the mail transfer agent of the recipient of the SPF check function, we show that syntactically wrong SPF should implement the extensions: the domain owner needs to rules may break the trust-based authentication system of email correctly set SPF, DKIM, and DMARC rules, and the recip- service providers by allowing forged emails to land in the user inbox. Finally, to help in remediation, we have issued notifications ient has to authenticate incoming messages as well correctly to CSIRTs responsible for domains with misconfigured SPF implement verification of the SPF and DMARC rules. records to engage them in the mitigation action. In this paper, we evaluate the adoption of the SPF and DMARC security extensions1 and analyze spoofing possibil- I. INTRODUCTION ities enabled by the absence or misconfigurations of their Email spoofing consists of sending a message with a forged rules. While previous work already investigated the adoption sender address and other parts of the email header so that it of SPF and DMARC by the Alexa top-ranked one million appears as sent from a legitimate source. Attackers commonly domains [7], [8], we consider a different threat model in which use this method to mislead the receivers, gain their trust, attackers use subdomains (both existent and non-existent) and eventually, achieve some malicious goals. Phishing and for email spoofing. We also identify defensively registered spam campaigns are examples of attacks that rely on email domains and evaluate their adoption of email anti-spoofing spoofing. Despite tremendous efforts deployed to mitigate schemes. We show that even if defensive registration can this technique, it is still one of the most successful attacks mitigate some types of attacks like cybersquatting and brand responsible for significant damage. According to the Internet abuse, these domains need to be protected against domain crime report [1], email spoofing costed US victims more than spoofing as well. 1.2 billion dollars in 2018. More specifically, our contributions are as follows: Email spoofing comes in two types. The first one consists of compromising legitimate servers and using their mail transfer 1) in a measurement campaign, we evaluate the adoption agent to send spoofed emails to victims either by specifying of SPF and DMARC by top 500 most popular domains a different ‘Reply-to:’ address or providing a phishing URL of 139 countries including local businesses, national in the body of the message. The second type is domain websites, local governments, and financial sectors, spoofing in which attackers send emails on behalf of legit- 2) we propose a method to find defensively registered do- imate domains, e.g., a forged email from account-security- mains for top-ranked websites and assess the extent of [email protected] impersonating the 1We do not analyze DKIM as it requires access to the selector tag in the 978-3-903176-27-0 © 2020 IFIP email header (see RFC 6376 for more details), not publicly available. TABLE I POSSIBLE RESULTS OF THE SPF CHECK_HOST FUNCTION AND THEIR DEFINITIONS. Result Definition Recommended action 1) No valid domain name was extracted from the SMTP session. None 1) The action must be the same as the Neutral output. 2) No SPF record was retrieved from the domain name. Neutral 1) There is no definite assertion (authorized or not) about the sender. 1) Depends on the receiver’s system. Pass 1) Client is authorized to send emails with the given identity. 1) Whitelist the domain in terms of SPF. 1) Depends on the receiver’s system. 1) Client is not authorized to send emails with the given identity. Fail 2) Make decision based on the DMARC policy. 1) Client is not authorized to send emails with the given identity. 1) Receiver should not reject the message. Softfail 2) No strong policy specified by the domain owner. 2) May mark the message as suspicious. 1) May defer the message. Temperror 1) A temporary error occurred during retrieving the SPF policy. 2) May deliver the message and mark it. Permerror 1) Parsing problem in published SPF. 1) May deliver the message and mark it. their adoption of email security extensions, 1.2.3.4 From: [email protected] 3) we are the first to measure the extent of SPF and DMARC deployment by the subdomains of the top-ranked web- MTA FIL SP sites to gain better insight into how attackers can abuse Sender's IP bob.com TER address AM subdomains to send spoofed emails, Bob MDA 4) we show that it is possible to send forged emails from 5.6.7.8 non-existent subdomains when a DMARC rule is not Alice strict enough regarding subdomains, MTA mallory.com 5) we also demonstrate how syntactically wrong SPF rules From: [email protected] Mallory may break the trust-based authentication system of se- lected email service providers by allowing forged emails Fig. 1. Email sending and receiving procedure. to land in the user inbox. To remediate vulnerable SPF rules, we contact relevant An effective anti-spoofing mechanism needs to differentiate Computer Security Incident Response Teams (CSIRTs) re- the Mallory message from the legitimate Bob’s mail. The sponsible for misconfigured domains and we measure the current first lines of defence to protect end-users from spoofed effectiveness of our notifications. To encourage reproducibility, emails include SPF [4], DKIM [5], and DMARC [6]. we make our measurement data available upon request. The rest of the paper is organized as follows. Section A. SPF – Sender Policy Framework II provides background on SPF and DMARC. Section III SPF is a set of text-form rules in TXT resource records of the specifies possible threat models and introduces our approach to Domain Name System (DNS). SPF specifies a list of servers generate the datasets and find defensively registered domains. allowed to send emails on behalf of a specific domain. During Sections IV presents the analysis of the results for scanned mail delivery over the SMTP protocol, the recipient server domains and subdomains as well as for emulation of SPF rules. authenticates the sender Mail Transfer Agent (MTA) using a In Section V, we study the trust-based authentication issue and given HELO or MAIL FROM identity based on the published Section VI describes remediation. Finally, Section VII reviews SPF record and the IP address of the sender—SPF needs to related work and Section VIII concludes the paper. contain the domain portion of the MAIL FROM identity. In our example, the Alice server gets the TXT records of the bob.com II. BACKGROUND ON ANTI-SPOOFING TECHNIQUES domain from DNS. Then, it checks whether the sender IP To understand the issue of email authentication better, we address is on the list of IP addresses allowed to send emails briefly explain the process of mail delivery. Figure 1 shows from the bob.com domain and decides whether the message Bob (sender) who sends legitimate mails to Alice (receiver). should be rejected or delivered to Alice. Mallory (attacker) wants to send an email that impersonates The decision is made by the check_host function de- Bob to Alice. Mallory and Bob use their respective servers scribed in RFC 7208 [4] that takes three arguments on input (mallory.com and bob.com) to send mails. The Mail De- (IP address of the sender, the domain, the MAIL FROM or HELO livery Agent (MDA) on the Alice server delivers two emails identity) and returns one of the seven possible results shown with the same sender address ([email protected]) but coming from in Table I.