Beruflich Dokumente
Kultur Dokumente
Brian Holyfield
Gotham Digital Science
http://www.gdssecurity.com
labs@gdssecurity.com
Attacking WCF Web Services
• Session Objectives
– Introduction to WCF
– Tools & Techniques for Attacking WCF Services
• Session Outline
– WCF Overview
– Silverlight WCF Web Services
– WCF and WS-Security
– Duplex Services
WTF is WCF?
Attacker
Obtaining WCF MetaData
• HTTP-GET
– Same as legacy ASMX
– Retrieved by appending “?wsdl” to the address
<serviceMetadata httpGetEnabled="true"/>
[snip]
Basic MEX Request Structure
POST /MyService.svc/mex HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Host: wcf.example.com
Content-Length: 565
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-
envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action>
http://schemas.xmlsoap.org/ws/2004/09/transfer/Get
</a:Action>
<a:To>
http://wcf.example.com/MyService.svc/mex
</a:To>
</s:Header>
<s:Body/>
</s:Envelope>
MetaData over SSL
– WcfTestClient
• Automatically Parses WSDL or MEX
• Ships with Visual Studio 2008+
– http://weblogs.asp.net/blogs/guillermo/Code/WcfTestClient.zip
– WCF Storm
• Supports most WCF bindings
• Free Lite Version available
– http://www.wcfstorm.com/wcf/download-wcfstorm-lite.aspx
Obtaining MetaData from XAP Files
23
Example 2: WCF Duplex Services
• CreateSequence
http://service/wcf.svc
Action: CreateSequence Port 80
Reply To: http://client:8000/test
• CreateSequence
http://service/wcf.svc http://target:8000/wcf.svc
Action: CreateSequence Action: CreateSequenceResponse
Reply To: http://target:8000/test Reply From: http://service/wcf.svc
• CreateSequence
http://service/wcf.svc Target1
Action: CreateSequence
Reply To: http://target1:8000/test
Client1
Target2
WSDualHttpBinding
• CreateSequence
http://service/wcf.svc Target1
Action: CreateSequence
Reply To: http://target1:8000/test
Client1 http://service/wcf.svc
Action: CreateSequence
Reply To: http://target2:8000/test
Target2
WSDualHttpBinding
• CreateSequence
http://service/wcf.svc Target1
Action: CreateSequence
Reply To: http://target1:8000/test
Client1 http://service/wcf.svc
Action: CreateSequence
Reply To: http://target2:8000/test
Target2
HTTP/1.1 202 Accepted
Abusing WSDualHttpBinding
10.X.X.X
myapp.cloudapp.net
Example 3: Secure WCF Bindings
QUESTIONS