Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $message = "first http://image.noelshack.com/fichiers/2017/11/1489668850-pepe.png"; // message à spam
- $url = "http://www.jeuxvideo.com/forums/42-22046-50423841-1-0-1-0-test.htm"; // lien du topic
- $cookie_coniunctio = "10021469$1490363442$5512c08a4e24be4fa8de0d314203ea11"; // cookie coniunctio /!\ NE LE PARTAGEZ PAS /!\
- $cookie_dlrowolleh = "9123ae8fb22843935cdb9338846c0836642aca6cc788dbe2cb7d4622821bf317"; // cookie dlrowolleh
- $nbRequetes = 13; // nb de messages à envoyer (max environ 13)
- // récupère les paramètres
- $options = array(
- 'http'=>array(
- 'method'=> "GET",
- 'header'=> "Upgrade-Insecure-Requests: 1\r\n".
- "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".
- "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n".
- "Accept-Encoding: gzip, deflate, sdch\r\n".
- "Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4\r\n".
- "Cookie: wbCookieNotifier=1; coniunctio=".$cookie_coniunctio."; acceptableAds=0; dlrowolleh=".$cookie_dlrowolleh."\r\n".
- "Connection: close\r\n"
- ));
- $context = stream_context_create($options);
- $html = gzdecode(file_get_contents($url, false, $context));
- function parse($html, $separator1, $separator2){
- $return = explode($separator2, explode($separator1, $html)[1])[0];
- return $return;
- }
- $fs_session = parse($html,'fs_session" value="', '"/>');
- $fs_timestamp = parse($html,'fs_timestamp" value="', '"/>');
- $html_fs = explode('value="topic_nouveau_message"/>', $html)[1];
- $html_fs = explode('<div class="row">', $html_fs)[0];
- $fs_name1 = parse($html_fs,'name="', '"');
- $fs_val1 = parse($html_fs,'value="', '"/>');
- $html_fs = explode('"/>', $html_fs)[1];
- $fs_name2 = parse($html_fs,'name="', '"');
- $fs_val2 = parse($html_fs,'value="', '"/>');
- // paramètre Curl
- $headers = array(
- "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
- "Cookie: wbCookieNotifier=1; coniunctio=".$cookie_coniunctio."; acceptableAds=0; dlrowolleh=".$cookie_dlrowolleh
- );
- $content = array(
- 'fs_session' => $fs_session,
- 'fs_timestamp' => $fs_timestamp,
- 'fs_version' => 'topic_nouveau_message',
- $fs_name1 => $fs_val1,
- $fs_name2 => $fs_val2,
- 'message_topic' => $message,
- 'form_alias_rang' => '1'
- );
- $mh = curl_multi_init();
- for ($i=0; $i < $nbRequetes; $i++){ //nombre de requètes à faire (environ 15 max)
- $ch[$i] = curl_init($url);
- curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch[$i], CURLOPT_POST, true);
- curl_setopt($ch[$i], CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch[$i], CURLOPT_POSTFIELDS, $content);
- curl_multi_add_handle($mh, $ch[$i]);
- }
- $running = null;
- do {
- curl_multi_exec($mh, $running);
- } while ($running);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement