来源:lam's blog
最近好象又开始流行播放器里插木马了,我于是在网上转了转,看有没有什么好东西能预防的.
结果在安天CERT小组 看到了这个:
9 U2 Z" [* P* y6 n# M8 g$ c软件名称:exe2swf 适用系统:WIN 9x/ME/2000/NT 文件大小:11K4 D# C, `9 m) {6 E 文件说明:FLASH格式文件转换器为了防止有人在可执行的FLASH格式文件(.exe)中夹插木马,或者用flash图标的木马冒充flash文件,编写了一个简单的工具。
下载:http://soft.hackbase.com/37/20050319/6389.html
) n1 F" R+ \' h/ ?. a哈,但是还有还想不到的呢,我找到了一段可以实验这个功能的代码
+ [) e( `/ B. J6 j2 f* D# l" `3 Z. I( S作者:海娃
% M5 p& r5 Z% F+ c$ p用法:
6 S7 W6 d3 W# t/ L$ \/ f'haiwa@http://www.51windows.Net- s3 w) {" o8 I3 _: M" o '感谢jimbob提供帮助. dim AsoR,FlashFileName6 u( t' V5 T) J( ?' v4 ? Set ArgObj = WScript.Arguments
dim PositionStart,OKed,Tag,EndSize PositionStart = 920000'flash 4的播放器的大致字节数$ K& Y7 s2 B" h! M1 }; N* R( Z* m EndSize = 8 'exe文件结尾字节数,其它版本可以设置为0 FlashFileName = ArgObj(0)'传递路径
2 L( d) ^2 O1 ]set AsoR=CreateObject("Adodb.Stream") AsoR.Mode=3 ; c" @$ S+ H& r+ ?* P/ P AsoR.Type=1 AsoR.Open a) P- t: E' R2 R* ]8 Y* H! r g! _ set AsoW=CreateObject("Adodb.Stream")5 x6 S) i$ \3 _% ]% s7 R AsoW.Mode=3 AsoW.Type=1 - k n0 {/ K6 u' N" l) | AsoW.Open7 i' m" n: d' ]5 B" y3 x" E* i AsoR.LoadFromFile(FlashFileName)
OKed = true dim filesize filesize = AsoR.size
$ Z( X8 A9 b$ i) Qif filesize>
ositionStart then
while OKed
AsoR.Position = PositionStart8 c6 B9 P! ~" x6 F$ x5 \
Tag = Bin2Str(AsoR.read(20))
if instr(Tag,"0000000") >0 then
PositionStart = PositionStart + 1
else
PositionStart = PositionStart + 20
end if! L8 B" w- C5 Q" ?2 o3 m$ T
if Tag = "00000000000000000708783" or Tag = "00000000000000000678783" then
OKed = false
end if
'if PositionStart > filesize then
' OKed = false1 I* B! d5 |3 S7 [
'end if' k) k, x# C! I) Y% m" ]3 \
wend
else
msgbox "文件错误"' y7 H' Q9 e* D& m) G
end if2 Z F Y) N4 s* u% O6 {, z
PositionStart = PositionStart + 16
'msgbox PositionStart2 ^+ ~: W$ T: ]3 h4 N, J
AsoR.Position = PositionStart
AsoW.write AsoR.read(filesize-int(PositionStart)-int(EndSize))
'新文件名6 k) @9 r) s+ m+ ? Y dim newFileName3 a8 \! ^! O/ t! ` 'newFileName = left(FlashFileName,len(FlashFileName)-4) & ".swf"( @- u2 Y5 I, e* C' m1 T newFileName = FlashFileName & ".swf"
$ c, _( i% {6 G3 sSet fso = CreateObject("Scripting.FileSystemObject") If (fso.FileExists(newFileName)) Then overwrite = msgbox(newFileName&" 已存在"& vbnewline &"要替换它吗?",308,"文件已经存在 - exe2swf脚本") if overwrite=6 then AsoW.SaveToFile newFileName, 24 w" i/ G; C/ Z4 [0 L( ~ else9 a' s. P/ Z. H+ W$ W# k msgbox "操作被取消",0,"exe2swf脚本" end if( |/ `# n+ k7 u. K8 F ]0 X else5 y% ?- |1 J2 k6 p0 n3 y5 e AsoW.SaveToFile newFileName, 12 H- k7 q* k0 c2 d6 G% f$ d end if
/ d, O7 m3 ^: A; fAsoR.close7 R2 _6 G& G. V set AsoR=nothing9 v. ^$ N: H5 C9 h: V& T AsoW.close set AsoW=nothing
Function Bin2Str(Bin)3 x: x2 Q" v5 e/ y Dim I, Str' e5 O: K7 o7 W z4 ~2 M( R For I=1 to LenB(Bin) clow=MidB(Bin,I,1) if ASCB(clow)<128 then Str = Str & (ASCB(clow)) else I=I+1 if I <= LenB(Bin) then Str = Str & (ASCW(MidB(Bin,I,1)&clow)) end if Next 8 w9 e6 Q5 _2 G; K; r" U Bin2Str = Str End Function
' w6 H9 q; |- i* J# ^3 T$ ?" d/ s' b$ {* U! Y: R6 J9 b

| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |