Advertisement
jvflood

jvflood

Mar 26th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 15.96 KB | None | 0 0
  1. <?php
  2.  
  3. set_time_limit(0);
  4.  
  5. if (file_exists('save.txt')) {
  6.     $save = file_get_contents('save.txt', FILE_USE_INCLUDE_PATH);
  7. }
  8.  
  9. // fonction pour parse le html
  10. function parse($html, $separator1, $separator2){
  11.     $return = explode($separator2, explode($separator1, $html)[1])[0];
  12.    
  13.     return $return;
  14. }
  15.  
  16.  
  17. function Flood($pemt, $delai, $repetition, $url , $message, $cookie_coniunctio, $random)
  18. {
  19.      
  20.  
  21.     // Les messages randoms :
  22.    
  23.     $spam[] = array( ":)", ":-)", ":hap:", ":-)))", ":content:", ":oui:", ":cool:", ":rire:", ":-D", ":rire2:", ":o))", ":ok:", ":sournois:", ":gni:", ":noel:", ":hap:");
  24.     $spam[] = array(  "😀", "😁", "😂", "😃", "😄", "😅", "😆", "😇", "😈", "😉", "😊", "😋", "😌", "😍", "😎", "😏", "😐", "😑", "😒", "😓", "😔", "😕", "😖", "😗", "😘", "😙", "😚", "😛", "😜", "😝", "😞", "😟", "😠", "😡", "😢", "😣", "😤", "😥", "😦", "😧", "😨", "😩", "😪", "😫", "😬", "😭", "😮", "😯", "😰", "😱", "😲", "😳", "😴", "😵", "😶", "😷", "😸", "😹", "😺", "😻", "😼", "😽", "😾", "😿", "🙀", "🙁", "🙂", "🙃", "🙄");
  25.    
  26.     $cookie_coniunctio_arr = explode(";", $cookie_coniunctio);
  27.     for ($j = 0; $j < $repetition; $j++){
  28.                        
  29.        
  30.         foreach ($cookie_coniunctio_arr as $cookie_coniunctio)
  31.         {
  32.             $options = array(
  33.                         'http'=>array(
  34.                         'method'=> "GET",
  35.                         'header'=> "Cookie: wbCookieNotifier=1; coniunctio=".$cookie_coniunctio."; acceptableAds=0\r\n".
  36.                                    "Connection: close\r\n"
  37.                             ));
  38.                                    
  39.             $context = stream_context_create($options);
  40.                  
  41.             // lit le fichier stop.txt, si il contient stop on stop la boucle
  42.             $file = fopen("stop.txt", "w+") or die("erreur");
  43.             $break = fread($file,5);
  44.             echo $break;
  45.             fclose($file);
  46.             if ($break == "stop"){
  47.                 file_put_contents('stop.txt', '');
  48.                 break 2;
  49.             }
  50.             $html = file_get_contents($url, false, $context); // html de la page jvc (pour récupérer les paramètres)
  51.          
  52.             // tous les paramètres necessaires :
  53.             $fs_session = parse($html,'fs_session" value="', '"/>');
  54.             $fs_timestamp = parse($html,'fs_timestamp" value="', '"/>');  
  55.          
  56.             $html_fs = explode('value="topic_nouveau_message"/>', $html)[1];
  57.             $html_fs = explode('<div class="row">', $html_fs)[0];
  58.          
  59.             $fs_name1 = parse($html_fs,'name="', '"');
  60.             $fs_val1 = parse($html_fs,'value="', '"/>');
  61.          
  62.             $html_fs = explode('"/>', $html_fs)[1];
  63.             $fs_name2 = parse($html_fs,'name="', '"');
  64.             $fs_val2 = parse($html_fs,'value="', '"/>');
  65.          
  66.          
  67.            
  68.             // Préparation cURL
  69.             $cookies = "wbCookieNotifier=1; coniunctio=".$cookie_coniunctio."; acceptableAds=0";
  70.                  
  71.             $content = array(
  72.                 'fs_session' => $fs_session,
  73.                 'fs_timestamp' => $fs_timestamp,
  74.                 'fs_version' => 'topic_nouveau_message',
  75.                 $fs_name1 => $fs_val1,
  76.                 $fs_name2 => $fs_val2,
  77.                 'g-recaptcha-response' => "",
  78.                 'form_alias_rang' => '1'
  79.             );
  80.              
  81.             $mh = curl_multi_init();      
  82.          
  83.             for ($i=0; $i < $pemt; $i++){ //nombre de requettes
  84.              
  85.                 if ($random) { // si message random activé
  86.                     $content['message_topic'] = $spam[0][mt_rand(0, count($spam[0]) - 1)];    
  87.                 }
  88.                 else{
  89.                     $content['message_topic'] = $message;          
  90.                 }
  91.                 $content_arr = http_build_query($content);
  92.                
  93.                
  94.                 $ch[$i] = curl_init($url);
  95.      
  96.                 curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, 1);
  97.                 curl_setopt($ch[$i], CURLOPT_POST, 1);
  98.                 curl_setopt($ch[$i], CURLOPT_COOKIE, $cookies);
  99.                 curl_setopt($ch[$i], CURLOPT_POSTFIELDS, $content_arr);
  100.      
  101.                 curl_multi_add_handle($mh, $ch[$i]);
  102.              
  103.             }
  104.                    
  105.          // poste les messages pile au début de la seconde
  106.          $ms = intval(explode(" ", microtime())[0]);
  107.          
  108.          while ($ms > 1000){
  109.              usleep(10);
  110.               $ms = intval(explode(" ", microtime())[0]);
  111.          }
  112.          
  113.          // ----------------------------
  114.          
  115.             $running = null;
  116.            
  117.             do {
  118.                 curl_multi_exec($mh, $running);
  119.             } while ($running >0);
  120.          
  121.             unset($ch);
  122.            
  123.            
  124.             sleep(2); // sleep entre chaque compte (2 semble être le mieux)
  125.         }
  126.            
  127.         $temps = $delai - count($cookie_coniunctio_arr); // après plusieurs test, c'est mieux d'attendre plus que 10 sec que juste 10
  128.         sleep($delai);
  129.     }
  130.        
  131.         echo "<h1> Flood terminé </h1>";
  132.    
  133. }
  134.  
  135.  
  136.  
  137.  
  138. if (isset($_POST['flood']))
  139. {
  140.            
  141.     if (isset($_POST['random'])){
  142.         $random = true; // si mode random activé
  143.     }else{
  144.         $random = false; // si mode random desactivé
  145.     }
  146.    
  147.     Flood($_POST['pemt'], $_POST['delai'], $_POST['nbRepetitions'], $_POST['url'], $_POST['message_list'],  $_POST['coniunctio'], $random);
  148. }
  149.    
  150.  
  151. if (!empty($_POST['stop']))
  152. {
  153.    
  154.     $ret = file_put_contents('stop.txt', 'stop');
  155.  
  156.     if($ret === false)
  157.     {
  158.         die("Erreur");
  159.     }
  160.          
  161. }
  162.  
  163.    
  164. // enregistre le cookie
  165. if (isset($_POST['save']))
  166. {
  167.     if(isset($_POST['coniunctio']))
  168.     {
  169.         $data = $_POST['coniunctio'] ;
  170.         $ret = file_put_contents('save.txt', $data);
  171.        
  172.         if($ret === false)
  173.         {
  174.             die("Erreur, impossible d'enregistrer le cookie");
  175.         }
  176.         else
  177.         {
  178.             echo "Le cookie a bien été enregistré";
  179.             header("refresh: 1;");
  180.         }
  181.     }
  182. }
  183.  
  184.  
  185.  
  186. ?>
  187.  
  188. <!doctype html>
  189. <html lang="en">
  190.     <head>
  191.     <style>
  192.    
  193. body {
  194.     background-color: #252525;
  195.     font-family: Tahoma,"DejaVu Sans Condensed",Arial,Helvetica,sans-serif;
  196.     font-size: 14px;
  197.     color: #aaa;
  198.     }
  199.  
  200. input {
  201.     background: #ccc !important;
  202.     border-color: #323232 !important;
  203.     color: #151515 !important;
  204.     border: 0.0625rem solid #D0D0D9;
  205.     height: 1.75rem;
  206.     width: 30.25rem;
  207.     padding: 0.1875rem;
  208. }
  209.  
  210. ul{
  211.     display: table;
  212.     list-style-type: none;
  213.     padding: 0.125rem 0;
  214.     margin: 0;
  215.     border: 0.0625rem solid #ccc;
  216.     margin-bottom: 1.5rem;
  217.     width: 100%;
  218.     table-layout: fixed;
  219.     border-collapse: separate;
  220.     padding: 0 0.125rem;
  221.     border-spacing: 0 0.125rem;
  222.     margin-top: 0;
  223.     margin-bottom: 10px;
  224.     box-sizing: border-box;
  225.     color: #B8B8B8 !important;
  226.     border-color: #555;
  227. }
  228. li {
  229.     background: #2A2A2A;
  230.     display: table-row;
  231.     font-size: 1rem;
  232.     vertical-align: middle;
  233.     line-height: 1rem;
  234.     box-sizing: border-box;
  235.     border-spacing: 0;
  236.     list-style-type: none;
  237.     border-collapse: separate;
  238.     border-spacing: 0 0.125rem;
  239.     color: #B8B8B8 !important;
  240. }
  241.  
  242. .topic-subject {
  243.         width:400px;
  244.     padding-right: 1.25rem;
  245.     font-weight: 700;
  246.     position: relative;
  247.     display: table-cell;
  248.     padding: 0.125rem;
  249.     box-sizing: border-box;
  250.     line-height: 1rem;
  251. }
  252. .titre-subject {
  253.     padding-right: 1.25rem;
  254.     font-weight: 700;
  255.     position: relative;
  256.     display: table-cell;
  257.     width:170px;
  258.     padding: 0.125rem;
  259.     box-sizing: border-box;
  260.     line-height: 1rem;
  261.     text-align:right;
  262. }
  263.  
  264. textarea {
  265.     background: #ccc !important;
  266.     width:485px;
  267.     max-width:99%;
  268.     min-width:99%;
  269.     min-height:40px;
  270.     max-height:300px;
  271.     height:200px;
  272. }
  273.    
  274. H2 {
  275.     color:#ddd;
  276.     background:#121212;
  277.     padding:5px;
  278. }
  279. .column_right{
  280.     width:90%;
  281.     height: 2.2rem;
  282.     padding:5px;
  283.     margin:auto;
  284.    
  285. }
  286.  
  287. input#random {
  288.     width:10px;
  289. }
  290.  
  291.     [type="checkbox"].CheckStyle:not(:checked),
  292.     [type="checkbox"].CheckStyle:checked {position: absolute;left: -9999px;}
  293.     [type="checkbox"].CheckStyle:not(:checked) + label,
  294.     [type="checkbox"].CheckStyle:checked + label {position: relative;padding-left: 55px;cursor: pointer;}
  295.     [type="checkbox"].CheckStyle:not(:checked) + label:before,
  296.     [type="checkbox"].CheckStyle:checked + label:before,
  297.     [type="checkbox"].CheckStyle:not(:checked) + label:after,
  298.     [type="checkbox"].CheckStyle:checked + label:after {content: "";position: absolute;}
  299.     [type="checkbox"].CheckStyle:not(:checked) + label:before,
  300.     [type="checkbox"].CheckStyle:checked + label:before {border: 1px solid #777;left:0; top: -3px;width: 45px; height: 20px;background: #DDDDDD;border-radius: 15px;-webkit-transition: background-color .2s;-moz-transition: background-color .2s;-ms-transition: background-color .2s;transition: background-color .2s;}
  301.     [type="checkbox"].CheckStyle:not(:checked) + label:after,
  302.     [type="checkbox"].CheckStyle:checked + label:after {border: 1px solid #777;width: 10px; height: 10px;-webkit-transition: all .2s;-moz-transition: all .2s;-ms-transition: all .2s;transition: all .2s;border-radius: 50%;background: #461B1B;top: 2px; left: 5px;}
  303.     [type="checkbox"].CheckStyle:checked + label:before {background:#34495E; }
  304.     [type="checkbox"].CheckStyle:checked + label:after {background: #39D2B4;top: 2px; left: 30px;}
  305.     [type="checkbox"].CheckStyle:checked + label .ui,
  306.     [type="checkbox"].CheckStyle:not(:checked) + label .ui:before,
  307.     [type="checkbox"].CheckStyle:checked + label .ui:after {position: absolute;left: 6px;width: 45px;border-radius: 15px;font-size: 14px;font-weight: bold;line-height: 22px;-webkit-transition: all .2s;-moz-transition: all .2s;-ms-transition: all .2s;transition: all .2s;}
  308.     [type="checkbox"].CheckStyle:not(:checked) + label .ui:before {top:-4px;content: "✖";left: 28px}
  309.     [type="checkbox"].CheckStyle:checked + label .ui:after {top:-4px;content: "✓";color: #39D2B4;}
  310.  
  311. </style>
  312.  
  313.  
  314.         <meta charset="UTF-8">
  315.         <title>JVFlood</title>
  316.     </head>
  317.     <body>
  318.     <div style="margin: 0 auto;padding: 1.25rem 1.25rem 0 1.25rem;width: 720px">
  319.         <H2> <center>JVFLOOD </center></H2>
  320.         <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" >
  321.                 <ul class="topic-list topic-list-admin">
  322.                     <li>
  323.                         <span class="titre-subject">Cookie :</span>
  324.                         <span class="topic-subject">
  325.                             <input id="coniunctio" placeholder="coniunctio" style="margin:auto!important;width:99%;"  name="coniunctio" value="<?php echo (isset($save))?$save:'';?>"</input>
  326.                         </span>
  327.                         <span class="column_right">
  328.                             <input class="column_right" type="submit" name="save" value="Sauvegarder">
  329.                         </span>
  330.                     </li>
  331.                     <li>
  332.                         <span class="titre-subject">URL du topic:</span>
  333.                         <span class="topic-subject">
  334.                             <input id="url" style="margin:auto!important;width:99%;" name="url" value="" placeholder="http://www.jeuxvideo.com/forums/..."></input>
  335.                         </span>
  336.                         </li>          
  337.                     <li>
  338.                         <span class="titre-subject">Message :</span>
  339.                         <span class="topic-subject">
  340.                             <textarea id="message_list" style="margin:auto!important;width:99%;" name="message_list"></textarea>
  341.                         </span>
  342.                     </li>
  343.                     <li>
  344.                         <span class="titre-subject">Message random :</span>
  345.                         <span class="topic-subject" style="padding-top:10px;padding-bottom:5px;";>
  346.                         <input name="random" id="random" class="CheckStyle" type="checkbox" value="random"/><label  name="ReponseCheck" for="random"><span class="ui"></span></label>
  347.                         </span>
  348.                     </li>              
  349.                     <li>
  350.                         <span class="titre-subject">Répétition :</span>
  351.                         <span class="topic-subject">
  352.                             <input type = "number"min="1" max="10000"  id="nbRepetitions" style="margin:auto!important;width:99%;"  name="nbRepetitions" value="10"  onchange="UpdateTimer()"></input>
  353.                         </span>
  354.                         <script>
  355.                              
  356.                                  function UpdateTimer()
  357.                                  {
  358.  
  359.                                     var duration = document.getElementById("nbRepetitions").value * document.getElementById("delai").value - document.getElementById("delai").value;
  360.                                     var display = document.querySelector('#time');
  361.                                     var timer = duration, minutes, seconds;
  362.                                    
  363.                                         minutes = parseInt(timer / 60, 10)
  364.                                         seconds = parseInt(timer % 60, 10);
  365.  
  366.                                         minutes = minutes < 10 ? "0" + minutes : minutes;
  367.                                         seconds = seconds < 10 ? "0" + seconds : seconds;
  368.  
  369.                                         display.textContent = minutes + ":" + seconds;
  370.  
  371.                                      
  372.                                 }
  373.                                 function startTimer() {
  374.                                     var duration = document.getElementById("nbRepetitions").value *  document.getElementById("delai").value - document.getElementById("delai").value;
  375.                                     var display = document.querySelector('#time');
  376.                                     var timer = duration, minutes, seconds;
  377.                                     setInterval(function () {
  378.                                         minutes = parseInt(timer / 60, 10)
  379.                                         seconds = parseInt(timer % 60, 10);
  380.  
  381.                                         minutes = minutes < 10 ? "0" + minutes : minutes;
  382.                                         seconds = seconds < 10 ? "0" + seconds : seconds;
  383.  
  384.                                         display.textContent = minutes + ":" + seconds;
  385.  
  386.                                         if (--timer < 0) {
  387.                                             timer = duration;
  388.                                         }
  389.                                     }, 1000);
  390.                                 }
  391.                          </script>
  392.                     </li>
  393.                      <li>
  394.                         <span class="titre-subject">Delai :</span>
  395.                         <span class="topic-subject">
  396.                             <input type = "number" min="11" max="60"  id="delai" style="margin:auto!important;width:99%;"  name="delai" value="12"  onchange="UpdateTimer()"></input>
  397.                         </span>
  398.                     </li>
  399.                     <li>
  400.                         <span class="titre-subject">Durée :</span>
  401.                         <span class="column_right" id="time">01:50</span>
  402.                         </span>
  403.                     </li>    
  404.                     <li>
  405.                         <span class="titre-subject">PEMT :</span>
  406.                         <span class="topic-subject">
  407.                             <input type = "number"min="1" max="20"  id="pemt" style="margin:auto!important;width:99%;"  name="pemt" value="15"  ></input>
  408.                         </span>
  409.                     </li>                  
  410.                     <li>
  411.                         <span class="titre-subject">
  412.                         </span <span class="topic-subject">
  413.                             <button style="width:100%;height:50px;" type="submit" name="flood" value="Flood" id="flood" onclick="startTimer()" />Flood</button>
  414.                         </span>
  415.                     </li>
  416.                     <li>
  417.                         <span class="titre-subject">
  418.                         </span>
  419.                         <span class="topic-subject">
  420.                             <button style="width:100%;height:25px;" type="submit" name="stop" value="Stop" id="stop"/>Stop</button>
  421.                         </span>
  422.                     </li>
  423.                 </ul>
  424.             </form>
  425.         </div>
  426.     </body>
  427. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement