demonicpossession ofbrowsers - aura information security...

27
Demonic Possession of Browsers BeEF issue #666

Upload: lamkiet

Post on 06-Feb-2018

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Demonic  Possession  of  Browsers  

   

BeEF  issue  #666  

Page 2: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Intros  

•  Who  am  I?  – Mike  Haworth  

•  What  do  I  do?  – Pentester  for  Aura  Informa?on  Security  – Contributor  to  BeEF  project  

Page 3: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Same  Origin  Policy  (SOP)  

•  What  is  SOP  and  why  should  I  care?  

•  It’s  a  rule  enforced  in  the  browser  •  SOP  is  what  stops  a  script  on  hacker.com  from  reading  content  on  gmail.com  

 

Page 4: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

SOP  –  what  the  docs  say..  

Same  Origin  Policy  says  that,  Host,  Protocol  and  Port  must  match…  

Page 5: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Same  Origin  Policy  (SOP)  

•  SOP,  Its  what  stops  this  happening…  

Page 6: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Same  Origin  Policy  (SOP)  

…  and  this  from  happening.  

Page 7: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Ways  to  get  an  SOP  bypass    

•  By  browser  issue:    – Opera  12.02,  loca?on  object  bug  –  XSS  into  Chrome  extensions  – Dropbox,  iOS  –  Safari  

•  By  DNS,  you  control  origin.  –  Not  gonna  cover  this  

•  By  WebApp  issue:  i.e.  “Spoofing”  origin  via  XSS  –  Or  this  

Page 8: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Opera  x-­‐domain  bug  

•  Overly  broad  access  to  loca?on  object  of  a  child  iframe  

•  Reported  by  Gareth  Hayes  (thespanner.co.uk)  

Page 9: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Opera  x-­‐domain  

       Opera  allows  overwrite  the  array  constructor  of  a  framed  page.    The  bug  is  triggered  when  framed  domain  does  join()  on  an  array  

Page 10: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Logged  in  to  Amazon.com  

Page 11: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Malicious  site  frames  Amazon,  steals  data  

Page 12: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Opera  bug  

•  Pros:  –  Its  in  a  browser  so  can  get  data  from  logged  in  apps  

•  Cons:  – Patched  (post  12.02)  – Vic?m  domain  must  do  [].join()  to  trigger  bug  – Must  be  able  to  iframe  vic?m  (X-­‐FRAME-­‐OPTIONS)  – Opera  browser  warnings  for  internal  sites  L  

 

Page 13: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

XSS  into  Chrome  Extensions  

Steps:  1)  Enumerate  chrome  extensions  remotely  2)  Find  vulnerable  extension  3)  Inject  BeEF  4)  Can  access  anything  extension  can  access  5)  Can  do  lots  of  other  stuff  that’s  out  of  scope  

for  this  talk    

Page 14: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Chrome  Extension  Example  

•  RSS  feed  reader  chrome  extension  •  Extension  reads  pages,  provides  buhon  to  subscribe  to  RSS  in  page  

•  Can  get  our  JS  into  the  context  of  the  extension,  via  page  

<link  ?tle="Slashdot  RSS<img  src=x  onerror=badness()..  

Page 15: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

XSS  of  Chrome  Extensions  

•  Pros:  – Can  get  waaaay  more  than  just  SOP  bypass  – Access  to  all  tabs  poten?al  for  RCE  if  using  NPAPI  

•  Cons:  – Content  Security  Policy  will  be  enforced  in  2013  

More:  hhp://blog.kotowicz.net/  

Page 16: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Stealing  files  ouha  Dropbox  

•  iOS  app  allows  JavaScript  to  read  local  files!            (via  XMLHhpRequest  for  file://)    •  Don’t  even  have  to  know  filename  as  there  is  a  plist  that  contains  a  list  of  cached  files  (thanks!)  

Page 17: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Steal  files  out  of  Dropbox  with  BeEF  

     hhp://www.youtube.com/watch?v=enKM1LWeLJk  

Page 18: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Stealing  files  ouha  Dropbox  

•  Bug  disclosed  and  fixed  L  

Page 19: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Dropbox  bug  

•  Pros:  – Access  local  files  – Access  sites  on  internal  network  

•  Cons:  – Not  in  a  browser,  no  data  from  logged  in  apps.  – Requires  vic?m  to  open  ahacker’s  file  in  Dropbox  app  on  iOS  device.  

 

Page 20: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

How  does  this  all  relate  to    BeEF  issue  #666?  

•  BeEF  has  a  ‘use  vic?m  as  proxy’  feature.  

 

•  Nice,  but  of  limited  use  as  need  an  XSS  in  this  domain  in  the  first  place.    –  i.e.  we  are  limited  by  SOP  

Page 21: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

BeEF  Issue  #666  

Got  the  Proxy  working  for  Cross-­‐Domain  requests!  

Page 22: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

BeEF  Cross  Domain  Proxy  

Ahacker  proxies  requests  via  vic?ms  browser  

Page 23: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

BeEF  Cross  Domain  Proxy  

     hhp://www.youtube.com/watch?v=ZO7VGCjBtFQ  

Page 24: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

BeEFs  Proxy  feature  

•  It  can  be  really  slow  

•  Not  that  prac?cal  

•  Be  nice  if  you  could  just  pull  down  Gmail  messages  or  something  useful…  

Page 25: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Use  SOP  Bypass  to  read  gmail  with  BeEF  

     hhp://www.youtube.com/watch?v=FVS8UFC-­‐hKA  

Page 26: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

Safari  bug  feature  

•  Pros:  – Access  anything  user  is  logged  into  in  Safari  – Access  local  files  –  It’s  a  feature!  (reported  in  2k7  and  s?ll  in  6.0)  

•  Cons:  – Requires  “spearphish”  vector,  user  must  open  file  from  ahacker  

 

Page 27: DemonicPossession ofBrowsers - Aura Information Security ...research.aurainfosec.io/assets/demonic_browsers.pdf ·

fin.