Hacking Web 2.0 Streams Cross Domain Injection and Exploits



Similar documents
Exploiting Web 2.0 Next Generation Vulnerabilities

Hacking Browser's DOM - Exploiting Ajax and RIA

(WAPT) Web Application Penetration Testing

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

Web Application Report

HTML5 Top 10 Threats - Stealth Attacks and Silent Exploits

A Tale of the Weaknesses of Current Client-Side XSS Filtering

Cross-Site Scripting

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

Where every interaction matters.

Client-side Web Engineering From HTML to AJAX

Gateway Apps - Security Summary SECURITY SUMMARY

Attack Vector Detail Report Atlassian

Security Model for the Client-Side Web Application Environments

Network Security Web Security

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Blackbox Reversing of XSS Filters

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Web Application Security Considerations

Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008

Web-Application Security

Detecting and Defending Against Security Vulnerabilities for Web 2.0 Applications

Adobe Systems Incorporated

Hack Proof Your Webapps

Attacks on Clients: Dynamic Content & XSS

State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell

The Top Web Application Attacks: Are you vulnerable?

Revisiting SQL Injection Will we ever get it right? Michael Sutton, Security Evangelist

The Dark Side of Ajax. Jacob West Fortify Software

Application Security Testing

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

Web Application Security

Hack Yourself First. Troy troyhunt.com

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

HTML5. Eoin Keary CTO BCC Risk Advisory.

Web Application Exploits

Next Generation Clickjacking

Preparing for the Cross Site Request Forgery Defense

MatriXay WEB Application Vulnerability Scanner V Overview. (DAS- WEBScan ) The best WEB application assessment tool

RTC-Web Security Considerations

Learn Ethical Hacking, Become a Pentester

Workday Mobile Security FAQ

Arrow ECS University 2015 Radware Hybrid Cloud WAF Service. 9 Ottobre 2015

Web Application Vulnerability Testing with Nessus

Conducting Web Application Pentests. From Scoping to Report For Education Purposes Only

Dissecting and digging application source code for vulnerabilities

Web application security

NSFOCUS Web Vulnerability Scanning System

WEB 2.0 AND SECURITY

HTTPParameter Pollution. ChrysostomosDaniel

Real World Web Service Testing For Web Hackers

Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

OWASP Top Ten Tools and Tactics

Criteria for web application security check. Version

Web App Security Audit Services

ASP.NET MVC Secure Coding 4-Day hands on Course. Course Syllabus

Smashing Web Apps Applying Fuzzing to Web Applications and Web Services. Michael Sutton, Security Evangelist

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Bank Hacking Live! Ofer Maor CTO, Hacktics Ltd. ATC-4, 12 Jun 2006, 4:30PM

Web App Security Keeping your application safe Joe Walker

Are AJAX Applications Vulnerable to Hack Attacks?

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

Web Application Penetration Testing

Testnet Summerschool. Web Application Security Testing. Dave van Stein

Barracuda Web Application Firewall vs. Intrusion Prevention Systems (IPS) Whitepaper

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

Chapter 12: Advanced topic Web 2.0

SERENA SOFTWARE Serena Service Manager Security

elearning for Secure Application Development

A Tale of the Weaknesses of Current Client-side XSS Filtering

Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert

Intrusion detection for web applications

Example. Represent this as XML

Secure Coding. External App Integrations. Tim Bach Product Security Engineer salesforce.com. Astha Singhal Product Security Engineer salesforce.

Security Research Advisory IBM inotes 9 Active Content Filtering Bypass

Exploits: XSS, SQLI, Buffer Overflow

AJAX Storage: A Look at Flash Cookies and Internet Explorer Persistence

Executive Summary On IronWASP

Integrating Web Application Security into the IT Curriculum

White Paper. Understanding Web 2.0. Technologies, Risks, and Best Practices

Cloudy with a chance of 0-day

Chapter 1 Web Application (In)security 1

Web Application Security 101

Security Testing with Selenium

Integration the Web 2.0 way. Florian Daniel April 28, 2009

Strategic Information Security. Attacking and Defending Web Services

Overview. In the beginning. Issues with Client Side Scripting What is JavaScript? Syntax and the Document Object Model Moving forward with JavaScript

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

JavaScript Security. John Graham Cumming

IJMIE Volume 2, Issue 9 ISSN:

Transcription:

Hacking Web 2.0 Streams Cross Domain Injection and Exploits Meeting (Sep-15-2009) in Brussels Shreeraj Shah Founder & Director, Blueinfy shreeraj@blueinfy.com 91+987-902-7018 Copyright The Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the License. The Foundation http://www.owasp.org Who Am I? http://shreeraj.blogspot.com http://shreeraj.blogspot.com shreeraj@blueinfy.com shreeraj@blueinfy.com http://www.blueinfy.com http://www.blueinfy.com Founder & Director Blueinfy Solutions Pvt. Ltd. (Brief) SecurityExposure.com 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, AppPrint etc. Advisories -.Net, Java servers etc. Books (Author) Web 2.0 Security Defending Ajax, RIA and SOA Hacking Web Services Web Hacking Blueinfy Solutions Pvt. Ltd. INDIA 8/B Shitalbaug society, Paldi Ahmedabad 380007 Tel: 91+9879027018 USA 900 S. Cardiff Street, Anaheim, CA 92806 Tel. 714-656-3652 Email: contact@blueinfy.com 2 1

Web/Enterprise 2.0 Application Audit Case Enterprise running on 2.0 wave - Portal Technologies & Components Dojo, Ajax, XML Services, Blog, Widgets Scan with tools/products failed Why? Security issues and hacks SQL injection over XML Ajax driven XSS Several XSS with Blog component Several information leaks through JSON fuzzing CSRF on both XML and JS-Array»HACKED» DEFENSE 3 Web/Enterprise 2.0 Application Audit Case Impact Possible to run sql queries remotely Changing price and placing order Customer information enumeration Stealing customer identities Manipulation in JSON/XML streams and much more Great financial impact 4 2

Attacks and Hacks 80% Sites are having security issues Web Application Layer vulnerabilities are growing at higher rate in security space Client side hacking and vulnerabilities are on the rise 5% to 30% (IBM) Web browser vulnerabilities is growing at high rate End point exploitation from OS to browser and its plugins 5 Web 2.0 Patterns Q1 2009 showed a steep rise in attacks against Web 2.0 sites. This is the most prevalent attack with 21% of the incidents. Attack vectors exploiting Web 2.0 features such as user-contributed content were commonly employed in Q1: Authentication abuse was the 2nd most active attack vector, accounting for 18% of the attacks, and Cross Site Request Forgery (CSRF) rose to number 6 with 8% of the reported attacks. Leakage of sensitive information remains the most common outcome of web hacks (29%), while disinformation came in 2nd with 26%, mostly due to the hacking of celebrity online identities.» http://www.secure-enterprise20.org/ 6 3

