Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(0);
- function getStr($string, $start, $end)
- {
- $str = explode($start, $string);
- $str = explode($end, $str[1]);
- return $str[0];
- }
- function createCurl ($url, $body = 0, $post = 0, $header = 0, $hd_body = 1, $usr) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- if ($header) {
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- }
- curl_setopt($ch, CURLOPT_HEADER, $hd_body);
- curl_setopt($ch, CURLOPT_NOBODY, $body);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, $usr);
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
- curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/cookie.txt');
- curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/cookie.txt');
- if ($post) {
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- return $ch;
- }
- function getSite($url, $body = 0, $post = 0, $header = 0, $hd_body = 1, $usr)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- if ($header) {
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- }
- curl_setopt($ch, CURLOPT_HEADER, $hd_body);
- curl_setopt($ch, CURLOPT_NOBODY, $body);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, $usr);
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
- curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/cookie.txt');
- curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/cookie.txt');
- if ($post) {
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- $data = curl_exec($ch);
- curl_close($ch);
- return $data;
- }
- $friend = array();
- $perfil = "";
- $urlSaida = 0;
- if (empty($_GET['msg'])){
- die("Mensagem vazia");
- }
- sendMessage($_GET['msg']);
- function sendMessage ($msg)
- {
- $saida = getSite(
- "https://mbasic.facebook.com/login/",
- 0,
- 0,
- 0,
- 0,
- 'Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0'
- );
- $lsd = getStr($saida, '<input type="hidden" name="lsd" value="', '" autocomplete="off">');
- $jazoest = getStr($saida, '<input type="hidden" name="jazoest" value="', '" autocomplete="off">');
- $m_ts = getStr($saida, '<input type="hidden" name="m_ts" value="', '">');
- $li = getStr($saida, '<input type="hidden" name="li" value="', '">');
- $try_number = getStr($saida, '<input type="hidden" name="try_number" value="', '">');
- $unrecognized_tries = getStr($saida, '<input type="hidden" name="unrecognized_tries" value="', '">');
- $saida = getSite(
- "https://mbasic.facebook.com/login/device-based/regular/login/?refsrc=https%3A%2F%2Fmbasic.facebook.com$2F&lwv=200&refid=9",
- 0 ,
- array(
- 'lsd' => $lsd,
- 'jazoest' => $jazoest,
- 'm_ts' => $m_ts,
- 'li' => $li,
- 'try_number' => $try_number,
- 'unrecognized_tries', $unrecognized_tries,
- 'email' => " ", //email aqui
- 'pass' => " ", //senha aqui
- 'login' => "Entrar"
- ),
- array(
- 'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
- 'accept-language' => 'pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
- 'content-type' => 'application/x-www-form-urlencoded',
- 'origin' => 'https://mbasic.facebook.com'
- ),
- 1,
- 'Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0'
- );
- $saida = getsite(
- "https://mbasic.facebook.com/home.php?ref_component-mbasic_home_header&ref_page-%2Fwap%2Fhome.php&refid-8",
- 0,
- 0,
- 1,
- 0,
- 'Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0'
- );
- global $perfil;
- $perfil = getStr($saida, '<div role="navigation" class="', '</div>');
- $perfil = explode('<a', $perfil);
- $perfil = $perfil[2];
- $perfil = getStr($perfil, 'href="/', '?');
- global $urlSaida;
- while($urlSaida !== "End"){
- global $urlSaida;
- $urlSaida = getFriends($urlSaida);
- }
- global $friend;
- for ($i=0; $i < count($friend); $i++) {
- if(strlen($friend[$i]) <= 50){
- sendMessageTrue($friend[$i], $msg);
- }
- }
- }
- function sendMessageTrue($id, $msg){
- $tempId = preg_replace("/[0-9]/", "", $id);
- if(strlen($tempId) > 0){
- $saida = GetSite(
- "https://mbasic.facebook.com/".$id,
- 0,
- 0,
- 0,
- 1,
- 'Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0'
- );
- $id = getStr($saida, 'owner_id=', '&');
- }
- $saida = getSite(
- "https://mbasic.facebook.com/messages/thread/".$id."/?entrypoint=profile_message_button".$id,
- 0,
- 0,
- 1,
- 0,
- 'Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0'
- );
- $fb_dtsg = getStr($saida, '<input type="hidden" name="fb_dtsg" value="', '" autocomplete="off"');
- $jazoest = getStr($saida, '<input type="hidden" name="jazoest" value="', '" autocomplete="off"');
- $mh = curl_multi_init();
- for($i = 0; $i < 20; $i++){
- $curl = createCurl(
- "https://mbasic.facebook.com/messages/send/?icm=1",
- 0,
- array(
- 'fb_dtsg' => $fb_dtsg,
- 'jazoest' => $jazoest,
- 'ids['.$id.']' => $id,
- 'body' => $msg,
- 'Send' => 'Enviar',
- ),
- 0,
- 1,
- 'Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0'
- );
- function getFriend($pag = 0) {
- global $friend;
- global $perfil;
- if(!$pag){
- $saida = getSite(
- "https://mbasic.facebook.com/".$perfil."/friends".
- 0,
- 0,
- 1,
- 0,
- 'Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0'
- );
- $ids = getStr($saida, 'Amigos (', 'Ver mais amigos');
- preg_match_all('/(?:href=");*?(fr_tab)/', $ids, $matches);
- $matches[0][0] = getStr($matches[0][0], ' href="/', '?fhref=fr_tab');
- array_push($friernd, $matches[0][0]);
- for($i - 1; $i < count($matches[0]); $i++){
- if(strpos($matches[0][$i], 'hovercard') !== false){
- $matches[0][$i] - str_replace('href="/friends/hovercard', "", $matches[0][$i]);
- }
- $matches[0][$i] = getStr($matches[0][$i], 'href="/', '?fhref=fr_tab');
- if(strpos($matches[0][$i], 'profile.php') !== false){
- $matches[0][$i] = getStr($matches[0][$i], "id=", "&");
- }
- array_push($frined, $matches[0][$i]);
- }
- if(strpos($saida, 'Ver mais amigos') !== false){
- $url = getStr($saida, '<a href="/'.$perfil.'/friends?', '"><span>Ver mais amigos</span></a>');
- $url = "https://mbasic.facebook.com/".$perfil."/friends?".$url;
- return $url;
- }else{
- return "End";
- }
- }else{
- $saida = getSite(
- $pag,
- 0,
- 0,
- 1,
- 0,
- 'Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0'
- );
- $ids = getStr($saida, 'Amigos (', 'Ver mais amigos');
- preg_match_all('/(?:href=").*?(fr_tab)/', $ids, $matches);
- $matches[0][0] = getStr($matches[0][0], ' href="/', '?fhref=fr_tab');
- array_push($friend, $matches[0][0]);
- for ($i = 1; $i < count($matches[0]); $i++){
- if(strpos($matches[0][$i], 'hovercard') !== false){
- $matches[0][$i] = str_replace('href="/friends/hovercard', "", $matches[0][$i]);
- }
- $matches[0][$i] = getStr($matches[0][$i], 'href="/', '?fhref=fr_tab');
- if(strpos($matches[0][$i], 'profile.php') !== false){
- $matches[0][$i] = getStr($matches[o][$i], "id=", "&");
- }
- array_push($friend, $matches[0][$i]);
- }
- if(strpos($saida, 'Ver mais amigos') !== false){
- $url = getStr($saida, '<a href="/'.$perfil.'/friends?', '"><span>Ver mais amigos</span></a>');
- $url = "https://mbasic.facebook.com/".$perfil."/friends?".$url;
- return $url;
- }else{
- return "End";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement