How we hacked and how you can be safe and what happened next Ruben - - PowerPoint PPT Presentation

how we hacked
SMART_READER_LITE
LIVE PREVIEW

How we hacked and how you can be safe and what happened next Ruben - - PowerPoint PPT Presentation

How we hacked How we hacked and how you can be safe and what happened next Ruben van Vreeland Ruben van Vreeland Web Application Security Web hosting / infrastructure Web applications / platforms VB6, C#, PHP, (Spring) Java


slide-1
SLIDE 1

How we hacked

and how you can be safe

Ruben van Vreeland

How we hacked

and what happened next
slide-2
SLIDE 2

Ruben van Vreeland

  • Web Application Security
  • Web hosting / infrastructure
  • Web applications / platforms
  • VB6, C#, PHP, (Spring) Java
  • The art of exploitation of the Web
  • Co-Founder BitSensor: security & insight
slide-3
SLIDE 3

Fixed

slide-4
SLIDE 4

Fixed

slide-5
SLIDE 5

Black magic?

slide-6
SLIDE 6

The ¡art ¡of ¡exploita.on

  • Dissect ¡in ¡5 ¡steps ¡
  • Intro ¡XSS ¡ ¡
  • Visual ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡HTML ¡+ ¡styling ¡ ¡
  • Whitelist ¡bypass ¡ ¡
  • Internet ¡Explorer ¡password ¡autocomplete ¡ ¡
  • ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡combining ¡both ¡ ¡
slide-7
SLIDE 7

Easy ¡intro ¡XSS

slide-8
SLIDE 8

Comand ¡& ¡Control ¡

Browser ¡Exploita.on ¡Framework

BeEF ¡ BROWSER ¡ WEBPAGE ¡ XSS ¡ Bootstrap ¡ Payload ¡ WEBPAGE ¡ User ¡Data ¡ Firewalled ¡ Change ¡Data ¡ Passwords ¡

slide-9
SLIDE 9

Common ¡XSS ¡vectors

Unsani.z Unsani.zed ed ¡HTML HTML <script>payload</script> Unesc Unescaped aped ¡ ¡aGribut aGribute <img ¡src=“” ¡/><script>payload</script><a ¡“” ¡/> <img ¡src=“/favicon.png” ¡onload=“payload” ¡/> Unsani.z Unsani.zed ed ¡ ¡aGribut aGribute ¡c ¡con

  • nten

ent <a ¡href=“javascript:payload” ¡/> Unsani.z Unsani.zed ed/Wr Wrongly ¡ ¡en encod

  • ded

ed ¡scrip ¡script Var ¡a ¡= ¡b; ¡ ¡Payload; Unsani.z Unsani.zed ed ¡S ¡Style ¡( yle ¡(ol

  • lder

er ¡IE ¡ ¡IE ¡on

  • nly)

) <img ¡src=“” ¡style=“width: ¡expression(payload); ¡” ¡/>

slide-10
SLIDE 10

<a ¡href="javascript:alert(/Exploit ¡me!/)"> javascript:alert(/Exploit ¡me!/) </a>

¡ ¡

slide-11
SLIDE 11

<a href=“javascript:payload” style=“ background: rgba(255, 0, 0, 0.5); position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; ” > </a>

hMp://output.jsbin.com/cipozanute/1/ ¡ ¡

slide-12
SLIDE 12

But, ¡wait

<a href=“*”> <* width=“*” height=“*” class=“*” style=“” />

Unsanitized Style (older IE only) <img src=“” style=“width: expression(payload); ” />

slide-13
SLIDE 13

