the owasp foundation why hackers don’t care about your firewall seba deleersnyder [email protected]

48
The OWASP Foundation http://www.owasp.org Why hackers don’t care about your firewall Seba Deleersnyder [email protected]

Upload: ryleigh-royster

Post on 14-Dec-2015

223 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

The OWASP Foundationhttp://www.owasp.org

Why hackers don’t care about your firewall

Seba Deleersnyder

[email protected]

Page 2: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Sebastien Deleersnyder?

• 5 years developer experience

• 11 years information security experience

• Managing Technical Consultant SAIT Zenitel

• Belgian OWASP chapter founder

• OWASP board member

• www.owasp.org

• Co-organizer www.BruCON.org

Page 3: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

OWASP World

OWASP is a worldwide free and open community focused on improving the security of

application software.

Our mission is to make application security visible so

that people and organizations can make

informed decisions about application security risks.

OWASP is a worldwide free and open community focused on improving the security of

application software.

Our mission is to make application security visible so

that people and organizations can make

informed decisions about application security risks.

Everyone is free to participate in OWASP and all of our materials are available

under a free and open software license.

The OWASP Foundation is a 501c3 not-for-profit

charitable organization that ensures the ongoing

availability and support for our work.

Everyone is free to participate in OWASP and all of our materials are available

under a free and open software license.

The OWASP Foundation is a 501c3 not-for-profit

charitable organization that ensures the ongoing

availability and support for our work.

Page 4: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

|4

Myth

We are secure because we have a firewall

75% of Internet Vulnerabilities are at Web Application Layer *

*Gartner Group (2002 report)

Page 5: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

|5 Source: Jeremiah Grossman, BlackHat 2001

Page 6: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

20th century technology

Page 7: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

7

Security evolution?

Source: Gunnar Peterson (Arctec Group)

Page 8: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

8

A firewall friendly protocol

=

“a skull friendly bullet”

(Bruce Schneier)

Page 9: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Your security “perimeter” has huge holes at the application layer

|9

Fire

wall

Hardened OS

Web Server

App Server

Fire

wall

Data

bases

Leg

acy

Syste

ms

Web

Serv

ices

Dir

ecto

ries

Hu

man

Resrc

s

Billin

g

Custom Developed Application Code

APPLICATIONATTACK

You can’t use network layer protection (firewall, SSL, IDS, hardening) to stop or detect application layer attacks

Ne

two

rk L

aye

rA

pp

lica

tio

n L

aye

r

Page 10: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

OWASP Top 10

A1: Injection A2: Cross-Site Scripting (XSS)

A3: Broken Authentication

and Session Management

A4: Insecure Direct Object References

A5: Cross Site Request

Forgery (CSRF)

A6: Security Misconfigurati

on

A7: Failure to Restrict URL

Access

A8: Insecure Cryptographic

Storage

A9: Insufficient Transport

Layer Protection

A10: Unvalidated

Redirects and Forwards

Page 11: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A1 – Injection

• Tricking an application into including unintended commands in the data sent to an interpreter

Injection means…

• Take strings and interpret them as commands• SQL, OS Shell, LDAP, XPath, Hibernate, etc…

Interpreters…

• Many applications still susceptible (really don’t know why)• Even though it’s usually very simple to avoid

SQL injection is still quite common

• Usually severe. Entire database can usually be read or modified• May also allow full database schema, or account access, or even OS

level access

Typical Impact

Page 12: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

example : SQL-injection attack

Select user_information from user_table where username=’input username’ and password=’input password’

Web Server Application Server

User DatabaseUser

https

Select user_information from user_table

where username=’’ or 1=1 -– ‘ and password=’abc’

Page 13: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

RockYou?

December 2009

• a hacker used SQL Injection techniquesto hack the database of RockYou

• RockYou creates applications for MySpace, Facebook, ...

Result

• data of 32.603.388 users and administrative accounts was compromised (credentials + clear text passwords)

• the data also containedemail-addresses and passwordsfor 3rd party sites

Question: how many of those users use the same password for other sites too?

Page 14: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A2 – Cross-Site Scripting (XSS)

• Raw data from attacker is sent to an innocent user’s browser

Occurs any time…

• Stored in database• Reflected from web input (form field, hidden field, URL, etc…)• Sent directly into rich JavaScript client

Raw data…

• Try this in your browser – javascript:alert(document.cookie)

Virtually every web application has this problem

• Steal user’s session, steal sensitive data, rewrite web page, redirect user to phishing or malware site

• Most Severe: Install XSS proxy which allows attacker to observe and direct all user’s behavior on vulnerable site and force user to other sites

Typical Impact

Page 15: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

XSS = Cross-site Scripting

Web application vulnerability

Injection of code into web pages viewed by others

XSS = new buffer overflow

Javascript = new Shell Code

Page 16: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

16

XSSED.ORG

Still not fixed (with redirection): http://www.google.com/search?btnI&q=allinurl:http://www.xssed.com/

Page 17: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Browser Exploitation Framework

Page 18: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A3 – Broken Authentication and Session Management

• Means credentials have to go with every request• Should use SSL for everything requiring authentication

HTTP is a “stateless” protocol

• SESSION ID used to track state since HTTP doesn’t• and it is just as good as credentials to an attacker

• SESSION ID is typically exposed on the network, in browser, in logs, …

Session management flaws

• Change my password, remember my password, forgot my password, secret question, logout, email address, etc…

Beware the side-doors

• User accounts compromised or user sessions hijacked

Typical Impact

Page 19: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Session Fixation Attack

Page 20: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A4 – Insecure Direct Object References

• This is part of enforcing proper “Authorization”, along with A7 – Failure to Restrict URL Access

How do you protect access to your data?

• Only listing the ‘authorized’ objects for the current user, or• Hiding the object references in hidden fields• … and then not enforcing these restrictions on the server side• This is called presentation layer access control, and doesn’t

work• Attacker simply tampers with parameter value

A common mistake …

• Users are able to access unauthorized files or data

Typical Impact

Page 21: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Insecure Direct Object References Illustrated

Attacker notices his acct parameter is 6065

?acct=6065

He modifies it to a nearby number

?acct=6066

Attacker views the victim’s account information

https://www.onlinebank.com/user?acct=6065

Page 22: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A5 – Cross Site Request Forgery (CSRF)

• An attack where the victim’s browser is tricked into issuing a command to a vulnerable web application

• Vulnerability is caused by browsers automatically including user authentication data (session ID, IP address, Windows domain credentials, …) with each request

Cross Site Request Forgery

• What if a hacker could steer your mouse and get you to click on links in your online banking application?

• What could they make you do?

Imagine…

• Initiate transactions (transfer funds, logout user, close account)• Access sensitive data• Change account details

Typical Impact

Page 23: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

CSRF Illustrated

page 23

Page 24: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

CSRF Illustrated

Page 25: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

25

Good Saturday for Orkut Users

Page 26: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A6 – Security Misconfiguration

• All through the network and platform• Don’t forget the development environment

Web applications rely on a secure foundation

• Think of all the places your source code goes• Security should not require secret source code

Is your source code a secret?

• All credentials should change in production

Configuration Management must extend to all parts of the application

• Install backdoor through missing network or server patch• XSS flaw exploits due to missing application framework patches• Unauthorized access to default accounts, application functionality or data, or

unused but accessible functionality due to poor server configuration

Typical Impact

Page 27: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Hardened OS

Web Server

App Server

Framework

Security Misconfiguration Illustrated

App Configuration

Custom Code

Acc

ounts

Fin

ance

Adm

inis

trati

on

Transa

ctio

ns

Com

mun

icati

on

Know

ledge M

gm

t

E-C

om

merc

e

Bus.

Funct

ion

s

Test Servers

QA Servers

Source Control

Development

Database

Insider

Page 28: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

28

Serving up malware

A quick Google Safe Browsing search of TechCrunch Europe's site shows suspicious activity twice over the last 90 days. "Of the 128 pages we tested on the site over the past 90 days,

58 page(s) resulted in malicious software being downloaded and installed without user consent.”(sep 2010) 

Reason: unpatched WordPress

Page 29: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A7 – Failure to Restrict URL Access

• This is part of enforcing proper “authorization”, along with A4 – Insecure Direct Object References

How do you protect access to URLs (pages)?

• Displaying only authorized links and menu choices• This is called presentation layer access control, and doesn’t

work• Attacker simply forges direct access to ‘unauthorized’ pages

A common mistake …

• Attackers invoke functions and services they’re not authorized for

• Access other user’s accounts and data• Perform privileged actions

Typical Impact

Page 30: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Failure to Restrict URL Access Illustrated

Attacker notices the URL indicates his role

/user/getAccounts

He modifies it to another directory (role)

/admin/getAccounts, or

/manager/getAccounts

Attacker views more accounts than just their own

https://www.onlinebank.com/user/getAccountshttps://www.onlinebank.com/user/getAccounts

Page 31: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A8 – Insecure Cryptographic Storage

• Failure to identify all sensitive data• Failure to identify all the places that this sensitive data gets stored

• Databases, files, directories, log files, backups, etc.• Failure to properly protect this data in every location

Storing sensitive data insecurely

• Attackers access or modify confidential or private information• e.g, credit cards, health care records, financial data (yours or your customers)

• Attackers extract secrets to use in additional attacks• Company embarrassment, customer dissatisfaction, and loss of trust• Expense of cleaning up the incident, such as forensics, sending apology letters, reissuing

thousands of credit cards, providing identity theft insurance• Business gets sued and/or fined

Typical Impact

Page 32: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

32

Encrypt customer data?

customer data, 77 Million compromised.(potentially CCs as well)

Page 33: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A9 – Insufficient Transport Layer Protection

• Failure to identify all sensitive data• Failure to identify all the places that this sensitive data is sent

• On the web, to backend databases, to business partners, internal communications• Failure to properly protect this data in every location

Transmitting sensitive data insecurely

• Attackers access or modify confidential or private information• e.g, credit cards, health care records, financial data (yours or your customers)

• Attackers extract secrets to use in additional attacks• Company embarrassment, customer dissatisfaction, and loss of trust• Expense of cleaning up the incident• Business gets sued and/or fined

Typical Impact

Page 34: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

34

Still not using SSL?

Page 35: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

A10 – Unvalidated Redirects and Forwards

• And frequently include user supplied parameters in the destination URL

• If they aren’t validated, attacker can send victim to a site of their choice

Web application redirects are very common

• They internally send the request to a new page in the same application

• Sometimes parameters define the target page• If not validated, attacker may be able to use unvalidated

forward to bypass authentication or authorization checks

Forwards (aka Transfer in .NET) are common too

• Redirect victim to phishing or malware site• Attacker’s request is forwarded past security checks, allowing

unauthorized function or data access

Typical Impact

Page 36: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Jobs by CNN?

http://ads.cnn.com/event.ng/Type=click&Redirect=http:/bit.ly/cP–XW

36

Page 37: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Download

http://www.owasp.org/index.php/Top_10

Page 38: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

CAN WE WIN THE WAR ON INSECURE SOFTWARE?

Page 39: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

39

Enter the rest of OWASP

• Education• Guides (build, test, code review)• Events• ...

People

• Webgoat• WebScarab• ESAPI• ...

Tools• Requirements list• CLASP• SAMM• ...

Process

Page 40: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Software Assurance Maturiy Model

(SAMM)

Page 41: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

SAMM Security Practices• The Security Practices cover all areas relevant

to software security assurance

• Each one is a ‘silo’ for improvement

Page 42: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

Build “Your” Roadmap

• Gap analysis:

• Capturing scores from detailed assessments versus expected performance levels

• Demonstrating improvement

• Capturing scores from before and after an iteration of assurance program build-out

• Ongoing measurement

• To make the “building blocks” usable, SAMM defines Roadmaps templates for typical kinds of organizations

Page 43: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

OWASP Projects Are Alive!

|43

43

2001

2003

2005

2007

2010 …

Page 44: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

www.owasp.org

|44

44

Page 45: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

45

OWASP NEAR YOU

Page 46: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

46

Upcoming local events

• OWASP Chapter meetings:

• 23-May - Brussels:

• The Ghost of XSS Past, Present and Future – A Defensive Tale (by Jim Manico, Infrared Security)

• 16-Jun - Brussels:

• The OWASP AppSensor Project (by Colin Watson, Watson Hall Ltd)

• How to become Twitter's admin: An introduction to Modern Web Service Attacks (by Andreas Falkenberg, RUB)

• OWASP AppSec Europe – Dublin – Jun 7-9

• BruCON – Brussels – Sep 19-22

• OWASP BeNeLux – Luxembourg Nov-30/Dec-1

Page 47: The OWASP Foundation  Why hackers don’t care about your firewall Seba Deleersnyder seba@owasp.org

47

Subscribe mailing list

www.owasp.be

Keep up to date!