Top Banner
ISQS 6342 Email server attacks Presented by Deven Patel
29

ISQS 6342 Email server attacks Presented by Deven Patel.

Jan 11, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ISQS 6342 Email server attacks Presented by Deven Patel.

ISQS 6342Email server attacks

Presented by

Deven Patel

Page 2: ISQS 6342 Email server attacks Presented by Deven Patel.

Common types of email abuse

Eavesdropping Mail-bombing Impersonating someone else Propagating viruses Sending Hoaxes or Chain letters Hijacking email server

Page 3: ISQS 6342 Email server attacks Presented by Deven Patel.

Email agents

Message Transfer Agent (MTA)

Message Delivery Agent (MDA)

Page 4: ISQS 6342 Email server attacks Presented by Deven Patel.

MTAs

Simple Mail Transfer Protocol (SMTP)

Unix to Unix Copy Program (UUCP)

Page 5: ISQS 6342 Email server attacks Presented by Deven Patel.

SMTP

Sendmail Postfix Qmail Exim

Page 6: ISQS 6342 Email server attacks Presented by Deven Patel.

Email Architecture: SMTP Gateways and DMZ Networks

Internet

Internet

DMZ net

End user workstations SMTP and other internal servers

Router Firewall

Switch

Internal net

SMTP Gateway

Public FTP

Public Web

Server

Page 7: ISQS 6342 Email server attacks Presented by Deven Patel.

SMTP attacks Buffer Overflow attacks

http://www.cert.org/advisories/CA-1997-05.html

Relaying Unsolicited Commercial Email

http://www.cert.org/incident_notes/IN-2001-02.html

Leaking User and System information to prospective intruders ftp://ftp.isi.edu/in-notes/rfc2821.txt VRFY & EXPN

Page 8: ISQS 6342 Email server attacks Presented by Deven Patel.

Unsolicited Commercial Email

Network availability

Server performance and

Bandwidth optimization.

Page 9: ISQS 6342 Email server attacks Presented by Deven Patel.

Remedies

Blacklist http://mail-abuse.org/rbl

SpamAssasin http://www.spamassassin.org

Page 10: ISQS 6342 Email server attacks Presented by Deven Patel.

Some SMTP troubleshooting commands Helo Mail from Rcpt to Data Subject Quit

Page 11: ISQS 6342 Email server attacks Presented by Deven Patel.

Sendmail

Pros Huge user community, as a result its easy to find

both free and commercial support for it, not to mention a wealth of electronic and print publications.

Page 12: ISQS 6342 Email server attacks Presented by Deven Patel.

Sendmail

ConsLayers of old code resulting in a reputation of being insecure and bloated.

Monolithic i.e. a vulnerability in one portion of its functionality results in the compromise of the entire application.

Complex application.

Page 13: ISQS 6342 Email server attacks Presented by Deven Patel.

Two modes of Operation

Invoked on the fly

Persistent Background Daemon

Page 14: ISQS 6342 Email server attacks Presented by Deven Patel.

Configuring Sendmail1. Enable needed features and tweak settings in sendmail.mc2. Set up domain name masquerading, if needed, in sendmail.mc3. Run m4 to generate sendmail.cf from sendmail.mc4. Configure delivery rules by editing the mailertable.5. Configure relaying rules by editing access.6. Configure multiple-domain handling rules by editing virtusers.7. Define local user-aliases in aliases.8. Convert mailertable, access, virtusers, and aliases to databases.9. Define all valid hostnames of the local system in the file local-host-

names.10. (Re-)start sendmail.

Page 15: ISQS 6342 Email server attacks Presented by Deven Patel.

Excert from an /etc/mail/sendmail.mc file

Page 16: ISQS 6342 Email server attacks Presented by Deven Patel.

Excert from an /etc/mail/sendmail.mc file (contd)

Page 17: ISQS 6342 Email server attacks Presented by Deven Patel.

Feature directives

Page 18: ISQS 6342 Email server attacks Presented by Deven Patel.
Page 19: ISQS 6342 Email server attacks Presented by Deven Patel.

Feature directives FEATURE(‘access_db’,’hash|dbm|btree [-o]

/path/access.db’)dnl This is a modularizing feature which creates an

access database providing a convenient way to maintain a list of both allowed and explicitly denied relaying hosts and domains.

Page 20: ISQS 6342 Email server attacks Presented by Deven Patel.

FEATURE(‘dnsbl’,’blackhole.list.provider’)dnl Use a special DNS look-up to check all senders

hostnames against a “black hole list” of known sources of UCE. If ommited, the name of the blackhole.list.provider defaults to blackholes.mail-abuse.org. This is a subscription-based service: mail-abuse.org charges a yearly fee for nonpersonal use.

http://mail-abuse.org/rbl

Page 21: ISQS 6342 Email server attacks Presented by Deven Patel.

FEATURE(‘blacklist_recipients’)dnl Check recipient addresses of incoming mail

against the access database to block mail to selected usernames.

Page 22: ISQS 6342 Email server attacks Presented by Deven Patel.

FEATURE(‘use_cw_file’)dnl This feature causes sendmail to use the file

/etc/mail/local-host-names to determine valid local names – i.e. names that, if used to the right of the “@” in an email address, will cause that mail to be delivered locally. This is part of Sendmail’s anti-SPAM-relaying functionality.

Page 23: ISQS 6342 Email server attacks Presented by Deven Patel.

Sendmail and SMTP AUTH SMTP AUTH is a badly needed extension

to the SMTP protocol: it describes a flexible authentication mechanism that can be used to authenticate relaying. SMTP AUTH allows a password shared by two hosts (or stored by one host for its local users) to be used to validate email senders.

ftp://ftp.isi.edu/in-notes/rfc2554.txt

Page 24: ISQS 6342 Email server attacks Presented by Deven Patel.

Sendmail and STARTTLS Beginning with version 8.11, sendmail

supports the Extended SMTP command STARTTLS. When this command is issued at the beginning of an ESMTP session, it initiates an encrypted TLS tunnel that protects the rest of the session from eavesdropping.

ftp://ftp.isi.edu/in-notes/rfc2487.txt

Page 25: ISQS 6342 Email server attacks Presented by Deven Patel.

Sendmail and STARTTLS TLS and SSL use x.509 digital certificates,

a type of public-key cryptography in which one’s public key is formatted to include certain amount of identification information (besides just your key ID and the public key itself), including the digital signature of a “Certificate Authority” (CA) that vouches for the authenticity of the certificate.

http://www.rsasecurity.com/rsalabs/faq

Page 26: ISQS 6342 Email server attacks Presented by Deven Patel.

Postfix Postfix is simpler in design, more modular,

and easier to configure and administer. Postfix is designed with scalability,

reliability, and security as fundamental requirements.

Postfix consists of a suite of Daemons and helper applications, whereas sendmail is essentially monolithic.

Page 27: ISQS 6342 Email server attacks Presented by Deven Patel.

Postfix Postfix separates functions across different

processes which is a big factor in postfix’s speed and stability.

Also Postfix handles the mails intelligently by processing mails in four different queues rather than a single big queue as sendmail does.

Page 28: ISQS 6342 Email server attacks Presented by Deven Patel.

Postfix’s four different queues Maildrop queue Incoming queue Active queue Deferred queue

Page 29: ISQS 6342 Email server attacks Presented by Deven Patel.

References

http://www.cert.org/incident_notes/IN-2001-02.html http://www.cert.org/advisories/CA-1997-05.html ftp://ftp.isi.edu/in-notes/rfc2821.txt http://mail-abuse.org/rbl http://www.spamassassin.org http://mail-abuse.org/rbl ftp://ftp.isi.edu/in-notes/rfc2554.txt ftp://ftp.isi.edu/in-notes/rfc2487.txt http://www.rsasecurity.com/rsalabs/faq Bauer, Michael D. (2002). Building Secure Servers with

Linux. O’reilly, CA