exploiting a/b testing ekoparty 2016 slides

47
Exploiting A/B Testing for Fun and Profit Juan Berner

Upload: juan-berner

Post on 15-Apr-2017

38 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Exploiting A/B Testing Ekoparty 2016 Slides

Exploiting A/B Testing for Fun and Profit

Juan Berner

Page 2: Exploiting A/B Testing Ekoparty 2016 Slides

About me● @89berner● Security researcher● Developer● SpaceX Fan

Page 3: Exploiting A/B Testing Ekoparty 2016 Slides

Why am I here?

Growing trend ignored by security teams and assessment tools

Not what I was looking for =>

??

Page 4: Exploiting A/B Testing Ekoparty 2016 Slides

Who is using it?

Page 5: Exploiting A/B Testing Ekoparty 2016 Slides

So.. What is A/B Testing?

● Simple way to evaluate different versions of the same product

● Provides a data-driven way of making decisions

● Key metrics are usually the decisive factors

Page 6: Exploiting A/B Testing Ekoparty 2016 Slides

Which one was chosen?

Page 7: Exploiting A/B Testing Ekoparty 2016 Slides

Which one was chosen?

Though most people prefer the first one

Page 8: Exploiting A/B Testing Ekoparty 2016 Slides

Not always A/B

● Multivariate experiments

● Might only be used for a percentage of traffic

● Can be short or long lived

● Usually forgotten after the fact

Page 9: Exploiting A/B Testing Ekoparty 2016 Slides

Why should we care?

● Number of companies using it keeps growing

● Decisions are based on untrusted parties data

● False sense of security

Page 10: Exploiting A/B Testing Ekoparty 2016 Slides

Detecting A/B TestingAre we only seeing part of the picture?

Page 11: Exploiting A/B Testing Ekoparty 2016 Slides

Detecting A/B Testing

What to look for:

● JS● Images● Additional code sections● New links● Display changes

Page 12: Exploiting A/B Testing Ekoparty 2016 Slides

Adversarial A/B Testing

● We make decisions based on user input.

● What could ever go wrong, Tay?

Page 13: Exploiting A/B Testing Ekoparty 2016 Slides

Please Track Me, Bro

● By user account / email / identifier

● Visitor’s cookie

● Mobile app id

Page 14: Exploiting A/B Testing Ekoparty 2016 Slides

Manipulating results“Unexpected results are expected in some degree”“Decisions are made based on user input”

Page 15: Exploiting A/B Testing Ekoparty 2016 Slides

Abnormal

Page 16: Exploiting A/B Testing Ekoparty 2016 Slides

Exploiting A/B TestingPhase 1: Exploring

Page 17: Exploiting A/B Testing Ekoparty 2016 Slides

Exploiting A/B TestingPhase 2: Mapping

Page 18: Exploiting A/B Testing Ekoparty 2016 Slides

Exploiting A/B TestingPhase 3: Pretending

Page 19: Exploiting A/B Testing Ekoparty 2016 Slides

We will need to blend

● Usual ways of getting armies of IPv4

● Nat’s will be expected

● Geographical distribution

● Fingerprinting evasion

Page 20: Exploiting A/B Testing Ekoparty 2016 Slides

All about the metrics

● Some metrics are pretty easy to guess

● More activity is usually better

● Not always financial

How do we find out about them?

Page 21: Exploiting A/B Testing Ekoparty 2016 Slides

They

https://www.optimizely.com/case-studies/brooks-running/

Page 22: Exploiting A/B Testing Ekoparty 2016 Slides

They wouldn’t

http://eng.wealthfront.com/2016/04/11/building-mobile-ab-testing-infrastructure/

Page 23: Exploiting A/B Testing Ekoparty 2016 Slides

They wouldn’t just

https://blog.twitter.com/2015/twitter-experimentation-technical-overview

Page 24: Exploiting A/B Testing Ekoparty 2016 Slides

They wouldn’t just blog

www.slideshare.net/SteveUrban/experimentation-platform-at-netflix

Page 25: Exploiting A/B Testing Ekoparty 2016 Slides

They wouldn’t just blog about it.

https://www.optimizely.com/case-studies/sony/

Page 26: Exploiting A/B Testing Ekoparty 2016 Slides

They wouldn’t just blog about it.

Right?http://www.slideshare.net/KrishnaGade2/why-eveyrthing-is-an-ab-test-at-pinterest

Page 27: Exploiting A/B Testing Ekoparty 2016 Slides

Impacting metrics

● Can be costly to go for the known metrics

● Use business logic in your favor

Page 28: Exploiting A/B Testing Ekoparty 2016 Slides

Not just a good thing

Users just drop out after watching this feature

This new feature will have more users closing their accounts

No financial cost associated

Page 29: Exploiting A/B Testing Ekoparty 2016 Slides
Page 30: Exploiting A/B Testing Ekoparty 2016 Slides

Scaling the attack

● We would need to keep normal user behaviour.

● This could mean a big financial investment depending on the metrics used.

● Could we just crowdsource?

Page 31: Exploiting A/B Testing Ekoparty 2016 Slides

Finding volunteers

Botnets

Malware

MITM

Open proxies

As little interference as possible

Page 32: Exploiting A/B Testing Ekoparty 2016 Slides

Finding volunteers

Interaction as usual in most of the site.

When faced with the variants you are not betting to create small disruptions that could be attributed to chance.

No real effect on users means no attention is drawn.

Page 33: Exploiting A/B Testing Ekoparty 2016 Slides

Remember these guys?

Page 34: Exploiting A/B Testing Ekoparty 2016 Slides

News sites experiment too

Page 35: Exploiting A/B Testing Ekoparty 2016 Slides

News sites experiment too

Source: https://freedom-to-tinker.com/2016/05/26/a-peek-at-ab-testing-in-the-wild/

Page 36: Exploiting A/B Testing Ekoparty 2016 Slides

The other side of A/B Testing

Decisions are based on data

Data is based on untrusted user input

Results can be unintuitive

Page 37: Exploiting A/B Testing Ekoparty 2016 Slides

Demo: Manipulating news headlinesInstead of faking users, let’s get real ones

You don’t need to win, just have someone else lose instead

Setup:

● Python open proxy● Sentiment classification to detect positive or negative news related

to a keyword

Page 38: Exploiting A/B Testing Ekoparty 2016 Slides

Demo: Manipulating news headlines

Less negative stories => Better conversion

Page 39: Exploiting A/B Testing Ekoparty 2016 Slides

What lies behind the experiments

Page 40: Exploiting A/B Testing Ekoparty 2016 Slides

What lies behind the experiments

How do we calculate amount of scans needed?

H: Desired probability of getting all scansN: Amount of experiments expected on site

Assumptions:All experiments in a 50/50 situationGetting 100% of traffic

Page 41: Exploiting A/B Testing Ekoparty 2016 Slides

What lies behind the experiments

log_2(N) + log_2(1/(1-h)) + 1

Page 42: Exploiting A/B Testing Ekoparty 2016 Slides

What lies behind the experiments

For example:

log2(1) + log2(1/(1-0.5)) + 1 = 2

log2(1) + log2(1/(1-0.99)) + 1 = 8

log2(1000) + log2(1/(1-0.99)) + 1 = 18

log2(10000) + log2(1/(1-0.99)) + 1 = 21

Page 43: Exploiting A/B Testing Ekoparty 2016 Slides

Backend vs Frontend experiments

● Backend experiments will seem transparent

● Frontend experiments will require to simulate the browser

● Common practice of JS rendering

Page 44: Exploiting A/B Testing Ekoparty 2016 Slides

Demo:

Finding vulnerabilities behind experiments

● One variant● 25% of traffic

Page 45: Exploiting A/B Testing Ekoparty 2016 Slides

Defensive techniques

Finding the fakes

Looking for manipulation

Retroactive experimentation

Human analysis

Page 46: Exploiting A/B Testing Ekoparty 2016 Slides

Final Remarks

● External data should be untrusted by default

● Experiments can’t replace human reasoning

● Experiments are coming to stay

Page 47: Exploiting A/B Testing Ekoparty 2016 Slides

Questions?

[email protected]

Thanks!