Incidents Adding filter through CSRF Loading js file through flash from scrapbook Attacking blogs and boards Flash components XSS through RSS feed HTTP Response Splitting Source: The Web Hacking Incidents Database [http://webappsec.org/projects/whid/] 7 Twitter hacks 8 4

Facebook 9 MySpace 10 5

Google 11 Gmail 12 6

Yahoo! 13 Enterprise Attack Profile XSS Ajax/RIA Hacks SQL Injection Bruteforce Command inj. Corporate Resources Customer information Intellectual property Confidential documents Web 2.0 worms Resource Predict. Directory indexing LDAP/XPATH inj. SSI vector Path traversal 14 7

Enterprise 2.0 Architecture Documents News Weather Browser Ajax Mails Internet Bank/Trade RSS feeds RIA (Flash) Internet Web 2.0 Start HTML / JS / DOM Blog Database Authentication Application Infrastructure Web Services End point 15 Enterprise 2.0 Components Protocol Layer SOAP XML-RPC REST Server Layer Ajax Flash / RIA HTTP/HTTPS SOA/WOA SaaS HTML/CSS JavaScript Web Services Ajax Widget DOM JSON XML Traditional APIs Client Layer RSS/ATOM Text JS-Objects Custom Structure Layer 16 8

Let s look at few apps Ajax calls - JSON/Flash driven app - DWR Java remoting app - 17 Web 2.0 Fingerprinting Identifying Web and Application servers. Forcing handlers to derive internal plugin or application servers like Tomcat or WebLogic. Looking for Axis or any other Web Services container. Gives overall idea about infrastructure. 18 9

Ajax/RIA call 19 Ajax/RIA call 20 10

Discovery JSON XML JS-Script JS-Array JS-Object 21 RIA fingerprints HTTP Service AMF discovery 22 11

Web 2.0 Dimension to Crawling Ajax resources RIA and Silverlight components It needs to mapped as well Very critical step to do Web 2.0 crawling Need to do JavaScript traversing and dynamic execution Different approach is required 23 Crawling challenges Dynamic page creation through JavaScript using Ajax. DOM events are managing the application layer. DOM is having clear context. Protocol driven crawling is not possible without loading page in the browser. 24 12

Ajax driven site Watir usage 25 Flash/Flex/Silverlight streams There are various different set of calls for flex/flash apps AMF and other internals SOAP over AMF etc Discovering through proxy Reverse engineering calls Silverlight calls 26 13

Fuzzing streams Web 2.0 stream fuzzing Manipulating JSON, SOAP or AMF traffic Looking out for response Vulnerability detection based on that Blind 27 Web Services and SOAP streams Discovering WSDL or entry points for Web Services Fetching hidden calls and methods Building SOAP Fuzzing SOAP Vulnerability detection 28 14

DOM based XSS Ajax based XSS is relatively new way of attacking the client Code written on browser end can be vulnerable to this attacks Various different structures can have their own confusion Information processing from un-trusted sources can lead to XSS 29 DOM based XSS Stream can be injected into the Ajax routine If function is vulnerable to XSS then it executes the script Script can be coming in various forms Web 2.0 applications are consuming various scripts and that makes it vulnerable to this set of attacks 30 15

Anatomy of an XSS attack 8008 attacker Third party Web Server proxy DB DB Web Client 31 Anatomy of an XSS attack 8008 attacker Third party source Web Server proxy DB DB Web Client 32 16

Anatomy of an XSS attack 8008 attacker Third party source Web Server proxy DB DB Web Client Stream eval() XSS 33 DOM based XSS if (http.readystate == 4) { var response = http.responsetext; var p = eval("(" + response + ")"); document.open(); document.write(p.firstname+"<br>"); document.write(p.lastname+"<br>"); document.write(p.phonenumbers[0]); document.close(); 34 17

Anatomy of an XSS attack 8008 attacker XML Web Server proxy DB DB Web Client Stream eval() XSS 35 Anatomy of an XSS attack 8008 attacker JSON Web Server proxy DB DB Web Client Stream eval() XSS 36 18

Anatomy of an XSS attack 8008 attacker JS-Array Web Server proxy DB DB Web Client Stream eval() XSS 37 Anatomy of an XSS attack 8008 attacker JS-Script Web Server proxy DB DB Web Client Stream eval() XSS JSON XSS JS-Object XSS 38 19

DOM based XSS document.write( ) document.writeln( ) document.body.innerhtml= document.forms[0].action= document.attachevent( ) document.create ( ) document.execcommand( ) document.body. window.attachevent( ) document.location= document.location.hostname= document.location.replace( ) document.location.assign( ) document.url= window.navigate( ) 39 DOM based XSS document.open( ) window.open( ) window.location.href= (and assigning to location s href, host and hostname) eval( ) window.execscript( ) window.setinterval( ) window.settimeout( ) Scanning for XSS 40 20

Cross Site Request Forgery (CSRF) Generic CSRF is with GET / POST Forcefully sending request to the target application with cookie replay Leveraging tags like IMG SCRIPT IFRAME Not abide by SOP or Cross Domain is possible 41 Request generation IMG SRC <img src="http://host/?command"> SCRIPT SRC <script src="http://host/?command"> IFRAME SRC <iframe src="http://host/?command"> 42 21

Request generation 'Image' Object <script> var foo = new Image(); foo.src = "http://host/?command"; </script> XHR Cross domain difficult 43 Request generation It is possible to generate POST as well Form can be build dynamically and button click from JavaScript is possible <script type="text/javascript" language="javascript"> document.foo.submit(); </script> 44 22

Cross Site Request Forgery (CSRF) What is different with Web 2.0 Is it possible to do CSRF to XML stream How? It will be POST hitting the XML processing resources like Web Services JSON CSRF is also possible Interesting check to make against application and Web 2.0 resources 45 One Way CSRF Scenario 46 23

One Way CSRF Scenario 47 One Way CSRF Scenario 48 24

One Way CSRF Scenario 49 One-Way CSRF 50 25

One-Way CSRF <html> <body> <FORM NAME="buy" ENCTYPE="text/plain" action="http://trade.example.com/xmlrpc/trade.rem" METHOD="POST"> <input type="hidden" name='<?xml version' value='"1.0"?><methodcall><methodname>stocks.buy</methodname>< params><param><value><string>msft</string></value></param><pa ram><value><double>26</double></value></param></params></met hodcall>'> </FORM> <script>document.buy.submit();</script> </body> </html> 51 Forcing XML Splitting XML stream in the form. Possible through XForms as well. Similar techniques is applicable to JSON as well. 52 26

Two-Way CSRF One-Way Just making forceful request. Two-Way Reading the data coming from the target May be getting hold onto important information profile, statements, numbers etc. Is it possible with JSON/XML 53 Two-Way CSRF 54 27

Two-Way CSRF 55 Two-Way CSRF Application is serving various streams like JSON, JS-Object, Array etc. 56 28

Two-Way CSRF Attacker page can make cross domain request using SCRIPT (firefox) Following code can overload the array stream. function Array() { var obj = this; var index = 0; for(j=0;j<4;j++){ obj[index++] setter = spoof; } } function spoof(x){ send(x.tostring()); } 57 Two-Way CSRF 58 29

Two-Way CSRF It is possible to overload these objects. Reading and sending to cross domain possible. Opens up two way channel for an attacker. Web 2.0 streams are vulnerable to these attacks. 59 Web 2.0 Components There are various other components for Web 2.0 Applications RSS feeds Mashups Widgets Blogs Flash based components 60 30

RSS feeds RSS feeds coming into application from various un-trusted sources. Feed readers are part of 2.0 Applications. Vulnerable to XSS. Malicious code can be executed on the browser. Several vulnerabilities reported. 61 RSS feeds 62 31

Mashups API exposure for Mashup supplier application. Cross Domain access by callback may cause a security breach. Confidential information sharing with Mashup application handling needs to be checked storing password and sending it across (SSL) Mashup application can be man in the middle so can t trust or must be trusted one. 63 Widgets/Gadgets DOM sharing model can cause many security issues. One widget can change information on another widget possible. CSRF injection through widget code. Event hijacking is possible Common DOM IFrame for widget is a MUST 64 32

Securing Web 2.0 Source Code Scanning WAF SOAP/JSON Secure Coding Practices Audit standards, PCI-DSS or CVE/CWE 65 Questions & Conclusion Copyright The Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the License. The Foundation http://www.owasp.org 33