How we hacked
and how you can be safeRuben van Vreeland
How we hacked
and what happened next
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
How we hacked
and how you can be safeRuben van Vreeland
How we hacked
and what happened nextRuben van Vreeland
Fixed
Fixed
The ¡art ¡of ¡exploita.on
Easy ¡intro ¡XSS
Comand ¡& ¡Control ¡
Browser ¡Exploita.on ¡Framework
BeEF ¡ BROWSER ¡ WEBPAGE ¡ XSS ¡ Bootstrap ¡ Payload ¡ WEBPAGE ¡ User ¡Data ¡ Firewalled ¡ Change ¡Data ¡ Passwords ¡
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
ent <a ¡href=“javascript:payload” ¡/> Unsani.z Unsani.zed ed/Wr Wrongly ¡ ¡en encod
ed ¡scrip ¡script Var ¡a ¡= ¡b; ¡ ¡Payload; Unsani.z Unsani.zed ed ¡S ¡Style ¡( yle ¡(ol
er ¡IE ¡ ¡IE ¡on
) <img ¡src=“” ¡style=“width: ¡expression(payload); ¡” ¡/>
<a ¡href="javascript:alert(/Exploit ¡me!/)"> javascript:alert(/Exploit ¡me!/) </a>
¡ ¡
<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/ ¡ ¡
But, ¡wait
<a href=“*”> <* width=“*” height=“*” class=“*” style=“” />
Unsanitized Style (older IE only) <img src=“” style=“width: expression(payload); ” />
¡<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"> >
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 ¡} ¡ ¡
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/ ¡ ¡ ¡
Hijack ¡login
Using ¡class ¡aGribute Recreate ¡pixel-‑perfect ¡clone
¡ ¡ ¡ ¡ ¡ ¡ hMp://jsbin.com/dejite/13/edit ¡ ¡ ¡
user ¡ password ¡ Login ¡
Abuse ¡Password ¡Manager
hMp://jsbin.com/dejite/13/edit
user ¡ password ¡ Login ¡
hMps://www.cs.utexas.edu/~suman/publicaZons/suman_pwdmgr.pdf ¡
Fixed
Failed: ¡javascript ¡link
Failed: ¡iframe ¡cross ¡domain
Worked ¡100% ¡covering ¡iframe ¡
Failed: ¡iframe ¡open ¡redirect
Worked: ¡Covering ¡link
Worked: ¡Covering ¡image ¡+ ¡Link
To ¡conclude
Sani.z Sani.ze AGribute: ¡id, ¡class, ¡style
Har Harden en HTML5 ¡IFrame ¡Sandbox
info@bitsensor.io ¡