¡<head> ¡ ¡ ¡ ¡<meta ¡charset="u[-­‑8"> ¡ ¡ ¡ ¡<meta ¡hGp-­‑equiv="X-­‑UA-­‑Compa.ble" ¡ content="IE=edge"> ¡ ¡ ¡ ¡<meta ¡name="viewport" ¡content="width=device-­‑ width, ¡ini.al-­‑scale=1"> ¡ ¡ ¡ ¡<!-­‑-­‑ ¡Bootstrap ¡core ¡CSS ¡-­‑-­‑> ¡ ¡ ¡ ¡<l <link ¡ ¡hr href=" ="hGp://getbootstrap.com/ m/dis dist/cs css/ bootstrap.mi min.css" ¡ ¡re rel=" ="stylesheet"> >

slide-14
SLIDE 14

Defined ¡in ¡bootstrap.min.css

3663 ¡.dropdown-­‑backdrop ¡{ ¡ ¡ 3664 ¡ ¡ ¡posiZon: ¡fixed; ¡ ¡ 3665 ¡ ¡ ¡top: ¡0; ¡ ¡ 3666 ¡ ¡ ¡right: ¡0; ¡ ¡ 3667 ¡ ¡ ¡boMom: ¡0; ¡ ¡ 3668 ¡ ¡ ¡le`: ¡0; ¡ ¡ 3669 ¡ ¡ ¡z-­‑index: ¡990; ¡ ¡ 3670 ¡} ¡ ¡ 4299 ¡.navbar-­‑fixed-­‑top, ¡ ¡ 4300 ¡.navbar-­‑fixed-­‑boMom ¡{ ¡ ¡ 4301 ¡ ¡ ¡posiZon: ¡fixed; ¡ ¡ 4302 ¡ ¡ ¡right: ¡0; ¡ ¡ 4303 ¡ ¡ ¡le`: ¡0; ¡ ¡ 4304 ¡ ¡ ¡z-­‑index: ¡1030; ¡ ¡ 4305 ¡} ¡ ¡

slide-15
SLIDE 15

Exploi.ng ¡with ¡style

<a ¡ ¡ ¡ ¡ ¡width=“100%” ¡ ¡ ¡ ¡height=“100%” ¡ ¡ ¡ ¡ ¡href=“javascript:payload” ¡ ¡ ¡ ¡ ¡class=“dropdown-­‑backdrop ¡navbar-­‑fixed-­‑top”> </a>

¡ ¡ ¡ ¡ hMp://output.jsbin.com/zoqipeloca/1/ ¡ ¡ ¡

slide-16
SLIDE 16
slide-17
SLIDE 17

Hijack ¡login

Using ¡class ¡aGribute Recreate ¡pixel-­‑perfect ¡clone

¡ ¡ ¡ ¡ ¡ ¡ hMp://jsbin.com/dejite/13/edit ¡ ¡ ¡

user ¡ password ¡ Login ¡

slide-18
SLIDE 18

Abuse ¡Password ¡Manager

  • Same-­‑Origin ¡IE: ¡Autofilled
  • Submit ¡buGon ¡overlay ¡100% ¡x ¡100% ¡
  • Not ¡autofilled: ¡spoof

hMp://jsbin.com/dejite/13/edit

user ¡ password ¡ Login ¡

hMps://www.cs.utexas.edu/~suman/publicaZons/suman_pwdmgr.pdf ¡

slide-19
SLIDE 19

Fixed

slide-20
SLIDE 20

LinkedIn

slide-21
SLIDE 21

Failed: ¡javascript ¡link

slide-22
SLIDE 22

Failed: ¡iframe ¡cross ¡domain

slide-23
SLIDE 23

Worked ¡100% ¡covering ¡iframe ¡

slide-24
SLIDE 24

Failed: ¡iframe ¡open ¡redirect

slide-25
SLIDE 25

Worked: ¡Covering ¡link

slide-26
SLIDE 26

Worked: ¡Covering ¡image ¡+ ¡Link

slide-27
SLIDE 27
slide-28
SLIDE 28

To ¡conclude

Sani.z Sani.ze AGribute: ¡id, ¡class, ¡style

  • embed/embed.ly

Har Harden en HTML5 ¡IFrame ¡Sandbox

slide-29
SLIDE 29

info@bitsensor.io ¡