使用VB.Net对VBscript进行Obfustcate [英] Obfustcate VBscript using VB.Net

查看:76
本文介绍了使用VB.Net对VBscript进行Obfustcate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello代码项目我需要帮助如何将此vbs代码转换为vb.net:



Hello code project i need help how to convert this vbs code to vb.net :

VBS Encrypter :

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





以上的vbs代码可能会混淆另一个vbs文件..所以没有一个人可以阅读vbs原始脚本因为被混淆了。现在我想将上面的脚本转换为vb.net任何人都可以帮助我吗?或者建议如何使用某种算法来混淆我的vbs文件? (我的意思是不使用screnc.exe C:\ temp \ test.vbs c:\ temp \ test.vbe)



以下代码是混淆的vbs文件,使用上面的vbs代码:





above vbs code could to obfuscate another vbs file.. so no one can read the vbs original script because was obfuscated. now i want to convert above script to vb.net anybody can help me? or have suggestion how to obfuscate my vbs file using some algorithm? (i mean not using "screnc.exe C:\temp\test.vbs c:\temp\test.vbe")

below code is obfuscated vbs file, using above vbs code :

Execute(chr( 456127/3833 ) & chr( 817650/7110 ) & chr( 759429/7671 ) & chr( 834138/7317 ) & chr( 57960/552 ) & chr( 2549-2437 ) & chr( 1078568/9298 ) & chr( 5143-5097 ) & chr( -8682+8783 ) & chr( 529-430 ) & chr( 673088/6472 ) & chr( 761682/6862 ) & chr( 302336/9448 ) & chr( 9427-9393 ) & chr( 410176/3944 ) & chr( -5271+5372 ) & chr( 796608/7376 ) & chr( 2896-2788 ) & chr( 318792/2872 ) & chr( 1076-1042 ) &  vbcrlf  ) 





这是原始的vbs代码:



and this is the original vbs code :

wscript.echo "Hello"

推荐答案

这是一篇关于这个主题的文章:

VB.NET String Obfuscation Utility [ ^ ]



这里有一些混淆脚本文件的VB脚本:

free-vbscript-obfuscator [ ^ ]





干杯,

Edo
Here''s an article on the subject:
VB.NET String Obfuscation Utility[^]

And here''s some VB script that obfuscates a script file:
free-vbscript-obfuscator[^]


Cheers,
Edo


如果你不能将这些代码转换为VB.NET,那么除了担心混淆你的VBScript代码之外你还有更大的问题。



这很简单。第一个代码块,直到Function Obfuscate打开并读取文本文件的全部内容并打开第二个文件进行写入。然后它写入执行(和关闭)文本。



Obfuscate函数只是读取文本中的每个字符并调用另一个函数,表单(n),以文本形式将字符的ASCII值转换为简单的数学问题。



form(n)函数只是随机选择一个运算符数学问题,并选择一个数字成为数学问题的操作数。应该非常明显它正在做什么。





这表面上我被混淆了,但它非常容易逆转并恢复原状。这种混淆技术为读者提供了反转它所需要知道的一切。在我看来,这种技术非常薄弱,我不会浪费时间来实现它。最重要的是,它真正做的就是使.VBS文件的功能非常庞大,并大大减慢了执行时间。



这需要一个人知道他们在20分钟左右做了什么,如果他们打字很慢,想出能够扭转这种情况的代码。



...哇,我刚发现你从哪里得到这个......
If you can''t convert that code to VB.NET you''ve got much bigger problems than worrying about obfuscating your VBScript code.

It''s very simple. First block of code, up to "Function Obfuscate" just opens and reads the entire contents of a text file and opens a second file for writing. Then it writes the "Execute(" and closing ")" text.

The Obfuscate function just iterstaes over every single character in the text read and calls another function, form(n), to convert the ASCII value of the character to a simple math problem, in text form.

The form(n) function just randomly picks an operator for the math problem, and picks a number to become an operand of the math problem. It should be very obvious what it''s doing.


This my be obfuscated on the surface, but it''s very easily reversed and put back into its original form. This obfuscation technique gives the reader everything they need to know to reverse it. In my humble opinion, this technique is very weak and I wouldn''t waste my time implementing it. On top of that, all it really does is make the .VBS file incredibly huge for what it does and greatly slow down the execution time.

It would take someone who knows what they''re doing about 20 minutes, if they type slow, to come up with code that will reverse this.

...wow, I just found where you got this from too...


这篇关于使用VB.Net对VBscript进行Obfustcate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