Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class InBot{
- var $port ="";
- var $proxy="";
- var $cookie="";
- var $header="";
- var $useragent= "" ;
- var $username ;
- var $password;
- var $csrf;
- function __construct() {
- $this->headers[] = "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
- $this->headers[] = "Connection: keep-alive";
- $this->headers[] = "Keep-Alive: 115";
- $this->headers[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
- $this->headers[] = "Accept-Language: en-us,en;q=0.5";
- $this->headers[] = "Pragma: ";
- }
- public function login(){
- $linkedin_login_page = "https://www.linkedin.com/uas/login";
- $linkedin_ref = "https://www.linkedin.com";
- $username = 'djfab007@hotmail.com';
- $password = 'rochester1*';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $linkedin_login_page);
- curl_setopt($ch, CURLOPT_REFERER, $linkedin_ref);
- curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7)');
- curl_setopt($ch, CURLOPT_AUTOREFERER, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
- $login_content = curl_exec($ch);
- if(curl_error($ch)) {
- echo 'error:' . curl_error($ch);
- }
- $var = array(
- 'isJsEnabled' => 'false',
- 'source_app' => '',
- 'clickedSuggestion' => 'false',
- 'session_key' => trim($username),
- 'session_password' => trim($password),
- 'signin' => 'Sign In',
- 'session_redirect' => '',
- 'trk' => '',
- 'fromEmail' => '');
- $var['loginCsrfParam'] = $this->fetch_value($login_content, 'type="hidden" name="loginCsrfParam" value="', '"');
- $var['csrfToken'] = $this->fetch_value($login_content, 'type="hidden" name="csrfToken" value="', '"');
- $var['sourceAlias'] = $this->fetch_value($login_content, 'input type="hidden" name="sourceAlias" value="', '"');
- $post_array = array();
- foreach ($var as $key => $value)
- {
- $post_array[] = urlencode($key) . '=' . urlencode($value);
- }
- $post_string = implode('&', $post_array);
- curl_setopt($ch, CURLOPT_URL, "https://www.linkedin.com/uas/login-submit");
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
- $store = curl_exec($ch);
- echo $store;
- if (stripos($store, "session_password-login-error") !== false){
- $err = trim(strip_tags(fetch_value($store, '<span class="error" id="session_password-login-error">', '</span>')));
- echo "Login error : ".$err;
- }elseif (stripos($store, 'profile-nav-item') !== false) {
- curl_setopt($ch, CURLOPT_URL, 'https://www.linkedin.com/in/beth-smith-93a3941/');
- curl_setopt($ch, CURLOPT_POST, false);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "");
- $content = curl_exec($ch);
- curl_close($ch);
- echo $content;
- }else{
- echo "unknown error";
- }
- }
- // Fetches the CSRF for login authentication
- private function fetchCSRF(){
- $url = 'https://www.linkedin.com/uas/login';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HEADER, TRUE);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- //curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
- curl_setopt($ch, CURLOPT_COOKIESESSION, true);
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
- curl_setopt($ch, CURLOPT_USERAGENT,
- "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0");
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //@TODO change back: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_PROXY, '108.62.102.78');
- curl_setopt($ch, CURLOPT_PROXYPORT, '3128');
- $html = curl_exec($ch);
- curl_close($ch);
- // $html = file_get_contents($url);
- $precsrf = (int) strpos($html, '<input type="hidden" name="loginCsrfParam" value="');
- $postcsrf = (int) strpos($html, '" id="loginCsrfParam-login">');
- $length = $postcsrf - $precsrf - 50; // The -50 / + 50 is to correct for: <input type="hidden" name="login...
- $this->csrf = substr($html, $precsrf + 50, $length);
- echo "<h1>" .$this->csrf ."</h1>";
- if($this->csrf == false){
- return false;
- }
- return $this->csrf;
- }
- private function fetch_value($str, $find_start = '', $find_end = '')
- {
- if ($find_start == '')
- {
- return '';
- }
- $start = strpos($str, $find_start);
- if ($start === false)
- {
- return '';
- }
- $length = strlen($find_start);
- $substr = substr($str, $start + $length);
- if ($find_end == '')
- {
- return $substr;
- }
- $end = strpos($substr, $find_end);
- if ($end === false)
- {
- return $substr;
- }
- return substr($substr, 0, $end);
- }
- function grab_page($site){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
- curl_setopt($ch, CURLOPT_TIMEOUT, 40);
- curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
- curl_setopt($ch, CURLOPT_URL, $site);
- ob_start();
- return curl_exec ($ch);
- ob_end_clean();
- curl_close ($ch);
- }
- function post_data($site,$data){
- $datapost = curl_init();
- $headers = array("Expect:");
- curl_setopt($datapost, CURLOPT_URL, $site);
- curl_setopt($datapost, CURLOPT_TIMEOUT, 40000);
- curl_setopt($datapost, CURLOPT_HEADER, TRUE);
- curl_setopt($datapost, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($datapost, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
- curl_setopt($datapost, CURLOPT_POST, TRUE);
- curl_setopt($datapost, CURLOPT_POSTFIELDS, $data);
- curl_setopt($datapost, CURLOPT_COOKIEFILE, "cookie.txt");
- ob_start();
- return curl_exec ($datapost);
- ob_end_clean();
- curl_close ($datapost);
- unset($datapost);
- }
- public function check_messages(){
- }
- public function request_friend(){
- }
- public function friend_list_update(){
- }
- }
- function getuseragent(){
- try{
- $pxdbh = new PDO("mysql:host=localhost;dbname=blackperl", "root", "1Bronx*007*");
- $pxdbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
- }
- catch (PDOException $e) {
- echo "fucking proxies agent strong database error you prick ";
- die('unable to connect to database ' . $e->getMessage());
- }
- $clientidstmt = "SELECT string FROM user_agent_strings ORDER BY RAND() LIMIT 1";
- $agentstring = $pxdbh->prepare($clientidstmt);
- echo "2";
- $agentstring->execute();
- $newagentstring = $agentstring->fetchALL();
- echo " The agent string is " ;
- var_dump($newagentstring);
- return $newagentstring[0][0];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement