Skip to content
RCE Write-up Advanced

Teaching the Old .NET Remoting New Exploitation Tricks

The post describes three techniques for hardened .NET Remoting servers using TypeFilterLevel.Low with CAS restrictions, useful when ExploitRemotingService is stuck.

Markus Wulftange Follow

Published on code-white.com

This blog post provides insights into three exploitation techniques that can still be used in cases of a hardened .NET Remoting server with TypeFilterLevel.Low and Code Access Security (CAS) restrictions in place. Two of these tricks are considered novel and can help in cases where ExploitRemotingService is stuck.

Markus Wulftange (@mwulftange), on code-white.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the deserialisation of attacker-controlled remoting messages under TypeFilterLevel.Low still allows calling privileged methods that assert extra permissions and coercing the server to serialise MarshalByRefObject instances, undermining the CAS restrictions.

What the attacker needed

Network access to the remoting endpoint; server uses TypeFilterLevel.Low; CAS restrictions in place

How it was found

  1. Identify a hardened .NET Remoting server using TypeFilterLevel.Low with CAS restrictions.
  2. Call a privileged method that asserts a file permission to write a file into the user cache directory.
  3. Load the written assembly to achieve code execution.
  4. Alternatively, send a serialisable MarshalByRefObject by value inside the LogicalCallContext and retrieve it back as a remote proxy.
  5. Or create a WebClient on the server, store it in an exception's data, and throw it so the server serialises it back.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A .NET Remoting server lets a client call methods on objects that live on the server. Normally the server only accepts a limited set of object types and runs the incoming data under tight permissions, but the author found ways to trick the server into doing more than intended, such as writing files or running code. The tricks rely on abusing built-in .NET features that grant extra permissions or make the server send back a remote-control handle to an object.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Markus Wulftange

View all

25 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.