UI Redressing A-acks on Android Devices Marcus Niemietz - - PowerPoint PPT Presentation

ui redressing a acks on android devices
SMART_READER_LITE
LIVE PREVIEW

UI Redressing A-acks on Android Devices Marcus Niemietz - - PowerPoint PPT Presentation

UI Redressing A-acks on Android Devices Marcus Niemietz Ruhr-University Bochum Horst Grtz InsAtute German Book Clickjacking und UI-Redressing


slide-1
SLIDE 1

UI ¡Redressing ¡A-acks ¡on ¡ Android ¡Devices ¡

Marcus ¡Niemietz ¡ Ruhr-­‑University ¡Bochum ¡

slide-2
SLIDE 2

 Horst ¡Görtz ¡InsAtute ¡  German ¡Book ¡

 Clickjacking ¡und ¡UI-­‑Redressing ¡

 WebAppSec: ¡ Trainings, ¡Pentests ¡  Speaker ¡at ¡BlueHat, ¡CONFidence, ¡ German ¡OWASP ¡Day, ¡PHDays, ¡... ¡  Twi-er: ¡@mniemietz ¡

slide-3
SLIDE 3

 This ¡talk ¡is ¡based ¡on ¡the ¡– ¡for ¡the ¡Black ¡Hat ¡ conference ¡wri-en ¡– ¡paper ¡

 UI ¡Redressing ¡A-acks ¡on ¡Android ¡Devices ¡

 Authors ¡

 Marcus ¡Niemietz, ¡Jörg ¡Schwenk ¡ ¡ ¡ ¡ ¡Horst ¡Görtz ¡InsAtute ¡for ¡IT-­‑Security ¡ ¡ ¡ ¡ ¡Ruhr-­‑University ¡Bochum, ¡Germany ¡

slide-4
SLIDE 4
  • 1. IntroducAon ¡
  • 2. Related ¡work ¡
  • 3. PorAng ¡UI ¡redressing ¡to ¡Android ¡devices ¡
  • 4. New ¡browserless ¡a-acks ¡
  • 5. MiAgaAon ¡techniques ¡
  • 6. Conclusion ¡and ¡outlook ¡
slide-5
SLIDE 5
  • 1. ¡IntroducAon ¡
slide-6
SLIDE 6

 UI ¡redressing ¡is ¡a ¡known ¡problem ¡since ¡2002 ¡  Security ¡problem ¡has ¡been ¡overlooked ¡unAl ¡ 2008 ¡è ¡Clickjacking ¡  Clickjacking ¡⊂ ¡UI ¡redressing ¡

 The ¡subclass ¡consists ¡of ¡a-acks ¡like ¡cursorjacking, ¡ filejacking, ¡tabnabbing, ¡and ¡inter ¡alia ¡tapjacking ¡  In ¡essence, ¡all ¡of ¡these ¡a-acks ¡need ¡a ¡Web ¡ browser ¡to ¡be ¡executed ¡

slide-7
SLIDE 7

 Considering ¡the ¡given ¡a-ack ¡vectors ¡on ¡ desktop-­‑based ¡Web ¡browsers, ¡we ¡pose ¡the ¡ following ¡quesAon: ¡ ¡ ¡ ¡Can ¡UI ¡redressing ¡a-acks ¡be ¡ported ¡to ¡ ¡ ¡ ¡ ¡smartphone-­‑based ¡systems? ¡

slide-8
SLIDE 8

 We ¡focus ¡on ¡the ¡Android ¡operaAng ¡system ¡

 Source: ¡Gartner ¡(November ¡2011) ¡

37.500.000 75.000.000 112.500.000 150.000.000 3Q2010 3Q2011

Android Symbian iOS RIM Others

slide-9
SLIDE 9

 We ¡focus ¡on ¡the ¡Android ¡operaAng ¡system ¡

 Source: ¡Android.com; ¡14-­‑day ¡period ¡data-­‑ ¡February ¡1, ¡2012 ¡

15 30 45 60 2.1 2.2 2.3.3 - 2.3.7 Other

slide-10
SLIDE 10

ANDROID 4.0 ANDROID 2.3.3

slide-11
SLIDE 11

 This ¡talk ¡focuses ¡on ¡two ¡points ¡

  • 1. A-acks ¡and ¡countermeasures ¡for ¡desktop-­‑

based ¡Web ¡browsers ¡available ¡for ¡Android ¡

  • 2. A ¡tapjacking ¡a-ack ¡technique ¡which ¡does ¡not ¡

need ¡a ¡Web ¡browser ¡to ¡execute ¡

slide-12
SLIDE 12
  • 2. ¡Related ¡work ¡
slide-13
SLIDE 13

¡ ¡ 2.1. ¡Desktop-­‑based ¡UI ¡Redressing ¡Techniques ¡ 2.2. ¡Browserless ¡UI ¡Redressing ¡A-acks ¡

slide-14
SLIDE 14

2.1. ¡Desktop-­‑based ¡ UI ¡Redressing ¡Techniques ¡

slide-15
SLIDE 15

 Clickjacking ¡  Strokejacking ¡  Drag-­‑and-­‑drop ¡operaAons ¡  Content ¡extracAon ¡  Event-­‑recycling ¡  SVG ¡masking ¡

slide-16
SLIDE 16

 Classic ¡clickjacking ¡  Likejacking ¡and ¡sharejacking ¡  Nested ¡clickjacking, ¡double ¡clickjacking ¡  Cookiejacking, ¡filejacking ¡  Eventjacking, ¡classjacking ¡  Cursorjacking, ¡tabnabbing ¡  CombinaAons ¡with ¡CSRF, ¡XSS, ¡and ¡CSS ¡

slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22

<h1>Funny pictures</h1> <img src="lol.gif"> <button>Click me</button> <img src="lol.gif"> <iframe style="position:absolute; z-index:1;

  • pacity:0.0; filter:alpha(opacity=0);

left:-120px; top:95px;" width="300" height="200" src="http://www.bing.com"> </iframe>

slide-23
SLIDE 23

2.2. ¡Browserless ¡ UI ¡Redressing ¡A-acks ¡

slide-24
SLIDE 24

 Is ¡it ¡possible ¡to ¡perform ¡browser-­‑like ¡UI ¡ redressing ¡a-acks ¡on ¡mobile ¡devices ¡without ¡ using ¡a ¡Web ¡browser ¡or, ¡at ¡the ¡very ¡least, ¡ without ¡using ¡it ¡directly? ¡

slide-25
SLIDE 25

 David ¡Richardson ¡in ¡2010 ¡about ¡the ¡ ¡ ¡Android ¡trust ¡model ¡

 An ¡applicaAon ¡is ¡allowed ¡to ¡programmaAcally ¡

  • pen ¡a ¡dialog ¡but ¡not ¡to ¡interact ¡with ¡it ¡

 Idea ¡

 Use ¡a ¡toast-­‑view ¡to ¡show ¡a ¡quick ¡li-le ¡message ¡ to ¡the ¡user ¡

 Basic ¡idea: ¡Be ¡as ¡unobtrusive ¡as ¡possible ¡

slide-26
SLIDE 26
slide-27
SLIDE 27

 Jack ¡Mannino ¡published ¡a ¡proof ¡of ¡concept ¡of ¡ a ¡tapjacking ¡a-ack ¡in ¡2011 ¡

 Scaling ¡the ¡usually ¡small ¡noAficaAon ¡message ¡to ¡ the ¡enAre ¡display ¡of ¡the ¡mobile ¡device ¡ ¡  Subsequent ¡usage ¡of ¡the ¡default ¡constant ¡ LENGTH LONG

slide-28
SLIDE 28
slide-29
SLIDE 29

 Crucial ¡point ¡

 A ¡touch ¡gesture ¡on ¡such ¡a ¡message ¡or ¡noAficaAon ¡ will ¡be ¡passed ¡through ¡to ¡the ¡underlying ¡ applicaAon ¡  Similar ¡to ¡Clickjacking ¡

 Idea ¡

 Create ¡a ¡noAficaAon ¡message, ¡which ¡looks ¡like ¡a ¡ normal ¡applicaAon ¡

slide-30
SLIDE 30
slide-31
SLIDE 31
  • 3. ¡PorAng ¡UI ¡redressing ¡to ¡

Android ¡devices ¡

slide-32
SLIDE 32

 Classic ¡clickjacking, ¡classjacking, ¡strokejacking ¡

 Requires ¡a ¡Web ¡browser ¡supporAng ¡frames, ¡CSS, ¡ JavaScript, ¡and ¡HTML5 ¡

 Nested ¡clickjacking, ¡filejacking, ¡tabnabbing, ¡ content ¡extracAon, ¡event-­‑recycling, ¡and ¡SVG ¡ masking ¡

 AddiAonal ¡features ¡in ¡desktop-­‑based ¡Web ¡ browsers ¡

PorAng ¡UI ¡redressing

slide-33
SLIDE 33

 Nowadays, ¡any ¡Web ¡browser ¡one ¡requires ¡ can ¡be ¡downloaded ¡via ¡Google ¡Play ¡  Not ¡transferable ¡a-acks ¡

 Cursorjacking ¡  Cookiejacking ¡  Double ¡clickjacking ¡and ¡pop-­‑up-­‑blocker ¡bypasses ¡

PorAng ¡UI ¡redressing

slide-34
SLIDE 34
  • 4. ¡New ¡browserless ¡a-acks ¡
slide-35
SLIDE 35

 In ¡addiAon ¡to ¡the ¡a-ack ¡described ¡by ¡Jack ¡ Mannino ¡we ¡can ¡do ¡

 Contact ¡data ¡manipulaAon ¡  NaAve ¡browser ¡uAlizaAon ¡  Touch ¡gestures ¡logging ¡  Predefined ¡phone ¡calls ¡  Installing ¡applicaAons ¡in ¡the ¡background ¡

New ¡browserless ¡a-acks

slide-36
SLIDE 36

 All ¡of ¡these ¡a-acks ¡are ¡using ¡the ¡same ¡ technique ¡

  • 1. There ¡is ¡a ¡visible ¡a-acker's ¡applicaAon ¡in ¡form ¡of ¡

a ¡noAficaAon ¡in ¡the ¡foreground ¡

  • 2. There ¡is ¡a ¡target ¡applicaAon ¡in ¡the ¡background ¡

New ¡browserless ¡a-acks

slide-37
SLIDE 37

New ¡browserless ¡a-acks

slide-38
SLIDE 38

 There ¡is ¡a ¡limited ¡number ¡of ¡operaAons ¡like ¡

  • pening ¡the ¡phone ¡call ¡applicaAon ¡

 SoluAon: ¡Unauthorized ¡home ¡screen ¡ navigaAon ¡a-ack ¡

 SubstanAally ¡extend ¡the ¡limited ¡set ¡of ¡a-acks ¡  An ¡a-acker ¡needs ¡more ¡touch ¡gestures ¡of ¡a ¡vicAm ¡

New ¡browserless ¡a-acks

slide-39
SLIDE 39
  • 5. ¡MiAgaAon ¡techniques ¡
slide-40
SLIDE 40

¡ ¡ 5.1. ¡Browser-­‑Based ¡UI ¡Redressing ¡ 5.2. ¡Tapjacking ¡Defense ¡Mechanisms ¡

MiAgaAon ¡techniques ¡

slide-41
SLIDE 41

5.1. ¡Browser-­‑Based ¡ UI ¡Redressing ¡

slide-42
SLIDE 42

 Frame ¡Buster ¡

 Consists ¡of ¡a ¡condiAonal ¡statement ¡and ¡a ¡counter-­‑acAon ¡ if (top.location != location)

  • top.location = self.location;

 BusAng ¡frame ¡busAng ¡is ¡possible ¡

 August ¡Detlefsen ¡et ¡al. ¡published ¡the ¡most ¡a-ack-­‑ resistant ¡countermeasure ¡against ¡busAng ¡frame ¡ busAng ¡techniques ¡

MiAgaAon ¡techniques

slide-43
SLIDE 43

<style id="antiClickjack"> body{display:none !important;} </style> <script type="text/javascript"> if (self === top) { var antiClickjack = document. getElementById("antiClickjack"); antiClickjack.parentNode. removeChild(antiClickjack); } else { top.location = self.location; } </script>

MiAgaAon ¡techniques

slide-44
SLIDE 44

 X-­‑Frame-­‑OpAons ¡

 HTTP ¡header ¡developed ¡by ¡Microsoi ¡in ¡2008 ¡  Checks ¡if ¡a ¡website ¡should ¡be ¡loaded ¡in ¡a ¡frame ¡or ¡not ¡

 DENY  SAMEORIGIN  ALLOW-FROM origin

 Restricted ¡to ¡modern ¡browsers ¡such ¡as ¡Firefox ¡≥3.6.9, ¡ Opera ¡≥10.5, ¡and ¡IE ¡≥8. ¡

MiAgaAon ¡techniques

slide-45
SLIDE 45

 Content ¡Security ¡Policy ¡

 Old ¡CSP: ¡Aside ¡from ¡the ¡framing ¡protecAon, ¡one ¡can ¡also ¡ idenAfy ¡other ¡targets, ¡such ¡as ¡prevenAng ¡data ¡injecAon ¡ a-acks ¡or ¡cross-­‑site ¡scripAng ¡(frame-­‑ancestors) ¡  New ¡CSP: ¡Focus ¡on ¡sandboxing ¡and ¡source ¡specificaAon ¡of ¡ style ¡sheets, ¡script ¡files ¡and ¡similar ¡issues ¡

MiAgaAon ¡techniques

slide-46
SLIDE 46

MiAgaAon ¡techniques

Browser ¡ Engine ¡ XFO ¡

  • CSP ¡

nCSP ¡ Android ¡– ¡4.0.3 ¡ WebKit ¡ ✓ ¡ ✗ ¡ ✗ ¡ Dolphin ¡– ¡8.7.0 ¡ WebKit ¡ ✓ ¡ ✗ ¡ ✗ ¡ Firefox ¡– ¡4.0.3 ¡ Gecko ¡ ✓ ¡ ✓ ¡ ✗ ¡ Opera ¡Mini ¡– ¡7.0 ¡ Presto ¡ ✓ ¡ ✗ ¡ ✗ ¡ Opera ¡Mobile ¡– ¡12.00 ¡ Presto ¡ ✓ ¡ ✗ ¡ ✗ ¡

slide-47
SLIDE 47

5.2. ¡Tapjacking ¡ Defense ¡Mechanisms ¡

slide-48
SLIDE 48

 Android ¡touch ¡filter ¡

 Blocks ¡touch ¡gestures ¡received ¡whenever ¡view's ¡window ¡is ¡

  • bscured ¡

 setFilterTouchesWhenObscured()


  • r, ¡alternaAvely, ¡with ¡the ¡a-ribute ¡

android:filterTouchesWhenObscured  Not ¡enabled ¡by ¡default ¡and ¡they ¡are ¡only ¡available ¡in ¡ Android ¡versions ¡higher ¡than ¡2.2 ¡

MiAgaAon ¡techniques

slide-49
SLIDE 49

 Tapjacking ¡Security ¡Layer ¡(TSL) ¡

 Should ¡be ¡implemented ¡by ¡the ¡Android ¡team ¡into ¡the ¡ kernel ¡in ¡the ¡near ¡future ¡ ¡  It ¡opens ¡automaAcally ¡once ¡a ¡user ¡fires ¡an ¡applicaAon ¡  It ¡is ¡always ¡in ¡the ¡background ¡and ¡remains ¡opened ¡unAl ¡ the ¡applicaAon ¡in ¡its ¡forefront ¡gets ¡closed ¡  A ¡touch ¡gesture ¡on ¡the ¡TSL ¡will ¡be ¡blocked ¡

MiAgaAon ¡techniques

slide-50
SLIDE 50

MiAgaAon ¡techniques

slide-51
SLIDE 51
  • 6. ¡Conclusion ¡and ¡outlook ¡
slide-52
SLIDE 52

 Most ¡of ¡the ¡exisAng ¡UI ¡redressing ¡a-acks ¡can ¡ be ¡used ¡with ¡very ¡li-le ¡effort ¡  There ¡are ¡a ¡lot ¡of ¡countermeasures: ¡ Frame ¡Buster, ¡XFO, ¡and ¡the ¡CSP ¡  We ¡have ¡introduced ¡a ¡browserless ¡UI ¡ redressing ¡a-ack ¡and ¡a ¡new ¡security ¡layer ¡ against ¡tapjacking ¡a-acks ¡

Conclusion ¡and ¡outlook

slide-53
SLIDE 53

 We ¡must ¡recommend ¡that ¡vendors ¡of ¡security ¡ soiware ¡urgently ¡implement ¡our ¡TLS ¡  HTML5 ¡and ¡CSS3 ¡drais ¡are ¡parAally ¡ implemented ¡in ¡Web ¡browsers ¡

 The ¡field ¡of ¡a-acks ¡will ¡conAnuously ¡expand ¡  Long-­‑lasAng ¡'cat ¡and ¡mouse ¡game‘ ¡

Conclusion ¡and ¡outlook

slide-54
SLIDE 54

Thank ¡you ¡for ¡your ¡a-enAon. ¡ ¡ Any ¡quesAons? ¡