Code Monkey home page Code Monkey logo

shredder's Introduction

CodeFactor

Shredder - UDP Flooding Tool

Shredder is a simple UDP flooding tool implemented in C# that allows you to perform UDP flood attacks on a specified IP address and port. This tool can be useful for testing the resilience of network infrastructure against UDP flood attacks or for educational purposes to understand the impact of such attacks. Please use this tool responsibly and only on networks that you have permission to test.

Getting Started

To use Shredder, follow these steps:

  1. Clone the repository:
git clone https://github.com/LUCKYONE-CC/Shredder.git
  1. Navigate to the project directory:
cd Shredder
  1. Build the project:
dotnet build
  1. Run the application:
dotnet run

Technical details

This class represents the main functionality of the Shredder tool. It provides methods to flood the target IP address and port with UDP packets and display information about the attack's progress.

public Shred(string ip, int port, int force, int threads)
  • ip: The target IP address to flood.
  • port: The target port to flood.
  • force: The size of the UDP payload in each packet (default: 1250 bytes).
  • threads: The number of threads to use for flooding (default: 100 threads).

void Flood() Initiates the UDP flood attack by creating multiple threads to send UDP packets to the target.

void Info() Displays information about the flood attack, such as the current flood rate in Mb/s and the total data sent in Gb.

void Stop() Stops the UDP flood attack.

void Send() The method called by each thread to send UDP packets to the target IP address and port.

Other Private Helper Methods

  • string Stage(string text, char symbol = '.'): Formats the text with a symbol and returns it.
  • EndPoint GetEndpoint(): Returns the IPEndPoint representing the target IP address and port.
  • int GetPort(): Returns the target port if specified; otherwise, generates a random port number.
  • static double GetTime(): Returns the current time in seconds.

Disclaimer

Remember, using this tool for malicious purposes or on unauthorized networks is illegal and unethical. Always obtain proper authorization before using it for testing or educational purposes. :)

shredder's People

Contributors

luckyone-cc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

egida whoami2323

shredder's Issues

UpdClient#SendAsync cannot be multithreaded; Making the threads parameter useless

The following lines and code paths are affected:

int threads = string.IsNullOrWhiteSpace(threadsInput) ? 100 : 0;

Shred shred = new Shred(ip, port, force, threads);

Shredder/Shred.cs

Lines 39 to 42 in 72579f8

for (int i = 0; i < _threads; i++)
{
await Task.Run(SendAsync);
}


When replacing the "100" with only "1" you will notice that both 100 threads and 1 thread yield the same throughput.

image

image


That's because Sockets do not allow concurrent SendAsync() calls.

See
dotnet/runtime#26843 (comment)
https://tangentsoft.com/wskfaq/intermediate.html#threadsafety

3.10 - Is Winsock thread-safe?
On modern Windows stacks, yes, it is, within limits.
It is safe, for instance, to have one thread calling send() and another thread calling recv() on a single socket.
By contrast, it’s a bad idea for two threads to both be calling send() on a single socket. This is “thread-safe” in the limited sense that your program shouldn’t crash, and you certainly shouldn’t be able to crash the kernel, which is handling these send() calls. The fact that it is “safe” doesn’t answer key questions about the actual effect of doing this. Which call’s data goes out first on the connection? Does it get interleaved somehow? Don’t do this.
Instead of multiple threads accessing asingle socket, you may want to consider setting up a pair of network I/O queues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.