Web Server-Side Security



Similar documents
Network Security - ISA 656 Security

Web and Security 1 / 40

Why you need secure

The basic groups of components are described below. Fig X- 1 shows the relationship between components on a network.

High-speed cryptography and DNSCurve. D. J. Bernstein University of Illinois at Chicago

How To Protect Your From Being Hacked On A Pc Or Mac Or Ipa From Being Stolen On A Network (For A Free Download) On A Computer Or Ipo (For Free) On Your Pc Or Ipom (For An Ipo

The Case For Secure

Public Key Infrastructure (PKI)

How To Secure A Website With A Password Protected Login Process (

APWG. (n.d.). Unifying the global response to cybecrime. Retrieved from

Web Security. Crypto (SSL) Client security Server security 2 / 40. Web Security. SSL Recent Changes in TLS. Protecting the Client.

Is your data safe out there? -A white Paper on Online Security

Talk Internet User Guides Controlgate Administrative User Guide

E-commerce. Security. Learning objectives. Internet Security Issues: Overview. Managing Risk-1. Managing Risk-2. Computer Security Classifications

Client Server Registration Protocol

SIP and VoIP 1 / 44. SIP and VoIP

Criteria for web application security check. Version

Sync Security and Privacy Brief

Securing DNS Infrastructure Using DNSSEC

How to make a VPN connection to our servers from Windows 8

Secure Frequently Asked Questions

Server Security. Contents. Is Rumpus Secure? 2. Use Care When Creating User Accounts 2. Managing Passwords 3. Watch Out For Aliases 4

This guide will go through the common ways that a user can make their computer more secure.

Content Teaching Academy at James Madison University

Where every interaction matters.

CS 361S - Network Security and Privacy Spring Homework #1

STABLE & SECURE BANK lab writeup. Page 1 of 21

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

OCT Training & Technology Solutions Training@qc.cuny.edu (718)

JOOMLA SECURITY. ireland website design. by Oliver Hummel. ADDRESS Unit 12D, Six Cross Roads Business Park, Waterford City

DiamondStream Data Security Policy Summary

ARGUS SUPPORT: INSTALLATION AND CONFIGURATION GUIDE FOR BEST PRACTICE

Application Security: Threats and Architecture

E-Commerce Security. The Client-Side Vulnerabilities. Securing the Data Transaction LECTURE 7 (SECURITY)

4. Client-Level Administration

Chapter 8. Network Security

What Are Certificates?

Key Management. CSC 490 Special Topics Computer and Network Security. Dr. Xiao Qin. Auburn University

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

SY system so that an unauthorized individual can take over an authorized session, or to disrupt service to authorized users.

Introduction Configuration & Spam Detection WinWare Webmail Accounts Account Notes Definitions...

Figure 9-1: General Application Security Issues. Application Security: Electronic Commerce and . Chapter 9

Architecture and Data Flow Overview. BlackBerry Enterprise Service Version: Quick Reference

Security Fort Mac

Authentication Types. Password-based Authentication. Off-Line Password Guessing

RFG Secure FTP. Web Interface

Detailed Description about course module wise:

INTRODUCTION TO CRYPTOGRAPHY

Anti-Phishing Best Practices for ISPs and Mailbox Providers

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Sending s without the risk! Secure Communications with Rohde & Schwarz

Using etoken for SSL Web Authentication. SSL V3.0 Overview

How to make the s you Send from Outlook 2010 appear to Originate from different Addresses

Application Design and Development

Installation Guide For Choic Enterprise Edition

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

2.4: Authentication Authentication types Authentication schemes: RSA, Lamport s Hash Mutual Authentication Session Keys Trusted Intermediaries

MDaemon configuration recommendations for dealing with spam related issues

Vodafone Hosted Services. Getting your . User guide

Network Security (2) CPSC 441 Department of Computer Science University of Calgary

ITSC Training Courses Student IT Competence Programme SIIS1 Information Security

Protect Yourself. Who is asking? What information are they asking for? Why do they need it?

Secure Mail Registration and Viewing Procedures

CCM 4350 Week 11. Security Architecture and Engineering. Guest Lecturer: Mr Louis Slabbert School of Science and Technology.

Secure Web Development Teaching Modules 1. Threat Assessment

Advanced Administration

Protect your brand from phishing s by implementing DMARC 1

: Network Security. Name of Staff: Anusha Linda Kostka Department : MSc SE/CT/IT

Network Security. HIT Shimrit Tzur-David

Midterm 2 exam solutions. Please do not read or discuss these solutions in the exam room while others are still taking the exam.

How To Make A Trustless Certificate Authority Secure

CS 161 Computer Security Spring 2010 Paxson/Wagner MT2

OUTLOOK WEB ACCESS. User Guide

10- Assume you open your credit card bill and see several large unauthorized charges unfortunately you may have been the victim of (identity theft)

Voltage's Encrypted

EE 7376: Introduction to Computer Networks. Homework #3: Network Security, , Web, DNS, and Network Management. Maximum Points: 60

Modern snoop lab lite version

How To Understand The History Of The Web (Web)

XGENPLUS SECURITY FEATURES...

The GlobalCerts TM Secur Gateway TM

CHARTER BUSINESS CUSTOM HOSTING MIGRATION INSTRUCTIONS

EDEXCEL FUNCTIONAL SKILLS ICT. Study Module 8. Using ICT to communicate

Thick Client Application Security

Implementing MDaemon as an Security Gateway to Exchange Server

Information Security Field Guide to Identifying Phishing and Scams

Portal Administration. Administrator Guide

Using the Web service

File Share Service User guide

Application Security Testing. Generic Test Strategy

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

MailEnable Connector for Microsoft Outlook

Information Security Basic Concepts

Homeland Security Red Teaming

Transcription:

Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users 1 / 47

Protecting the Server Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users Servers are very tempting targets Defacement Steal data (i.e., credit card numbers) Distribute malware to unsuspecting clients 2 / 47

Standard Defenses Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users Check all inputs Remember that nothing the client sends can be trusted Scrub your site 3 / 47

Server-Side Scripts Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users Most interesting web sites use server-side scripts: CGI, ASP, PHP, server-side include, etc. Each such script is a separate network service For a web site to be secure, all of its scripts must be secure What security context do scripts run in? The web server s? How does the server protect its sensitive files against malfunctioing scripts? This latter is a particular problem with server plug-ins, such as PHP Partial defense: use things like suexec 4 / 47

Injection Attacks Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users Often, user-supplied input is used to construct a file name or SQL query Bad guys can send bogus data Example: a script that sends email collects a username and executes /usr/bin/sendmail username The bad guy supplies foo; rm -rf / as the username The actual code executed is /usr/bin/sendmail foo; rm -rf / Oops... 5 / 47

Example: Webmail Server Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users Assumption: general-purpose machine has a webmail server User mailboxes are under /home/*/mail. Folders are separate directories under that; each mail message is a separate file in a subdirectory. (This is very close to the CU-CS setup.) What needs tight filtering? 6 / 47

Filtering Webmail Requests Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users The usename may not need too much filtering (except for SQL issues), becase it s authenticated against a list of valid users Folder names do need checking what if a user specifies folder../../../etc? What if a user specifies../../../etc/passwd for a message file? 7 / 47

File Permissions Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users What UID does the webmailer run as? It needs some privileges, to read everyone s mail folders But running as root is dangerous, because then it can be tricked into reading protected files: ln /some/secret/file mail/inbox/42 8 / 47

Scrubbing Your Site Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users What is really being served? Web servers often come with default scripts some of these are insecure Example: nph-test-cgi that used to come with Apache Example: proprietary documents; Google for them: filetype:pdf "company confidential" (By the way, many documents have other, hidden data) Can Google for some other vulnerabilities, too 9 / 47

Users Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Example: Webmail Server Filtering Webmail Requests File Permissions Scrubbing Your Site Users If your site permits user web pages this deparment? you have serious threats Are the user CGI scripts secure? Can users run PHP scripts in the browser s security context? Are all of these secure? 10 / 47

The Usual Questions Assets 11 / 47

The Usual Questions The Usual Questions Assets What are we trying to protect? Against whom? 12 / 47

Assets The Usual Questions Assets Confidentiality people often discuss sensitive things via email Authenticity who really sent the email? Anti-spam?? Authenticity has many motivations here 13 / 47

General Strategy Some Details Transit Signing Headers General Flow 14 / 47

General Strategy General Strategy Some Details Transit Signing Headers General Flow Basic scheme is pretty straight-forward Encrypt the message body with a symmetric cipher, using a randomly-generated traffic key Use public key cryptography to encrypt the traffic key to all recipients Digitally sign a hash of the message But there are many details 15 / 47

Some Details General Strategy Some Details Transit Signing Headers General Flow Obvious ones: which symmetric, public key, and hash algorithms to use? More subtle: which algorithms do the recipients understand? Where do certificates come from? Do you sign the plaintext or the ciphertext? How do you handle BCC? Will the ciphertext survive transit intact? How are header lines protected? What about attachments? Many possible answers to all of these questions 16 / 47

Transit General Strategy Some Details Transit Signing Headers General Flow Not all mail systems accept all characters Cryptographic transforms won t survive even minor changes Very few are 8-bit clean EBCDIC vs. ASCII? Unicode? Tabs versus blanks? Solution: encode all email in base 64, using characters all systems accept: A-Za-z0-9+/ Use 4 bytes to represent 3; overhead is 33% Only those characters matter; everything else is deleted on receipt, including white space 17 / 47

Signing General Strategy Some Details Transit Signing Headers General Flow If you sign the plaintext and then encrypt, the sender s identity is hidden from all except the proper recipients If you sign the ciphertext, a gateway can verify signatures and present mail accordingly perhaps better for anti-spam and anti-phishing 18 / 47

Headers General Strategy Some Details Transit Signing Headers General Flow Headers change in transit Obvious example: Received: lines are added Less-obvious example: Email addresses are often rewritten to hide internal machines, and present clearer addresses to the outside: smb@att.com Steven.Bellovin@att.com Consequence: headers are not protected by secure email schemes 19 / 47

General Flow General Strategy Some Details Transit Signing Headers General Flow Collect input message Put in canonical form Encrypt and sign, or sign and encrypt Add metadata: encrypted traffic key, your certificate, algorithm identifiers, etc. Convert to transit form Embed in email message 20 / 47

Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues 21 / 47

Eavesdropping Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues Most obvious way to read email: eavesdropping The bad guy simply listens to the network Harder than it sounds, except for some wireless nets Frequently used by police and intelligence agencies, i.e., the FBI s Carnivore device 22 / 47

Password Theft Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues Most email is retrieved by login and password Anyone who gets your password can read your email It s much easier for an eavesdropper to pick those up passwords are usually sent each time someone polls for new email 23 / 47

Hacking Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues The real threat to email is while it s in storage This can be temporary storage, waiting for you to pick it up It can also be your personal machine, for email you ve sent or received What if your laptop is stolen? Does it have plaintext copies of all the secure email you ve sent and received? 24 / 47

Screen Dumps Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues Connect via X11 Use some other Trojan horse software to dump user s screen periodically Reflection off the back wall... 25 / 47

Subpoena Attacks Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues What if you records are subpoenaed? This is a legal issue; technical wiggling won t help! 26 / 47

Rubber Hose Cryptanalysis Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues What if the local secret police want to know what some intercepted email says? Protecting human rights workers was one of the original goals for PGP! It s public key-encrypted you can t read it If the signature is encrypted, they can t even prove you sent it Of course, people like that don t care much about proof, and they don t like to take no for an answer... 27 / 47

Spoofing Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues Ordinary email is trivial to spoof On timesharing machines and web mailers, the systems can tack on the userid On PCs, individuals set their own addresses No security if you need to authenticate email, you have to use crypto 28 / 47

Systems Issues Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis Spoofing Systems Issues Only read email on secure machines Only connect to them securely Watch out for buggy mailers and systems But if the process of reading secure email is too cumbersome, your email will be insecure, because you ll never use the secure version Finding the right tradeoff is a difficult engineering choice 29 / 47

Approaches Certificate Style Web of Trust Does the Web of Trust Work? Finding Public Keys Which Style is Better? 30 / 47

Approaches Approaches Certificate Style Web of Trust Does the Web of Trust Work? Finding Public Keys Which Style is Better? Two major standards, Many minor syntactic differences Major split by audience: computer scientists like PGP; mainstream users use S/MIME Biggest technical difference: how certificates are signed 31 / 47

Certificate Style Approaches Certificate Style Web of Trust Does the Web of Trust Work? Finding Public Keys Which Style is Better? S/MIME uses standard X.509 certificate format More importantly, X.509 certificates form a traditional PKI, with a root and a hierarchical structure Works well within an organization Between organizations, can work if it s easy to find that organization s root CU has no PKI what is the PKI under which you d find my cert? Why should you trust its root? 32 / 47

Web of Trust Approaches Certificate Style Web of Trust Does the Web of Trust Work? Finding Public Keys Which Style is Better? PGP use a web of trust Anyone can sign a certificate Most people have more than one signature I have 65 signatures on my primary PGP key Do you know and trust any of my signers? See my key at http://www.cs.columbia.edu/~smb/smbpgp.txt 33 / 47

Does the Web of Trust Work? Approaches Certificate Style Web of Trust Does the Web of Trust Work? Finding Public Keys Which Style is Better? Number of signatures alone is meaningless; I can create lots of identities if I want I can even forge names is the Angelos Keromytis who signed my key the same one who s a professor here? How do you know? There are at least six PGP keys purporting to belong to George W. Bush. One is signed by Yes, it s really Bush! You have to define your own set of trust anchors, as well as policies on how long a signature chain is too long 34 / 47

Finding Public Keys Approaches Certificate Style Web of Trust Does the Web of Trust Work? Finding Public Keys Which Style is Better? Many mailers cache received certificates Some organizations list people s certificates in an LDAP database Some people have them on their web site For PGP, there are public key servers anyone can upload keys Is that safe? Sure the security of a certificate derives from the signature, not from where you found it 35 / 47

Which Style is Better? Approaches Certificate Style Web of Trust Does the Web of Trust Work? Finding Public Keys Which Style is Better? PGP was easier to start it doesn t need an infrastructure Many security and network conferences have PGP key-signing parties S/MIME is better for official use it makes it clearer when someone is speaking in an organizational role, since the organization issued the certificate. Both have usability issues, though PGP is probably worse 36 / 47

What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on 37 / 47

What is? What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on Spoofed emails, purportedly from a financial institution Ask you to login to reset or revalidate your account Often claim that your account has been suspended 38 / 47

A Phish What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on From: no-reply@flagstarbanking2.com To: undisclosed-recipients:; Subject: YOUR ACCOUNT HAS BEEN SUSPENDED!!! Date: Fri, 29 Sep 2006 09:29:25-0500... If you fail to provide information about your account you ll discover that your account has been automatically deleted from Flagstar Bank database. Please click on the link below to start the update process: https://www.flagstar.com/signon.cgi?update Flagstar Bank 39 / 47

What s Wrong? The URL is a booby trap: What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on When I clicked on it, I was actually redirected to a site in Colombia, via yet another indirection... The login page appears identical to the real one (One of the web sites I visited seemed to have several variant bank pages) 40 / 47

The Login Box What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on 41 / 47

The URL Bar What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on 42 / 47

They Want Data... What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on 43 / 47

Some Mail Headers What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on Received: from plesk.salesforcefoundation.org ([198.87.81.9]) by cs.columbia.edu (8.12.10/8.12.10) (version=tlsv1/sslv3 cipher=dhe-rsa-aes256-sha bits=256 verify=not) for <smb@cs.columbia.edu> Received: from adsl-68-20-44-198.dsl.chcgil.ameritec (68.20.44.198) by 198.87.81.11 Where does plesk.salesforcefoundation.org come from? It is asserted by the far side. The 198.87.81.9 is derived from the IP header, and is hard to forge (but stay tuned for routing attacks, in a few weeks). A DNS lookup on 198.87.81.9 isn t very helpful; the mapping is controlled by the address owner, not the name owner. 44 / 47

Other Issues What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on Why is the email from flagstarbanking2.com? The domain for the bank is flagstar.com no ing and no 2. That s legit! the real web site for their online service is flagstarbanking2.com We have trained users to accept weird, seemingly gratuitous differences; it can make life easier for the phisher 45 / 47

Tricks with URLs What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on http://cnn.com@some.other.site/foo cnn.com is a userid http://2151288839/foo 2151288839 is 128.58.16.7, cluster.cs.columbia.edu http://rds.yahoo.com/_ylt=a0g...http%3a/ So the search engine knows what you clicked on 46 / 47

Final Thoughts on What is? A Phish What s Wrong? The Login Box The URL Bar They Want Data... Some Mail Headers Other Issues Tricks with URLs Final Thoughts on We have the basic technical mechanisms to authenticate email and web sites Human interaction with these mechanisms remains a very challenging problem is a systems problem 47 / 47