The Unintended Consequences of Spam Prevention

Slides:



Advertisements
Similar presentations
Sergei Komarov. DNS  Mechanism for IP hostname resolution  Globally distributed database  Hierarchical structure  Comprised of three components.
Advertisements

Addressing spam and enforcing a Do Not Registry using a Certified Electronic Mail System Information Technology Advisory Group, Inc.
DNSSEC & Validation Tiger Team DHS Federal Network Security (FNS) & Information Security and Identity Management Committee (ISIMC) Earl Crane Department.
© 2007 Convio, Inc. Implementation of Sender ID Bill Pease, Chief Scientist Convio.
DNSOP WG IETF-67 SPF/Sender-ID DNS & Internet Threat Douglas Otis
DomainKeys Identified Mail (DKIM): Introduction and Overview Eric Allman Chief Science Officer Sendmail, Inc.
1 Internet Networking Spring 2006 Tutorial 8 DNS and DHCP as UDP applications.
The Domain Name System Overview Introduction DNS overview How DNS helps us? Summary.
The Application Layer Chapter 7. Where are we now?
Sender policy framework. Note: is a good reference source for SPFhttp://
Pro Exchange SPAM Filter An Exchange 2000 based spam filtering solution.
Spam Reduction Techniques Using greylisting and SpamAssassin.
11 SECURING INTERNET MESSAGING Chapter 9. Chapter 9: SECURING INTERNET MESSAGING2 CHAPTER OBJECTIVES  Explain basic concepts of Internet messaging. 
© 2007 Convio, Inc. HOW TO: Best Practices for Sending to Organizations Confidential for use by American Cancer Society and Convio – Copyright ©
The Linux Operating System Lecture 7: Tonga Institute of Higher Education.
Wireless and Security CSCI 5857: Encoding and Encryption.
DNS Related Commands Sayed Ahmed Computer Engineering, BUET, Bangladesh (Graduated on 2001 ) MSc, Computer Science, U of Manitoba, Canada
DNS Security Pacific IT Pros Nov. 5, Topics DoS Attacks on DNS Servers DoS Attacks by DNS Servers Poisoning DNS Records Monitoring DNS Traffic Leakage.
Postfix Mail Server Postfix is used frequently and handle thousands of messages. compatible with sendmail at command level. high performance program easier-
Packet Filtering & Firewalls. Stateless Packet Filtering Assume We can classify a “good” packet and/or a “bad packet” Each rule can examine that single.
SPF/Sender-ID DNS & DDoS Threats Operations Analysis and Research Center for the Internet Douglas Otis November 3, 2007
Data Communications and Networks Chapter 5 – Network Services DNS, DHCP, FTP and SMTP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
S/MIME and Certs Cullen Jennings
Silicon & Software Systems (S3)‏ Copyright © Silicon & Software Systems Limited Antispam protection IT Department 20/03/2008 Ondrej Valousek.
SPF/Sender-ID DNS & DDoS Threats Internet Security Operations and Intelligence II Douglas Otis
Application Security: (April 10, 2013) © Abdou Illia – Spring 2013.
* Agenda  What is the DNS ?  Poisoning the cache  Short term solution  Long term solution.
DNS Security Extension 1. Implication of Kaminsky Attack Dramatically reduces the complexity and increases the effectiveness of DNS cache poisoning –No.
A Quick Look At How Works Understanding the basics of how works can make life a lot easier for any user. Especially those who are interested.
DNS Security 1. Fundamental Problems of Network Security Internet was designed without security in mind –Initial design focused more on how to make it.
Sender policy framework. Note: is a good reference source for SPFhttp://
Discussion of OCP/SMTP profile and some Use cases Presented by Abbie Barbir
Grades update. Homework #1 Count35 Minimum Value47.00 Maximum Value Average
Network Applications: DNS Y. Richard Yang 2/1/2016.
sender policy framework
Communications and Networks
Routers and Redundancy
Security Issues with Domain Name Systems
IETF 66 EAI WG Testing Report
Attacking DNS Slides adapted from Olaf Kolkman, RIPE Lecture 18
Networking Applications
How Works Ameera Al Ghamdi ID:
DNS Security.
Networking CS 3470, Section 1 Sarah Diesburg
Routers and Redundancy
Secure Sockets Layer (SSL)
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
Geoff Huston APNIC Labs September 2017
Hervey Allen Chris Evans Phil Regnauld September 3 – 4, 2009
DNS Cache Poisoning Attack
CPS 512 midterm exam #1, 10/5/17 Your name please: NetID:_______ Sign for your honor:____________________________.
DNS security.
DNSSEC Basics, Risks and Benefits
By Ian Foster, Jon Larson, Max Masich, Alex C
Domain-based Authentication, Reporting, and Conformance
New Functionality in ARIN Online
Re-Engineering the Root of the DNS
has many aspects that work together to give people almost instant communication from any computer on the internet to any other computer There.
Networking CS 3470, Section 1 Sarah Diesburg
How Works Ameera Al Ghamdi ID:
DNS: Domain Name System
KERBEROS.
Firewalls Chapter 8.
Applications Layer Functionality & Protocols
COMPUTER NETWORKS PRESENTATION
Chapter 7 Network Applications
 Zone in name space  DNS IN THE INTERNET  Generic domains :There are fourteen generic domains, each specifying an organization type.
Slides Credit: Sogand Sadrhaghighi
Data Communications and Networks
Presentation transcript:

The Unintended Consequences of Email Spam Prevention Measure closed DNS resolvers DoS attack against nameserver Sarah Scheffler, Sean Smith, Yossi Gilad, Sharon Goldberg Boston University

Closed Resolvers Serve Only Their Network bob.com bob Resolver alice.com alice Closed resolvers don’t respond to queries made outside their network ns1.charlie.com

This work: Using email spam prevention to make closed resolvers do my bidding bob.com Resolver alice.com alice ns1.charlie.com

Outline Querying closed DNS resolvers using spam prevention Bypassing query limits Testing the query limit in practice

Background: How Email Works bob.com bob MTA alice.com To talk about SPF, must first talk about SMTP. alice@A.com wants to send message to bob@B.com A.Com and B.com each have a “Mail Transfer Agent” (MTA) that communicate over SMTP Alice writes message, A.com MTA sends it to B.com MTA, which gives it to Bob alice MTA to:bob@bob.com from:alice@alice.com

Why Email Needs Sender Verification bob.com bob MTA alice.com But, much like the normal post office, SMTP does not verify that the sender “owns” the address. Evil.com MTA can send message as alice@A.com, which might be spam or might even impersonate Alice to Bob. Raw SMTP does not have a way to tell the difference. alice MTA MTA to:bob@bob.com from:alice@alice.com evil.com

SPF Records are Sender Whitelists bob.com SPF record for alice.com 1.2.3.4 Resolver MTA SPF ns1.alice.com alice.com Only now SPF on the receiving MTA is going to verify the sender’s identity. When B receives a message from A.com, it asks what the SPF record for A.com is. The SPF record is stored as a TXT record in the A.com authoritative nameserver. In this example, it says the server at IPv4 address 1.2.3.4 is allowed to send messages for A.com, and all other servers should be rejected. This info is passed back to the B.com SPF implementation. In this case, the message was sent from 1.2.3.4, so it is accepted. alice MTA 1.2.3.4 to:bob@bob.com from:alice@alice.com

SPF Rejects Non-Whitelisted Senders bob.com SPF record for alice.com 1.2.3.4 Resolver MTA SPF ns1.alice.com alice.com And now if evil.com tries to send a message from A.com, since the message was not sent from 1.2.3.4, instead it was sent from this evil.com server, it gets rejected by the B.com SPF implementation. alice MTA 6.6.6.6 MTA 1.2.3.4 to:bob@bob.com from:alice@alice.com evil.com

Recursively include other SPF Records foo.alice.com alice.com carol.com alice.com foo.alice.com carol.com bob.com SPF record for alice.com include: foo.alice.com include: carol.com Resolver MTA SPF ns1.alice.com alice.com ns1.foo. alice.com And now the B.com SPF implementation must make three additional queries, for those new SPF records. In this example, each new SPF record allows a single IPv4 address to send from it. The SPF implementation queries for sd1.A.com, sd2.A.com, and C.com, wherever those all are. alice MTA 1.2.3.5 ns1. carol.com to:bob@bob.com from:alice@alice.com SPF record for carol.com 1.2.3.6 SPF record for foo.alice.com 1.2.3.5

Goal was to make closed resolvers do my bidding bob.com Resolver alice.com alice ns1.charlie.com

Goal Achieved! Induced query at closed resolver! bob.com SPF record for alice.com include: target.net Resolver MTA SPF ns1.alice.com alice.com alice MTA to:bob@bob.com from:alice@alice.com ns1.target.net

Outline Querying closed DNS resolvers using spam prevention Bypassing query limits Testing the query limit in practice

New Goal: Induce Many Queries at Closed Resolver SPF record for alice.com include: 1.target.net include 2.target.net include: other.com bob.com Resolver MTA SPF ns1.alice.com alice.com alice ns1.other.com ns1.target.net MTA

How many queries can we induce at closed resolver How many queries can we induce at closed resolver? RFC7208 limit of 10 query-causing terms “SPF implementations MUST limit the total number of those terms [which cause DNS queries] to 10… to avoid unreasonable load on the DNS.” Spirit of the limit: 10 total queries Letter of the limit: 10 query-causing terms Now we’ve started to make a lot of queries. One could ask what’s stopping an evil domain from causing a large number of queries to an unrelated nameserver. The RFC limits the number of DNS query-causing terms to 10. But notice that we haven’t bounded the number of queries. We’ve bounded the number of terms.

