#voici le script qui tue créé pour vous par Statisticator# ########################################################## use LWP::UserAgent; use HTTP::Request; use Net::Ping; my $url = shift or die "utilisation : $0 url ip_depart mask nombre gw tempo\n"; my $start= shift or die "utilisation : $0 url ip_depart mask nombre gw tempo\n"; my $mask = shift or die "utilisation : $0 url ip_depart mask nombre gw tempo\n"; my $nombre = shift or die "utilisation : $0 url ip_depart mask nombre gw tempo\n"; my $gw = shift or die "utilisation : $0 url ip_depart mask nombre gw tempo\n"; my $tempo = shift or die "utilisation : $0 url ip_depart mask nombre gw tempo\n"; @ip = split(/\./,$start); $| = 1; printf "%s =>\n\t", $url; my $ua = LWP::UserAgent->new(); $ua->agent("Mozilla/4.0 (compatible; MSIE 5.5; MSN 2.5; Windows 98)"); my $req = HTTP::Request->new(GET => $url); $req->referer(""); for ($cpt = 0; $cpt < $nombre ; $cpt++) { $affip=@ip[0].".".@ip[1].".".@ip[2].".".@ip[3]; $p = Net::Ping->new("icmp"); if ( ! $p->ping($affip,1)) { @args=("ifconfig","eth0",$affip,"netmask",$mask); system(@args)==0 or die "crash boum ifconfig"; @args=("route","add","default","gw",$gw); system(@args)==0 or die "crash boum route"; my $reponse = $ua->request($req); if ($reponse->is_error()) { printf " %s\n", $reponse->status_line; } else { printf "%s \n", $affip } sleep($tempo); } else { printf "IP occupée : %s \n", $affip; } if (@ip[3] < 254) { @ip[3]++ ; } else {@ip[3]=1; @ip[2]++; } }