Advertisement
Guest User

Twwk checker (in-gala.com)

a guest
Jul 31st, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.54 KB | None | 0 0
  1. <?php
  2.  
  3. $inuser = 'Dekk';
  4. $incode = '777';
  5.  
  6. $inlogin = iconv('CP1251','UTF-8',$inuser);
  7.  
  8. function pars($in,$from,$to){
  9.    preg_match('#'.$from.'(.*)'.$to.'#',$in,$out);
  10.    return $out[1];
  11. };
  12.  
  13. function twwkget($url,$isparse,$login,$pass,$hash){
  14.    $ch = curl_init();
  15.    curl_setopt($ch, CURLOPT_URL, $url);
  16.    curl_setopt($ch, CURLOPT_REFERER, $url);
  17.    curl_setopt($ch, CURLOPT_VERBOSE, 1);
  18.    
  19.    if (!empty($isparse)):
  20.     curl_setopt($ch, CURLOPT_POSTFIELDS,'lifm=lifm&lifm:login='.$login.'&lifm:pass='.$pass.'&lifm:j_idt49=Войти&from=&javax.faces.ViewState='.$hash);
  21.     curl_setopt($ch, CURLOPT_POST, 1);
  22.     curl_setopt($ch, CURLOPT_COOKIEFILE, $_SERVER['DOCUMENT_ROOT'].'/cookie.txt');
  23.    else:
  24.     curl_setopt($ch, CURLOPT_POST, 0);
  25.     curl_setopt($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/cookie.txt');
  26.    endif;
  27.    
  28.    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  29.    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (Windows; U; Windows NT 5.0; En; rv:1.8.0.2) Gecko/20070306 Firefox/1.0.0.4');
  30.    curl_setopt($ch, CURLOPT_HEADER, 1);
  31.    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  32.    $result=curl_exec($ch);
  33.    curl_close($ch);
  34.    return $result;
  35. }
  36.  
  37. $hash = pars(twwkget('http://twwk.ru/login.xhtml','','','',''),'id="j_id1:javax.faces.ViewState:0" value="','" autocomplete');
  38.  
  39. if (!empty($hash)):
  40.   $html = twwkget('http://twwk.ru/login.xhtml',1,$inlogin,$incode,$hash);
  41.   if (!strripos($html,'login-link-exit')):
  42.     echo 'No valid!';
  43.   else:
  44.     echo 'Valid!';
  45.   endif;
  46. else:
  47.   echo 'Hash is empty.';
  48. endif;
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement