Rapid7’s 2026 Global Cybersecurity Summit is now available on-demand.Watch sessions.
Rapid7

module

Powershell .NET Compiler

Disclosed
Aug 14, 2012
Created
May 30, 2018

Description

This module will build a .NET source file using powershell. The compiler builds
the executable or library in memory and produces a binary. After compilation the
PowerShell session can also sign the executable if provided a path the
a .pfx formatted certificate. Compiler options and a list of assemblies
required can be configured in the datastore.

Author

RageLtMan rageltman@sempervictus

Platform

Windows

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':


msf > use post/windows/manage/powershell/build_net_code
msf post(build_net_code) > show actions
...actions...
msf post(build_net_code) > set ACTION < action-name >
msf post(build_net_code) > show options
...show and set options...
msf post(build_net_code) > run

Title
Rapid7 Labs

2026 Global Threat Landscape Report

The predictive window has collapsed. Exploitation follows disclosure in days. See how attackers are accelerating and how to stay ahead.