А АSaturday 13 January 2018

The protection of Powershell script.

Hi there.
 
If you know the obfuscation for VBScript files was with tiny tool as Script Encoder from Microsoft. We could get VBE file instead VBS file. VBE file could be run easy as VBS: cscript file.vbe. This was poor protection for VBS scripts. Anybody could find in Internet decoder for VBE.
 
And what is situation about such protection for Powershell script?
 
For example, I know fine GUI tool as PowerGUI.
 
Script compilation to executable files (binary exe) is one of the features we have added in PowerGUI version 3.0 or above. You would likely want to use compile a script when you want to share it in the enterprise environment and you are not sure whether the other person is comfortable running scripts or you simply don’t want risking someone modifying the your code.
 
To compile a PowerShell script:
  • open the script in PowerGUI Script Editor,
  • on the Tools menu, click Compile Script,
  • then specify the name and path for the exe file you want to create EXE-file.
 
The additional options you get are:
  • show or hide the PowerShell Console window when executing the script,
  • automatically close or keep the console window,
  • protect the script source code by obfuscating it using a password you specify,
  • add other PowerShell scripts  to the exe (if you have another script which your main script is using).
However you shouldn't to be calm. You have to know some moments. You have to type Password each time for running your exe-file. So you can't to share your exe-file without password. And if your exe-file take any error during execution, so your powershell script will be locate in PowerGUI temporary folder in clear type.

Be careful.
 
 
 

1 comment:

Anonymous said...

Hi. The check in "Close PS console window" don't permit to execute Pause or Read-Host commands.

Post a Comment

А что вы думаете по этому поводу?

Версия на печать

Популярное