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.
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.
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
- Identify a hardened .NET Remoting server using TypeFilterLevel.Low with CAS restrictions.
- Call a privileged method that asserts a file permission to write a file into the user cache directory.
- Load the written assembly to achieve code execution.
- Alternatively, send a serialisable MarshalByRefObject by value inside the LogicalCallContext and retrieve it back as a remote proxy.
- 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.