Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //MARCH 16 2018
- //BY BL4CKAR13S
- /*
- Tolong install
- .php
- .php-curl
- */
- error_reporting(E_ALL);
- ini_set('display_errors', 'Off');
- ini_set("log_errors", 1);
- ini_set("error_log", "error.log");
- //
- echo "\n[Facebook bot super beta v.0.0.0.1]";
- //konfigurasi
- $cookies = "dsa.txt";
- $username = "emiliano0000000@outlook.com";
- $password = "Lucky!@!@123";
- $id_msg = "2028917070468905"; //
- //
- echo "\n[".date("h:i:sa")."][Konfigurasi diterima]";
- echo "\n[".date("h:i:sa")."]+--->Cookies\t: ".$cookies;
- echo "\n[".date("h:i:sa")."]+--->Username\t:".$username;
- echo "\n[".date("h:i:sa")."]+--->Pesan ID\t:".$id_msg;
- $page_login_req = page_login_req($cookies);
- if($page_login_req == "blacklist."){
- echo "\n[".date("h:i:sa")."]+--->Yaahhh :'( , Ip anda telah di blacklist.";
- $read_log_id = 0;
- }
- elseif($page_login_req == "login."){
- echo "\n[".date("h:i:sa")."]+--->Anda sudah login";
- $read_log_id = 1;
- }
- else{
- echo "\n[".date("h:i:sa")."]+--->Mencoba Login.";
- login_facebook($page_login_req, $username, $password, $cookies);
- $read_home = read_home($cookies);
- if(read_home_login($read_home) == 1){
- echo "\n[".date("h:i:sa")."]+--->Login Berhasil.";
- $read_log_id = 1;
- }
- else{
- echo "\n[".date("h:i:sa")."]+--->Login Gagal.";
- $read_log_id = 0;
- }
- }
- if($read_log_id == 1){
- preg_match_all("/>Logout \(([^\"]*)\)<\/a>/", read_home($cookies), $read_home_profile_name, PREG_SET_ORDER);
- $my_profile_name = $read_home_profile_name[0][1];
- echo "\n[".date("h:i:sa")."]+--->Halo ".$my_profile_name.",";
- echo "\n[".date("h:i:sa")."]+--->Ayo Bermain sesuatu yang bagus :)";
- for($a = 1;$a <= $a; $a++){
- $read_message = read_message($cookies, $id_msg);
- $get_token_message = get_token_message($read_message);
- //echo $read_message;
- $compress_message = json_decode(compress_message($read_message));
- foreach($compress_message as $message_list){
- $last_message = $message_list;
- }
- $last_message = json_decode($last_message);
- //echo "\n".$last_message->{"name"};
- if($last_message->{"name"} == $my_profile_name){
- echo "\n[".date("h:i:sa")."]+--->Pesan terakhir cuman dari saya. :(";
- }
- else{
- $last_message_send_tot = str_replace("­", "", $last_message->{"message"});
- $last_message_send_tot = str_replace(""", '"', $last_message_send_tot);
- $is_bot_hi = preg_match("/hi bot/", $last_message_send_tot);
- $is_bot_system = preg_match("/\.\/system\([^\)]*\)/", $last_message_send_tot);
- if($is_bot_hi){
- echo "\n[".date("h:i:sa")."]+--->Pesan ini diterima. :) [".$last_message_send_tot."]";
- $my_message = "Hi, ".$last_message->{"name"};
- send_message($get_token_message, $my_message, $cookies, $id_msg);
- echo "\n[".date("h:i:sa")."]+--->Telah merespon pesan. :)";
- }
- elseif($is_bot_system){
- echo "\n[".date("h:i:sa")."]+--->Pesan ini diterima. :) [".$last_message_send_tot."]";
- preg_match_all("/\.\/system\(([^\)]*)\)/", $last_message_send_tot, $open_bot_system, PREG_SET_ORDER);
- exec($open_bot_system[0][1], $arr_result_bot_system);
- $my_bot_message = "";
- foreach($arr_result_bot_system as $result_bot_system){
- $my_bot_message = $my_bot_message."\n".$result_bot_system;
- }
- if(strlen($my_bot_message) >= 5000){
- send_message($get_token_message, "Hallo ".$last_message->{"name"}.",\nPermintaan tidak bisa ditampilkan disini.", $cookies, $id_msg);
- echo "\n[".date("h:i:sa")."]+--->Limit char 5000 :(";
- }
- else{
- send_message($get_token_message, $my_bot_message, $cookies, $id_msg);
- echo "\n[".date("h:i:sa")."]+--->Telah merespon pesan. :)";
- }
- }
- else{
- echo "\n[".date("h:i:sa")."]+--->Pesan dari ".$last_message->{"name"}." tidak diterima. :( ";
- }
- }
- sleep(3);
- }
- }
- else{}
- function send_message($a, $b, $d, $e){
- $a = json_decode($a);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://m.facebook.com/".$a->{"url"});
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "fb_dtsg=".urlencode($a->{"fb_dtsg"})."&body=".str_replace("\n", "%0D%0A", $b)."&send=Send&tids=cid.g.".$e."&wwwupp=C3&referrer=&ctype=&cver=legacy&csid=".$a->{"csid"});
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- curl_setopt($ch, CURLOPT_COOKIEJAR, $d);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $d);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $headers = array();
- $headers[] = "Origin: https://m.facebook.com";
- $headers[] = "Accept-Encoding: gzip, deflate, br";
- $headers[] = "Accept-Language: en-US,en;q=0.9";
- $headers[] = "Upgrade-Insecure-Requests: 1";
- $headers[] = "User-Agent: Nokia5250/10.0.011 (SymbianOS/9.4; U; Series60/5.0 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Safari/525 3gpp-gba";
- $headers[] = "Content-Type: application/x-www-form-urlencoded";
- $headers[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";
- $headers[] = "Cache-Control: max-age=0";
- $headers[] = "Authority: m.facebook.com";
- $headers[] = "Referer: https://m.facebook.com/messages/read/?tid=".$e."&request_type=send_success&_rdr";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $result = curl_exec($ch);
- echo $result;
- }
- function get_token_message($a){
- preg_match_all("/<input type=\"hidden\" name=\"fb_dtsg\" value=\"([^\"]*)\" autocomplete=\"off\" \/>/", $a, $fb_dtsg, PREG_SET_ORDER);
- preg_match_all("/<input type=\"hidden\" name=\"csid\" value=\"([^\"]*)\" \/>/", $a, $csid, PREG_SET_ORDER);
- preg_match_all("/<form method=\"post\" action=\"([^\"]*)\" class=\"bz\" id=\"composer_form\">/", $a, $url_form, PREG_SET_ORDER);
- $arr = array(
- "url" => $url_form[0][1],
- "csid" => $csid[0][1],
- "fb_dtsg" => $fb_dtsg[0][1]
- );
- return json_encode($arr);
- }
- function compress_message($a){
- $page_message_arr = explode('<div class="d bm bn" id="fua">', $a);
- $b = 1;
- foreach($page_message_arr as $page_message){
- preg_match_all("/<div class=\"bo\"><a href=\"(\/[^\"]*)\" class=\"[^\"]*\">/", $page_message, $page_message_profile_url, PREG_SET_ORDER);
- preg_match_all("/class=\"bp\"><strong class=\"bq\">([^<]*)<\/strong>/", $page_message, $page_message_profile_name, PREG_SET_ORDER);
- preg_match_all("/<div><span>([^\"]*)<\/span>/", $page_message, $page_message_messages, PREG_SET_ORDER);
- preg_match_all("/<abbr>([^<]*)<\/abbr>/", $page_message, $page_message_time_ago, PREG_SET_ORDER);
- $page_message_message_total = count($page_message_messages);
- $aa = 0;
- foreach($page_message_messages as $page_message_messages_for){
- if($a == $page_message_message_total){
- $w = ",";
- }else{ $w = ""; }
- $page_message_message = $page_message_messages_for[1].$w;
- $aa = $aa + 1;
- }
- $arr = array(
- "profile" => $page_message_profile_url[0][1],
- "name" => $page_message_profile_name[0][1],
- "message" => $page_message_message,
- "time ago" => $page_message_time_ago[0][1]
- );
- $json_arr[$b] = json_encode($arr);
- $b = $b + 1;
- }
- return json_encode($json_arr);
- }
- function read_home_login($a){
- $is_Login = preg_match("/ href=\"\/logout.php\?[^\"]*/", $a);
- if($is_Login){
- return 1;
- }
- else{
- return 0;
- }
- }
- function read_message($d, $a){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://m.facebook.com/messages/read/?tid=cid.g.".$a."&ref_component=mbasic_home_header&ref_page=%2Fwap%2Fhome.php&refid=7&ref=wizard");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
- curl_setopt($ch, CURLOPT_COOKIEJAR, $d);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $d);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- $headers = array();
- $headers[] = "Accept: */*";
- $headers[] = "Accept-Language: en-US";
- $headers[] = "Cache-Control: max-age=0";
- $headers[] = "Connection: keep-alive";
- $headers[] = "Host: m.facebook.com";
- $headers[] = "Upgrade-Insecure-Requests: 1";
- $headers[] = "User-Agent: Nokia5250/10.0.011 (SymbianOS/9.4; U; Series60/5.0 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Safari/525 3gpp-gba";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $result = curl_exec($ch);
- return $result;
- }
- function login_facebook($a, $b, $c, $d){
- $a = json_decode($a);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $a->{'url'});
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "lsd=".$a->{'lsd'}."&m_ts=".$a->{'m_ts'}."&li=".$a->{'li'}."&try_number=".$a->{'try_number'}."&unrecognized_tries=".$a->{'unrecognized_tries'}."&email=".urlencode($b)."&pass=".urlencode($c)."&login=Log+In");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- curl_setopt($ch, CURLOPT_COOKIEJAR, $d);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $d);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $headers = array();
- $headers[] = "Origin: https://m.facebook.com";
- $headers[] = "Accept-Encoding: gzip, deflate, br";
- $headers[] = "Accept-Language: en-US,en;q=0.9";
- $headers[] = "Upgrade-Insecure-Requests: 1";
- $headers[] = "User-Agent: Nokia5250/10.0.011 (SymbianOS/9.4; U; Series60/5.0 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Safari/525 3gpp-gba";
- $headers[] = "Content-Type: application/x-www-form-urlencoded";
- $headers[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";
- $headers[] = "Cache-Control: max-age=0";
- $headers[] = "Authority: m.facebook.com";
- $headers[] = "Referer: https://m.facebook.com/login/?ref=wizard&fl&refid=8";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $result = curl_exec($ch);
- return $result;
- }
- function read_home($a){
- $ch = curl_init();
- //set
- curl_setopt($ch, CURLOPT_URL, "https://m.facebook.com/home.php");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- curl_setopt($ch, CURLOPT_COOKIEJAR, $a);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $a);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- //header
- $headers = array();
- $headers[] = "Accept: */*";
- $headers[] = "Accept-Language: en-US";
- $headers[] = "Cache-Control: max-age=0";
- $headers[] = "Connection: keep-alive";
- $headers[] = "Host: m.facebook.com";
- $headers[] = "Upgrade-Insecure-Requests: 1";
- $headers[] = "User-Agent: Nokia5250/10.0.011 (SymbianOS/9.4; U; Series60/5.0 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Safari/525 3gpp-gba";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $page_login = curl_exec($ch);
- return $page_login;
- }
- function page_login_req($a){
- for($aa = 1; $aa <= 10;){
- $ch = curl_init();
- //set
- curl_setopt($ch, CURLOPT_URL, "https://m.facebook.com/");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- curl_setopt($ch, CURLOPT_COOKIEJAR, $a);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $a);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- //header
- $headers = array();
- $headers[] = "Accept: */*";
- $headers[] = "Connection: keep-alive";
- $headers[] = "User-Agent: Nokia5250/10.0.011 (SymbianOS/9.4; U; Series60/5.0 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Safari/525 3gpp-gba";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $page_login = curl_exec($ch);
- preg_match_all("/<form method=\"post\" action=\"([^'\"]*)\" class=\"bg bh\" id=\"login_form\" novalidate=\"[0-9]*\">/", $page_login, $page_login_url, PREG_SET_ORDER);
- preg_match_all("/<input type=\"hidden\" name=\"lsd\" value=\"([^\"]*)\" autocomplete=\"off\" \/>/", $page_login, $page_login_lsd, PREG_SET_ORDER);
- preg_match_all("/<input type=\"hidden\" name=\"m_ts\" value=\"([^\"]*)\" \/>/", $page_login, $page_login_m_ts, PREG_SET_ORDER);
- preg_match_all("/<input type=\"hidden\" name=\"li\" value=\"([^\"]*)\" \/>/", $page_login, $page_login_li, PREG_SET_ORDER);
- preg_match_all("/<input type=\"hidden\" name=\"try_number\" value=\"([0-9]*)\" \/>/", $page_login, $page_login_try_number, PREG_SET_ORDER);
- preg_match_all("/<input type=\"hidden\" name=\"unrecognized_tries\" value=\"([0-9]*)\" \/>/", $page_login, $page_login_unrecognized_tries, PREG_SET_ORDER);
- $is_Login = preg_match("/<a class=\"[^\"]*\" href=\"\/logout.php[^\"]*\">/", $page_login);
- if($is_Login){
- $aa = $aa + 10;
- $stat = 1;
- }
- elseif($page_login_url[0][1]==""||$page_login_lsd[0][1]==""||$page_login_m_ts[0][1]==""||$page_login_li[0][1]==""||$page_login_try_number[0][1]==""||$page_login_unrecognized_tries[0][1]==""){
- $aa = $aa + 1;
- $stat = 0;
- }
- else{
- $aa = $aa + 10;
- $stat = 2;
- }
- }
- if($stat == 2){
- $page_login_get = array(
- "url" => $page_login_url[0][1],
- "lsd" => $page_login_lsd[0][1],
- "m_ts" => $page_login_m_ts[0][1],
- "li" => $page_login_li[0][1],
- "try_number" => $page_login_try_number[0][1],
- "unrecognized_tries" => $page_login_unrecognized_tries[0][1]
- );
- $finish = json_encode($page_login_get);
- }
- elseif($stat == 1){
- $finish = "login.";
- }
- else{
- $finish = "blacklist.";
- }
- return $finish;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement