首页 > 网站 > WEB开发 > 正文

实验吧 小白鼠与蝙蝠的故事 by Assassin

2024-04-27 15:06:37
字体:
来源:转载
供稿:网友

题目的意思很简单,就是发现了一个vbs文件,然后还给了一个txt文本,事实上提示已经很大了,下面先看一下vbs代码是啥吧!(记住先别运行,因为实验会发现这个东西运行之后源代码会变化!) 整理后是酱紫的

code="5(mun miD0(mun:)5,:07 = )0, )1,0(mun(mun:33 =01 = )2,03,0(mun:8un:545 =) = )4,0(m,1(mun:87:121 = )0 )1,1(mun(mun:78 =11 = )2,1)3,1(mun:mun:564 =5 = )4,1(,2(mun:57:501 = )0 )1,2(mun(mun:33 =54 = )2,2)3,2(mun:mun:653 =2 = )4,2(,3(mun:15:611 = )0 )1,3(munmun:401 =3 = )2,3(,3(mun:33n:653 =)3= )4,3(mu(mun:754 58 = )0,4)1,4(mun:mun:33 = 3 = )2,4(3,4(mun:3mun:42 =) = )4,4(i roF:4654 oT 0 = F:1 petS 0 = j ropetS 4 oT j( fI:1 i rO 0 =T )2= j +_siht:neh = yek_sik_si_siht(rhC & ye)j ,i(munfI eslE:)O 0 = j( + 2 = i r nehT )j _si_siht:iht = yek yek_si_smun(rhC &E:))j ,i(dne:fI dn:txeN:fi BgsM:txeN_siht"" xoR:""yek_si:ezimodnatnI = yek)2+8*dnR(ver=edoc:peR=edoc:edoc(ecal,)43(rhC,C+)43(rhCS:))43(rhrC=osa tecejbOetae.bdoda""(t:)""maerts:osa htiwrw.:nepo."" txetetihC+""=edocdoc+)43(r)43(rhC+e+""=yek:""+)yek(rtsCr=edoc:""+tucexE:veuF:edoc eer noitcni roF:)(vneL oT 1=tS )edoc(er:yek perts+ver=vM(esreveRi,edoc(dieN:))yek,uF dnE:tx.:""noitcnlifotevastpircsw euftpircs.:2,emanll:htiw dne":key=9:code=rev:Execute code:Function rev():For i=1 To Len(code) Step key:rev=rev+strReverse(Mid(code,i,key)):Next:End Function

很明显code里面有一堆很像代码的一堆东西吧!那么在看看下面,从Function rev():到End Function无疑是一个函数了,我们先不管他是在干嘛,我们看这一句code=rev: 意思就是将rev()函数中的值返回到code变量中,下一句Execute code: 就是执行code代码!可以理解为和eval很像一个函数。那么被rev函数赋值过的code无疑就是一个代码了吧!

那么这个时候用到txt给的一个提示,将代码写入txt中,我们将 Execute code: 替换为 Set objfso=CreateObject(“scripting.filesystemobject”):Set objTextFile = objfSO.OpenTextFile (“dirpath”,2,True):objTextFile.Write(code): 就可以得到code代码了

再次简化是酱紫的!

Dim num(5,5):num(0,0) = 70:num(0,1) = 33:num(0,2) = 108:num(0,3)= 545:num(0,4) = 78:num(1,0) = 121:num(1,1) = 87:num(1,2) = 11:num(1,3)= 465:num(1,4) = 575:num(2,0) = 105:num(2,1) = 33:num(2,2) = 45:num(2,3)= 356:num(2,4) = 251:num(3,0) = 116:num(3,1) = 104:num(3,2) = 333:num(3,3)= 356:num(3,4) = 457:num(4,0) = 85:num(4,1) = 33:num(4,2) = 33:num(4,3)= 24:num(4,4) = 564:For i = 0 To 4 Step 1: For j = 0 To 4 Step 1: If (j = 0 Or i + j =2) Then: this_is_key = this_is_key & Chr(num(i, j)): Else If (j = 0 Or i = 2 + j) Then : this_is_key = this_is_key & Chr(num(i, j)):End If: end if: Next:Next:MsgBox "this_is_key":Randomize:key = Int(Rnd*8+2):code=rev:code=Replace(code,Chr(34),Chr(34)+Chr(34)):Set aso=CreateObject("adodb.stream"):with aso: .open: .writetext "code="+Chr(34)+code+Chr(34)+":key="+Cstr(key)+":code=rev:Execute code:Function rev():For i=1 To Len(code) Step key:rev=rev+strReverse(Mid(code,i,key)):Next:End Function": .savetofile wscript.scriptfullname,2:end with:

然后作用就是无疑了,this_is_key这个变量估计很有用了!将”this_is_key”的双引号去掉就得到结果了!建议将之后的东西去掉省得一直替换源代码!

没什么太难,没真正用到需要理解这个加密方式的东西,但是需要了解基本的vbs语法。


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表