Letter of Law but not Spirit of Law  Unlimited Queries! evil.com evil.com 1 2 3 4 5 6 7 8 9 1.evil.com 1.evil.com bob.com 11 12 13 14 15 16 17 18 19 Resolver 2.evil.com 2.evil.com MTA SPF ns1.evil.com evil.com . . . alice By making 9 include statements for an unrelated server, an evil sender can cause the B.com recursive resolver to repeatedly issue queries to the target.com nameserver. With mutually-recursive SPF records, they could extend this, getting an infinite loop of queries, where 9 queries are issued to the target for each 1 issued to the sending nameserver. MTA to:bob@bob.com from:alice@evil.com ns1.target.net

Outline Querying closed DNS resolvers using spam prevention Bypassing query limits (in spirit) Testing the query limit in practice

Ethically Testing the RFC7208 Limit That’s it in total. Measure induced queries DoS only ourselves Send minimal mail to each MTA Mail should not be delivered to humans

SPF Configurations for Testing the Limit Obey the letter of the limit, but not the spirit of the limit Disregard the letter and spirit of the limit Control: Obey the letter and spirit of the limit 4 3 2 1 6 5 1f 1d 1e 1b 1c 1a 2f 2d 2e 2b 2c 2a 3f 3d 3e 3b 3c 3a 4f 4d 4e 4b 4c 4a 5f 5d 5e 5b 5c 5a 6f 6d 6e 6b 6c 6a *.treespf.emaildns.net 8 9 10 6 7 4 5 2 3 1 18 19 20 16 17 14 15 12 13 11 *.badspf.emaildns.net Goodspf is a baseline determining that SPF behaves as expected when checking a record with <10 include statements. It has 5 include statements. Badspf is a baseline detemrining that SPF behaves as expected when checking a record with >10 include statements. It has 20 include statements. Treespf is our test for whether or not include statements can be used recursively to bypass the limit of 10. Treespf has 6 include statements, but each of those induces an *additional* 6 statements, for a total of 42. TODO put treespf first 4 5 2 3 1 *.goodspf.emaildns.net

Measuring the RFC7208 Limit bob.com Resolver MTA SPF zmap ns1.emaildns.net That’s it in total. MTA Partial scan: 0.0.0.0 – 34.255.255.255

Finding: The Spirit of the Limit Is Not Enforced 42 Letter of Limit Enforced Actual 34.3 No SPF 10 Spirit of Limit Enforced 3e 20 No Limit Enforced No SPF 10 Limit Enforced Actual 7.79 Coll res!!! Actual 4.87 5 Expected No SPF

Additional Finding: Many Closed Resolvers 7303 (82%) 8889 resolvers 82% of resolvers that queried us were closed Nearly all had both TXID randomization and port ID randomization Nearly a decade after Kaminsky’s attack, the patch is in place! Caveat: only applies to resolvers serving MTAs from 0.0.0.0-35.0.0.0

Takeaway 1: Induce Queries in Closed Resolvers with SPF bob.com Resolver MTA ns1.alice.com alice.com alice ns1.other.com ns1.target.net MTA

Takeaway 2: Letter of SPF Query Limit Does Not Match Spirit of Query Limit bob.com Resolver MTA SPF zmap ns1.emaildns.net That’s it in total. MTA

Writing IETF internet draft to address this in SPF sscheff@bu.edu Takeaway 3: Potential DoS Attack if Spirit and Letter of Limit do not match evil.com 1 2 3 4 5 6 7 8 9 1.evil.com bob.com 11 12 13 14 15 16 17 18 19 Resolver 2.evil.com MTA SPF ns1.evil.com evil.com . . . alice By making 9 include statements for an unrelated server, an evil sender can cause the B.com recursive resolver to repeatedly issue queries to the target.com nameserver. With mutually-recursive SPF records, they could extend this, getting an infinite loop of queries, where 9 queries are issued to the target for each 1 issued to the sending nameserver. MTA ns1.target.net Writing IETF internet draft to address this in SPF sscheff@bu.edu

DKIM: verify email signature with key in nameserver bob.com Verif key for alice.com 0xa9ff2e8b Resolver MTA ns1.alice.com alice.com Only now SPF on the receiving MTA is going to verify the sender’s identity. When B receives a message from A.com, it asks what the SPF record for A.com is. The SPF record is stored as a TXT record in the A.com authoritative nameserver. In this example, it says the server at IPv4 address 1.2.3.4 is allowed to send messages for A.com, and all other servers should be rejected. This info is passed back to the B.com SPF implementation. In this case, the message was sent from 1.2.3.4, so it is accepted. alice MTA to:bob@bob.com from:alice@alice.com -Alice