How to Stop Man in the Browser Attacks

53
Stopping Fraud – Getting Rid of the Man in Your Browser Rob Rachwald, Director of Security Strategy Noa Bar-Yosef, Sr. Security Strategist

description

Fraud is a key--and evolving--challenge facing security teams today. This presentations highlight tactics organizations can deploy to dramatically reduce incidents of fraud, provides a high-level, technical overview of client-side attacks and demonstrates how man-in-the-browser attacks operate, reveals two techniques that can be used by a Web application to detect infected clients, and discusses practical aspects of implementing these two methods and how to use the output of the detection process in the application.

Transcript of How to Stop Man in the Browser Attacks

Page 1: How to Stop Man in the Browser Attacks

Stopping Fraud – Getting Rid of the Man in Your Browser

Rob Rachwald, Director of Security Strategy Noa Bar-Yosef, Sr. Security Strategist

Page 2: How to Stop Man in the Browser Attacks

Agenda

Motivation Problem Definition Shape Based Tests Content Based Tests Overall Solution Strategy Summary

Page 3: How to Stop Man in the Browser Attacks

Today’s Presenter Rob Rachwald, Dir. of Security Strategy, Imperva

Research + Directs security strategy + Works with the Imperva Application Defense Center

Security experience + Fortify Software and Coverity + Helped secure Intel’s supply chain software + Extensive international experience in Japan, China, France, and

Australia

Thought leadership + Presented at RSA, InfoSec, OWASP, ISACA + Appearances on CNN, SkyNews, BBC, NY Times, and USA Today

Graduated from University of California, Berkeley

Page 4: How to Stop Man in the Browser Attacks

Today’s Presenter Noa Bar-Yosef, Senior Security Strategist, Imperva

Research + Researches trends in the threat landscape

Security experience + Previously, held the position of Sr. Security

Researcher for Imperva’s Application Defense Center

+ Credited for multiple commercial applications’ vulnerabilities

+ Holds a Master’s thesis specializing in Information Security

Thought leadership + Writes a bi-weekly column on hacker trends and

techniques for SecurityWeek

Page 5: How to Stop Man in the Browser Attacks

Motivation

Page 6: How to Stop Man in the Browser Attacks

Client Side Attacks - Scope of Problem Major Attack Vectors

Page 7: How to Stop Man in the Browser Attacks

Client Side Attacks - Scope of Problem Major Attack Vectors

Exploiting Browser Code Vulnerabilities • Expected to rise with the introduction of HTML5

Exploiting Browser Plug-ins • E.g. Java, Flash, PDF, Media Player

Exploiting OS libraries • E.g. Graphics rendering

Page 8: How to Stop Man in the Browser Attacks

Client Side Attacks - Scope of Problem 2010 Vulnerability Figures

Client side

• 77 IE vulnerabilities, 106 Firefox vulnerabilities, 188 Chrome vulnerabilities

• 73 Adobe Flash, 9 Adobe Reader related vulnerabilities

• 72 Various ActiveX related vulnerabilities

Server side

• Only 36 vulnerabilities across IIS, Apache and Tomcat

Page 9: How to Stop Man in the Browser Attacks

Client Side Attacks - Scope of Problem Malware Distribution Methods

Drive-By-Download / Malvertizing

Phishing, “Spear Phishing”

Torrent and P2P

Physical

Page 10: How to Stop Man in the Browser Attacks

Client Side Attacks - Scope of Problem 2010 Attack Figures

A 2010 report by Kaspersky + ~600M attempts reported to KSN, more than 5 times increase

over 2009

Microsoft detects 60K-100K Zeus-infected machine per month

2010 1H – Microsoft cleaned 6.5M bot infections Rustock spanned 1M computers

Consumers cannot be expected to cope with the technical

problem on their own

Page 11: How to Stop Man in the Browser Attacks

From Consumer Attack to a Business Problem

The threat to consumers is

constantly growing •Number of vulnerabilities

•Number of attacks •Types of attacks •Sophistication

Usage is expanding beyond banking and

popular retail applications

We are passed the point of no return •We cannot expect average consumers to avoid infection and mitigate attacks alone

•We cannot deny service to infected consumers

•We cannot let the consumer bear the consequences of a compromise

Page 12: How to Stop Man in the Browser Attacks

From Consumer Attack to a Business Problem

Potential consequences (of failing to do so): + Reduced onboarding rate + Reduced activity + Increased refunds + Increased insurance rates

Consumer facing malware threatens online commerce*

Forrester Feb 2011: Malware And Trojans And Bots, Oh My!

Page 13: How to Stop Man in the Browser Attacks

From Consumer Attack to a Business Problem

Car User Safety

Online User Safety

Page 14: How to Stop Man in the Browser Attacks

Problem Definition

Page 15: How to Stop Man in the Browser Attacks

Client Side Trouble – Types of Interaction

• No interaction between malware and application

• Offline interaction between attacker and application using stolen credentials

Key loggers

Page 16: How to Stop Man in the Browser Attacks

Client Side Trouble – Types of Interaction

• Some interaction between browser and actual application during attack • Could be used for detection of some

Phishing campaigns • Offline interaction between attacker

and application using stolen credentials

Phishing

Page 17: How to Stop Man in the Browser Attacks

Client Side Trouble – Types of Interaction

• Extensive interaction between malware and application during attack

• Offline interaction between attacker and application using stolen credentials

Man in the

Browser

Page 18: How to Stop Man in the Browser Attacks

Attacker code runs in context of victim’s browser Original motivation

+ No need to attack infrastructure (DNS, tap into router, etc.) + Defeats SSL

Additional benefits + Access to local resources + Access to application session data

Prominent Actors + ZeuS, Gozi, URLZone, Sinowal, Limbo, and SpyEye + Silentbanker

Man in the Browser Attacks (aka Proxy Trojan)

Page 19: How to Stop Man in the Browser Attacks

MitB Attacks - Proxy Trojans in Action

Before After

Page 20: How to Stop Man in the Browser Attacks

MitB Attacks - Proxy Trojans in Action

Before After

Page 21: How to Stop Man in the Browser Attacks

MitB Attacks - Proxy Trojans in Action

Before After

Page 22: How to Stop Man in the Browser Attacks

Proxy Trojan Architecture

Client Machine Web Application

Page 23: How to Stop Man in the Browser Attacks

Proxy Trojan Architecture

Client Machine Web Application

Tamper Request

Tamper Page

Extract Data

Inject Fake Transaction

Drop Server

Page 24: How to Stop Man in the Browser Attacks

Shape Based Tests

Page 25: How to Stop Man in the Browser Attacks

A Typical Change by a Trojan

Clean Infected

Observation: Trojan likes to tamper with plain traffic

Page 26: How to Stop Man in the Browser Attacks

Observing Typical Changes by Trojans

• Enforces use of traffic that is easily tampered by the Trojan

• Avoids HTTP/1.1 connections, and compressed data

Encoding of Related Headers

• Ensures identification by the drop server and other attacker controlled components

Client Type Identification

• Extra data provided by an unfortunate victim • Could represent client identification for attacker

controlled components

Additional Parameters

• A consequence of fake transactions Parameter Order

Page 27: How to Stop Man in the Browser Attacks

Shape Based Tests

• The application (or a device protecting the application) inspects the shape of incoming messages for changes typical to Trojans

Step 1:

• If a Trojan pattern is detected mark the client (IP address / session / request) as “infected”

Step 2:

Page 28: How to Stop Man in the Browser Attacks

Shape Based Tests in Action

Client Machine Web Application

Tamper Request

Tamper Page

Extract Data

Inject Fake Transaction

Drop Server

Apply Shape Tests

Apply Shape Tests

Page 29: How to Stop Man in the Browser Attacks

Challenges – Tracking Trojan Discrepancies

• Each Trojan may display a different change • Changes may be reflected in specific request types

• Need to keep track of Trojans • Create a framework for shape based rules • Create a framework for constructing shape tests

Page 30: How to Stop Man in the Browser Attacks

Challenges – Avoiding False Positives

• Some real client devices do not support (or choose not to support) HTTP/1.1 or compressed data

Challenge:

• Engage the browser in a challenge response protocol

Solution:

Page 31: How to Stop Man in the Browser Attacks

Challenges – Avoiding False Positives

HTTP/1.1 200 OK . . . Content-Encoding: gzip Refresh: 2;url=infection_test.html?infected=no <html> <head> <script>window.navigate('infection_test.html?infected=yes')</script> </head> <body></body> </html>

...........V*//W...Qzi...I...z...J:`.......T$......d.y.%@.^f.R,...(..y.:.J....9.V......%%[email protected]...%6....

Page 32: How to Stop Man in the Browser Attacks

Content Based Tests

Page 33: How to Stop Man in the Browser Attacks

Observing Content-Tampering Trojans

• Current malware tampers HTML at the network layer (before it is interpreted by browser)

• This is due to simplicity and robustness considerations

Observation:

• Use client side code to verify integrity of HTML page content in coordination with the server

Solution:

Page 34: How to Stop Man in the Browser Attacks

OK Solution: Altering the Trojan Behavior

• Step 1: “Provoke” the MitB into making changes • Step 2: Compare the HTML content to known Trojan

behaviors

Naïve Solution

• MitB can be configured to avoid this type of manipulation • Solution requires constant chase after MitB configuration

files Requires constructing an up-to-date database of “known

behaviors”

Challenges

Page 35: How to Stop Man in the Browser Attacks

Better Solution: Content-Based Tests

•Server computes a digest of the delivered HTML page Random (invisible) elements are injected into the page before computation

Step 1:

• Server appends a page digest computation function to the HTML page Computation function code includes a random salt

Step 2:

•When page is loaded into the browser, the computation function is invoked, computes the digest and sends it to the server for verification

Step 3:

• If the browser does not send back a digest then infection is assumed

Step 4:

Page 36: How to Stop Man in the Browser Attacks

Content Based Tests in Action

Client Machine Web Application

Tamper Request

Tamper Page

Extract Data

Inject Fake Transaction

Drop Server

Compare Digests

Compute Digest and Inject Digest Computation Function

Compute Digest

Page 37: How to Stop Man in the Browser Attacks

Content-Based Tests: Strengths

1) Digest cannot be pre-computed by malware due to the random HTML elements

2) Digest cannot be computed by malware without executing the digest computation function + Requires malware to implement / invoke Javascript engine

3) Computation function can be extended to explicitly reference the randomly injected HTML elements through DOM functions + Requires the malware to implement / fake DOM

4) Malware cannot dismiss test

Page 38: How to Stop Man in the Browser Attacks

Content-Based Tests: Strengths

5) Does not depend on specific MitB configuration and the expected changes + Only depends on protected application page + Some configuration options should be available to restrict the

parts of the page that are digested – Avoid elements produced by client side code

6) Breaking the tie with attackers + Complexity of the computation process can be increased with

small effort + Resulting changes to malware code are complex and painful,

increasing its footprint

Page 39: How to Stop Man in the Browser Attacks

Overall Solution Strategy

Page 40: How to Stop Man in the Browser Attacks

Look at the Complete Picture

Apply shape based tests…

… And content-based tests

Page 41: How to Stop Man in the Browser Attacks

Interact with Infected Clients

Provide clear visual warnings

Contact customer offline

Apply business access policies • Example 1: Allow data extraction but deny transaction • Example 2: Limit transaction size

Automatically employ extra validation through side channels • Adaptive authentication

Keep a more comprehensive audit trail for the user / session

Page 42: How to Stop Man in the Browser Attacks

MitB is Only Part of the Landscape

• Server side fraud detection • Device profiling and reputation • Advanced authentication

Identifying account takeover

• Detect and takedown campaigns • Detect victims in real time

Defeat phishing campaigns

Page 43: How to Stop Man in the Browser Attacks

Requires a Flexible Deployment Framework

Cannot change application code whenever capabilities change or threats morph

Create consistency across all applications and flexibility in choosing vendors

Be able to protect legacy applications

Page 44: How to Stop Man in the Browser Attacks

Summary

Page 45: How to Stop Man in the Browser Attacks

Summary

Threat to consumer is constantly growing and is past the point where we can expect most of our consumers to avoid infection

Consumer infection has become a business problem While providers should urge consumers to be prudent

they MUST learn how to interact with infected consumers and create a safe business environment for them regardless of the general threat

Some car safety mechanisms are already regulated. We can expect the same from business IT security

Page 46: How to Stop Man in the Browser Attacks

Summary

Enterprise IT is failing to properly tackle client based attacks within enterprise

The growing number of so called “APT” attacks on organizations demonstrate the effect of “compromised insider”

Failures stem from the same reason: try to avoid infection rather than learn to interact with infected clients

Page 47: How to Stop Man in the Browser Attacks

Imperva’s Fraud Solution

Page 48: How to Stop Man in the Browser Attacks

SecureSphere 9.0 - Fraud Prevention Services

Is this endpoint safe?

Pass / Block

SecureSphere integrates with Trusteer to detect users infected with malware like SpyEye, Zeus, Gozi & Silon

1. User accesses Website

2. SecureSphere redirects browser to Trusteer

3. Browser downloads, runs malware check

4. Result reaches WAF for analysis

Page 49: How to Stop Man in the Browser Attacks

Use Case: Man in the Browser – Fraud Malware

Challenge + Fraud malware performing activities on behalf of

customers, causing money losses & customers dissatisfaction

+ FFIEC compliance requirements

Solution + Detect infected end-devices + Block sensitive areas in the application from infected

devices + Report on users connected from infected end-devices

49

Page 50: How to Stop Man in the Browser Attacks

ThreatRadar Fraud Prevention Stopping MitB

SecureSphere provides full event detail to analyze Man in the Browser (MitB) attacks

Page 51: How to Stop Man in the Browser Attacks

Centrally Manage Fraud and Web Security

SecureSphere Policy Engine

Known Attack Sources

Bot Detection Web Attack

Detection

Geolocation

User Infected with Malware

Browser and Agent

Combining Web fraud with WAF policies enhances accuracy of fraud detection

User Name

Page 52: How to Stop Man in the Browser Attacks

Webinar Materials

Post-Webinar Discussions

Answers to Attendee Questions

Webinar Recording Link Webinar Slides

Get LinkedIn to Imperva Data Security Direct for…

Page 53: How to Stop Man in the Browser Attacks

www.imperva.com

- CONFIDENTIAL -