Top Banner
Web Services and Authentication IS/CS 698 Min Song Information Systems
31

Web Services and Authentication IS/CS 698 Min Song Information Systems.

Dec 22, 2015

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: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Web Services and Authentication

IS/CS 698Min Song

Information Systems

Page 2: Web Services and Authentication IS/CS 698 Min Song Information Systems.

What is Web Application Security?

Web Applications exist in many forms. Some search, some count, others even transfer money within your bank accounts. Web Applications are employed to carry out many mission-critical tasks and if anything on the web is certain, our reliance upon web applications will continue to grow.

Simply, the securing of web applications.

Page 3: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Why is web application security important?

Before software functionality was capable of being delivered via the web, software developers security concerns were relatively given: that their user-base was limited to internal or wan networks. All this has now changed. Web developers now create software that runs upon web servers accessed by anyone, anywhere. The scope and magnitude of their software delivery has increased exponentially and in so doing, security issues have also risen.

- Browser Hi-Jacking- Cookie Theft- Denial of Service- Abuse- User Privacy Invasion

Page 4: Web Services and Authentication IS/CS 698 Min Song Information Systems.

• Hypertext information model (linking of documents)

• Client/Server consultation protocol

?

documentsserveruser transaction

Internet

Architecture of the Web

Page 5: Web Services and Authentication IS/CS 698 Min Song Information Systems.

• Unauthorized release of information

Security problems : confidentiality

?

?

Internet

pirate

user

Page 6: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Security problems: integrity

• Unauthorized modification of information

?

Internet

pirate

user

Page 7: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Security measures

authentication authorization

firewallsencryption

Access control

Page 8: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Mathematical transformation of a message

-Document confidentiality-Document integrity

-Server authentication-Client authentication

Encrypt DecryptHello Hello

plaintext cyphertext plaintext

encryption key decryption key

Encryption: principles

Page 9: Web Services and Authentication IS/CS 698 Min Song Information Systems.

ReferenceMonitor

user resourcesrequest

operation noeuds

deny

authorize

securitydatabase

guard

consult

security administrator

update

Access control model

Page 10: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Access control: authentication

Verifying the identity of a user

identity, proof of identity

securitydatabase

Page 11: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Web authentication mechanisms

method Data confidentialityand integrity

mutualauthentication

IP address no no

Password no no

SSL + user password yes yes

SSL + userPubkey certificate

yes yes

Page 12: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Access control: authorization

Verifying the access rights of a user

identity, proof of identity

securitydatabase

?

Page 13: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Web authorization mechanisms

Document id User id access rights

read

Grenoble physicians read, write

Access control lists (ACL)

Roles, groups : simple user administration Capabilities : exchange of access control information in the

request

Page 14: Web Services and Authentication IS/CS 698 Min Song Information Systems.

The goal of an attack

Steal data Blackmail Beachhead for other attacks Bragging rights Vandalism Demonstrate

vulnerability/satisfy curiosity Damage company reputation Others?

Page 15: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Commonly attacked services SMTP servers (port 25)

sendmail: “The address parser performs insufficient bounds checking in certain conditions due to a char to int conversion, making it possible for an attacker to take control of the application. “

RPC servers (port 111 & others) NetBIOS shares (port 139)

Opasoft worm FTP servers (ports 20, 21)

wuftpd vulnerabilities SSH servers (port 22)

OpenSSH vulnerability Web servers (ports 80, 443)

Apache chunked encoding vulnerability

Page 16: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Web server attack Scan to find open ports Find out what’s running on open ports (banner

grabbing) Profile the server

Windows (look for Kerberos, NetBIOS, AD) Unix Use TCP fingerprinting

Probe for weaknesses on interesting ports Default configuration files and settings

(e.g. popular IIS ones) Buffer overflows Insecure applications

Launch attack Use exploit code from Internet… …or build your own

Page 17: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Scanning…What O/S is this system?

Page 18: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Scanning…What O/S is this system?

Page 19: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Example Web Application

Webserver

Web app

Web app

Web app

Web app

transport

DB

DB

Appserver

(optional)

Web client:

IE, Mozilla,

etc.

HTTP reply (HTML,

JavaScript, VBScript,

etc.)

HTTP request

Clear-text or

SSL

• Apache• IIS• Netscape• etc.

• Servlet engine• J2EE server• ColdFusion• Oracle 9iAS• etc.

