Header Ads

Encription of VBS file

Today i got a question on VBS file encoding from Srinivas...
Srini i really never encoded a vbs file but yes i know that can be done..
there are popular solution given in hereIt looks like you have already encoded your script, but as a reference for those who would like more information about encoding their SecureCRT scripts, here is how it is done.

There are two other ActiveX script engines besides "VBScript" and "JScript" that are known as "VBscript.Encode" and "JScript.Encode". These script engines appear to be identical except for the fact that they decode input that has been encoded before executing it.

In order to encode scripts, you'll need to download the "Windows Script Encoder" from Microsoft. Here's a link to an overview of the script encoder technology:
The way the script encoder works with (Windows Script Host) WSH scripts is you simply take your *.vbs or *.js scripts and run them through the encoder and create new output files named *.vbe or *.jse, respectively.

SecureCRT requires that its own headers being present as the first lines of the script file. As with all SecureCRT scripts, you need to include these headers in plain text.

With an encoded script, these headers must still be in plain text so that SecureCRT can read them. There is a special comment which tells the script encoder where to begin encoding:
'**Start Encode**
Including this comment after the required SecureCRT script headers will ensure that SecureCRT will be able to load the correct script engine.

With respect to the "correct" script engine to use, this is where the SecureCRT script headers come in to play again. Normally, the script header for a SecureCRT script that uses the VBScript engine would look like:
# $language = "VBScript"
# $interface = "1.0"
An encoded script is actually interpreted by a different script engine, so the SecureCRT script headers must reflect this as well:
# $language = "VBScript.Encode"
# $interface = "1.0"
If you are using JScript as your language, the header would follow the same pattern:
# $language = "JScript.Encode"
# $interface = "1.0"

The following steps provide an example of using the
Microsoft script encoder with a SecureCRT script:
Take the following example VBScript for (called "plain.vbs"). Note that the "$language" header tag is now specified as "VBScript.Encode". Also, note the existence of the '**Start Encode** comment:

# $language = "VBScript.Encode"
# $interface = "1.0"
'**Start Encode**

Sub Main()
MsgBox "This is an encoded script!"
End SubAt a shell prompt, run the Microsoft script encoder to encode "plain.vbs" to the output file named "encoded.vbe":
screnc plain.vbs encoded.vbe

If you open "encoded.vbe" in Notepad (or your favorite text/code editor) it should look now look something like this:

# $language = "VBScript.Encode"
# $interface = "1.0"
'**Start Encode**#@~^WgAAAA=as;dlka;23=-sdfl93jfje8*()#*%^sl,>/w.3dke.......Now you should be able to run "encoded.vbe" from within SecureCRT.

or else you can check this page
Powered by Blogger.