Aladdin – Payload Generation Technique That Allows The Deseriallization Of A .NET Payload And Execution In Memory


Aladdin is a payload generation technique based on the work of James Forshaw (@tiraniddo) that allows the deseriallization of a .NET payload and execution in memory. The original vector was documented on

By spawning the process AddInProcess.exe with arguments /guid:32a91b0f-30cd-4c75-be79-ccbd6345de99 and /pid:, the process will start a named pipe under \\.\pipe\32a91b0f-30cd-4c75-be79-ccbd6345de99 and will wait for a .NET Remoting object. If we generate a payload that has the appropiate packet bytes required to communicate with a .NET remoting listener we will be able to trigger the ActivitySurrogateSelector class from System.Workflow.ComponentModel. and gain code execution.

Originally, James Forshaw released a POC at However this POC will fail on recent versions of Windows since Microsoft went ahead and patched the vulnerable System.Workflow.ComponentModel (

Nick Landers (@monoxgas) however, identified a way to disable the check that Microsoft introduced and wrote a detailed article at . The bypass is documented at pwntester/ .

Aladdin is a payload generation tool, which using the specific bypass as well as the necessary header bytes of the .NET remoting protocol is able to generate initial access payloads that abuse the AddInProcess as originally documented.

The provided templates are:



* JS



In order for the attack to be successfull the .NET assembly must contain a single public class with an empty constructor to act as the entry point during deserialization. An example assembly has been included in the project.

-w, --scriptType=VALUE Set to js / hta / vba / chm.

-o, --output=VALUE The generated output, e.g: -o

-a, --assembly=VALUE Provided Assembly DLL, e.g: -a

-h, --help Help


  • The user supplied .NET binary will be executed under the AddInProcess.exe that gets spawned from the HTA / JS payload. The spawning of the processes currently happens using the 9BA05972-F6A8-11CF-A442-00A0C90A8F39 COM object ( which will launch the process as a child of Explorer.exe process.

  • The GUID supplied in the process parameters of AddInProcess.exe can be user controlled. At the moment the guid is hardcoded in the template and the code.

  • CHM executes the JScript through XSLT transformation

Defensive Considerations

  • Addinprocess.exe will always launch with /guid and /pid. Baseline your environment for legitimate uses – monitor the rest

Useful References:



Readme / Credits

Code is based on the following repos:



Shouts to:

  • @m0rv4i for helping with C# nuances
  • @ace0fspad3s for troubleshooting
  • @ Nettitude RT for being awesome

A considerable amount of time and effort goes into maintaining this website, creating backend automation and creating new features and content for you to make actionable intelligence decisions. Everyone that supports the site helps enable new functionality.

If you like the site, please support us on “Patreon” or “Buy Me A Coffee” using the buttons below

 To keep up to date follow us on the below channels.