• Perl• C++• CGI• Java• ASP• PHP• etc.

• ADO• ODBC• JDBC• etc.

• Oracle• SQL Server• etc.

Internet DMZ Protectednetwork

Internalnetwork

• AJP• IIOP• T9• etc.

Page 20: Web Services and Authentication IS/CS 698 Min Song Information Systems.

OWASP Top 10 Web Application Security Vulnerabilities

1. Unvalidated parameters2. Broken access control3. Broken account/session management4. Cross-site scripting flaws5. Buffer overflows6. Command injection flaws7. Error handling problems8. Insecure use of cryptography9. Remote administration flaws10.Web and app server mis-configuration

http://www.owasp.org

Page 21: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#10: Web/App Server Misconfiguration

Tension between “work out of the box” and “use only what you need”

Developers ≠ web masters Examples

Unpatched security flaws (BID example) Misconfigurations that allow directory traversal Administrative services accessible Default accounts/passwords

Countermeasures Create and use hardening guides Turn off all unused services Set up and audit roles, permissions, and

accounts Set up logging and alerts

Page 22: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#9: Remote Administration Flaws Problems

Weak authentication (username=“admin”) Weak encryption

Countermeasures Don’t place admin interface on same server Use strong authentication: certificates, tokens,

strong passwords, etc. Encrypt entire session (VPN or SSL) Control who has accounts IP restrictions

Page 23: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#8: Poor Cryptography

Insecure storage of credit cards, passwords, etc. Poor choice of algorithm (or invent your own) Poor randomness

Session IDs Tokens Cookies

Improper storage in memory Countermeasures

Store only what you must Store a hash instead of the full value (SHA-1) Use only vetted, public cryptography

Page 24: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#7: Error Handling

Examples: stack traces, DB dumps Helps attacker know how to target the app Inconsistencies can be revealing too

“File not found” vs. “Access denied” Fail-open errors Need to give enough info to user w/o giving

too much info to attacker Countermeasures

Code review Modify default error pages (404, 401, etc.)

Page 25: Web Services and Authentication IS/CS 698 Min Song Information Systems.

Error messages example

Page 26: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#6: Command Injection Allows attacker to relay malicious code in form variables

or URL System commands SQL Interpreted code (Perl, Python, etc.)

Many apps use calls to external programs sendmail

Examples Path traversal: “../” Add more commands: “; rm –r *” SQL injection:

Countermeasures Taint all input Avoid system calls (use libraries instead) Run application with limited privileges

Page 27: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#5: Buffer Overflows Mostly affects web/app servers Can affect apps/libraries too Goal: crash the target app and get a shell Buffer overflow example

echo “vrfy `perl –e ‘print “a” x 1000’`” |nc www.targetsystem.com 25

Replace this with something like this… char shellcode[] = “\xeb\xlf\x5e\x89\x76\x08…”

Countermeasures Keep up with bug reports Code reviews Use Java

Page 28: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#4: Cross-Site Scripting (XSS) Attacker uses a trust application/company to send

malicious code to end-user Attacker can “hide” the malicious code

Unicode encoding 2 types of attacks

Stored Reflected

Wide-spread problem! Countermeasure: input validation

Positive Negative: “< > ( ) # &” Don’t forget these: “&lt &gt &#40 &#41 &#35

&#38”

Page 29: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#3: Broken Account and Session Management

Weak authentication Password-only Easily guessable usernames (admin, etc.) Unencrypted secrets are sniffable

How to break in Guess password Reset password Have app email you new password Sniff password

Backend authentication How database passwords are stored Trust relationships between hosts (IP address can be

spoofed, etc.)

Page 30: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#2: Broken Access Control

Usually inconsistently defined/applied Examples

Insecure session IDs or keys Forced browsing past access control

checks Path traversal File permissions – may allow access to

config/password files Client-side caching

Page 31: Web Services and Authentication IS/CS 698 Min Song Information Systems.

#1: Unvalidated Parameters Attacker can easily change any part of the HTTP request

before submitting URL Cookies Form fields Hidden fields Headers

Encoding is not encrypting Toasted Spam: http://www.toastedspam.com/decode64

Input must be validated on the server (not just the client). CoolCarts: http://www.extremelasers.com

Countermeasures Tainting (Perl) Code reviews (check variable against list of allowed values,

not vice-versa) Application firewalls

CodeSeeker: http://www.owasp.org/codeseeker/