Here's a Little script i whipped up for you that will obfuscate any vbs
file....
The obfuscation is pretty simple, so anyone familiar with vbs
can prolly de-obfuscate it in 1 min.
If you want higher level of obfuscation, well you need to pay me... :) but for this i'll take your votes! :D
The resulting script obfuscated.vbs
will remain a valid vbs
file.
I could've made a self decrypting vbs, but chances are that will cause a red-flag with an antivirus...and if your anti-virus is any good, it should flag this as suspicious.
Please note, Standard disclaimer applies...I'm not responsible for any damage that maybe occur due to the script, use at own risk. I don't guarantee it'll work all the time
'VBS Obfuscator by st0le
Randomize
set fso = CreateObject("Scripting.FileSystemObject")
fileName = Inputbox("Enter Path of the File to scramble : ")
set src = fso.OpenTextfile(fileName,1)
body = src.readall
set rep = fso.createtextfile("Obfuscated.vbs",true)
rep.writeline "Execute(" & Obfuscate(body) & " ) "
Function Obfuscate(txt)
enc = ""
for i = 1 to len(txt)
enc = enc & "chr( " & form( asc(mid(txt,i,1)) ) & " ) & "
next
Obfuscate = enc & " vbcrlf "
End Function
Function form(n)
r = int(rnd * 10000)
k = int(rnd * 3)
if( k = 0) then ret = (r+n) & "-" & r
if( k = 1) then ret = (n-r) & "+" & r
if( k = 2) then ret = (n*r) & "/" & r
form = ret
End Function
Best Solution
One thing I would be especially concerned about in doing this is you must really trust the product that is compiling the script. After all, what better way to embed a virus or worm than to offer a free compiler that compiles your VBScript into an unreadable executable.