Advertisement
Guest User

scriptphpjvc

a guest
Mar 25th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. <?php
  2. $message = "first http://image.noelshack.com/fichiers/2017/11/1489668850-pepe.png"; // message à spam
  3. $url = "http://www.jeuxvideo.com/forums/42-22046-50423841-1-0-1-0-test.htm"; // lien du topic
  4. $cookie_coniunctio = "10021469$1490363442$5512c08a4e24be4fa8de0d314203ea11"; // cookie coniunctio /!\ NE LE PARTAGEZ PAS /!\
  5. $cookie_dlrowolleh = "9123ae8fb22843935cdb9338846c0836642aca6cc788dbe2cb7d4622821bf317"; // cookie dlrowolleh
  6. $nbRequetes = 13; // nb de messages à envoyer (max environ 13)
  7. // récupère les paramètres
  8.  
  9. $options = array(
  10. 'http'=>array(
  11. 'method'=> "GET",
  12. 'header'=> "Upgrade-Insecure-Requests: 1\r\n".
  13. "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\r\n".
  14. "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n".
  15. "Accept-Encoding: gzip, deflate, sdch\r\n".
  16. "Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4\r\n".
  17. "Cookie: wbCookieNotifier=1; coniunctio=".$cookie_coniunctio."; acceptableAds=0; dlrowolleh=".$cookie_dlrowolleh."\r\n".
  18. "Connection: close\r\n"
  19. ));
  20.  
  21. $context = stream_context_create($options);
  22. $html = gzdecode(file_get_contents($url, false, $context));
  23.  
  24. function parse($html, $separator1, $separator2){
  25. $return = explode($separator2, explode($separator1, $html)[1])[0];
  26.  
  27. return $return;
  28. }
  29.  
  30. $fs_session = parse($html,'fs_session" value="', '"/>');
  31. $fs_timestamp = parse($html,'fs_timestamp" value="', '"/>');
  32.  
  33. $html_fs = explode('value="topic_nouveau_message"/>', $html)[1];
  34. $html_fs = explode('<div class="row">', $html_fs)[0];
  35.  
  36. $fs_name1 = parse($html_fs,'name="', '"');
  37. $fs_val1 = parse($html_fs,'value="', '"/>');
  38.  
  39. $html_fs = explode('"/>', $html_fs)[1];
  40. $fs_name2 = parse($html_fs,'name="', '"');
  41. $fs_val2 = parse($html_fs,'value="', '"/>');
  42.  
  43. // paramètre Curl
  44. $headers = array(
  45. "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
  46. "Cookie: wbCookieNotifier=1; coniunctio=".$cookie_coniunctio."; acceptableAds=0; dlrowolleh=".$cookie_dlrowolleh
  47. );
  48.  
  49. $content = array(
  50. 'fs_session' => $fs_session,
  51. 'fs_timestamp' => $fs_timestamp,
  52. 'fs_version' => 'topic_nouveau_message',
  53. $fs_name1 => $fs_val1,
  54. $fs_name2 => $fs_val2,
  55. 'message_topic' => $message,
  56. 'form_alias_rang' => '1'
  57. );
  58.  
  59. $mh = curl_multi_init();
  60.  
  61. for ($i=0; $i < $nbRequetes; $i++){ //nombre de requètes à faire (environ 15 max)
  62. $ch[$i] = curl_init($url);
  63. curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, true);
  64. curl_setopt($ch[$i], CURLOPT_POST, true);
  65. curl_setopt($ch[$i], CURLOPT_HTTPHEADER, $headers);
  66. curl_setopt($ch[$i], CURLOPT_POSTFIELDS, $content);
  67. curl_multi_add_handle($mh, $ch[$i]);
  68. }
  69.  
  70. $running = null;
  71. do {
  72. curl_multi_exec($mh, $running);
  73. } while ($running);
  74. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement