Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'vendor/autoload.php';
- # 一些網址的資訊, 沒事別亂改他不然會壞掉
- define('BASE_URL', 'http://linkspeedup.com');
- define('AJAX_URL', sprintf('%s%s', BASE_URL, '/free_points/ajax'));
- /**
- * 這邊是初始化 Guzzle Client 的一些預設設定值
- */
- $client = new GuzzleHttp\Client([
- 'defaults' => [
- 'cookies' => true,
- 'connect_timeout' => 3,
- 'debug' => false,
- 'exceptions' => true,
- #'proxy' => 'socks://127.0.0.1:9050',
- 'timeout' => 30,
- 'verify' => false
- ]
- ]);
- /**
- * 每個請求皆共有的 header 資訊
- */
- $headers = [
- 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
- 'Accept-Encoding' => 'gzip,deflate,sdch',
- 'Accept-Language' => 'zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4',
- 'Cache-Control' => 'no-cache',
- 'Connection' => 'keep-alive',
- 'Pragma' => 'no-cache',
- 'User-Agent' => random_uagent()
- ];
- /**
- * 目前網站上可用的積分點擊類別
- */
- $methods = [
- # Facebook
- '1' => 'Facebook Likes',
- '2' => 'Facebook Share',
- '3' => 'Facebook Subscribes',
- '4' => 'Facebook Post Like',
- # Youtube
- '6' => 'Youtube Views',
- '7' => 'Youtube Subscribes',
- '8' => 'Youtube Likes',
- '9' => 'Youtube Favorites',
- # Twitter
- '10' => 'Twitter Followers',
- '11' => 'Twitter Tweets',
- '12' => 'Twitter Retweets',
- '13' => 'Twitter Favorites',
- # Google
- '14' => 'Google Circles',
- # Others
- #'15' => 'Website Hits'
- ];
- /**
- * 註冊的固定資訊
- */
- $register = [
- 'name' => 'John Doe',
- 'password' => 'fuck_linkspeedup',
- 'month' => 9,
- 'day' => 13,
- 'year' => 2014,
- 'gender' => 'male',
- 'ref' => '804UlueSPt'
- ];
- # ok, 開砲拉 !
- try {
- # 模擬使用者於瀏覽器鍵入網址並瀏覽
- getIndexPage();
- # 可以隨意更換成想要洗點數的帳號密碼
- if ($argc == 2) {
- define('USERNAME', $argv[1]);
- define('PASSWORD', $argv[2]);
- } else {
- define('USERNAME', sprintf('%d@mailnesia.com', time()));
- define('PASSWORD', $register['password']);
- registerNewAccount(USERNAME, $register['ref']);
- # 註冊完就做點簡單的紀錄, 以後方便查詢嘛 !
- $fp = fopen('/tmp/linkspeedup.txt', 'a');
- fwrite($fp, USERNAME . "\n");
- fclose($fp);
- }
- # 模擬使用者鍵入帳號以及密碼
- enterLoginInfo(3);
- # 模擬使用者的登入行為
- clickLoginButton(USERNAME, PASSWORD);
- # 模擬使用者點擊取得每日紅利點數
- # clickBonusButton();
- # 無限自動點擊循環開始 !
- while (true) {
- # 怕被盯上或封鎖, 當然是隨機挑選一個來洗點數唄
- $rand = array_rand($methods);
- # 這裡模擬使用者於左方點擊 Facebook Likes, Youtube Favorites 或 Twitter Followers 等連結時所傳送的查詢
- $getLinksList = clickPointURL($rand);
- # 從後端回傳一段 javascript, 以正則表達式擷取我們所需要的參數資訊
- # confirmSingleFB('53304', "https://www.facebook.com/studentsforabetterfuture", 1, '',9, "245682198938224", "ci_csrf_token", "");
- preg_match('/confirmSingleFB[^(]*\(([^)]*)\)/', $getLinksList, $confirmSingleFB);
- # 這邊簡單地採用字串的長度比對, 檢查是否出現以下的錯誤訊息
- # No more new pages in this item, please try again later!
- if ((count($confirmSingleFB) != 2) or (strlen($getLinksList) == 55)) {
- continue;
- } else {
- # 第二組所匹配的正則結果就是我們要的 id, url, network 等資訊啦嘿嘿
- # '53304', "https://www.facebook.com/studentsforabetterfuture", 1, '',9, "245682198938224", "ci_csrf_token", ""
- $confirmSingleFB = explode(',', $confirmSingleFB[1]);
- # 這邊就是我們所需要傳送的參數資訊了, 處理下單引號空白等字元
- $id = trim(str_replace('\'', '', $confirmSingleFB[0]));
- $url = trim(str_replace('"', '', $confirmSingleFB[1]));
- $network = trim($confirmSingleFB[2]);
- $cpc = trim($confirmSingleFB[4]);
- $title = trim(str_replace('"', '', $confirmSingleFB[5]));
- # 這裡模擬當點擊開始的按鈕時所傳送的查詢
- $getFBLikesDataBefore = clickStartButton($rand, $id, $url, $network);
- # 這裡模擬當將點擊視窗關閉時所傳送的查詢
- $checkFollowed = closePopupWindow($rand, $id, $url, $network);
- # 哇哈哈 ! 這邊就是可以新增積分的函數啦 !!
- $updateAction = sendFakeFollowed($rand, $id, $url, $network);
- # 取得該次詳細的積分點擊說明
- preg_match(
- '/<br \/\>(.*?)<br\/\>/',
- getPointinfo($rand, $cpc, $network, $title, $checkFollowed),
- $likeNote
- );
- $prompt = sprintf(
- '現在時間: %s, 點擊方法: %s, 目前點數: %s, 折現金額: %s, 詳細資訊: %s',
- date("Y-m-d H:i:s", time()),
- $methods[$rand],
- $updateAction['point'],
- $updateAction['money'],
- $likeNote[1]
- );
- print $prompt . PHP_EOL;
- }
- }
- } catch (Exception $e) {
- # 不做其他的例外處理, 只印出錯誤訊息就好
- print '已出現以下錯誤: ' . $e->getMessage() . PHP_EOL;
- }
- /**
- * 模擬使用者於瀏覽器鍵入網址 http://linkspeedup.com 並瀏覽網頁
- *
- * @return \GuzzleHttp\Stream\StreamInterface|null
- *
- * @see https://gist.github.com/skiddie/0bec2f609ad33d19d0e0
- */
- function getIndexPage()
- {
- global $client, $headers;
- return $client->get(BASE_URL, ['headers' => $headers])->getBody();
- }
- /**
- * 模擬使用者註冊帳號
- *
- * @param string $email
- * @param string $ref
- *
- * @return \GuzzleHttp\Stream\StreamInterface|null
- *
- * @see https://gist.github.com/skiddie/e9a7491171f4fedc4efe
- */
- function registerNewAccount($email, $ref = '804UlueSPt')
- {
- global $client, $headers, $register;
- # http://linkspeedup.com/user/register/804UlueSPt
- $address = sprintf('%s%s%s', BASE_URL, '/user/register/', $ref);
- $getCaptchaText = function ($address) {
- global $client, $headers;
- preg_match(
- '/<input type="hidden" name="capchatext" value="(.*?)"/',
- $client->get(
- $address,
- [
- 'headers' => array_merge(
- $headers,
- [
- 'Accept-Encoding' => 'gzip,deflate',
- 'Origin' => BASE_URL,
- 'Referer' => $address
- ]
- )
- ]
- )->getBody(),
- $matches
- );
- return $matches[1];
- };
- $captcha = $getCaptchaText($address);
- return $client->post(
- $address,
- [
- 'body' => [
- 'user_name' => $register['name'],
- 'user_email' => $email,
- 'user_password' => $register['password'],
- 'birthday_month' => $register['month'],
- 'birthday_day' => $register['day'],
- 'birthday_year' => $register['year'],
- 'user_gender' => $register['gender'],
- 'captcha' => $captcha,
- 'urlref' => $register['ref'],
- 'capchatext' => $captcha
- ],
- 'headers' => array_merge(
- $headers,
- [
- 'Accept-Encoding' => 'gzip,deflate',
- 'Origin' => BASE_URL,
- 'Referer' => $address
- ]
- )
- ]
- )->getBody();
- }
- /**
- * 模擬使用者鍵入帳號以及密碼
- * 這邊需要假裝用了點時間, 所以瀏覽器會至少觸發一次 /welcome/live_exchange ajax 請求
- * 預設等待五秒後才會繼續下一個動作
- *
- * @param int $seconds
- *
- * @return \GuzzleHttp\Stream\StreamInterface|null
- *
- * @see https://gist.github.com/skiddie/6b512b0e1936d14187fb
- */
- function enterLoginInfo($seconds = 5)
- {
- global $client, $headers;
- sleep($seconds);
- return $client->get(
- sprintf('%s%s', BASE_URL, '/welcome/live_exchange'),
- [
- 'headers' => array_merge(
- $headers,
- [
- 'Accept' => '*/*',
- 'Referer' => sprintf('%s/', BASE_URL),
- 'X-Requested-With' => 'XMLHttpRequest'
- ]
- )
- ]
- )->getBody();
- }
- /**
- * 模擬使用者的登入行為
- *
- * @param string $email
- * @param string $password
- * @param int $remember
- * @param string $redirect
- *
- * @return \GuzzleHttp\Stream\StreamInterface|null
- *
- * @see https://gist.github.com/skiddie/482c60f371b6d686c71a
- */
- function clickLoginButton($email, $password, $remember = 1, $redirect = '')
- {
- global $client, $headers;
- return $client->post(
- sprintf('%s%s', BASE_URL, '/user/login'),
- [
- 'body' => [
- 'email' => $email,
- 'password' => $password,
- 'rememberme' => $remember,
- 'redirect' => $redirect
- ],
- 'headers' => array_merge(
- $headers,
- [
- 'Accept-Encoding' => 'gzip,deflate',
- 'Origin' => BASE_URL,
- 'Referer' => sprintf('%s/', BASE_URL)
- ]
- )
- ]
- )->getBody();
- }
- /**
- * todo: 還沒寫完 ! 官方那邊有問題就是了
- */
- function clickBonusButton()
- {
- global $client, $headers;
- $response = $client->post(
- sprintf('%s%s', BASE_URL, '/user/bonus_points'),
- [
- 'body' => [
- 'checkbonus' => 'check'
- ],
- 'headers' => array_merge(
- $headers,
- [
- 'Referer' => sprintf('%s%s', BASE_URL, '/user/bonus_points')
- ]
- )
- ]
- );
- checkAccountBaned($response);
- }
- /**
- * 模擬使用者於左方點擊 Facebook Likes, Youtube Favorites 或 Twitter Followers 等連結時所傳送的查詢
- *
- * @param int $rand
- *
- * @return mixed
- *
- * @see https://gist.github.com/skiddie/e85b3427a81266e78f5e
- */
- function clickPointURL($rand)
- {
- global $client, $headers, $methods;
- # http://linkspeedup.com/free_points/facebook_subscribes
- $address = sprintf('%s/free_points/%s', BASE_URL, strtolower(str_replace(' ', '_', $methods[$rand])));
- $sendAjaxRequest = function ($rand, $address) {
- global $client, $headers;
- return $client->get(
- AJAX_URL,
- [
- 'query' => [
- 'act' => 'getLinksList',
- 'params' => sprintf('{"network":"%s", "page":"1"}', $rand),
- # 這裡把 _ 參數的值加入了隨機的秒數, 以避免可能被偵測為使用自動化工具
- '_' => round((microtime(true) * 1000) + ($rand * rand(1 * 1000, 30 * 1000)))
- ],
- 'headers' => array_merge(
- $headers,
- [
- 'Accept' => '*/*',
- 'Referer' => $address,
- 'X-Requested-With' => 'XMLHttpRequest'
- ]
- )
- ]
- );
- };
- $client->get(
- $address,
- [
- 'headers' => array_merge(
- $headers,
- [
- 'Referer' => sprintf('%s%s', BASE_URL, '/free_points')
- ]
- )
- ]
- );
- return checkAccountBaned($sendAjaxRequest($rand, $address));
- }
- /**
- * 模擬當點擊 Like, Share, Follow 等開始的按鈕時所傳送的查詢
- *
- * @param int $rand
- * @param int $id
- * @param string $url
- * @param int $network
- * @param int $user_id
- *
- * @return mixed
- *
- * @see https://gist.github.com/skiddie/aa4c4ba44d925010f877
- */
- function clickStartButton($rand, $id, $url, $network, $user_id = 0)
- {
- global $client, $headers, $methods;
- # http://linkspeedup.com/free_points/facebook_subscribes
- $address = sprintf('%s/free_points/%s', BASE_URL, strtolower(str_replace(' ', '_', $methods[$rand])));
- $response = $client->post(
- AJAX_URL,
- [
- 'body' => [
- 'act' => 'getFBLikesDataBefore',
- 'params' => sprintf(
- '{"id":"%s", "url":"%s", "network":"%s", "user_id":"%s"}',
- $id,
- $url,
- $network,
- $user_id
- ),
- 'ci_csrf_token' => ''
- ],
- 'headers' => array_merge(
- $headers,
- [
- 'Accept' => '*/*',
- 'Accept-Encoding' => 'gzip,deflate',
- 'Origin' => BASE_URL,
- 'Referer' => $address,
- 'X-Requested-With' => 'XMLHttpRequest'
- ]
- )
- ]
- );
- return checkAccountBaned($response);
- }
- /**
- * 模擬當將點擊視窗關閉時所傳送的查詢
- *
- * @param int $rand
- * @param int $id
- * @param string $url
- * @param int $network
- *
- * @return mixed
- *
- * @see https://gist.github.com/skiddie/d5945950575fb9789c03
- */
- function closePopupWindow($rand, $id, $url, $network)
- {
- global $client, $headers, $methods;
- # http://linkspeedup.com/free_points/facebook_subscribes
- $address = sprintf('%s/free_points/%s', BASE_URL, strtolower(str_replace(' ', '_', $methods[$rand])));
- $response = $client->post(
- AJAX_URL,
- [
- 'body' => [
- 'act' => 'checkFollowed',
- 'params' => sprintf('{"id":"%s", "url":"%s", "network":"%s"}', $id, $url, $network),
- 'ci_csrf_token' => ''
- ],
- 'headers' => array_merge(
- $headers,
- [
- 'Accept' => '*/*',
- 'Accept-Encoding' => 'gzip,deflate',
- 'Origin' => BASE_URL,
- 'Referer' => $address,
- 'X-Requested-With' => 'XMLHttpRequest'
- ]
- )
- ]
- );
- return checkAccountBaned($response);
- }
- /**
- * 哇哈哈 ! 這邊就是可以新增積分的函數啦 !!
- *
- * @param int $rand
- * @param int $id
- * @param string $url
- * @param int $network
- *
- * @return mixed
- *
- * @see https://gist.github.com/skiddie/1c590b7fcecaac603805
- */
- function sendFakeFollowed($rand, $id, $url, $network)
- {
- global $client, $headers, $methods;
- # http://linkspeedup.com/free_points/facebook_subscribes
- $address = sprintf('%s/free_points/%s', BASE_URL, strtolower(str_replace(' ', '_', $methods[$rand])));
- return $client->post(
- AJAX_URL,
- [
- 'body' => [
- 'act' => 'updateAction',
- 'params' => sprintf('{"link_id":"%s", "url":"%s", "network":"%s"}', $id, $url, $network),
- 'ci_csrf_token' => ''
- ],
- 'headers' => array_merge(
- $headers,
- [
- # 得先把 Aceept 欄位修改一下不然等下資料可能送不出去或傳不回來
- 'Accept' => 'application/json, text/javascript, */*; q=0.01',
- 'Accept-Encoding' => 'gzip,deflate',
- 'Origin' => BASE_URL,
- 'Referer' => $address,
- 'X-Requested-With' => 'XMLHttpRequest'
- ]
- )
- ]
- )->json();
- }
- /**
- * 取得該次詳細的積分點擊說明
- *
- * @param int $rand
- * @param int $cpc
- * @param int $network
- * @param string $title
- * @param int $m
- *
- * @return mixed
- *
- * @see https://gist.github.com/skiddie/aa339bd6164c3b2ca36c
- */
- function getPointinfo($rand, $cpc, $network, $title, $m = 1)
- {
- global $client, $headers, $methods;
- # http://linkspeedup.com/free_points/facebook_subscribes
- $address = sprintf('%s/free_points/%s', BASE_URL, strtolower(str_replace(' ', '_', $methods[$rand])));
- $response = $client->post(
- AJAX_URL,
- [
- 'body' => [
- 'act' => 'getLikeNote',
- 'params' => sprintf('{"m":"%s", "cpc":"%s", "network":"%s", "title":"%s"}', $m, $cpc, $network, $title),
- 'ci_csrf_token' => ''
- ],
- 'headers' => array_merge(
- $headers,
- [
- 'Accept' => '*/*',
- 'Accept-Encoding' => 'gzip,deflate',
- 'Origin' => BASE_URL,
- 'Referer' => $address,
- 'X-Requested-With' => 'XMLHttpRequest'
- ]
- )
- ]
- );
- return checkAccountBaned($response);
- }
- function checkAccountBaned($response)
- {
- $html = $response->getBody();
- if (strlen(strval($html)) == 99) {
- # <script type="text/javascript">window.location.href = "http://linkspeedup.com/user/login";</script>
- die(sprintf('%s 可能被封鎖了 !', USERNAME) . PHP_EOL);
- } else {
- return $html;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement