SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
Hacking Web 2.0
Art and Science of Vulnerability Detection




                                      Shreeraj Shah
                                         Pune,India
Who am I?
                                                  http://shreeraj.blogspot.com
                                                  shreeraj@blueinfy.com
• Founder & Director
   – Blueinfy Solutions Pvt. Ltd. (Brief)
• Past experience
   – Net Square, Chase, IBM & Foundstone
• Interest
   – Web security research
• Published research
   – Articles / Papers – Securityfocus, O’erilly, DevX, InformIT etc.
   – Tools – wsScanner, scanweb2.0, AppMap, AppCodeScan,
     wsChess etc.
   – Advisories - .Net, Java servers etc.
• Books (Author)
   – Hacking Web Services (Thomson 2006)
   – Web Hacking (AWL 2003)
   – Web 2.0 Security (Work in progress)
Agenda
• Web 2.0 overview and security concerns
• Ajax Security – Attacks and Defense
  – Methods
  – Vectors
  – Defense
• Web Services – Attacks and Defense
  – Methodology
  – Assessment and Tools
  – Defense
Web 2.0 Trends
• 80% of companies are investing in Web
  Services as part of their Web 2.0 initiative
  (McKinsey2007 Global Survey)
• By the end of 2007, 30 percent of large
  companies will have some kind of Web 2.0-
  based business initiative up and running.
  (Gartner)
• 2008. Web Services or Service-Oriented
  Architecture (SOA) would surge ahead.
  (Gartner)
Web 2.0 – Ajax & Web Services
                                                    Documents

                                        News                      Emails
Browser
                                Weather                             Bank/Trade
     Ajax
                                                       Internet
                  Internet
  RIA (Flash)                                                              RSS feeds
HTML / JS / DOM
                                                                           Blog
                             Web Services
                                  Local Application



                                 Database Authentication
Web 2.0 Layers

       Browser         Structures                 Server-Side
                                     Protocols

                                    JSON-RPC
  Ajax   Flash / RIA                              Services
                         XML          REST
HTML/CSS JavaScript                                SaaS
                        JSON         XML-RPC
 Widget     DOM                                  Open APIs
                                      SOAP


                               HTTP(S)
Technologies
  Internet            DMZ                              Trusted



                      SOAP, REST, XML-RPC, JSON etc.
Ajax
 RIA                                                             W
Client                                                           E
                                                Application
                               Scripted                          B
                 Web                             Servers
                                Web
                                                                 S
                Server                             And
                               Engine                            E
               Static pages  Dynamic pages
Web                                             Integrated       R
              HTML,HTM etc.. ASP DHTML,
                                                                 V
Client                                          Framework
                              PHP,CGI Etc..
                                                                 I

                                 X
                                                 ASP.NET with    C
                                                     .Net        E
                                                   J2EE App
                                                                 S
                                                    Server
                                                 Web Services
                                                     Etc..
                                 DB

                         Internal/Corporate
Web 2.0 Security
• Complex architecture and confusion with
  technologies
• Web 2.0 worms and viruses – Sammy,
  Yammaner & Spaceflash
• Ajax and JavaScripts – Client side attacks
  are on the rise
• Web Services attacks and exploitation
• Flash clients are running with risks
Ajax Security – Attacks & Defense

•   Basics
•   Structures and streams
•   Fingerprinting
•   Scanning and Enumeration
•   XSS and CSRF issues
•   Securing code base
Ajax basics
• Asynchronous JavaScript and XML

       HTML / CSS              Database / Resource

         JS / DOM             XML / Middleware / Text

   XMLHttpRequest (XHR)            Web Server



               Asynchronous
               over HTTP(S)
Ajax - Sample
function loadhtml()
{
    var http;
    if(window.XMLHttpRequest){
       http = new XMLHttpRequest();
    }else if (window.ActiveXObject){
             http=new ActiveXObject(quot;Msxml2.XMLHTTPquot;);
       if (! http){
             http=new ActiveXObject(quot;Microsoft.XMLHTTPquot;);
       }
    }
    http.open(quot;GETquot;, quot;main.htmlquot;, true);
    http.onreadystatechange = function()
    {
             if (http.readyState == 4) {
                         var response = http.responseText;
                         document.getElementById('main').innerHTML = response;

    }
}
http.send(null);
}
Ajax & Data structures
•   Ajax is using various data streams
•   Developers are innovating this field
•   JavaScript can talk with back end sources
•   Mashups application can be leveraged
•   It is important to understand these streams
•   It has significant security impact
•   JSON, Array, JS-Object etc.
Cross-domain calls
• Browser security doesn’t support cross
  domain calls
• But cross domain callback with JavaScript
  is possible
• This can be lethal attack since cross
  domain information get executed on the
  current DOM context.
• Developers put proxy to bypass the SOP.
Ajax fingerprinting
• Determining Ajax calls
• Framework fingerprinting
• Running with what?
  – Atlas
  – GWT
  – Etc.
• Ajaxfinger a tool to achieve this
• Can help in assessment process
• RIA finger printing is possible
Ajax attack points
• Ajax components & Widgets
• Cross domain vulnerable browsers and
  callback implementations
• DOM manipulation calls and points
• Insecure eval()
• HTML tags
• Intranet nodes and internal resources
Ajax attack vectors
•   Entry point scanning and enumeration
•   Cross site scripting (XSS) attacks
•   Cross site Request Forgery (CSRF) issues
•   Client side code reverse engineering
•   Security control and validation bypassing
•   Local privacy information enumeration
•   Ajax framework exploitation – known bugs
Ajax Scanning
• Scanning Ajax components
• Retrieving all JS include files
    – Part of <SCRIPT SRC=….>
•   Identifying XHR calls
•   Grabbing function
•   Mapping function to DOM event
•   Scanning code for XSS – look for eval()
    and document.write()
Ajax serialization issues
• Ajax processing various information
  coming from server and third party
  sources. – XSS opportunities
  message = {
         from : quot;john@example.comquot;,
         to : quot;jerry@victim.comquot;,
         subject : quot;I am finequot;,
         body : quot;Long message herequot;,
         showsubject :
  function(){document.write(this.subject)}
  };



                  XSS
Ajax serialization issues
• JSON issues
  {quot;bookmarksquot;:[{quot;Linkquot;:quot;www.example.comquot;,quot;D
  escquot;:quot;Interesting linkquot;}]}


• JS – Array manipulation
  new Array(“Laptop”, “Thinkpad”, “T60”,
  “Used”, “900$”, “It is great and I have
  used it for 2 years”)
Ajax and JS manipulation
• JavaScript exploitation – XSS
• Identifying DOM points like
  document.write()
• Eval() – another interesting point
• Attack APIs and tools for exploitation
• Lot can be done by an attacker from
  session hijacking to key loggers
Ajax and RSS injection
• RSS feeds are another entry point to the
  browser
• Injecting script to the RSS feeds and Ajax
  call may execute it.
• One click – Malformed linked injected into
  it and can lead to exploit “javascript:”
• Leveraging events – onClick, onMouse
  etc.
Ajax Crawling
• Crawling Ajax driven app – a challenge
• Resources are hidden in JavaScript
• Simple scanner will fail
• Crawling with actual DOM context
• Automated crawling with browser is
  required
• How?
Defending Ajax
• No business logic information on client
  side.
• Do not trust third party source – filter it out
• No direct cross domain call back
• Filtering at browser level before
  processing information
• Avoiding client side validation
Defending Ajax
• No secret in Ajax calls
• Proper data structure selection and
  frameworks
• Avoid client side validation
• Securing client side calls like eval() and
  document.write()
• HTML tags filtering before serving to end
  client
Web Services – Attacks & Defense

•   Methodology
•   Footprinting & Discovery
•   Profiling and Enumeration
•   Scanning and Fuzzing
•   Attack vectors
•   Scanning code for vulnerabilities
•   Defense by filtering
Methodology
                       Insecure Web Services
Blackbox                                                  Whitebox

   Footprinting & Discovery


   Enumeration & Profiling               Code / Config Scanning


    Vulnerability Detection



Defense                       Secure Coding
&
Countermeasure          Web Services Firewall


                        Secure Web Services
Footprinting and Discovery
• Objective: Discovering Web Services
  running on application domain.
• Methods
  – Primary discovery
    • Crawling and spidering
    • Script analysis and page scrubbing
    • Traffic analysis
  – Secondary discovery
    • Search engine queries
    • UDDI scanning
Primary Discovery
• Crawling the application and mapping file
  extensions and directory structures, like
  “.asmx”
• Page scrubbing – scanning for paths and
  resources in the pages, like atlas back end
  call to Web Services.
• Recording traffic while browsing and
  spidering, look for XML based traffic –
  leads to XML-RPC, REST, SOAP, JSON
  calls.
Primary Discovery - Demos
• Page scanning with grep – Look in
  JavaScripts for URLs, Paths etc.
• Crawling – Simple!
• Scanning for Atlas references –
  Framework creates stubs and proxy. –
  scanweb2.0/scanatlas
• Urlgrep can be used as well.
Secondary Discovery
• Searching UDDI server for Web Services
  running on particular domain.
  – Three tactics for it – business, services or
    tModel.
• Running queries against search engines
  like Google or MSN with extra directives
  like “inurl” or “filetype”
  – Look for “asmx”

• wsScanner – Discovery!
Enumerating and Profiling
• Scanning WSDL
  – Looking for Methods
  – Collecting In/Out parameters
  – Security implementations
  – Binding points
  – Method signature mapping
Scanning strategies
•   Manual invocation and response analysis.
•   Dynamic proxy creation and scanning.
•   Auto auditing for various vectors.
•   Fuzzing Web Services streams – XML or
    JSON
•   Response analysis is the key
    –   Look for fault code nodes
    –   Enumerating fault strings
    –   Dissecting XML message and finding bits
    –   Hidden error messages in JSON
Cross Site Scripting (XSS)
• XSS is possible through Web Services.
• It would be DOM based XSS via eval().
• JSON-RPC based stream coming in the
  browser and get injected into DOM.
• Source of stream can be of third party and
  Un-trusted.
• XML streams coming in the browser and
  can cause XSS via document.write call.
Injection Flaws
• Web Services methods are consuming
  parameters coming from end users.
• It is possible to inject malicious characters
  into the stream.
• It can break Web Services code and send
  faultsting back to an attacker
• Various injections possible – SQL and
  XPATH
Malicious File Execution
• Malicious command can be injected
  through the parameter.
• WS supports attachments as well and that
  can lead to uploading a file.
• This can give remote command execution
  capability to the attacker.
Insecure Direct Object Reference
• Injecting characters to break file system
  sequences.
• Faultcode spits out internal information if
  not protected.
• Customized error shows the file refernces.
• Access to internal file and full traversal to
  directories
• Inspecting methods and parameters in the
  profile stage can help.
Cross Site Request Forgery
• CSRF with XML streams
• XML-RPC or SOAP based request can be
  generated from browsers.
• Splitting form and XML injection is
  possible – interesting trick.
• If Content-Type is not validated on the
  server then it can cause a potential CSRF.
• XForms usage in browser can produce
  XML requests to attack CSRF.
Code Analysis for Web Services

• Scanning the code base.
• Identifying linkages.
• Method signatures and inputs.
• Looking for various patterns for SQL,
  LDAP, XPATH, File access etc.
• Checking validation on them.
• Code walking and tracing the base - Key
Code filtering with IHTTPModule

• Regular firewall will not work
• Content filtering on HTTP will not work
  either since it is SOAP over HTTP/HTTPS
• SOAP level filtering and monitoring would
  require
• ISAPI level filtering is essential
• SOAP content filtering through
  IHTTPModule
HTTP Stack for .Net
           HttpRuntime


      HttpApplicationFactory
                                 Web Application
                                 Firewall
                                 & IDS
         HttpApplication



                               IHttpModule




       HttpHandlerFactory


             Handler

148
IHTTPModule for Web Services Firewall

•   Code walkthrough – Events and Hooks
•   Loading the DLL
•   Setting up the rules
•   Up and running!
•   Demo.
Thanks!
• Questions?

  – shreeraj@blueinfy.com

Weitere ähnliche Inhalte

Was ist angesagt?

04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Jay Nagar
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013tmd800
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applicationsAdeel Javaid
 
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERYFIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERYShreeraj Shah
 
Client sidesec 2013 - script injection
Client sidesec 2013 - script injectionClient sidesec 2013 - script injection
Client sidesec 2013 - script injectionTal Be'ery
 
Hacking the Web
Hacking the WebHacking the Web
Hacking the WebMike Crabb
 
RSA Europe 2013 OWASP Training
RSA Europe 2013 OWASP TrainingRSA Europe 2013 OWASP Training
RSA Europe 2013 OWASP TrainingJim Manico
 
XSS and CSRF with HTML5
XSS and CSRF with HTML5XSS and CSRF with HTML5
XSS and CSRF with HTML5Shreeraj Shah
 
[Infosecworld 08 Orlando] New Defenses for .NET Web Apps: IHttpModule in Prac...
[Infosecworld 08 Orlando] New Defenses for .NET Web Apps: IHttpModule in Prac...[Infosecworld 08 Orlando] New Defenses for .NET Web Apps: IHttpModule in Prac...
[Infosecworld 08 Orlando] New Defenses for .NET Web Apps: IHttpModule in Prac...Shreeraj Shah
 
HTML5 Top 10 Threats - Silent Attacks and Stealth Exploits
HTML5 Top 10 Threats - Silent Attacks and Stealth ExploitsHTML5 Top 10 Threats - Silent Attacks and Stealth Exploits
HTML5 Top 10 Threats - Silent Attacks and Stealth ExploitsShreeraj Shah
 
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...Aditya K Sood
 
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)Shreeraj Shah
 
DVWA(Damn Vulnerabilities Web Application)
DVWA(Damn Vulnerabilities Web Application)DVWA(Damn Vulnerabilities Web Application)
DVWA(Damn Vulnerabilities Web Application)Soham Kansodaria
 
DVWA BruCON Workshop
DVWA BruCON WorkshopDVWA BruCON Workshop
DVWA BruCON Workshoptestuser1223
 
