Advanced Mail hyili.

Slides:



Advertisements
Similar presentations
Enabling Secure Internet Access with ISA Server
Advertisements

Protocols and Troubleshooting Brandon Checketts.
© 2007 Convio, Inc. Implementation of Sender ID Bill Pease, Chief Scientist Convio.
DomainKeys Identified Mail (DKIM): Introduction and Overview Eric Allman Chief Science Officer Sendmail, Inc.
Sender policy framework. Note: is a good reference source for SPFhttp://
23 October 2002Emmanuel Ormancey1 Spam Filtering at CERN Emmanuel Ormancey - 23 October 2002.
Spam Reduction Techniques Using greylisting and SpamAssassin.
DomainKeys Identified Mail (DKIM) D. Crocker ~ bbiw.net dkim.org  Consortium spec Derived from Yahoo DomainKeys and Cisco Identified Internet Mail  IETF.
DomainKeys Identified Mail (DKIM) D. Crocker Brandenburg InternetWorking mipassoc.org/mass  Derived from Yahoo DomainKeys and Cisco.
SHASHANK MASHETTY security. Introduction Electronic mail most commonly referred to as or e- mail. Electronic mail is one of the most commonly.
Login Screen This is the Sign In page for the Dashboard Enter Id and Password to sign In New User Registration.
Review of Last Session Search Engine Optimisation (SEO) Search Engine Optimisation (SEO) You can fine-tune your site so that the search engines notice.
Identity Based Sender Authentication for Spam Mitigation Sufian Hameed (FAST-NUCES) Tobias Kloht (University of Goetingen) Xiaoming Fu (University.
Mail Services.
SMTP PROTOCOL CONFIGURATION AND MANAGEMENT Chapter 8.
Login Screen This is the Sign In page for the Dashboard New User Registration Enter Id and Password to sign In.
Masud Hasan Secue VS Hushmail Project 2.
IETF 66 EAI WG Testing Report TWNIC
DNS-based Message-Transit Authentication Techniques D. Crocker Brandenburg InternetWorking D. Crocker Brandenburg InternetWorking.
Introduction to Internet Mail Abridged & Updated by Hervey Allen Noah Sematimba Based on Materials by Philip Hazel.
A Trust Overlay for Operations: DKIM and Beyond Dave Crocker Brandenburg Internet Working bbiw.net Apricot / Perth 2006 Dave Crocker Brandenburg.
Advanced Mail. Greylisting mail/postgrey /usr/local/etc/postfix/postgrey_whitelist_clients /usr/local/etc/postfix/postgrey_whitelist_recipients.
What is and How Does it Work?  Electronic mail ( ) is the most popular use of the Internet. It is a fast and inexpensive way of sending messages.
Postfix Mail Server Postfix is used frequently and handle thousands of messages. compatible with sendmail at command level. high performance program easier-
Microsoft Office Outlook 2013 Microsoft Office Outlook 2013 Courseware # 3252 Lesson 6: Organizing Information.
1 SMTP - Simple Mail Transfer Protocol –RFC 821 POP - Post Office Protocol –RFC 1939 Also: –RFC 822 Standard for the Format of ARPA Internet Text.
SPF/Sender-ID DNS & DDoS Threats Operations Analysis and Research Center for the Internet Douglas Otis November 3, 2007
Responsible Submitter An SMTP Service Extension IETF 60 San Diego, CA Harry Katz Microsoft Corp. 8/4/2004.
1. 2 Overview In Exchange security is managed by assigning permissions in Active Directory Exchange objects are secured with DACL and ACEs Permissions.
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
Silicon & Software Systems (S3)‏ Copyright © Silicon & Software Systems Limited Antispam protection IT Department 20/03/2008 Ondrej Valousek.
Source pictures for document ”Thoughts about increasing spam annoyance” by License: This material may be distributed only subject.
LinxChix And Exim. Mail agents MUA = Mail User Agent Interacts directly with the end user  Pine, MH, Elm, mutt, mail, Eudora, Marcel, Mailstrom,
Homework 04 Hint Mail System. Computer Center, CS, NCTU 2 Software  Postfix mail/postfix  POP/IMAP mail/dovecot  MTA filter security/amavisd-new 
Copyright ©2015 WatchGuard Technologies, Inc. All Rights Reserved WatchGuard Training WatchGuard XCS What’s New in version 10.1.
SMTP Tapu Ahmed Jeremy Nunn. Basics Responsible for electronic mail delivery. Responsible for electronic mail delivery. Simple ASCII protocol that runs.
Sender policy framework. Note: is a good reference source for SPFhttp://
Advanced Mail. Computer Center, CS, NCTU 2 Introduction  SPAM vs. non-SPAM Mail sent by spammer vs. non-spammer  Problem of SPAM mail Over 99% of s.
Draft-lemonade-imap-submit-00.txt “Forward without Download” Allow IMAP client to include previously- received message (or parts) in or as new message.
Fighting Spam in an Exchange Environment Tzahi Kolber IT Supervisor - Polycom Israel.
Spring 2006 CPE : Application Layer_ 1 Special Topics in Computer Engineering Application layer: Some of these Slides are Based on Slides.
Anti-Spam Updates Activity Coordination Meeting March 2006 Kevin Hill.
Presented by Phani Krishna P
sender policy framework
concepts & protocols
Security Issues with Domain Name Systems
SMTP - Simple Mail Transfer Protocol POP - Post Office Protocol
IETF 66 EAI WG Testing Report
Sender ID: An Overview for Registrars ICANN Vancouver December 1, 2005
Networking Applications
TMG Client Protection 6NPS – Session 7.
Network Administration Practice Homework4 – Mail System
SMTP: simple mail transfer protocol
An Application with Active Spoof Monitoring and Control
What Is DMARC Brian Reid Microsoft Office Servers and Services MVP
draft-lemonade-imap-submit-01.txt “Forward without Download”
Is this legitimate or not?
Hypertext Transport Protocol
Advanced Mail.
SUBMITTED BY: NAIMISHYA ATRI(7TH SEM) IT BRANCH
Simple Mail Transfer Protocol (SMTP)
IIS.
Social Media And Global Computing Sending
06 | Planning Exchange Online and Configuring DNS Records
Real World Advanced Threat Protection
William Stallings Data and Computer Communications
This is the Sign In page for the Dashboard
Chapter 7 Network Applications
Slides Credit: Sogand Sadrhaghighi
MASS BOF IETF63, Paris 4 August 2005
Presentation transcript:

Advanced Mail hyili

Introduction What is Email SPAM? Problem of SPAM How to detect? Also known as junk email Ex. Phishing mail, malware mail, and unsolicited email Problem of SPAM In 2016, Over 50% of E-mails are SPAM! How to detect? Client-based detection Content-based detection Email Spoofing

Introduction – Client-based detection Spammer detection Actually detect who is sending SPAM Rely on IP, domain name, or Email address to identify Open relay servers Zombie servers Known spammers Known proxy servers ... For example Greylisting DNSBL RBL

Introduction – Content-based detection Spam detection Actually detect if an email is SPAM or not Rely on the email content to identify Pattern of advertising Malware pattern ... For example Anti-Spam scan Anti-Virus scan ...Machine learning

Introduction – Email Spoofing Sender information of the email can be spoof without check by default. Spammers may pretent you to send email. Countermeasure SPF DKIM DMARC

Overview The following techniques are some (new) tools for an administrator to fight with spammers: Greylisting DNSBL RBL The following is techniques for prevent Email Spoofing: SPF DKIM DMARC

Greylisting Greylisting is a client-based method that can stop mails coming from some spamming programs. Behavior of different clients while receiving SMTP response codes While spammers prefer to send mails to other recipients rather than keeping log and retrying later, MTAs have the responsibility of retrying a deferred mail. Response Codes 2xx 4xx 5xx Normal MTA Success Retry later Give-up Most Spamming Programs Ignore and send another

Greylisting – Idea and Workflow Idea of greylisting: Taking use of 4xx SMTP response code to stop steps of spamming programs. Steps: A database to store (recipient, client-ip) pair. Reply a 4xx code for the first coming of every (recipient, client-ip) pair. Allow retrial of this mail after a period of time (usually 5~20 mins). Suitable waiting time will make the spamming programs giving up this mail.

Greylisting – Tool Tool: mail/postgrey (port or pacakge) A policy service of postfix. Daemon-based, like amavisd

Greylisting – Enable Greylisting and Configuration Setup In /etc/rc.conf service postgrey start Run on TCP port 10023 by default In main.cf Reload Postfix postgrey_enable="YES" smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:127.0.0.1:10023

Greylisting – Log and Others When a mail is reject by postgrey, you can find it in /var/log/maillog Whitelist Configuration /usr/local/etc/postfix/postgrey_whitelist_clients /usr/local/etc/postfix/postgrey_whitelist_recipients 450 4.2.0 <hyili@cs.nctu.edu.tw>: Recipient address rejected: Greylisted, see http://postgrey.schweikert.ch/help/cs.nctu.edu.tw.html (in reply to RCPT TO command)

Greylisting – Problem of Greylisting It cannot handle the domain which has large server farms (MSA pools) without using white list. Microsoft Exchange Online Office 365 Gmail Outlook ...

Sender Policy Framework (SPF) A client-based method to detect whether a client is authorized or not. Checking for smtp.mailfrom (Return-Path)

Sender Policy Framework (SPF) – Idea and Workflow Idea of SPF Using DNS TXT record to provide authorized server list for the query domain. Steps A MTA connects to the server and sends an email. Take the email’s smtp.mailfrom’s domain (ex. hyili@hyili.idv.tw) and the MTA’s ip. Query the domain’s TXT record for authorized server list. Check if that MTA is authorized to send email as hyili.idv.tw and see how to handle the email.

SPF Record Syntax – Tool Tool: mail/postfix-policyd-spf-perl (port or package) A policy service of postfix. Daemon-based, like amavisd

SPF Record Syntax – Enable SPF Check in Postfix Setup In /usr/local/etc/postfix/main.cf In /usr/local/etc/postfix/master.cf Reload Postfix A policy service of postfix. Daemon-based, like amavisd spf-policy_time_limit = 3600 smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service unix:private/spf-policy spf-policy unix - n n - 0 spawn user=nobody argv=/usr/local/libexec/postfix-policyd-spf-perl

Sender Policy Framework (SPF) – Backward Compatibility When there is no SPF record, guess by A record. Comparative result – when SPF record available. spf=neutral (google.com: 140.131.188.43 is neither permitted nor denied by best guess record for domain of student@hyili.idv.tw) smtp.mailfrom=hyili@hyili.idv.tw; spf=pass (google.com: domain of hyili@hyili.idv.tw designates 140.131.188.43 as permitted sender)

SPF Record Syntax – Mechanisms (1/3) all Always matches Usually at the end of the SPF record ip4 (NOT ipv4) ip4: <ip4-address> ip4: <ip4-network>/<prefix-length> ip6 (NOT ipv6) ip6:<ip6-address> ip6:<ip6-network>/<prefix-length>

SPF Record Syntax – Mechanisms (2/3) a/<prefix-length> a:<domain> a:<domain>/<prefix-length> mx mx/<prefix-length> mx:<domain> mx:<domain>/<prefix-length>

SPF Record Syntax – Mechanisms (3/3) ptr ptr:<domain> exists exists:<domain> include include:<domain> Also lookup record from <domain> Warning: If the domain does not have a valid SPF record, the result is a permanent error. Some mail receivers will reject based on a PermError. v=spf1 a mx ~all

SPF Record Syntax – Qualifiers & Evaluation + Pass (default qualifier) - Fail ~ SoftFail ? Neutral v=spf1 a mx ~all cs.nctu.edu.tw "v=spf1 a mx a:csmailer.cs.nctu.edu.tw a:csmailgate.cs.nctu.edu.tw a:csmail.cs.nctu.edu.tw ~all"

SPF Record Syntax – Qualifiers & Evaluation Mechanisms are evaluated in order: (first match rule) If a mechanism results in a hit, its qualifier value is used. If no mechanism or modifier matches, the default result is "Neutral“ Ex. “v=spf1 +a +mx -all” “v=spf1 a mx -all” v=spf1 a mx ~all cs.nctu.edu.tw "v=spf1 a mx a:csmailer.cs.nctu.edu.tw a:csmailgate.cs.nctu.edu.tw a:csmail.cs.nctu.edu.tw ~all"

SPF Record Syntax – Evaluation Results Explanation Intended action Pass The SPF record designates the host to be allowed to send Accept Fail The SPF record has designated the host as NOT being allowed to send Reject SoftFail The SPF record has designated the host as NOT being allowed to send but is in transition Accept but mark Neutral The SPF record specifies explicitly that nothing can be said about validity None The domain does not have an SPF record or the SPF record does not evaluate to a result PermError A permanent error has occurred (eg. Badly formatted SPF record) Unspecified TempError A transient error has occurred Accept or reject

SPF Record Syntax – Modifier v=spf1 redirect=cs.nctu.edu.tw redirect redirect=<doamin> When mail server is outside from my domain The SPF record for domain replace the current record. The macro- expanded domain is also substituted for the current-domain in those look-ups.

SPF Record Syntax – Modifier v=spf1 mx a exp=error.hyili.idv.tw exp exp=<doamin> Explaination If an SMTP receiver rejects a message, it can include an explanation. An SPF publisher can specify the explanation string that senders see. This way, an ISP can direct nonconforming users to a web page that provides further instructions about how to configure SASL. The domain is expanded; a TXT lookup is performed. The result of the TXT query is then macro-expanded and shown to the sender. Other macros can be used to provide a customized explanation.

Sender Policy Framework (SPF) – SPF and Forwarding What will happened if SPF meet mail forwarding?

Sender Policy Framework (SPF) – SPF and Forwarding If the email is forwarded without SRS cs.nctu.edu.tw => hyili.idv.tw(140.131.188.43) => google.com 220 csmailer.cs.nctu.edu.tw ESMTP Postfix MAIL FROM: hyili@cs.nctu.edu.tw 250 2.1.0 Ok RCPT TO: hyili@hyili.idv.tw 250 2.1.5 Ok DATA 354 End data with <CR><LF>.<CR><LF> SRS testing mail . 250 2.0.0 Ok: queued as C3D9A18DB1 spf=softfail (google.com: domain of transitioning hyili@cs.nctu.edu.tw does not designate 140.131.188.43 as permitted sender) smtp.mailfrom=hyili@cs.nctu.edu.tw

Sender Policy Framework (SPF) – Enable Sender Rewrite Scheme Tool: mail/postsrsd Setup In /usr/local/etc/postfix/main.cf In /etc/rc.conf Start postsrsd service Reload postfix sender_canonical_maps = tcp:127.0.0.1:10001 sender_canonical_classes = envelope_sender recipient_canonical_maps = tcp:127.0.0.1:10002 recipient_canonical_classes = envelope_recipient,header_recipient postsrsd_enable=”YES” postsrsd_flags=”...”

DomainKeys Identified Mail (DKIM) A content-based method to verify the source of a mail (with only few computation cost.) Checking for the connected MTA’s domain

DomainKeys Identified Mail (DKIM) – Goals Validate message content itself Transparent to end users No client User Agent upgrades required But extensible to per-user signing Allow sender delegation Outsourcing Low development, and use costs Avoid large PKI, new Internet services No trusted third parties (except DNS)

DomainKeys Identified Mail (DKIM) – Idea Msg header authentication DNS identifiers Public keys in DNS End-to-end Between origin/receiver administrative domains. Not path-based ※ Digital signatures

DomainKeys Identified Mail (DKIM) – Technical High-points Signs body and selected parts of header Signature transmitted in DKIM-Signature header Public key stored in DNS In _domainkey subdomain New RR type, fall back to TXT Namespace divided using selectors Allows multiple keys for aging, delegation, etc. Sender Signing Policy lookup for unsigned (outgoing) or improperly signed mail (incoming)

DomainKeys Identified Mail (DKIM) – DKIM-Signature header (1/2) v= Version a= Hash/signing algorithm q= Algorithm for getting public key d= Signing domain i= Signing identity s= Selector c= Canonicalization algorithm (simple or relaxed) t= Signing time (seconds since 1/1/1970) x= Expiration time h= List of headers included in signature; dkim-signature is implied b= The signature itself bh= Body hash

DomainKeys Identified Mail (DKIM) – DKIM-Signature header (2/2) Example: DNS query will be made to: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hyili.idv.tw; s=2017; t=1493246840; bh=tlzeNLTwC0Zv4kvvPcSUFZ/AsgR4l2snpljs1thAmE8=; h=To:Subject:Date:From; b=V+EeBrWY+1EP6fJPRc+jz+F41YL9EqEAUP5aOnktCQ0re+iQhNG2Z02WgSuKT+wY6 FGQ5zXJfG25GSjxgxmwXB1VmCJUlE3Nv7NmhC54nPyfKh4EZnXs9KwK3XGF2iaBO52 9kNS2qkEbSFi92+T1VCqGQ8IcMiXU6V/YRm8rNlmczrLBAoNyIXu7zlSA0Tezaqn2y 6g7g/H8/VyyVMySzL9Gf70iWCKg4HhsgEAzMCEZHTtyinxXP8D5xH7AB5ec59N40An Atgo1+J/EOUg37Ddz/VLWPAYCvQIk4xWOXkaHcPpASImvFR+CRVabAmBqRUWigVEQc ZIHRLFc8aQtaUmuMf7jZ1n8Y2dTYWEQJPXY/m0IkWUGwEDbUiUc9W27O3KHt5FGLYs YU1bIzxI/M1ZOwRcsbWVlQmxCtcmpsWMcYbbU+WzR6cwftGluWEwyFX9HgZPcLYy8r bxvFcj3o2p77eyNxgAZ1ZPAA7pRGCAsSOpcT7gaBRNLgAnrU/0vPyfaWpWIjGia4L9 JKfBk5rKAHwaLIW+fQzZYQLCdxExWdRsypRizZ7UGi/dSaBNKXUrr4xct5TC/zVhn9 mP6NxcRYG9iEhb7AICpsE1EVAjoyPmEM/oDugIplwxikHjhIkSN0Z247Yl+r3k6vdg DAhS9g/Z4GfnmTqtHmWm1eKI= 2017._domainkey.hyili.idv.tw

DomainKeys Identified Mail (DKIM) – Enable OpenDKIM (1) Setup In /usr/local/etc/mail/opendkim.conf Canonicalization relaxed/simple KeyTable refile:/var/db/dkim/opendkim.keytable LogWhy yes SigningTable refile:/var/db/dkim/opendkim.signingtable Socket local:/var/run/dkim/opendkim.sock SyslogSuccess yes UserID opendkim:opendkim

DomainKeys Identified Mail (DKIM) – Enable OpenDKIM (2) Setup Preparing environment #add user opendkim:opendkim #add postfix to opendkim group mkdir -p /var/run/dkim /var/db/dkim touch /var/db/dkim/opendkim.keytable touch /var/db/dkim/opendkim.signingtable chown opendkim:opendkim /var/run/dkim /var/db/dkim chmod 0755 /var/run/dkim

DomainKeys Identified Mail (DKIM) – Enable OpenDKIM (3) Setup Generate key file and TXT record export domain=hyili.idv.tw export selector=2017 mkdir -p /usr/local/etc/mail/keys/$domain cd /usr/local/etc/mail/keys/$domain opendkim-genkey --selector=$selector --domain=$domain --subdomains −b 4096 -v chown -R opendkim:opendkim /usr/local/etc/mail/keys/$domain echo "$selector._domainkey.$domain $domain:$selector:/usr/local/etc/mail/keys/$domain/$selector.private" | tee /var/db/dkim/opendkim.keytable echo "*@$domain $selector._domainkey.$domain" | tee /var/db/dkim/opendkim.signingtable

DomainKeys Identified Mail (DKIM) – Enable OpenDKIM (4) Setup In /etc/rc.conf In /usr/local/etc/postfix/main.cf Start milter-opendkim service Reload postfix milteropendkim_enable="YES" milteropendkim_uid="opendkim” milteropendkim_cfgfile="/usr/local/etc/mail/opendkim.conf" smtpd_milters = unix:/var/run/dkim/opendkim.sock non_smtpd_milters = $smtpd_milters milter_default_action = accept

DMARC A client-based method that can provide expand control policy for your domain. Checking for header.from (which would be shown as sender in gmail GUI)

DMARC – Idea and Workflow Idea of DMARC Like SPF, DMARC using TXT record to list policies. Based on SPF and dkim Steps A MTA connects to the server and sends an email. After SPF and DKIM have been done. Take the email’s header.from’s domain (ex. hyili@hyili.idv.tw). Query _dmarc.hyili.idv.tw’s TXT record for domain policies. Check if that MTA is authorized to send email as hyili.idv.tw and see how to handle the email. Decide to inform the domain owner or not.

DMARC – Common Tags v=<version> p=<policy> <version>: DMARC1 Mandatory. This must be the first supplied tag=value within the dmarc specific text and, while DMARC tag=value pairs are not case sensitive, this one must have the explicit upper-case value DMARC1. p=<policy> <policy>: none, quarantine, reject Mandatory and must be the second tag=value pair. Defines the policy the sending MTA advises the receiving MTA to follow.

DMARC – Common Tags sp=<sub-domain policy> <sub-domain policy>: none, quarantine, reject Optional. If the following DMARC RR is present: Then failed mail from user@example.com would be rejected but mail from user@a.example.com or user@b.a.example.com or user@anything.example.com would be quarantined. $ORIGIN example.com. ... _dmarc IN TXT "v=DMARC1;p=reject;sp=quarantine"

DMARC – Common Tags rua=<@mail> ruf=<@mail> <@mail>: Optional. A comma delimited list of URI(s) to which aggregate mail reports should be sent. ruf=<@mail> <@mail>: Optional. A comma delimited list of URI(s) to which detailed failure reports should be sent. pct=<percent> <percent>: Number from 0 to 100 Optional. Defines the percentage of mail to which the DMARC policy applies.

Anything else? Of course! Advanced Mail Anything else? Of course!

Sender ID RFC4406, 4405, 4407, 4408 Caller ID for E-mail + Sender Policy Framework (SPF 2.0) http://www.microsoft.com/mscorp/safety/technologies/send erid/default.mspx

Sender ID – paypal.com example knight:~ -lwhsu- dig paypal.com txt ;; ANSWER SECTION: paypal.com. 3600 IN TXT "v=spf1 mx include:spf-1.paypal.com include:p._spf.paypal.com include:p2._spf.paypal.com include:s._spf.ebay.com include:m._spf.ebay.com include:c._spf.ebay.com include:thirdparty.paypal.com ~all" paypal.com. 3600 IN TXT "spf2.0/pra mx include:s._sid.ebay.com include:m._sid.ebay.com include:p._sid.ebay.com include:c._sid.ebay.com include:spf-2._sid.paypal.com include:thirdparty._sid.paypal.com ~all"

Other MTA? qmail exim Sendmail X MeTA1 http://www.sendmail.org/sm-X/ http://www.meta1.org/