Hacking Ajax & Web Services - Next Generation Web Attacks on the Rise
Hacking Ajax & Web Services - Next Generation Web Attacks on the RiseHacking Ajax & Web Services - Next Generation Web Attacks on the Rise
Hacking Ajax & Web Services - Next Generation Web Attacks on the RiseShreeraj Shah
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Shreeraj Shah
 
Owasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesOwasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesMarco Morana
 

Was ist angesagt? (20)

04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applications
 
Attacking REST API
Attacking REST APIAttacking REST API
Attacking REST API
 
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERYFIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
 
Client sidesec 2013 - script injection
Client sidesec 2013 - script injectionClient sidesec 2013 - script injection
Client sidesec 2013 - script injection
 
Hacking the Web
Hacking the WebHacking the Web
Hacking the Web
 
RSA Europe 2013 OWASP Training
RSA Europe 2013 OWASP TrainingRSA Europe 2013 OWASP Training
RSA Europe 2013 OWASP Training
 
XSS and CSRF with HTML5
XSS and CSRF with HTML5XSS and CSRF with HTML5
XSS and CSRF with HTML5
 
Web Security 101
Web Security 101Web Security 101
Web Security 101
 
[Infosecworld 08 Orlando] New Defenses for .NET Web Apps: IHttpModule in Prac...
[Infosecworld 08 Orlando] New Defenses for .NET Web Apps: IHttpModule in Prac...[Infosecworld 08 Orlando] New Defenses for .NET Web Apps: IHttpModule in Prac...
[Infosecworld 08 Orlando] New Defenses for .NET Web Apps: IHttpModule in Prac...
 
HTML5 Top 10 Threats - Silent Attacks and Stealth Exploits
HTML5 Top 10 Threats - Silent Attacks and Stealth ExploitsHTML5 Top 10 Threats - Silent Attacks and Stealth Exploits
HTML5 Top 10 Threats - Silent Attacks and Stealth Exploits
 
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
 
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
 
DVWA(Damn Vulnerabilities Web Application)
DVWA(Damn Vulnerabilities Web Application)DVWA(Damn Vulnerabilities Web Application)
DVWA(Damn Vulnerabilities Web Application)
 
DVWA BruCON Workshop
DVWA BruCON WorkshopDVWA BruCON Workshop
DVWA BruCON Workshop
 
Hacking Ajax & Web Services - Next Generation Web Attacks on the Rise
Hacking Ajax & Web Services - Next Generation Web Attacks on the RiseHacking Ajax & Web Services - Next Generation Web Attacks on the Rise
Hacking Ajax & Web Services - Next Generation Web Attacks on the Rise
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010
 
Owasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesOwasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root Causes
 

Andere mochten auch

Andere mochten auch (7)

O Que Mudar Em Pombal
O Que Mudar Em Pombal O Que Mudar Em Pombal
O Que Mudar Em Pombal
 
LeWeb 3 Conference Summary
 LeWeb 3 Conference Summary LeWeb 3 Conference Summary
LeWeb 3 Conference Summary
 
0304bbbweb
0304bbbweb0304bbbweb
0304bbbweb
 
Awareness
AwarenessAwareness
Awareness
 
Present
PresentPresent
Present
 
Ch2 Ppt Lect 1
Ch2 Ppt Lect 1Ch2 Ppt Lect 1
Ch2 Ppt Lect 1
 
Linked In Basics
Linked In BasicsLinked In Basics
Linked In Basics
 

Ähnlich wie Shreeraj-Hacking_Web_2

Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007ClubHack
 
A Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 RevolutionA Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 RevolutionJames Pearce
 
Amish Umesh - Future Of Web App Testing - ClubHack2007
Amish Umesh - Future Of Web App Testing  - ClubHack2007Amish Umesh - Future Of Web App Testing  - ClubHack2007
Amish Umesh - Future Of Web App Testing - ClubHack2007ClubHack
 
Cross platform mobile web apps
Cross platform mobile web appsCross platform mobile web apps
Cross platform mobile web appsJames Pearce
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
Building Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web AppsBuilding Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web AppsJames Pearce
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1James Pearce
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
Find me if you can – smart fuzzing and discovery! shreeraj shah
Find me if you can – smart fuzzing and discovery!   shreeraj shahFind me if you can – smart fuzzing and discovery!   shreeraj shah
Find me if you can – smart fuzzing and discovery! shreeraj shahowaspindia
 
Building Cloud-Based Cross-Platform Mobile Web Apps
Building Cloud-Based Cross-Platform Mobile Web AppsBuilding Cloud-Based Cross-Platform Mobile Web Apps
Building Cloud-Based Cross-Platform Mobile Web AppsJames Pearce
 
Working with Data and Web Services in Microsoft Silverlight 2
Working with Data and Web Services in Microsoft Silverlight 2Working with Data and Web Services in Microsoft Silverlight 2
Working with Data and Web Services in Microsoft Silverlight 2goodfriday
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsJames Pearce
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptmartinlippert
 
Building cross platform mobile web apps
Building cross platform mobile web appsBuilding cross platform mobile web apps
Building cross platform mobile web appsJames Pearce
 
Polysource-IT Profile
Polysource-IT ProfilePolysource-IT Profile
Polysource-IT ProfileHelen
 
Polysource-IT Profile
Polysource-IT ProfilePolysource-IT Profile
Polysource-IT ProfileHelen
 
Application Security Workshop
Application Security Workshop Application Security Workshop
Application Security Workshop Priyanka Aash
 
Bd conf sencha touch workshop
Bd conf sencha touch workshopBd conf sencha touch workshop
Bd conf sencha touch workshopJames Pearce
 
Тестирование производительности Ajax приложений с помощью JMeter
Тестирование производительности Ajax приложений с помощью JMeterТестирование производительности Ajax приложений с помощью JMeter
Тестирование производительности Ajax приложений с помощью JMeterautomated-testing.info
 
An Intro to Mobile HTML5
An Intro to Mobile HTML5An Intro to Mobile HTML5
An Intro to Mobile HTML5James Pearce
 

Ähnlich wie Shreeraj-Hacking_Web_2 (20)

Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007
 
A Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 RevolutionA Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 Revolution
 
Amish Umesh - Future Of Web App Testing - ClubHack2007
Amish Umesh - Future Of Web App Testing  - ClubHack2007Amish Umesh - Future Of Web App Testing  - ClubHack2007
Amish Umesh - Future Of Web App Testing - ClubHack2007
 
Cross platform mobile web apps
Cross platform mobile web appsCross platform mobile web apps
Cross platform mobile web apps
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
Building Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web AppsBuilding Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web Apps
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
Find me if you can – smart fuzzing and discovery! shreeraj shah
Find me if you can – smart fuzzing and discovery!   shreeraj shahFind me if you can – smart fuzzing and discovery!   shreeraj shah
Find me if you can – smart fuzzing and discovery! shreeraj shah
 
Building Cloud-Based Cross-Platform Mobile Web Apps
Building Cloud-Based Cross-Platform Mobile Web AppsBuilding Cloud-Based Cross-Platform Mobile Web Apps
Building Cloud-Based Cross-Platform Mobile Web Apps
 
Working with Data and Web Services in Microsoft Silverlight 2
Working with Data and Web Services in Microsoft Silverlight 2Working with Data and Web Services in Microsoft Silverlight 2
Working with Data and Web Services in Microsoft Silverlight 2
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScript
 
Building cross platform mobile web apps
Building cross platform mobile web appsBuilding cross platform mobile web apps
Building cross platform mobile web apps
 
Polysource-IT Profile
Polysource-IT ProfilePolysource-IT Profile
Polysource-IT Profile
 
Polysource-IT Profile
Polysource-IT ProfilePolysource-IT Profile
Polysource-IT Profile
 
Application Security Workshop
Application Security Workshop Application Security Workshop
Application Security Workshop
 
Bd conf sencha touch workshop
Bd conf sencha touch workshopBd conf sencha touch workshop
Bd conf sencha touch workshop
 
Тестирование производительности Ajax приложений с помощью JMeter
Тестирование производительности Ajax приложений с помощью JMeterТестирование производительности Ajax приложений с помощью JMeter
Тестирование производительности Ajax приложений с помощью JMeter
 
An Intro to Mobile HTML5
An Intro to Mobile HTML5An Intro to Mobile HTML5
An Intro to Mobile HTML5
 

Mehr von guest66dc5f

Os Timed Original
Os Timed OriginalOs Timed Original
Os Timed Originalguest66dc5f
 
Control your entire house with your iPhone
Control your entire house with your iPhoneControl your entire house with your iPhone
Control your entire house with your iPhoneguest66dc5f
 
Awesome car collection
Awesome car collectionAwesome car collection
Awesome car collectionguest66dc5f
 
Freaky car number plates
Freaky car number platesFreaky car number plates
Freaky car number platesguest66dc5f
 
Sunil-Hacking_firefox
Sunil-Hacking_firefoxSunil-Hacking_firefox
Sunil-Hacking_firefoxguest66dc5f
 
Chetan-Mining_Digital_Evidence_in_Microsoft_Windows
Chetan-Mining_Digital_Evidence_in_Microsoft_WindowsChetan-Mining_Digital_Evidence_in_Microsoft_Windows
Chetan-Mining_Digital_Evidence_in_Microsoft_Windowsguest66dc5f
 
WHITEPAPER-7_years_of_Indian_Cyber_Law
WHITEPAPER-7_years_of_Indian_Cyber_LawWHITEPAPER-7_years_of_Indian_Cyber_Law
WHITEPAPER-7_years_of_Indian_Cyber_Lawguest66dc5f
 
Rohas-7_years_of_indian_cyber_laws
Rohas-7_years_of_indian_cyber_lawsRohas-7_years_of_indian_cyber_laws
Rohas-7_years_of_indian_cyber_lawsguest66dc5f
 
Dror-Crazy_toaster
Dror-Crazy_toasterDror-Crazy_toaster
Dror-Crazy_toasterguest66dc5f
 
Ajit-Legiment_Techniques
Ajit-Legiment_TechniquesAjit-Legiment_Techniques
Ajit-Legiment_Techniquesguest66dc5f
 
Varun-Subtle_Security_flaws
Varun-Subtle_Security_flawsVarun-Subtle_Security_flaws
Varun-Subtle_Security_flawsguest66dc5f
 
longisland_golf_07
longisland_golf_07longisland_golf_07
longisland_golf_07guest66dc5f
 
GolfLakeCity_002
GolfLakeCity_002GolfLakeCity_002
GolfLakeCity_002guest66dc5f
 
ACAD Golf Leaflet
ACAD Golf LeafletACAD Golf Leaflet
ACAD Golf Leafletguest66dc5f
 

Mehr von guest66dc5f (20)

Os Timed Original
Os Timed OriginalOs Timed Original
Os Timed Original
 
Control your entire house with your iPhone
Control your entire house with your iPhoneControl your entire house with your iPhone
Control your entire house with your iPhone
 
Awesome car collection
Awesome car collectionAwesome car collection
Awesome car collection
 
Freaky car number plates
Freaky car number platesFreaky car number plates
Freaky car number plates
 
David-FPGA
David-FPGADavid-FPGA
David-FPGA
 
Sunil-Hacking_firefox
Sunil-Hacking_firefoxSunil-Hacking_firefox
Sunil-Hacking_firefox
 
Chetan-Mining_Digital_Evidence_in_Microsoft_Windows
Chetan-Mining_Digital_Evidence_in_Microsoft_WindowsChetan-Mining_Digital_Evidence_in_Microsoft_Windows
Chetan-Mining_Digital_Evidence_in_Microsoft_Windows
 
WHITEPAPER-7_years_of_Indian_Cyber_Law
WHITEPAPER-7_years_of_Indian_Cyber_LawWHITEPAPER-7_years_of_Indian_Cyber_Law
WHITEPAPER-7_years_of_Indian_Cyber_Law
 
Rohas-7_years_of_indian_cyber_laws
Rohas-7_years_of_indian_cyber_lawsRohas-7_years_of_indian_cyber_laws
Rohas-7_years_of_indian_cyber_laws
 
David-FPGA
David-FPGADavid-FPGA
David-FPGA
 
Dror-Crazy_toaster
Dror-Crazy_toasterDror-Crazy_toaster
Dror-Crazy_toaster
 
Ajit-Legiment_Techniques
Ajit-Legiment_TechniquesAjit-Legiment_Techniques
Ajit-Legiment_Techniques
 
Varun-Subtle_Security_flaws
Varun-Subtle_Security_flawsVarun-Subtle_Security_flaws
Varun-Subtle_Security_flaws
 
CostofWarinIraq
CostofWarinIraqCostofWarinIraq
CostofWarinIraq
 
NR-golf-sept07
NR-golf-sept07NR-golf-sept07
NR-golf-sept07
 
NR-golf-sept07
NR-golf-sept07NR-golf-sept07
NR-golf-sept07
 
golf
golfgolf
golf
 
longisland_golf_07
longisland_golf_07longisland_golf_07
longisland_golf_07
 
GolfLakeCity_002
GolfLakeCity_002GolfLakeCity_002
GolfLakeCity_002
 
ACAD Golf Leaflet
ACAD Golf LeafletACAD Golf Leaflet
ACAD Golf Leaflet
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

Shreeraj-Hacking_Web_2

  • 1. Hacking Web 2.0 Art and Science of Vulnerability Detection Shreeraj Shah Pune,India
  • 2. Who am I? http://shreeraj.blogspot.com shreeraj@blueinfy.com • Founder & Director – Blueinfy Solutions Pvt. Ltd. (Brief) • Past experience – Net Square, Chase, IBM & Foundstone • Interest – Web security research • Published research – Articles / Papers – Securityfocus, O’erilly, DevX, InformIT etc. – Tools – wsScanner, scanweb2.0, AppMap, AppCodeScan, wsChess etc. – Advisories - .Net, Java servers etc. • Books (Author) – Hacking Web Services (Thomson 2006) – Web Hacking (AWL 2003) – Web 2.0 Security (Work in progress)
  • 3. Agenda • Web 2.0 overview and security concerns • Ajax Security – Attacks and Defense – Methods – Vectors – Defense • Web Services – Attacks and Defense – Methodology – Assessment and Tools – Defense
  • 4. Web 2.0 Trends • 80% of companies are investing in Web Services as part of their Web 2.0 initiative (McKinsey2007 Global Survey) • By the end of 2007, 30 percent of large companies will have some kind of Web 2.0- based business initiative up and running. (Gartner) • 2008. Web Services or Service-Oriented Architecture (SOA) would surge ahead. (Gartner)
  • 5. Web 2.0 – Ajax & Web Services Documents News Emails Browser Weather Bank/Trade Ajax Internet Internet RIA (Flash) RSS feeds HTML / JS / DOM Blog Web Services Local Application Database Authentication
  • 6. Web 2.0 Layers Browser Structures Server-Side Protocols JSON-RPC Ajax Flash / RIA Services XML REST HTML/CSS JavaScript SaaS JSON XML-RPC Widget DOM Open APIs SOAP HTTP(S)
  • 7. Technologies Internet DMZ Trusted SOAP, REST, XML-RPC, JSON etc. Ajax RIA W Client E Application Scripted B Web Servers Web S Server And Engine E Static pages Dynamic pages Web Integrated R HTML,HTM etc.. ASP DHTML, V Client Framework PHP,CGI Etc.. I X ASP.NET with C .Net E J2EE App S Server Web Services Etc.. DB Internal/Corporate
  • 8. Web 2.0 Security • Complex architecture and confusion with technologies • Web 2.0 worms and viruses – Sammy, Yammaner & Spaceflash • Ajax and JavaScripts – Client side attacks are on the rise • Web Services attacks and exploitation • Flash clients are running with risks
  • 9. Ajax Security – Attacks & Defense • Basics • Structures and streams • Fingerprinting • Scanning and Enumeration • XSS and CSRF issues • Securing code base
  • 10. Ajax basics • Asynchronous JavaScript and XML HTML / CSS Database / Resource JS / DOM XML / Middleware / Text XMLHttpRequest (XHR) Web Server Asynchronous over HTTP(S)
  • 11. Ajax - Sample function loadhtml() { var http; if(window.XMLHttpRequest){ http = new XMLHttpRequest(); }else if (window.ActiveXObject){ http=new ActiveXObject(quot;Msxml2.XMLHTTPquot;); if (! http){ http=new ActiveXObject(quot;Microsoft.XMLHTTPquot;); } } http.open(quot;GETquot;, quot;main.htmlquot;, true); http.onreadystatechange = function() { if (http.readyState == 4) { var response = http.responseText; document.getElementById('main').innerHTML = response; } } http.send(null); }
  • 12. Ajax & Data structures • Ajax is using various data streams • Developers are innovating this field • JavaScript can talk with back end sources • Mashups application can be leveraged • It is important to understand these streams • It has significant security impact • JSON, Array, JS-Object etc.
  • 13. Cross-domain calls • Browser security doesn’t support cross domain calls • But cross domain callback with JavaScript is possible • This can be lethal attack since cross domain information get executed on the current DOM context. • Developers put proxy to bypass the SOP.
  • 14. Ajax fingerprinting • Determining Ajax calls • Framework fingerprinting • Running with what? – Atlas – GWT – Etc. • Ajaxfinger a tool to achieve this • Can help in assessment process • RIA finger printing is possible
  • 15. Ajax attack points • Ajax components & Widgets • Cross domain vulnerable browsers and callback implementations • DOM manipulation calls and points • Insecure eval() • HTML tags • Intranet nodes and internal resources
  • 16. Ajax attack vectors • Entry point scanning and enumeration • Cross site scripting (XSS) attacks • Cross site Request Forgery (CSRF) issues • Client side code reverse engineering • Security control and validation bypassing • Local privacy information enumeration • Ajax framework exploitation – known bugs
  • 17. Ajax Scanning • Scanning Ajax components • Retrieving all JS include files – Part of <SCRIPT SRC=….> • Identifying XHR calls • Grabbing function • Mapping function to DOM event • Scanning code for XSS – look for eval() and document.write()
  • 18. Ajax serialization issues • Ajax processing various information coming from server and third party sources. – XSS opportunities message = { from : quot;john@example.comquot;, to : quot;jerry@victim.comquot;, subject : quot;I am finequot;, body : quot;Long message herequot;, showsubject : function(){document.write(this.subject)} }; XSS
  • 19. Ajax serialization issues • JSON issues {quot;bookmarksquot;:[{quot;Linkquot;:quot;www.example.comquot;,quot;D escquot;:quot;Interesting linkquot;}]} • JS – Array manipulation new Array(“Laptop”, “Thinkpad”, “T60”, “Used”, “900$”, “It is great and I have used it for 2 years”)
  • 20. Ajax and JS manipulation • JavaScript exploitation – XSS • Identifying DOM points like document.write() • Eval() – another interesting point • Attack APIs and tools for exploitation • Lot can be done by an attacker from session hijacking to key loggers
  • 21. Ajax and RSS injection • RSS feeds are another entry point to the browser • Injecting script to the RSS feeds and Ajax call may execute it. • One click – Malformed linked injected into it and can lead to exploit “javascript:” • Leveraging events – onClick, onMouse etc.
  • 22. Ajax Crawling • Crawling Ajax driven app – a challenge • Resources are hidden in JavaScript • Simple scanner will fail • Crawling with actual DOM context • Automated crawling with browser is required • How?
  • 23. Defending Ajax • No business logic information on client side. • Do not trust third party source – filter it out • No direct cross domain call back • Filtering at browser level before processing information • Avoiding client side validation
  • 24. Defending Ajax • No secret in Ajax calls • Proper data structure selection and frameworks • Avoid client side validation • Securing client side calls like eval() and document.write() • HTML tags filtering before serving to end client
  • 25. Web Services – Attacks & Defense • Methodology • Footprinting & Discovery • Profiling and Enumeration • Scanning and Fuzzing • Attack vectors • Scanning code for vulnerabilities • Defense by filtering
  • 26. Methodology Insecure Web Services Blackbox Whitebox Footprinting & Discovery Enumeration & Profiling Code / Config Scanning Vulnerability Detection Defense Secure Coding & Countermeasure Web Services Firewall Secure Web Services
  • 27. Footprinting and Discovery • Objective: Discovering Web Services running on application domain. • Methods – Primary discovery • Crawling and spidering • Script analysis and page scrubbing • Traffic analysis – Secondary discovery • Search engine queries • UDDI scanning
  • 28. Primary Discovery • Crawling the application and mapping file extensions and directory structures, like “.asmx” • Page scrubbing – scanning for paths and resources in the pages, like atlas back end call to Web Services. • Recording traffic while browsing and spidering, look for XML based traffic – leads to XML-RPC, REST, SOAP, JSON calls.
  • 29. Primary Discovery - Demos • Page scanning with grep – Look in JavaScripts for URLs, Paths etc. • Crawling – Simple! • Scanning for Atlas references – Framework creates stubs and proxy. – scanweb2.0/scanatlas • Urlgrep can be used as well.
  • 30. Secondary Discovery • Searching UDDI server for Web Services running on particular domain. – Three tactics for it – business, services or tModel. • Running queries against search engines like Google or MSN with extra directives like “inurl” or “filetype” – Look for “asmx” • wsScanner – Discovery!
  • 31. Enumerating and Profiling • Scanning WSDL – Looking for Methods – Collecting In/Out parameters – Security implementations – Binding points – Method signature mapping
  • 32. Scanning strategies • Manual invocation and response analysis. • Dynamic proxy creation and scanning. • Auto auditing for various vectors. • Fuzzing Web Services streams – XML or JSON • Response analysis is the key – Look for fault code nodes – Enumerating fault strings – Dissecting XML message and finding bits – Hidden error messages in JSON
  • 33. Cross Site Scripting (XSS) • XSS is possible through Web Services. • It would be DOM based XSS via eval(). • JSON-RPC based stream coming in the browser and get injected into DOM. • Source of stream can be of third party and Un-trusted. • XML streams coming in the browser and can cause XSS via document.write call.
  • 34. Injection Flaws • Web Services methods are consuming parameters coming from end users. • It is possible to inject malicious characters into the stream. • It can break Web Services code and send faultsting back to an attacker • Various injections possible – SQL and XPATH
  • 35. Malicious File Execution • Malicious command can be injected through the parameter. • WS supports attachments as well and that can lead to uploading a file. • This can give remote command execution capability to the attacker.
  • 36. Insecure Direct Object Reference • Injecting characters to break file system sequences. • Faultcode spits out internal information if not protected. • Customized error shows the file refernces. • Access to internal file and full traversal to directories • Inspecting methods and parameters in the profile stage can help.
  • 37. Cross Site Request Forgery • CSRF with XML streams • XML-RPC or SOAP based request can be generated from browsers. • Splitting form and XML injection is possible – interesting trick. • If Content-Type is not validated on the server then it can cause a potential CSRF. • XForms usage in browser can produce XML requests to attack CSRF.
  • 38. Code Analysis for Web Services • Scanning the code base. • Identifying linkages. • Method signatures and inputs. • Looking for various patterns for SQL, LDAP, XPATH, File access etc. • Checking validation on them. • Code walking and tracing the base - Key
  • 39. Code filtering with IHTTPModule • Regular firewall will not work • Content filtering on HTTP will not work either since it is SOAP over HTTP/HTTPS • SOAP level filtering and monitoring would require • ISAPI level filtering is essential • SOAP content filtering through IHTTPModule
  • 40. HTTP Stack for .Net HttpRuntime HttpApplicationFactory Web Application Firewall & IDS HttpApplication IHttpModule HttpHandlerFactory Handler 148
  • 41. IHTTPModule for Web Services Firewall • Code walkthrough – Events and Hooks • Loading the DLL • Setting up the rules • Up and running! • Demo.
  • 42. Thanks! • Questions? – shreeraj@blueinfy.com